Fixing bugs, cleaning up code, balancing things.
parent
027717923e
commit
84ac181929
|
@ -12,17 +12,17 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
|
||||
public class FabricatorContainer extends Container
|
||||
{
|
||||
private final IInventory tilePrinter;
|
||||
private int printTime;
|
||||
private int totalPrintTime;
|
||||
private final IInventory tileFabricator;
|
||||
private int fabricateTime;
|
||||
private int totalfabricateTime;
|
||||
private int energyCapacity;
|
||||
private int energyStored;
|
||||
|
||||
public FabricatorContainer(InventoryPlayer playerInventory, IInventory printerInventory)
|
||||
public FabricatorContainer(InventoryPlayer playerInventory, IInventory fabricatorInventory)
|
||||
{
|
||||
this.tilePrinter = printerInventory;
|
||||
this.addSlotToContainer(new Slot(printerInventory, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(printerInventory, 2, 116, 35));
|
||||
this.tileFabricator = fabricatorInventory;
|
||||
this.addSlotToContainer(new Slot(fabricatorInventory, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(fabricatorInventory, 2, 116, 35));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class FabricatorContainer extends Container
|
|||
public void addListener(IContainerListener listener)
|
||||
{
|
||||
super.addListener(listener);
|
||||
listener.sendAllWindowProperties(this, this.tilePrinter);
|
||||
listener.sendAllWindowProperties(this, this.tileFabricator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,37 +57,37 @@ public class FabricatorContainer extends Container
|
|||
{
|
||||
IContainerListener icontainerlistener = this.listeners.get(i);
|
||||
|
||||
if (this.energyStored != this.tilePrinter.getField(0))
|
||||
if (this.energyStored != this.tileFabricator.getField(0))
|
||||
{
|
||||
icontainerlistener.sendWindowProperty(this, 0, this.tilePrinter.getField(0));
|
||||
icontainerlistener.sendWindowProperty(this, 0, this.tileFabricator.getField(0));
|
||||
}
|
||||
|
||||
if (this.energyCapacity != this.tilePrinter.getField(1))
|
||||
if (this.energyCapacity != this.tileFabricator.getField(1))
|
||||
{
|
||||
icontainerlistener.sendWindowProperty(this, 1, this.tilePrinter.getField(1));
|
||||
icontainerlistener.sendWindowProperty(this, 1, this.tileFabricator.getField(1));
|
||||
}
|
||||
|
||||
if (this.printTime != this.tilePrinter.getField(2))
|
||||
if (this.fabricateTime != this.tileFabricator.getField(2))
|
||||
{
|
||||
icontainerlistener.sendWindowProperty(this, 2, this.tilePrinter.getField(2));
|
||||
icontainerlistener.sendWindowProperty(this, 2, this.tileFabricator.getField(2));
|
||||
}
|
||||
|
||||
if (this.totalPrintTime != this.tilePrinter.getField(3))
|
||||
if (this.totalfabricateTime != this.tileFabricator.getField(3))
|
||||
{
|
||||
icontainerlistener.sendWindowProperty(this, 3, this.tilePrinter.getField(3));
|
||||
icontainerlistener.sendWindowProperty(this, 3, this.tileFabricator.getField(3));
|
||||
}
|
||||
}
|
||||
this.energyStored = this.tilePrinter.getField(0);
|
||||
this.energyCapacity = this.tilePrinter.getField(1);
|
||||
this.printTime = this.tilePrinter.getField(2);
|
||||
this.totalPrintTime = this.tilePrinter.getField(3);
|
||||
this.energyStored = this.tileFabricator.getField(0);
|
||||
this.energyCapacity = this.tileFabricator.getField(1);
|
||||
this.fabricateTime = this.tileFabricator.getField(2);
|
||||
this.totalfabricateTime = this.tileFabricator.getField(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int id, int data)
|
||||
{
|
||||
this.tilePrinter.setField(id, data);
|
||||
this.tileFabricator.setField(id, data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ public class FabricatorContainer extends Container
|
|||
@Override
|
||||
public boolean canInteractWith(EntityPlayer playerIn)
|
||||
{
|
||||
return this.tilePrinter.isUsableByPlayer(playerIn);
|
||||
return this.tileFabricator.isUsableByPlayer(playerIn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -371,7 +371,7 @@ public class ExtruderTileEntity extends TileEntity implements ITickable, ISidedI
|
|||
|
||||
public int getextrudeTime(ItemStack stack) //Could be used for varying extrude time for different ingots.
|
||||
{
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
|
||||
private boolean isCopperIngot(ItemStack stack)
|
||||
|
@ -401,7 +401,7 @@ public class ExtruderTileEntity extends TileEntity implements ITickable, ISidedI
|
|||
}
|
||||
else
|
||||
{
|
||||
ItemStack itemstack = new ItemStack(ProspectItems.copper_wire);
|
||||
ItemStack itemstack = new ItemStack(ProspectItems.copper_wire,6);
|
||||
|
||||
if (itemstack.isEmpty())
|
||||
{
|
||||
|
@ -439,7 +439,7 @@ public class ExtruderTileEntity extends TileEntity implements ITickable, ISidedI
|
|||
if (canExtrude())
|
||||
{
|
||||
ItemStack itemstack = extruderItemStacks.get(0);
|
||||
ItemStack itemstack1 = new ItemStack(ProspectItems.copper_wire);
|
||||
ItemStack itemstack1 = new ItemStack(ProspectItems.copper_wire,6);
|
||||
ItemStack itemstack2 = extruderItemStacks.get(2);
|
||||
|
||||
if (itemstack2.isEmpty())
|
||||
|
|
|
@ -46,9 +46,10 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
private NonNullList<ItemStack> fabricatorItemStacks = NonNullList.<ItemStack>withSize(3, ItemStack.EMPTY);
|
||||
private int energyStored;
|
||||
private int energyCapacity;
|
||||
private int printTime;
|
||||
private int totalPrintTime;
|
||||
private int fabricateTime;
|
||||
private int totalfabricateTime;
|
||||
private int effectsTimer;
|
||||
private boolean itemsConsumed;
|
||||
private Object ic2EnergySink;
|
||||
private ProspectEnergyStorage energyStorage = new ProspectEnergyStorage();
|
||||
|
||||
|
@ -160,8 +161,8 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
|
||||
if (index == 0 && !flag)
|
||||
{
|
||||
totalPrintTime = getPrintTime(stack);
|
||||
printTime = 0;
|
||||
totalfabricateTime = getfabricateTime(stack);
|
||||
fabricateTime = 0;
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +197,8 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
fabricatorItemStacks = NonNullList.<ItemStack>withSize(getSizeInventory(), ItemStack.EMPTY);
|
||||
ItemStackHelper.loadAllItems(compound, fabricatorItemStacks);
|
||||
energyStored = compound.getInteger("EnergyStored");
|
||||
printTime = compound.getInteger("PrintTime");
|
||||
totalPrintTime = compound.getInteger("PrintTimeTotal");
|
||||
fabricateTime = compound.getInteger("fabricateTime");
|
||||
totalfabricateTime = compound.getInteger("fabricateTimeTotal");
|
||||
energyCapacity = compound.getInteger("EnergyCapacity");
|
||||
if (Loader.isModLoaded("ic2"))
|
||||
{
|
||||
|
@ -215,8 +216,8 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
super.writeToNBT(compound);
|
||||
compound.setInteger("EnergyStored", (short)energyStored);
|
||||
compound.setInteger("EnergyCapacity", (short)energyCapacity);
|
||||
compound.setInteger("PrintTime", (short)printTime);
|
||||
compound.setInteger("PrintTimeTotal", (short)totalPrintTime);
|
||||
compound.setInteger("fabricateTime", (short)fabricateTime);
|
||||
compound.setInteger("fabricateTimeTotal", (short)totalfabricateTime);
|
||||
ItemStackHelper.saveAllItems(compound, fabricatorItemStacks);
|
||||
if (Loader.isModLoaded("ic2"))
|
||||
{
|
||||
|
@ -282,14 +283,18 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
{
|
||||
updateEnergy();
|
||||
if (isEnergized())
|
||||
{
|
||||
if (canPrint())
|
||||
{
|
||||
if (useEnergy())
|
||||
{
|
||||
if (itemsConsumed)
|
||||
{
|
||||
if (useEnergy())
|
||||
{
|
||||
doWork();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (canFabricate())
|
||||
{
|
||||
consumeItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -297,19 +302,13 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
|
||||
private void doWork()
|
||||
{
|
||||
boolean flag1 = false;
|
||||
++printTime;
|
||||
++fabricateTime;
|
||||
|
||||
if (printTime == totalPrintTime)
|
||||
{
|
||||
printTime = 0;
|
||||
totalPrintTime = getPrintTime(fabricatorItemStacks.get(0));
|
||||
printItem();
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
if (fabricateTime == totalfabricateTime)
|
||||
{
|
||||
fabricateTime = 0;
|
||||
totalfabricateTime = getfabricateTime(fabricatorItemStacks.get(0));
|
||||
fabricateItem();
|
||||
markDirty();
|
||||
}
|
||||
|
||||
|
@ -375,9 +374,9 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
return false;
|
||||
}
|
||||
|
||||
public int getPrintTime(ItemStack stack)
|
||||
public int getfabricateTime(ItemStack stack) //For now, all schematics take the same amount of time. This may change.
|
||||
{
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
|
||||
private boolean canCraft(ItemStack[] stacks, IInventory iinventory)
|
||||
|
@ -413,32 +412,49 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
return false;
|
||||
}
|
||||
|
||||
private void consumeItems(ItemStack[] stacks)
|
||||
private void consumeItems()
|
||||
{
|
||||
IInventory iinventory = getInventoryForCrafting(stacks);
|
||||
if (iinventory != null)
|
||||
ItemStack[] stacks = null;
|
||||
Item item = fabricatorItemStacks.get(0).getItem();
|
||||
|
||||
if (item instanceof Schematic)
|
||||
{
|
||||
int size = iinventory.getSizeInventory();
|
||||
for (ItemStack requiredStack : stacks)
|
||||
{
|
||||
boolean foundStack = false;
|
||||
for (int index = 0; index < size; ++index)
|
||||
{
|
||||
ItemStack containerStack = iinventory.getStackInSlot(index);
|
||||
if (containerStack.getItem() == requiredStack.getItem())
|
||||
ItemStack[] required = ((Schematic) item).getIngredients();
|
||||
IInventory inventoryToUse = getInventoryForCrafting(required);
|
||||
if (inventoryToUse != null)
|
||||
{
|
||||
stacks = required;
|
||||
}
|
||||
}
|
||||
|
||||
if (stacks != null)
|
||||
{
|
||||
IInventory iinventory = getInventoryForCrafting(stacks);
|
||||
if (iinventory != null)
|
||||
{
|
||||
int size = iinventory.getSizeInventory();
|
||||
for (ItemStack requiredStack : stacks)
|
||||
{
|
||||
boolean foundStack = false;
|
||||
for (int index = 0; index < size; ++index)
|
||||
{
|
||||
if (containerStack.getCount() >= requiredStack.getCount())
|
||||
{
|
||||
if (foundStack == false)
|
||||
{
|
||||
foundStack = true;
|
||||
containerStack.shrink(requiredStack.getCount());
|
||||
}
|
||||
}
|
||||
ItemStack containerStack = iinventory.getStackInSlot(index);
|
||||
if (containerStack.getItem() == requiredStack.getItem())
|
||||
{
|
||||
if (containerStack.getCount() >= requiredStack.getCount())
|
||||
{
|
||||
if (foundStack == false)
|
||||
{
|
||||
foundStack = true;
|
||||
containerStack.shrink(requiredStack.getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
iinventory.markDirty();
|
||||
}
|
||||
itemsConsumed = true;
|
||||
iinventory.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -502,85 +518,57 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if the fabricator can print an item, i.e. has a source item, destination stack isn't full, etc.
|
||||
* Returns true if the fabricator can fabricate an item, i.e. has a source item, destination stack isn't full, etc.
|
||||
*/
|
||||
private boolean canPrint()
|
||||
private boolean canFabricate()
|
||||
{
|
||||
if (fabricatorItemStacks.get(0).isEmpty() || !(fabricatorItemStacks.get(0).getItem() instanceof Schematic))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemstack = null;
|
||||
Item item = fabricatorItemStacks.get(0).getItem();
|
||||
ItemStack[] required = ((Schematic) item).getIngredients();
|
||||
ItemStack result = ((Schematic) item).getResult();
|
||||
|
||||
IInventory inventoryToUse = getInventoryForCrafting(required);
|
||||
|
||||
if (inventoryToUse != null)
|
||||
{
|
||||
itemstack = result;
|
||||
}
|
||||
|
||||
if (itemstack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack result = ((Schematic) fabricatorItemStacks.get(0).getItem()).getResult();
|
||||
ItemStack output = fabricatorItemStacks.get(2);
|
||||
|
||||
ItemStack itemstack1 = fabricatorItemStacks.get(2);
|
||||
|
||||
if (itemstack1.isEmpty())
|
||||
if (output.isEmpty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (!itemstack1.isItemEqual(itemstack))
|
||||
else if (!output.isItemEqual(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (itemstack1.getCount() + itemstack.getCount() <= getInventoryStackLimit() && itemstack1.getCount() + itemstack.getCount() <= itemstack1.getMaxStackSize()) // Forge fix: respect stack sizes
|
||||
else if (output.getCount() + result.getCount() <= getInventoryStackLimit() && output.getCount() + result.getCount() <= output.getMaxStackSize())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return itemstack1.getCount() + itemstack.getCount() <= itemstack.getMaxStackSize(); // Forge fix: respect stack sizes
|
||||
return output.getCount() + result.getCount() <= result.getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
||||
public void printItem()
|
||||
{
|
||||
if (canPrint())
|
||||
{
|
||||
ItemStack itemstack1 = new ItemStack(Items.AIR);
|
||||
|
||||
Item item = fabricatorItemStacks.get(0).getItem();
|
||||
|
||||
if (item instanceof Schematic)
|
||||
{
|
||||
ItemStack[] required = ((Schematic) item).getIngredients();
|
||||
ItemStack result = ((Schematic) item).getResult();
|
||||
|
||||
IInventory inventoryToUse = getInventoryForCrafting(required);
|
||||
|
||||
if (inventoryToUse != null)
|
||||
{
|
||||
consumeItems(required);
|
||||
itemstack1 = result;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack itemstack2 = fabricatorItemStacks.get(2);
|
||||
public void fabricateItem()
|
||||
{
|
||||
ItemStack result = new ItemStack(Items.AIR);
|
||||
ItemStack output = fabricatorItemStacks.get(2);
|
||||
Item item = fabricatorItemStacks.get(0).getItem();
|
||||
|
||||
if (item instanceof Schematic)
|
||||
{
|
||||
result = ((Schematic) item).getResult();
|
||||
}
|
||||
|
||||
if (itemstack2.isEmpty())
|
||||
{
|
||||
fabricatorItemStacks.set(2, itemstack1.copy());
|
||||
}
|
||||
else if (itemstack2.getItem() == itemstack1.getItem())
|
||||
{
|
||||
itemstack2.grow(itemstack1.getCount());
|
||||
}
|
||||
if (output.isEmpty())
|
||||
{
|
||||
fabricatorItemStacks.set(2, result.copy());
|
||||
itemsConsumed = false;
|
||||
}
|
||||
else if (output.getItem() == result.getItem())
|
||||
{
|
||||
output.grow(result.getCount());
|
||||
itemsConsumed = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -682,9 +670,9 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
case 1:
|
||||
return energyCapacity;
|
||||
case 2:
|
||||
return printTime;
|
||||
return fabricateTime;
|
||||
case 3:
|
||||
return totalPrintTime;
|
||||
return totalfabricateTime;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -702,10 +690,10 @@ public class FabricatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
energyCapacity = value;
|
||||
break;
|
||||
case 2:
|
||||
printTime = value;
|
||||
fabricateTime = value;
|
||||
break;
|
||||
case 3:
|
||||
totalPrintTime = value;
|
||||
totalfabricateTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -420,32 +420,32 @@ public class LaunchPadTileEntity extends TileEntity implements ITickable, ISided
|
|||
{
|
||||
if (item == TGItems.PLASMA_GENERATOR.getItem())
|
||||
{
|
||||
currentPayout = 32;
|
||||
currentPayout = 64;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == TGBlocks.BASIC_MACHINE.getItemblock())
|
||||
{
|
||||
currentPayout = 16;
|
||||
currentPayout = 32;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == TGItems.CIRCUIT_BOARD_ELITE.getItem())
|
||||
{
|
||||
currentPayout = 8;
|
||||
currentPayout = 16;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == TGItems.ELECTRIC_ENGINE.getItem())
|
||||
{
|
||||
currentPayout = 4;
|
||||
currentPayout = 8;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == TGItems.CIRCUIT_BOARD_BASIC.getItem())
|
||||
{
|
||||
currentPayout = 2;
|
||||
currentPayout = 4;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == TGItems.ENERGY_CELL.getItem())
|
||||
{
|
||||
currentPayout = 1;
|
||||
currentPayout = 2;
|
||||
return currentPayout;
|
||||
}
|
||||
}
|
||||
|
@ -453,32 +453,32 @@ public class LaunchPadTileEntity extends TileEntity implements ITickable, ISided
|
|||
{
|
||||
if (item == Ic2Items.massfabricator.getItem() || item == Ic2Items.adjustableTransformer.getItem())
|
||||
{
|
||||
currentPayout = 32;
|
||||
currentPayout = 64;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Ic2Items.nuclearReactor.getItem())
|
||||
{
|
||||
currentPayout = 16;
|
||||
currentPayout = 32;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Ic2Items.advancedCircuit.getItem() || item == Ic2Items.macerator.getItem() || item == Ic2Items.compressor.getItem() || item == Ic2Items.electroFurnace.getItem() || item == Ic2Items.extractor.getItem())
|
||||
{
|
||||
currentPayout = 8;
|
||||
currentPayout = 16;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Ic2Items.electricCircuit.getItem())
|
||||
{
|
||||
currentPayout = 4;
|
||||
currentPayout = 8;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Ic2Items.doubleInsulatedGoldCable.getItem() || item == Ic2Items.tribbleInsulatedIronCable.getItem())
|
||||
{
|
||||
currentPayout = 2;
|
||||
currentPayout = 4;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Ic2Items.copperCable.getItem())
|
||||
{
|
||||
currentPayout = 1;
|
||||
currentPayout = 2;
|
||||
return currentPayout;
|
||||
}
|
||||
}
|
||||
|
@ -487,31 +487,31 @@ public class LaunchPadTileEntity extends TileEntity implements ITickable, ISided
|
|||
currentPayout = 64;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.quarry) || item == Item.getItemFromBlock(ProspectBlocks.ev_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.purifier) || item == Item.getItemFromBlock(ProspectBlocks.fabricator))
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.hv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.ev_transformer) || item == Item.getItemFromBlock(ProspectBlocks.quarry) || item == Item.getItemFromBlock(ProspectBlocks.ev_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.purifier) || item == Item.getItemFromBlock(ProspectBlocks.fabricator))
|
||||
{
|
||||
currentPayout = 32;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.hv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.ev_transformer))
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.mv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.hv_transformer) || item == Item.getItemFromBlock(ProspectBlocks.iv_cable))
|
||||
{
|
||||
currentPayout = 16;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.mv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.hv_transformer) || item == Item.getItemFromBlock(ProspectBlocks.iv_cable))
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.extruder) || item == Item.getItemFromBlock(ProspectBlocks.press) || item == Item.getItemFromBlock(ProspectBlocks.lv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.hv_cable) || item == Item.getItemFromBlock(ProspectBlocks.mv_transformer))
|
||||
{
|
||||
currentPayout = 8;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.extruder) || item == Item.getItemFromBlock(ProspectBlocks.press) || item == Item.getItemFromBlock(ProspectBlocks.lv_solar_panel) || item == Item.getItemFromBlock(ProspectBlocks.hv_cable) || item == Item.getItemFromBlock(ProspectBlocks.mv_transformer) || item == ProspectItems.in_iv_wire)
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.lv_cable) || item == Item.getItemFromBlock(ProspectBlocks.lv_transformer) || item == Item.getItemFromBlock(ProspectBlocks.mv_cable) || item == ProspectItems.quantum_circuit || item == ProspectItems.gem)
|
||||
{
|
||||
currentPayout = 4;
|
||||
return currentPayout;
|
||||
}
|
||||
if (item == Item.getItemFromBlock(ProspectBlocks.lv_cable) || item == Item.getItemFromBlock(ProspectBlocks.lv_transformer) || item == Item.getItemFromBlock(ProspectBlocks.mv_cable) || item == ProspectItems.in_ev_wire || item == ProspectItems.in_hv_wire || item == ProspectItems.in_mv_wire || item == ProspectItems.in_lv_wire || item == ProspectItems.quantum_circuit || item == ProspectItems.gem)
|
||||
}
|
||||
if (item == ProspectItems.in_iv_wire || item == ProspectItems.in_ev_wire || item == ProspectItems.in_hv_wire || item == ProspectItems.in_mv_wire || item == ProspectItems.in_lv_wire)
|
||||
{
|
||||
currentPayout = 2;
|
||||
return currentPayout;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ public class PressTileEntity extends TileEntity implements ITickable, ISidedInve
|
|||
|
||||
public int getpressTime(ItemStack stack) //Could be used for varying press time for different ingots.
|
||||
{
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
|
||||
private ItemStack getPlate(ItemStack stack)
|
||||
|
|
|
@ -425,22 +425,15 @@ public class ReplicatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
{
|
||||
return false;
|
||||
}
|
||||
if (Loader.isModLoaded("ic2"))
|
||||
{
|
||||
if (stack == Ic2Items.stickyResin || stack == Ic2Items.uraniumDrop)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
NonNullList<ItemStack> copper = OreDictionary.getOres("ingotCopper");
|
||||
for (ItemStack s : copper)
|
||||
{
|
||||
{
|
||||
if (s.getItem().getRegistryName() == stack.getItem().getRegistryName())
|
||||
{
|
||||
if (s.getMetadata() == stack.getMetadata())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NonNullList<ItemStack> tin = OreDictionary.getOres("ingotTin");
|
||||
|
@ -498,6 +491,7 @@ public class ReplicatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
}
|
||||
}
|
||||
}
|
||||
System.out.println("Invalid replicator item!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -505,37 +499,27 @@ public class ReplicatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
* Returns true if the transmitter can transmit an item, i.e. has a source item, destination stack isn't full, etc.
|
||||
*/
|
||||
private boolean canReplicate()
|
||||
{
|
||||
Item item = replicatorItemStacks.get(0).getItem();
|
||||
ItemStack itemstack = new ItemStack(item);
|
||||
|
||||
if (itemstack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (invalidReplicatorItem(itemstack))
|
||||
{
|
||||
if (replicatorItemStacks.get(0).isEmpty() || invalidReplicatorItem(replicatorItemStacks.get(0)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack itemstack1 = replicatorItemStacks.get(2);
|
||||
ItemStack input = replicatorItemStacks.get(0);
|
||||
ItemStack output = replicatorItemStacks.get(2);
|
||||
|
||||
if (itemstack1.isEmpty())
|
||||
if (output.isEmpty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (!itemstack1.isItemEqual(itemstack))
|
||||
else if (!output.isItemEqual(input))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (itemstack1.getCount() + itemstack.getCount() <= getInventoryStackLimit() && itemstack1.getCount() + itemstack.getCount() <= itemstack1.getMaxStackSize()) // Forge fix: respect stack sizes
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return itemstack1.getCount() + itemstack.getCount() <= itemstack.getMaxStackSize(); // Forge fix: respect stack sizes
|
||||
return output.getCount() + input.getCount() <= output.getMaxStackSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -564,19 +548,19 @@ public class ReplicatorTileEntity extends TileEntity implements ITickable, ISide
|
|||
Item i = stack.getItem();
|
||||
if (i == Items.EMERALD || i == Items.DIAMOND)
|
||||
{
|
||||
return 3;
|
||||
return 10;
|
||||
}
|
||||
if (i == Item.getItemFromBlock(Blocks.WOOL))
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
if (Loader.isModLoaded("ic2"))
|
||||
{
|
||||
if (stack == Ic2Items.uraniumDrop)
|
||||
{
|
||||
return 3;
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
if (i == Item.getItemFromBlock(Blocks.WOOL))
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
return 50;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "prospect:transmitter"
|
||||
"item": "prospect:ev_cable"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
|
@ -16,6 +16,6 @@
|
|||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "prospect:transmitter_schematic"
|
||||
"item": "prospect:ev_cable_schematic"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "prospect:hv_cable"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dye",
|
||||
"data": 4
|
||||
},
|
||||
{
|
||||
"item": "minecraft:feather"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "prospect:hv_cable_schematic"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "prospect:iv_cable"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dye",
|
||||
"data": 4
|
||||
},
|
||||
{
|
||||
"item": "minecraft:feather"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "prospect:iv_cable_schematic"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "prospect:lv_cable"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dye",
|
||||
"data": 4
|
||||
},
|
||||
{
|
||||
"item": "minecraft:feather"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "prospect:lv_cable_schematic"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "prospect:mv_cable"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dye",
|
||||
"data": 4
|
||||
},
|
||||
{
|
||||
"item": "minecraft:feather"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "prospect:mv_cable_schematic"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue