Bound tools should be unbreakable, yet enchantable (#815, #793)

This commit is contained in:
Nicholas Ignoffo 2016-06-23 18:40:28 -07:00
parent d240daf958
commit aeb7b0af12
4 changed files with 31 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import java.util.Locale;
import java.util.Set;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.state.IBlockState;
@ -172,6 +173,12 @@ public class Utils
return itemHandler;
}
public static ItemStack setUnbreakable(ItemStack stack) {
NBTHelper.checkNBT(stack);
stack.getTagCompound().setBoolean("Unbreakable", true);
return stack;
}
/**
* Gets a default block for each type of {@link EnumAltarComponent}
*