mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed spell entities not saving their affinity
This commit is contained in:
parent
759da19f6d
commit
a98b027f0f
1 changed files with 5 additions and 0 deletions
|
@ -344,6 +344,10 @@ public class EntitySpell extends EntityCreature implements IMagicals, ICaster<En
|
||||||
@Override
|
@Override
|
||||||
public void readEntityFromNBT(NBTTagCompound compound) {
|
public void readEntityFromNBT(NBTTagCompound compound) {
|
||||||
super.readEntityFromNBT(compound);
|
super.readEntityFromNBT(compound);
|
||||||
|
if (compound.hasKey("affinity")) {
|
||||||
|
setAffinity(SpellAffinity.of(compound.getString("affinity")));
|
||||||
|
}
|
||||||
|
|
||||||
setOwner(compound.getString("ownerName"));
|
setOwner(compound.getString("ownerName"));
|
||||||
setCurrentLevel(compound.getInteger("level"));
|
setCurrentLevel(compound.getInteger("level"));
|
||||||
|
|
||||||
|
@ -356,6 +360,7 @@ public class EntitySpell extends EntityCreature implements IMagicals, ICaster<En
|
||||||
public void writeEntityToNBT(NBTTagCompound compound) {
|
public void writeEntityToNBT(NBTTagCompound compound) {
|
||||||
super.writeEntityToNBT(compound);
|
super.writeEntityToNBT(compound);
|
||||||
|
|
||||||
|
compound.setString("affinity", getAffinity().name());
|
||||||
compound.setString("ownerName", getOwnerName());
|
compound.setString("ownerName", getOwnerName());
|
||||||
compound.setInteger("level", getCurrentLevel());
|
compound.setInteger("level", getCurrentLevel());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue