Skip to content

Commit

Permalink
Fix compiler error and crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfa-ag committed Jan 7, 2016
1 parent 3fa1abd commit eb99511
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/ljfa/tntutils/proxy/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ObjectIntIdentityMap;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
Expand Down Expand Up @@ -61,12 +62,12 @@ private void replaceVanillaTNT() {
tntItem.block = TNTUtils.replaced_tnt;

//Add it to the Block -> Item map
GameData.getBlockItemMap().put(TNTUtils.replaced_tnt, tntItem);
((BiMap<Block, Item>)GameData.getBlockItemMap()).forcePut(TNTUtils.replaced_tnt, tntItem);

//Add the block states to the Block State -> ID map, imitating how it is done in GameRegistry
for(IBlockState state: TNTUtils.replaced_tnt.getBlockState().getValidStates()) {
int id = tntID << 4 | TNTUtils.replaced_tnt.getMetaFromState(state);
GameData.getBlockStateIDMap().put(state, id);
((ObjectIntIdentityMap<IBlockState>)GameData.getBlockStateIDMap()).put(state, id);
}

//Replace it in the Blocks class
Expand Down

0 comments on commit eb99511

Please sign in to comment.