#403 - Temporarily disabled Engineering table autocraft

This commit is contained in:
Calclavia 2014-03-11 22:17:32 +08:00
parent 749d84648f
commit acbf1ccbbc
2 changed files with 718 additions and 710 deletions

View file

@ -313,37 +313,6 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
return 10 + (this.invPlayer != null ? this.invPlayer.getSizeInventory() : 0);
}
@Override
public ItemStack decrStackSize(int i, int amount)
{
if (this.getStackInSlot(i) != null)
{
ItemStack stack;
if (this.getStackInSlot(i).stackSize <= amount)
{
stack = this.getStackInSlot(i);
this.setInventorySlotContents(i, null);
return stack;
}
else
{
stack = this.getStackInSlot(i).splitStack(amount);
if (this.getStackInSlot(i).stackSize == 0)
{
this.setInventorySlotContents(i, null);
}
return stack;
}
}
else
{
return null;
}
}
/** DO NOT USE THIS INTERNALLY. FOR EXTERNAL USE ONLY! */
@Override
public ItemStack getStackInSlot(int slot)
@ -384,12 +353,44 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
return null;
}
@Override
public ItemStack decrStackSize(int i, int amount)
{
if (getStackInSlot(i) != null)
{
ItemStack stack;
if (getStackInSlot(i).stackSize <= amount)
{
stack = getStackInSlot(i);
setInventorySlotContents(i, null);
return stack;
}
else
{
stack = getStackInSlot(i).splitStack(amount);
if (getStackInSlot(i).stackSize == 0)
{
setInventorySlotContents(i, null);
}
return stack;
}
}
else
{
return null;
}
}
@Override
public void setInventorySlotContents(int slot, ItemStack itemStack)
{
System.out.println("SET" + slot + " : " + itemStack);
if (slot < CRAFTING_MATRIX_END)
{
this.craftingMatrix[slot] = itemStack;
craftingMatrix[slot] = itemStack;
}
else if (slot < CRAFTING_OUTPUT_END)
{
@ -397,7 +398,7 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
if (itemStack == null)
onPickUpFromSlot(null, slot, this.outputInventory[slot - CRAFTING_MATRIX_END]);
this.outputInventory[slot - CRAFTING_MATRIX_END] = itemStack;
outputInventory[slot - CRAFTING_MATRIX_END] = itemStack;
}
else if (slot < PLAYER_OUTPUT_END && this.invPlayer != null)
{
@ -433,8 +434,10 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
onInventoryChanged();
}
/** When some containers are closed they call this on each slot, then drop whatever it returns as
* an EntityItem - like when you close a workbench GUI. */
/**
* When some containers are closed they call this on each slot, then drop whatever it returns as
* an EntityItem - like when you close a workbench GUI.
*/
@Override
public ItemStack getStackInSlotOnClosing(int slot)
{
@ -468,9 +471,11 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
this.onInventoryChanged();
}
/** Construct an InventoryCrafting Matrix on the fly.
/**
* Construct an InventoryCrafting Matrix on the fly.
*
* @return */
* @return
*/
public InventoryCrafting getCraftingMatrix()
{
InventoryCrafting inventoryCrafting = new InventoryCrafting(new ContainerDummy(this), 3, 3);
@ -646,7 +651,10 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
public int[] getAccessibleSlotsFromSide(int side)
{
if (Settings.ALLOW_ENGINEERING_AUTOCRAFT)
{
if (side != 0)
return new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
}
return new int[0];
}

View file

@ -49,13 +49,13 @@ public class Settings
return Settings.CONFIGURATION.get(Configuration.CATEGORY_ITEM, key, id).getInt(id);
}
@Config(category = Configuration.CATEGORY_GENERAL, key = "Engineering Table Autocraft")
@Config(key = "Engineering Table Autocraft")
public static boolean ALLOW_ENGINEERING_AUTOCRAFT = true;
@Config(category = Configuration.CATEGORY_GENERAL, key = "Tesla Sound FXs")
@Config(key = "Tesla Sound FXs")
public static boolean SOUND_FXS = true;
@Config(category = Configuration.CATEGORY_GENERAL, key = "Shiny silver Wires")
@Config(key = "Shiny silver Wires")
public static boolean SHINY_SILVER = true;
@Config(category = Configuration.CATEGORY_GENERAL, key = "Max EM Contractor Path")
@Config(key = "Max EM Contractor Path")
public static int MAX_LEVITATOR_DISTANCE = 200;
public static void setModMetadata(ModMetadata metadata, String id, String name)