Skip to content

Commit

Permalink
Fixed some NBT tag stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyyTV committed Sep 26, 2018
1 parent 2b28ac5 commit 35ba4f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/jackyy/exchangers/handler/ExchangerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ public static void setDefaultTagCompound(ItemStack stack) {
if (stack.getTagCompound() == null) {
NBTTagCompound compound = new NBTTagCompound();
compound.setTag("blockstate", new NBTTagCompound());
NBTUtil.writeBlockState(compound.getCompoundTag("blockstate"), Blocks.AIR.getDefaultState());
compound.setInteger("exmode", 0);
compound.setInteger("range", 0);
compound.setBoolean("forceDropItems", false);
stack.setTagCompound(compound);
} else {
if (!stack.getTagCompound().hasKey("blockstate")) {
stack.getTagCompound().setTag("blockstate", new NBTTagCompound());
NBTUtil.writeBlockState(stack.getTagCompound().getCompoundTag("blockstate"), Blocks.AIR.getDefaultState());
} else if (!stack.getTagCompound().hasKey("exmode")) {
stack.getTagCompound().setInteger("exmode", 0);
Expand Down

0 comments on commit 35ba4f6

Please sign in to comment.