Fix deserialization of EnumDemonWillType
This commit is contained in:
parent
b1335f9e9a
commit
66974716ef
|
@ -2,10 +2,8 @@ package WayofTime.bloodmagic.api.soul;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@Getter
|
||||
public enum EnumDemonWillType implements IStringSerializable
|
||||
{
|
||||
DEFAULT("default"),
|
||||
|
|
|
@ -14,6 +14,8 @@ import WayofTime.bloodmagic.gson.Serializers;
|
|||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public abstract class EntityAspectedDemonBase extends EntityDemonBase
|
||||
{
|
||||
protected static final DataParameter<EnumDemonWillType> TYPE = EntityDataManager.<EnumDemonWillType>createKey(EntityAspectedDemonBase.class, Serializers.WILL_TYPE_SERIALIZER);
|
||||
|
@ -223,7 +225,7 @@ public abstract class EntityAspectedDemonBase extends EntityDemonBase
|
|||
setType(EnumDemonWillType.DEFAULT);
|
||||
} else
|
||||
{
|
||||
setType(EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE)));
|
||||
setType(EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.entity.mob;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -457,7 +458,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
type = EnumDemonWillType.DEFAULT;
|
||||
} else
|
||||
{
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
wasGivenSentientArmour = tag.getBoolean("sentientArmour");
|
||||
|
|
|
@ -13,6 +13,8 @@ import WayofTime.bloodmagic.api.Constants;
|
|||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class EntitySentientArrow extends EntityTippedArrow
|
||||
{
|
||||
public double reimbursedAmountOnHit = 0;
|
||||
|
@ -63,7 +65,7 @@ public class EntitySentientArrow extends EntityTippedArrow
|
|||
super.readEntityFromNBT(tag);
|
||||
|
||||
reimbursedAmountOnHit = tag.getDouble("reimbursement");
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.tile;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
@ -284,7 +285,7 @@ public class TileInversionPillar extends TileTicking
|
|||
type = EnumDemonWillType.DEFAULT;
|
||||
}
|
||||
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE));
|
||||
type = EnumDemonWillType.valueOf(tag.getString(Constants.NBT.WILL_TYPE).toUpperCase(Locale.ENGLISH));
|
||||
currentInversion = tag.getDouble("currentInversion");
|
||||
currentInfectionRadius = tag.getInteger("currentInfectionRadius");
|
||||
consecutiveFailedChecks = tag.getInteger("consecutiveFailedChecks");
|
||||
|
|
Loading…
Reference in a new issue