Fix a load of null issues, and get it to sort of work.

This commit is contained in:
modmuss50 2016-11-19 16:36:13 +00:00
parent 65e651f402
commit 528fecc2b5
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
35 changed files with 101 additions and 87 deletions

View file

@ -52,7 +52,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
World worldIn,
@Nullable
EntityLivingBase entityIn) {
if (stack != null && stack.getTagCompound().getBoolean("isActive")) {
if (stack != ItemStack.EMPTY && stack.getTagCompound().getBoolean("isActive")) {
return 1.0F;
}
return 0.0F;
@ -65,7 +65,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
int modifier = 0;
if (stack.getTagCompound().getBoolean("isActive"))
if (!stack.isEmpty() && stack.getTagCompound().getBoolean("isActive"))
modifier = 9;
if (slot == EntityEquipmentSlot.MAINHAND) {