Resolved #131 - Added tons of decoration blocks for monodemono
This commit is contained in:
parent
28e9a9a9ef
commit
de2a9a9608
12 changed files with 82 additions and 34 deletions
|
@ -20,6 +20,7 @@ import resonantinduction.archaic.imprint.TileImprinter;
|
|||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.core.part.BlockMachinePart;
|
||||
import calclavia.lib.content.ContentRegistry;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.prefab.item.ItemBlockMetadata;
|
||||
|
@ -66,6 +67,7 @@ public class Archaic
|
|||
public static Block blockTurntable;
|
||||
public static Block blockFirebox;
|
||||
public static Block blockHotPlate;
|
||||
public static Block blockMachinePart;
|
||||
|
||||
public static Item itemImprint;
|
||||
|
||||
|
@ -81,6 +83,8 @@ public class Archaic
|
|||
blockFirebox = contentRegistry.createTile(BlockFirebox.class, TileFirebox.class);
|
||||
blockHotPlate = contentRegistry.createBlock(BlockHotPlate.class, ItemBlockMetadata.class, TileHotPlate.class);
|
||||
|
||||
blockMachinePart = contentRegistry.createBlock(BlockMachinePart.class, ItemBlockMetadata.class);
|
||||
|
||||
itemImprint = contentRegistry.createItem(ItemBlockImprint.class);
|
||||
proxy.preInit();
|
||||
Settings.save();
|
||||
|
|
|
@ -1,19 +1,49 @@
|
|||
package resonantinduction.core.part;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.prefab.block.BlockBase;
|
||||
|
||||
/**
|
||||
* A block used to build machines.
|
||||
* A block used to build machines or decoration.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class BlockMachinePart extends BlockBase
|
||||
{
|
||||
String[] iconNames = new String[] { "material_metal_side", "material_metal_top", "material_stone_brick", "material_stone_brick2", "material_stone_chiseled", "material_stone_cobble", "material_stone_cracked", "material_stone", "material_stone_slab", "material_stone_mossy", "material_steel_dark", "material_steel_tint", "material_steel" };
|
||||
Icon[] icons = new Icon[iconNames.length];
|
||||
|
||||
public BlockMachinePart()
|
||||
{
|
||||
super("machinePart");
|
||||
setTextureName(Reference.PREFIX + "material_stone_brick");
|
||||
super("material");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int metadata)
|
||||
{
|
||||
return icons[metadata];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(this.getTextureName());
|
||||
|
||||
for (int i = 0; i < iconNames.length; i++)
|
||||
icons[i] = par1IconRegister.registerIcon(Reference.PREFIX + iconNames[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
for (int i = 0; i < iconNames.length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class Electrical
|
|||
public static Block blockGenerator;
|
||||
|
||||
// Machines
|
||||
public static Block blockAdvancedFurnace, blockMachinePart, blockGrinderWheel, blockPurifier;
|
||||
public static Block blockAdvancedFurnace;
|
||||
|
||||
// Transport
|
||||
public static Block blockEMLevitator;
|
||||
|
@ -124,11 +124,6 @@ public class Electrical
|
|||
blockEncoder = contentRegistry.createTile(BlockEncoder.class, TileEncoder.class);
|
||||
itemDisk = contentRegistry.createItem(ItemDisk.class);
|
||||
|
||||
// Machines
|
||||
blockMachinePart = contentRegistry.createBlock(BlockMachinePart.class);
|
||||
blockGrinderWheel = contentRegistry.createTile(BlockGrinderWheel.class, TileGrinderWheel.class);
|
||||
blockPurifier = contentRegistry.createTile(BlockPurifier.class, TilePurifier.class);
|
||||
|
||||
// Generator
|
||||
blockSolarPanel = contentRegistry.createTile(BlockSolarPanel.class, TileSolarPanel.class);
|
||||
blockGenerator = contentRegistry.createTile(BlockGenerator.class, TileGenerator.class);
|
||||
|
|
|
@ -88,7 +88,9 @@ public class TileBattery extends TileElectrical implements IConnector<BatteryNet
|
|||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if ((markDistributionUpdate || this.produce() > 0) && ticks % 5 == 0)
|
||||
long produce = this.produce();
|
||||
|
||||
if ((markDistributionUpdate || produce > 0) && ticks % 5 == 0)
|
||||
{
|
||||
this.getNetwork().redistribute();
|
||||
markDistributionUpdate = false;
|
||||
|
|
|
@ -92,8 +92,15 @@ public class TileGenerator extends TileElectrical implements IRotatable
|
|||
long currentTorque = Math.abs(mech.getTorque());
|
||||
|
||||
if (currentTorque != 0)
|
||||
{
|
||||
setTorque = Math.min(+setTorque, maxTorque) * (mech.getTorque() / currentTorque);
|
||||
|
||||
if (setTorque < currentTorque)
|
||||
{
|
||||
setTorque = (long) Math.max(setTorque, currentTorque * (currentTorque / maxTorque));
|
||||
}
|
||||
}
|
||||
|
||||
float currentVelo = Math.abs(mech.getAngularVelocity());
|
||||
if (currentVelo != 0)
|
||||
setAngularVelocity = Math.min(+setAngularVelocity, maxAngularVelocity) * (mech.getAngularVelocity() / currentVelo);
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.electrical.purifier.BlockPurifier;
|
||||
import resonantinduction.mechanical.belt.BlockConveyorBelt;
|
||||
import resonantinduction.mechanical.belt.TileConveyorBelt;
|
||||
import resonantinduction.mechanical.fluid.pipe.ItemBlockFluidContainer;
|
||||
|
@ -26,6 +27,9 @@ import resonantinduction.mechanical.logistic.TileManipulator;
|
|||
import resonantinduction.mechanical.logistic.TileRejector;
|
||||
import resonantinduction.mechanical.network.IMechanical;
|
||||
import resonantinduction.mechanical.network.PacketNetwork;
|
||||
import resonantinduction.mechanical.process.BlockGrinderWheel;
|
||||
import resonantinduction.mechanical.process.TileGrinderWheel;
|
||||
import resonantinduction.mechanical.process.TilePurifier;
|
||||
import calclavia.lib.content.ContentRegistry;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
|
@ -81,6 +85,10 @@ public class Mechanical
|
|||
public static Item itemPipe;
|
||||
public static Item itemPipeGuage;
|
||||
|
||||
// Machines
|
||||
public static Block blockGrinderWheel;
|
||||
public static Block blockPurifier;
|
||||
|
||||
public static final PacketNetwork PACKET_NETWORK = new PacketNetwork(IMechanical.class, Reference.CHANNEL);
|
||||
|
||||
@EventHandler
|
||||
|
@ -102,6 +110,10 @@ public class Mechanical
|
|||
itemPipeGuage = contentRegistry.createItem(ItemPipeGauge.class);
|
||||
itemPipe = contentRegistry.createItem(ItemPipe.class);
|
||||
|
||||
// Machines
|
||||
blockGrinderWheel = contentRegistry.createTile(BlockGrinderWheel.class, TileGrinderWheel.class);
|
||||
blockPurifier = contentRegistry.createTile(BlockPurifier.class, TilePurifier.class);
|
||||
|
||||
OreDictionary.registerOre("gear", itemGear);
|
||||
|
||||
proxy.preInit();
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import resonantinduction.archaic.Archaic;
|
||||
import resonantinduction.core.render.RenderFluidHelper;
|
||||
import resonantinduction.electrical.Electrical;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
|
||||
import calclavia.lib.render.RenderUtility;
|
||||
|
@ -94,24 +94,24 @@ public class RenderTank extends TileEntitySpecialRenderer
|
|||
if (!north)
|
||||
{
|
||||
// north east
|
||||
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, 0.501, -0.475, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, 0.501, -0.475, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!south)
|
||||
{
|
||||
// south east
|
||||
RenderUtility.renderCube(0.475, -0.501, 0.475, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(0.475, -0.501, 0.475, 0.501, 0.501, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
|
||||
if (!down)
|
||||
{
|
||||
// bottom east
|
||||
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, -0.475, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, -0.475, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
|
||||
if (!up)
|
||||
{
|
||||
// top east
|
||||
RenderUtility.renderCube(0.475, 0.475, -0.501, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(0.475, 0.475, -0.501, 0.501, 0.501, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,22 +120,22 @@ public class RenderTank extends TileEntitySpecialRenderer
|
|||
if (!north)
|
||||
{
|
||||
// north west
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, 0.501, -0.475, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, 0.501, -0.475, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!south)
|
||||
{
|
||||
// south west
|
||||
RenderUtility.renderCube(-0.501, -0.501, 0.475, -0.475, 0.501, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, -0.501, 0.475, -0.475, 0.501, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!down)
|
||||
{
|
||||
// bottom west
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, -0.475, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, -0.475, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!up)
|
||||
{
|
||||
// top west
|
||||
RenderUtility.renderCube(-0.501, 0.475, -0.501, -0.475, 0.501, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, 0.475, -0.501, -0.475, 0.501, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
}
|
||||
if (!north)
|
||||
|
@ -143,12 +143,12 @@ public class RenderTank extends TileEntitySpecialRenderer
|
|||
if (!up)
|
||||
{
|
||||
// top north
|
||||
RenderUtility.renderCube(-0.501, 0.475, -0.501, 0.501, 0.501, -0.475, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, 0.475, -0.501, 0.501, 0.501, -0.475, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!down)
|
||||
{
|
||||
// bottom north
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, 0.501, -0.475, -0.475, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, -0.501, -0.501, 0.501, -0.475, -0.475, Archaic.blockMachinePart);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,12 +157,12 @@ public class RenderTank extends TileEntitySpecialRenderer
|
|||
if (!up)
|
||||
{
|
||||
// top south
|
||||
RenderUtility.renderCube(-0.501, 0.475, 0.475, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, 0.475, 0.475, 0.501, 0.501, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
if (!down)
|
||||
{
|
||||
// bottom south
|
||||
RenderUtility.renderCube(-0.501, -0.501, 0.475, 0.501, -0.475, 0.501, Electrical.blockMachinePart);
|
||||
RenderUtility.renderCube(-0.501, -0.501, 0.475, 0.501, -0.475, 0.501, Archaic.blockMachinePart);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class PartGear extends PartMechanical implements IMechanical
|
|||
manualCrankTime--;
|
||||
}
|
||||
|
||||
angularVelocity *= 0.9f;
|
||||
angularVelocity *= 0.95f;
|
||||
}
|
||||
|
||||
super.update();
|
||||
|
|
|
@ -19,11 +19,9 @@ import calclavia.lib.utility.FluidUtility;
|
|||
|
||||
public class ItemPipeGauge extends ItemRI
|
||||
{
|
||||
Icon pipeGuage;
|
||||
|
||||
public ItemPipeGauge()
|
||||
{
|
||||
super("pipeGuage");
|
||||
super("pipeGauge");
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import universalelectricity.core.net.NetworkTickHandler;
|
|||
*/
|
||||
public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical> implements IMechanicalNetwork, IUpdate
|
||||
{
|
||||
public static final float ACCELERATION = 0.1f;
|
||||
/** The current rotation of the network */
|
||||
private float rotation = 0;
|
||||
private long lastRotateTime;
|
||||
|
@ -79,19 +80,18 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
|
|||
if (adjacentMech != null)
|
||||
{
|
||||
float ratio = adjacentMech.getRatio() / mechanical.getRatio();
|
||||
float acceleration = 0.5f;
|
||||
long torque = mechanical.getTorque();
|
||||
|
||||
if (Math.abs(torque - adjacentMech.getTorque() / ratio * acceleration) < Math.abs(adjacentMech.getTorque() / ratio))
|
||||
if (Math.abs(torque - adjacentMech.getTorque() / ratio * ACCELERATION) < Math.abs(adjacentMech.getTorque() / ratio))
|
||||
{
|
||||
mechanical.setTorque((long) (torque - (adjacentMech.getTorque() / ratio * acceleration)));
|
||||
mechanical.setTorque((long) (torque - (adjacentMech.getTorque() / ratio * ACCELERATION)));
|
||||
}
|
||||
|
||||
float velocity = mechanical.getAngularVelocity();
|
||||
|
||||
if (Math.abs(velocity - adjacentMech.getAngularVelocity() * ratio * acceleration) < Math.abs(adjacentMech.getAngularVelocity() * ratio))
|
||||
if (Math.abs(velocity - adjacentMech.getAngularVelocity() * ratio * ACCELERATION) < Math.abs(adjacentMech.getAngularVelocity() * ratio))
|
||||
{
|
||||
mechanical.setAngularVelocity(velocity - (adjacentMech.getAngularVelocity() * ratio * acceleration));
|
||||
mechanical.setAngularVelocity(velocity - (adjacentMech.getAngularVelocity() * ratio * ACCELERATION));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ tile.resonantinduction\:fluidPipe.16.name=White Wood Trough
|
|||
tile.resonantinduction\:tesla.name=Tesla Coil
|
||||
tile.resonantinduction\:levitator.name=Electromagnetic Levitator
|
||||
tile.resonantinduction\:battery.name=Battery
|
||||
tile.resonantinduction\:machinePart.name=Machine Part
|
||||
tile.resonantinduction\:material.name=Material
|
||||
tile.resonantinduction\:grindingWheel.name=Grinder Wheel
|
||||
tile.resonantinduction\:purifier.name=Purifier Rotor
|
||||
tile.resonantinduction\:filter.name=Filter
|
||||
|
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Loading…
Reference in a new issue