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

@ -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)));
}
}

View file

@ -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");

View file

@ -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