Fixed #427 - Engineering table consume twice and glitched drops
This commit is contained in:
parent
10bce50044
commit
0a228514b7
4 changed files with 44 additions and 55 deletions
|
@ -145,7 +145,7 @@ public class Archaic
|
|||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, "SSS", "W W", "PPP", 'S', Block.stone, 'P', Block.pistonBase, 'W', "logWood"));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, "SSS", "PGP", "WWW", 'S', Block.stone, 'G', UniversalRecipe.MOTOR.get(), 'P', Block.pistonBase, 'W', "logWood"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, "SSS", "PGP", "WWW", 'S', Block.stone, 'G', Item.redstone, 'P', Block.pistonBase, 'W', "logWood"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockCast, "I I", "IBI", "III", 'S', Item.ingotIron, 'B', Block.fenceIron));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockGutter, "S S", "I I", "III", 'S', Item.stick, 'I', Block.cobblestone));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "WBW", "B B", "WBW", 'B', Block.fenceIron, 'W', "plankWood"));
|
||||
|
|
|
@ -122,12 +122,8 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
|
|||
|
||||
if (dropStack != null)
|
||||
{
|
||||
int var11 = dropStack.stackSize;
|
||||
dropStack.stackSize -= var11;
|
||||
InventoryUtility.dropItemStack(world(), center(), dropStack);
|
||||
|
||||
if (dropStack.stackSize <= 0)
|
||||
inventory.setInventorySlotContents(i, null);
|
||||
InventoryUtility.dropItemStack(world(), new Vector3(player), dropStack);
|
||||
inventory.setInventorySlotContents(i, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,15 +234,14 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
|
|||
@Override
|
||||
public ArrayList<ItemStack> getDrops(int metadata, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||
ItemStack stack = ItemBlockSaved.getItemStackWithNBT(this.getBlockType(), world(), x(), y(), z());
|
||||
list.add(stack);
|
||||
return list;
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropEntireInventory(int par5, int par6)
|
||||
public void onRemove(int par5, int par6)
|
||||
{
|
||||
ItemStack stack = ItemBlockSaved.getItemStackWithNBT(this.getBlockType(), world(), x(), y(), z());
|
||||
InventoryUtility.dropItemStack(world(), center(), stack);
|
||||
}
|
||||
|
||||
/** Creates a "fake inventory" and hook the player up to the crafter to use the player's items. */
|
||||
|
@ -392,10 +387,6 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
|
|||
}
|
||||
else if (slot < CRAFTING_OUTPUT_END)
|
||||
{
|
||||
/** An external inventory is attempting to craft the item from the engineering table. */
|
||||
if (itemStack == null)
|
||||
onPickUpFromSlot(null, slot, this.outputInventory[slot - CRAFTING_MATRIX_END]);
|
||||
|
||||
outputInventory[slot - CRAFTING_MATRIX_END] = itemStack;
|
||||
}
|
||||
else if (slot < PLAYER_OUTPUT_END && this.invPlayer != null)
|
||||
|
@ -552,11 +543,11 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
|
|||
{
|
||||
if (itemStack != null)
|
||||
{
|
||||
Pair<ItemStack, ItemStack[]> idealRecipeItem = this.getCraftingManager().getIdealRecipe(itemStack);
|
||||
Pair<ItemStack, ItemStack[]> idealRecipeItem = getCraftingManager().getIdealRecipe(itemStack);
|
||||
|
||||
if (idealRecipeItem != null)
|
||||
{
|
||||
this.getCraftingManager().consumeItems(idealRecipeItem.right().clone());
|
||||
getCraftingManager().consumeItems(idealRecipeItem.right().clone());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -648,12 +639,6 @@ public class TileEngineeringTable extends TileInventory implements IPacketReceiv
|
|||
@Override
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
|
@ -21,41 +21,45 @@ public class RenderManipulator extends RenderImprintable
|
|||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||
{
|
||||
TileManipulator tile = (TileManipulator) tileEntity;
|
||||
int face = tile.getDirection().ordinal();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
if (tile.worldObj != null)
|
||||
{
|
||||
int face = tile.getDirection().ordinal();
|
||||
|
||||
if (tile.isOutput())
|
||||
{
|
||||
bindTexture(TEXTURE_INPUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
bindTexture(TEXTURE_OUTPUT);
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
|
||||
if (face == 2)
|
||||
{
|
||||
GL11.glRotatef(0f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 3)
|
||||
{
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 4)
|
||||
{
|
||||
GL11.glRotatef(270f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 5)
|
||||
{
|
||||
GL11.glRotatef(90f, 0f, 1f, 0f);
|
||||
}
|
||||
if (tile.isOutput())
|
||||
{
|
||||
bindTexture(TEXTURE_INPUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
bindTexture(TEXTURE_OUTPUT);
|
||||
}
|
||||
|
||||
MODEL.render(0.0625F, true, 0);
|
||||
if (face == 2)
|
||||
{
|
||||
GL11.glRotatef(0f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 3)
|
||||
{
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 4)
|
||||
{
|
||||
GL11.glRotatef(270f, 0f, 1f, 0f);
|
||||
}
|
||||
else if (face == 5)
|
||||
{
|
||||
GL11.glRotatef(90f, 0f, 1f, 0f);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
MODEL.render(0.0625F, true, 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 2e44e1e10066c5e30f5e707fffbf70f159c50cca
|
||||
Subproject commit 1614b4d84a023bfac276ced7e0654035e8ecd0b3
|
Loading…
Reference in a new issue