From 0a228514b7cf3d03de769d8612def1c88e794c01 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 12 Mar 2014 21:35:05 +0800 Subject: [PATCH] Fixed #427 - Engineering table consume twice and glitched drops --- .../resonantinduction/archaic/Archaic.java | 2 +- .../engineering/TileEngineeringTable.java | 31 +++------ .../logistic/belt/RenderManipulator.java | 64 ++++++++++--------- .../assets/resonantinduction/languages | 2 +- 4 files changed, 44 insertions(+), 55 deletions(-) diff --git a/archaic/src/main/java/resonantinduction/archaic/Archaic.java b/archaic/src/main/java/resonantinduction/archaic/Archaic.java index 8a0659586..19b46cb84 100644 --- a/archaic/src/main/java/resonantinduction/archaic/Archaic.java +++ b/archaic/src/main/java/resonantinduction/archaic/Archaic.java @@ -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")); diff --git a/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java b/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java index e2e60ef06..82739e015 100644 --- a/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java +++ b/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java @@ -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 getDrops(int metadata, int fortune) { - ArrayList list = new ArrayList(); - ItemStack stack = ItemBlockSaved.getItemStackWithNBT(this.getBlockType(), world(), x(), y(), z()); - list.add(stack); - return list; + return new ArrayList(); } @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 idealRecipeItem = this.getCraftingManager().getIdealRecipe(itemStack); + Pair 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]; } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/RenderManipulator.java b/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/RenderManipulator.java index 09ecf00b5..b59df4bee 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/RenderManipulator.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/RenderManipulator.java @@ -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(); + } } } \ No newline at end of file diff --git a/src/main/resources/assets/resonantinduction/languages b/src/main/resources/assets/resonantinduction/languages index 2e44e1e10..1614b4d84 160000 --- a/src/main/resources/assets/resonantinduction/languages +++ b/src/main/resources/assets/resonantinduction/languages @@ -1 +1 @@ -Subproject commit 2e44e1e10066c5e30f5e707fffbf70f159c50cca +Subproject commit 1614b4d84a023bfac276ced7e0654035e8ecd0b3