From 1d60a0e3d65a369e8ad2f820f909c6d73ec496ed Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 3 Jan 2015 19:54:54 +0800 Subject: [PATCH] Hammering now works again --- .../assets/resonantinduction/lang/en_US.lang | 2 ++ .../archaic/process/TileWorkbench.scala | 28 ++++++++----------- .../core/ResonantInduction.scala | 2 ++ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/resources/assets/resonantinduction/lang/en_US.lang b/src/main/resources/assets/resonantinduction/lang/en_US.lang index 40f06995a..c583d0325 100644 --- a/src/main/resources/assets/resonantinduction/lang/en_US.lang +++ b/src/main/resources/assets/resonantinduction/lang/en_US.lang @@ -89,6 +89,8 @@ tile.resonantinduction:firebox.1.name=Electric Firebox tile.resonantinduction:hotPlate.name=Hot Plate +tile.resonantinduction:workbench.name=Workbench +tile.resonantinduction:workbench.tooltip=The workbench is used for hammering and sawing resources. tile.resonantinduction:engineeringTable.name=Engineering Table engineerTable.config.inventory.true=Engineering table is now connected to nearby inventories. engineerTable.config.inventory.false=Engineering table is now disconnected from nearby inventories. diff --git a/src/main/scala/resonantinduction/archaic/process/TileWorkbench.scala b/src/main/scala/resonantinduction/archaic/process/TileWorkbench.scala index ae90dbb67..e4cbcbfcb 100644 --- a/src/main/scala/resonantinduction/archaic/process/TileWorkbench.scala +++ b/src/main/scala/resonantinduction/archaic/process/TileWorkbench.scala @@ -16,11 +16,10 @@ import resonant.lib.prefab.tile.TileInventory import resonant.lib.render.{RenderItemOverlayUtility, RenderUtility} import resonant.lib.transform.vector.Vector3 import resonant.lib.utility.inventory.InventoryUtility +import resonant.lib.wrapper.ByteBufWrapper._ import resonantinduction.archaic.engineering.ItemHammer -import resonantinduction.core.resource.content.{ItemDust, ItemRubble} import resonantinduction.core.{Reference, ResonantInduction} -import resonant.lib.wrapper.ByteBufWrapper._ /** * The workbench is meant for manual ore and wood processing. * It is also the core block in Resonant Induction that leads the player to all aspect of the mod. @@ -82,47 +81,44 @@ class TileWorkbench extends TileInventory(Material.rock) with TPacketSender with world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, Reference.prefix + "hammer", 0.5f, 0.8f + (0.2f * world.rand.nextFloat)) player.addExhaustion(0.1f) player.getCurrentEquippedItem.damageItem(1, player) - return true } } } - } - else - { - interactCurrentItem(this, 0, player) - onInventoryChanged() + return true } } - return false + //Try putting the current item in. + interactCurrentItem(this, 0, player) + onInventoryChanged() + return true } override def isItemValidForSlot(i: Int, itemStack: ItemStack): Boolean = { - if (i == 0) - return itemStack.getItem.isInstanceOf[ItemRubble] || itemStack.getItem.isInstanceOf[ItemDust] - - return false + return true } /** Called each time the inventory changes */ override def onInventoryChanged() { super.onInventoryChanged() - sendDescPacket() + + if (!world.isRemote) + sendDescPacket() } override def read(buf: ByteBuf, id: Int, packetType: PacketType) { super.read(buf, id, packetType) - buf <<< getInventory + buf >>> getInventory } override def write(buf: ByteBuf, id: Int) { super.write(buf, id) - buf >>> getInventory + buf <<< getInventory } /** diff --git a/src/main/scala/resonantinduction/core/ResonantInduction.scala b/src/main/scala/resonantinduction/core/ResonantInduction.scala index 5b2ffbf80..97d23e429 100644 --- a/src/main/scala/resonantinduction/core/ResonantInduction.scala +++ b/src/main/scala/resonantinduction/core/ResonantInduction.scala @@ -60,12 +60,14 @@ final object ResonantInduction def init(evt: FMLInitializationEvent) { ResonantPartFactory.init() + ResourceFactory.init() loadables.init() } @EventHandler def postInit(evt: FMLPostInitializationEvent) { + ResourceFactory.generateAll() loadables.postInit() } } \ No newline at end of file