Added recipes to almost everything

This commit is contained in:
Calclavia 2014-01-28 12:59:33 +08:00
parent abcbb00280
commit 73ddd6ff18
6 changed files with 25 additions and 42 deletions

View file

@ -128,8 +128,8 @@ public class Electrical
Settings.save();
OreDictionary.registerOre("wire", itemPartWire);
OreDictionary.registerOre("battery", blockBattery);
OreDictionary.registerOre("batteryBox", blockBattery);
OreDictionary.registerOre("battery", ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 0));
OreDictionary.registerOre("batteryBox", ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 0));
/**
* Set reference itemstacks
@ -167,9 +167,9 @@ public class Electrical
GameRegistry.addRecipe(new ShapedOreRecipe(itemMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Battery */
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 0), "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 1), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.getTier(new ItemStack(blockBattery, 1, 0)), 'I', UniversalRecipe.PRIMARY_PLATE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 2), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.getTier(new ItemStack(blockBattery, 1, 1)), 'I', Block.blockDiamond));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 0), "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 1), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 1), 'I', UniversalRecipe.PRIMARY_PLATE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 2), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.setTier(new ItemStack(blockBattery, 1, 0), (byte) 0), 'I', Block.blockDiamond));
/** Wires **/
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.COPPER.getWire(3), "MMM", 'M', "ingotCopper"));
@ -186,7 +186,7 @@ public class Electrical
/** Generators **/
GameRegistry.addRecipe(new ShapedOreRecipe(blockSolarPanel, "CCC", "WWW", "III", 'W', defaultWire, 'C', Item.coal, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGenerator, "SRS", "SMS", "SWS", 'W', defaultWire, 'M', UniversalRecipe.MOTOR.get(), 'S', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGenerator, "SRS", "SMS", "SWS", 'W', defaultWire, 'R', Item.redstone, 'M', UniversalRecipe.MOTOR.get(), 'S', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockThermopile, "ORO", "OWO", "OOO", 'W', defaultWire, 'O', Block.obsidian, 'R', Item.redstone));
/** Wire Compatiblity **/

View file

@ -126,7 +126,7 @@ public class ItemBlockBattery extends ItemBlock implements IEnergyItem, IVoltage
return energyStored;
}
public ItemStack setTier(ItemStack itemStack, byte tier)
public static ItemStack setTier(ItemStack itemStack, byte tier)
{
if (itemStack.getTagCompound() == null)
{

View file

@ -144,7 +144,7 @@ public class Mechanical
GameRegistry.addRecipe(new ShapedOreRecipe(blockTank, "GGG", "GSG", "GGG", 'G', Block.glass, 'S', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "BBB", "B B", "BBB", 'B', Block.fenceIron));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 4), "BBB", "GGG", "BBB", 'B', UniversalRecipe.SECONDARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 4), "BBB", " ", "BBB", 'B', UniversalRecipe.SECONDARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(itemPipeGuage, "RRR", "GGG", " S ", 'S', Item.stick, 'G', Block.glass, 'R', Item.redstone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrinderWheel, "III", "LGL", "III", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'L', "logWood", 'G', itemGear));

View file

@ -45,12 +45,12 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
{
if (angularVelocity > 0)
{
torque += 1;
torque += 10;
angularVelocity += 0.1f;
}
else
{
torque -= 1;
torque -= 10;
angularVelocity -= 0.1f;
}
@ -84,7 +84,7 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
{
if (!world().isRemote)
{
System.out.println(getNetwork());
// System.out.println(this + ":" + getNetwork());
// for(Object obj : connections)
// System.out.println(obj);
}
@ -152,6 +152,7 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
}
// TODO: Make bending with large gears work.
if (!getMultiBlock().isConstructed())
{
/** Look for gears that are internal and adjacent to this gear. (The 4 sides) */

View file

@ -113,6 +113,8 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
public void reconstruct()
{
super.reconstruct();
if (canUpdate())
NetworkTickHandler.addNetwork(this);
}
@ -122,25 +124,6 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
connector.setNetwork(this);
}
/** Segmented out call so overriding can be done when machines are reconstructed. */
protected void reconstructHandler(Object obj, ForgeDirection side)
{
if (obj != null && !(obj instanceof IMechanical))
{
if (obj instanceof IMechanical)
{
EnumSet<ForgeDirection> set = this.handlerDirectionMap.get(obj);
if (set == null)
{
set = EnumSet.noneOf(ForgeDirection.class);
}
this.getConnectors().add((IMechanical) obj);
set.add(side);
this.handlerDirectionMap.put(obj, set);
}
}
}
@Override
public float getRotation(float velocity)
{

View file

@ -71,10 +71,8 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
@Override
public void update()
{
if (ticks == 0)
{
// TODO: Fix gear network somehow tick while network is invalid.
getNetwork().addConnector(this);
}
ticks++;
angle += angularVelocity / 20;
@ -255,18 +253,19 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
@Override
public IMechanicalNetwork getNetwork()
{
if (this.network == null)
if (network == null)
{
this.network = new MechanicalNetwork();
this.network.addConnector(this);
network = new MechanicalNetwork();
network.addConnector(this);
}
return this.network;
return network;
}
@Override
public void setNetwork(IMechanicalNetwork network)
{
this.network = network;
network = network;
}
@Override