Fixed saving of spell nbt data

This commit is contained in:
Sollace 2019-01-26 19:27:24 +02:00
parent 3f9029098e
commit ca1d649b5d
2 changed files with 3 additions and 2 deletions

View file

@ -31,7 +31,8 @@ public class EffectSync<T extends EntityLivingBase> {
effect = null;
} else {
String id = comp.getString("effect_id");
if (effect == null || id != effect.getName()) {
if (effect == null || !effect.getName().contentEquals(id)) {
effect = SpellRegistry.instance().createEffectFromNBT(comp);
} else if (owned.getEntity().world.isRemote) {
effect.readFromNBT(comp);

View file

@ -45,7 +45,7 @@ public class SpellRegistry {
IMagicEffect effect = getSpellFromName(compound.getString("effect_id"));
if (effect != null) {
effect.readFromNBT(compound.getCompoundTag("effect"));
effect.readFromNBT(compound);
}
return effect;