Fix deserialization of EnumDemonWillType

This commit is contained in:
Nicholas Ignoffo 2016-10-18 16:59:50 -07:00
parent b1335f9e9a
commit 66974716ef
12 changed files with 25 additions and 33 deletions

View file

@ -1,9 +1,6 @@
package WayofTime.bloodmagic.item.armour;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
@ -480,7 +477,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(EnumDemonWillType type, ItemStack stack)

View file

@ -1,9 +1,6 @@
package WayofTime.bloodmagic.item.soul;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.*;
import javax.annotation.Nullable;
@ -263,7 +260,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(ItemStack stack, EnumDemonWillType type)

View file

@ -33,6 +33,8 @@ import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter;
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
import WayofTime.bloodmagic.registry.ModItems;
import java.util.Locale;
public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentientTool//, IMeshProvider
{
public static int[] soulBracket = new int[] { 16, 60, 200, 400, 1000 };
@ -141,7 +143,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public double getDamageModifier(EnumDemonWillType type, int willBracket)

View file

@ -1,9 +1,6 @@
package WayofTime.bloodmagic.item.soul;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.*;
import javax.annotation.Nullable;
@ -263,7 +260,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(ItemStack stack, EnumDemonWillType type)

View file

@ -1,9 +1,6 @@
package WayofTime.bloodmagic.item.soul;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.*;
import javax.annotation.Nullable;
@ -263,7 +260,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(ItemStack stack, EnumDemonWillType type)

View file

@ -1,9 +1,6 @@
package WayofTime.bloodmagic.item.soul;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.*;
import javax.annotation.Nullable;
@ -235,7 +232,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(ItemStack stack, EnumDemonWillType type)

View file

@ -2,6 +2,7 @@ package WayofTime.bloodmagic.item.soul;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.annotation.Nullable;
@ -255,7 +256,7 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMeshProvider, I
return EnumDemonWillType.DEFAULT;
}
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
return EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
}
public void setCurrentType(EnumDemonWillType type, ItemStack soulGemStack)