Worked on mulitpart wires a bit
This commit is contained in:
parent
bfeba60e6a
commit
ec73031e1a
5 changed files with 33 additions and 28 deletions
|
@ -75,7 +75,8 @@ public class ALRecipeLoader
|
|||
public static Item itemGlowingSand;
|
||||
public static Item itemDiggingTool;
|
||||
public static Item itemVehicleTest;
|
||||
|
||||
public static Item itemMPWire;
|
||||
|
||||
private static ALRecipeLoader instance;
|
||||
|
||||
public static final String COPPER_WIRE = "wireCopper";
|
||||
|
@ -91,7 +92,7 @@ public class ALRecipeLoader
|
|||
|
||||
public void loadRecipes()
|
||||
{
|
||||
this.createStandardRecipes();
|
||||
this.setupAutomationRecipes();
|
||||
this.createUERecipes();
|
||||
|
||||
this.registerPipes();
|
||||
|
@ -302,6 +303,21 @@ public class ALRecipeLoader
|
|||
|
||||
private void createUERecipes()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void setupAutomationRecipes()
|
||||
{
|
||||
// Imprint
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), "RPI", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0)));
|
||||
// Imprinter
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, "SSS", "GPG", "WCW", 'G', EnumMaterial.WOOD.getOreName(EnumOrePart.GEARS), 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase));
|
||||
// Crate
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 0), "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.planks));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 0), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS)));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'T', Block.wood));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 1), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES)));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'T', Block.wood));
|
||||
// Armbot
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockArmbot), "II ", "SIS", "MCM", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'C', Parts.CircuitAdvanced.name, 'I', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'M', Parts.Motor.name));
|
||||
// Disk
|
||||
|
@ -309,7 +325,7 @@ public class ALRecipeLoader
|
|||
// Encoder
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockEncoder), "SPS", "SSS", "SCS", 'P', Block.pistonBase, 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitAdvanced.name));
|
||||
// Detector
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockDetector), "SES", "SCS", "S S", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitBasic.name, 'E', Item.eyeOfEnder));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockDetector), "SES", "SCS", "S S", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitBasic.name, 'E', Item.enderPearl));
|
||||
// Conveyor Belt
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10, 0), "III", "MCM", 'I', Item.ingotIron, 'C', Parts.CircuitBasic.name, 'M', Parts.Motor.name));
|
||||
// Rejector
|
||||
|
@ -325,20 +341,6 @@ public class ALRecipeLoader
|
|||
}
|
||||
}
|
||||
|
||||
private void createStandardRecipes()
|
||||
{
|
||||
// Imprint
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), "RPI", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0)));
|
||||
// Imprinter
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, "SSS", "GPG", "WCW", 'G', EnumMaterial.WOOD.getOreName(EnumOrePart.GEARS), 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase));
|
||||
// Crate
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 0), "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.planks));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 0), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS)));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'T', Block.wood));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 1), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES)));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'T', Block.wood));
|
||||
}
|
||||
|
||||
public void registerTanks()
|
||||
{
|
||||
if (blockTank != null)
|
||||
|
@ -363,7 +365,6 @@ public class ALRecipeLoader
|
|||
{
|
||||
if (blockPipe != null)
|
||||
{
|
||||
//TODO re-add leather seal recipes
|
||||
GameRegistry.addRecipe(FluidPartsMaterial.WOOD.getStack(2), "LLL", "WWW", "LLL", 'W', Block.planks, 'L', Block.wood);
|
||||
GameRegistry.addRecipe(FluidPartsMaterial.STONE.getStack(2), "SSS", "CCC", "SSS", 'S', Block.stone, 'C', Block.cobblestone);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.IRON.getStack(2), EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), Parts.Seal.name));
|
||||
|
|
|
@ -89,6 +89,7 @@ import com.builtbroken.assemblyline.machine.encoder.BlockEncoder;
|
|||
import com.builtbroken.assemblyline.machine.encoder.ItemDisk;
|
||||
import com.builtbroken.assemblyline.machine.processor.BlockProcessor;
|
||||
import com.builtbroken.assemblyline.machine.red.BlockAdvancedHopper;
|
||||
import com.builtbroken.assemblyline.multipart.ItemWire;
|
||||
import com.builtbroken.assemblyline.multipart.MultipartAL;
|
||||
import com.builtbroken.assemblyline.transmit.BlockWire;
|
||||
import com.builtbroken.assemblyline.transmit.ItemBlockWire;
|
||||
|
@ -302,7 +303,9 @@ public class AssemblyLine
|
|||
ALRecipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", DarkCore.getNextItemId()).getInt());
|
||||
ALRecipeLoader.itemFluidCan = CoreRegistry.createNewItem("ItemFluidCan", AssemblyLine.MOD_ID, ItemFluidCan.class, true);
|
||||
ALRecipeLoader.itemParts = CoreRegistry.createNewItem("DMCraftingParts", AssemblyLine.MOD_ID, ItemParts.class, true);
|
||||
|
||||
ALRecipeLoader.itemMetals = CoreRegistry.createNewItem("DMOreDirvParts", AssemblyLine.MOD_ID, ItemOreDirv.class, true);
|
||||
ALRecipeLoader.itemMPWire = CoreRegistry.createNewItem("DMMPWire", AssemblyLine.MOD_ID, ItemWire.class, true);
|
||||
|
||||
TileEntityAssembly.refresh_diff = CONFIGURATION.get("TileSettings", "RefreshRandomRange", 9, "n = value of config, 1 + n, random number range from 1 to n that will be added to the lowest refresh value").getInt();
|
||||
TileEntityAssembly.refresh_min_rate = CONFIGURATION.get("TileSettings", "RefreshLowestValue", 20, "Lowest value the refresh rate of the tile network will be").getInt();
|
||||
|
|
|
@ -11,7 +11,7 @@ import codechicken.multipart.TMultiPart;
|
|||
public class ItemWire extends ItemMultipartBase
|
||||
{
|
||||
|
||||
public ItemWire(int id)
|
||||
public ItemWire()
|
||||
{
|
||||
super("wire");
|
||||
this.setHasSubtypes(true);
|
||||
|
@ -21,7 +21,7 @@ public class ItemWire extends ItemMultipartBase
|
|||
@Override
|
||||
public TMultiPart newPart(ItemStack itemStack, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 hit)
|
||||
{
|
||||
return (PartBasicWire) MultiPartRegistry.createPart("resonant_induction_flat_wire", false);
|
||||
return (PartBasicWire) MultiPartRegistry.createPart("assembly_line_basic_wire", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,8 +19,6 @@ public class PartBasicWire extends PartAdvanced implements IConductor
|
|||
|
||||
protected Object[] connections = new Object[6];
|
||||
|
||||
private long saveBuffer = 0;
|
||||
|
||||
/** Universal Electricity conductor functions. */
|
||||
@Override
|
||||
public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive)
|
||||
|
@ -143,7 +141,8 @@ public class PartBasicWire extends PartAdvanced implements IConductor
|
|||
public void load(NBTTagCompound nbt)
|
||||
{
|
||||
super.load(nbt);
|
||||
this.saveBuffer = nbt.getLong("saveBuffer");
|
||||
if (nbt.hasKey("saveBuffer"))
|
||||
this.getNetwork().setBufferFor(this, nbt.getLong("saveBuffer"));
|
||||
}
|
||||
|
||||
/** Writes a tile entity to NBT. */
|
||||
|
@ -151,6 +150,8 @@ public class PartBasicWire extends PartAdvanced implements IConductor
|
|||
public void save(NBTTagCompound nbt)
|
||||
{
|
||||
super.save(nbt);
|
||||
nbt.setLong("saveBuffer", this.saveBuffer);
|
||||
if (this.getNetwork().getBufferOf(this) > 0)
|
||||
nbt.setLong("saveBuffer", this.getNetwork().getBufferOf(this));
|
||||
}
|
||||
|
||||
}
|
|
@ -38,8 +38,6 @@ public class TileEntityWire extends TileEntityAdvanced implements IConductor, IS
|
|||
|
||||
public byte currentAcceptorConnections = 0x00;
|
||||
|
||||
private long saveBuffer = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
|
@ -214,7 +212,8 @@ public class TileEntityWire extends TileEntityAdvanced implements IConductor, IS
|
|||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
this.saveBuffer = nbt.getLong("saveBuffer");
|
||||
if (nbt.hasKey("saveBuffer"))
|
||||
this.getNetwork().setBufferFor(this, nbt.getLong("saveBuffer"));
|
||||
}
|
||||
|
||||
/** Writes a tile entity to NBT. */
|
||||
|
@ -222,6 +221,7 @@ public class TileEntityWire extends TileEntityAdvanced implements IConductor, IS
|
|||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("saveBuffer", this.saveBuffer);
|
||||
if (this.getNetwork().getBufferOf(this) > 0)
|
||||
nbt.setLong("saveBuffer", this.getNetwork().getBufferOf(this));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue