Anthony's Development Blog
Sunday, January 15, 2017
Simple Coins v.1.0.0 - Release
So all in all: this project was an exercise of my ability on using Google. Only two times did I need to ask questions on the Minecraft Forum. I started off by following a guide by _Bedrock_Miner_ but then diverged from it and started to do what I wanted to do, looking up guides, tutorials, code on GitHub, asking questions on the Minecraft Forge Forum.
Of course, I didn't make any extraordinary mod that added 100x more content to the game. What amazed me the most is how easy it is to add extra content to the game, especially items and blocks. Modding for Minecraft is a good project to exercise your Java and Googling skills. I'd recommend giving it a go.
Friday, January 13, 2017
Simple Coins 0.5.2 Build - PriceInfo
Simple Coins 0.5.1 Build - Mobs drop coins now; New Villager; Forge Trading Methods
- Emeralds cannot be converted to coins properly. This trade option has been removed for the time being. That means this trade is what is left:
- At Tier 1:
- 21-27 Iron Coins -> 1 Emerald
- 24-30 Gold Coins -> 1 Emerald
- At Tier 2:
- 21-27 Iron Coins -> 1 Emerald
- 24-30 Gold Coins -> 1 Emerald
- Added new type of Villager: Banker. Banker wears a light blue robe.
- At Tier 1:
- 21-27 Iron Coins <-> 1 Emerald
- 24-30 Gold Coins <-> 1 Emerald
- At Tier 2:
- 21-27 Iron Coins -> 1 Emerald
- 24-30 Gold Coins -> 1 Emerald
- 38-50 Iron Coins <- 2 Emeralds
- 24-30 Gold Coins <- 2 Emeralds
- 3 Nuggets are required for 1 coin.
- 1 coin back crafts to 3 nuggets.
- Fixed a crafting bug that would not waste nuggets and not give you a coin.
- Zombies, ZombiePigmen, Husks, and ZombieVillagers have a 20% chance of
- dropping 4 iron coins, and a 10% chance of dropping 4 coins.
- Evokers, Vindicators and Villagers all drop 0-3 iron coins and 0-3 gold
- coins
- Updated to Forge 13.20.0.2212
Adding Mob Drops
GitHub for this section - Go to "0.4.0 - Coins added to mob drops"
Adding a new Villager
GitHub for this section
Wednesday, January 11, 2017
Simple Coins 0.3.1 Build - Curse Page
Build 0.3.1 of Simple Coins doesn't fix any un/known bugs, it only updates the mod to Forge 13.20.0.2206.
I released the mod on Curse. From now on any issues should be reported there all download links will be there.
Simple Coins 0.3.0 Build for Minecraft 1.11.2 - Persistence is key
Quite a few changes. Firstly the Mint block. The crafting recipe has been changed.
In order to make coins, the mint is now required to craft the coins. The crafting recipes for the coins have been removed. Just right click the mint block, and place the nuggets as so:
The coins can also be crafted back to nuggets.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Persistence
Man, this piece of the build took a while to finish. Firstly was just getting the GUI to correctly work. It kept crashing at first because I assigned nulls to ItemStack variables or methods and that was the deprecated way to do it. Forge now requires ItemStack.EMPTY to be used.Next issue was getting the custom slots to behave correctly. For some reason, the custom slots would just not let me take the item in the slot unless the cursor was already holding another ItemStack. After doing looking on GitHub as to what other modders' did. I changed the assign of the custom slots, I created an InventoryCrafting variable along with an IInventory variable that would assign to MintCraftResult - A class that extends InventoryCraftResult but returns false every time isItemValidForSlot is called.
This fixed all issues of clicking on the custom slots. But then my next issue was the input doubling when the amount was greater than 1. There was something occurring with the slotClick method, so I had to override it, and super.slotClick and ensure the after crafting, the input would decrease by 1 no matter what.
It took me 3 days to implement a Mint Block that actually works. More experienced modders can probably do this in less than a few hours. There were times when I wanted to give up. But I didn't. Even if I felt like I couldn't figure something out, I just kept going. And sometimes the answer won't come to you when you're working on it. It's good to take a break sometimes. This is all cliche-sounding but there is truth to this.
I'm unsure where I want to take this mod in the future, I thinking of making villagers be able to trade with coins instead of emeralds.
Tuesday, January 10, 2017
Mint GUI Implemented - Simple Coins 0.3.0 Build Delayed
ItemStack var = null; -> ItemStack var = ItemStack.EMPTY;and
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.
Monday, January 9, 2017
onBlockActivated() - Not wanting to be Overriden
I solved the issue of onBlockActivated(...) not being accepted by @Override. So I first checked all the variables within onBlockActivated and the tutorial I was using to make sure they were similar. After some thinking I decided to use super.onBlockActivated(...), highlighted the super constructor in Eclipse and it told me the missing variables.
It's always the most stupid issues I get stuck on.
But I had another issue with implementing TileEntity. Immediately tried to extend my existing MintBlock class with BlockContainer instead of Block. However this led to the block being invisible in game. Rather then extend BlockContainer, I extended Block (like originally) and implement ITileEntityProvider.
I still need to add additional GUI classes but I should be able to get Version 0.3.0 Build released today. If you're following these same tutorials hopefully this helps you if you've had similar issues.