Tuesday, January 10, 2017

Mint GUI Implemented - Simple Coins 0.3.0 Build Delayed

So I've managed to go through and figure out a few issues I've had with ItemStacks. After fixing the overridden onBlockActivated method, I was met by an error that caused the game to crash from the server side. It was a NullPointerException, in which ItemStack.areItemStacksEqual(...) was trying to compare two ItemStacks. After some research online, I couldn't find any solutions, so I brought up the question on the Minecraft Forge forum in the modder support forum. In summary, I had to change any instance of
ItemStack var = null; -> ItemStack var = ItemStack.EMPTY;
ItemStack[] inventory -> NonNullList<ItemStack> inventory;
Afterwords, I was able to right click and bring up a GUI. After some changing of integer values, I was able to the size the GUI to the correct size and bring the slots to their correct places on the GUI. But now an issue I'm present with is removing an item from the two item slots when the cursor is not holding a stack of items.

I also still need to add crafting to the mint. I added a check in the Update() method for the block's TileEntity file so if an iron ingot or gold ingot is in the input slot, it sets 4 coins of iron or gold in the output slot.

GitHub of the Mod

Hopefully, I can get finish Mint block once and for all by tonight.

No comments:

Post a Comment