From ca1d649b5d2f7b5625d820cef27a126628a26900 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 26 Jan 2019 19:27:24 +0200 Subject: [PATCH] Fixed saving of spell nbt data --- .../java/com/minelittlepony/unicopia/network/EffectSync.java | 3 ++- .../java/com/minelittlepony/unicopia/spell/SpellRegistry.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/network/EffectSync.java b/src/main/java/com/minelittlepony/unicopia/network/EffectSync.java index 94e97db8..57aafee2 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/EffectSync.java +++ b/src/main/java/com/minelittlepony/unicopia/network/EffectSync.java @@ -31,7 +31,8 @@ public class EffectSync { 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); diff --git a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java index 5b3ad079..abe46699 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java @@ -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;