From 9b651da09fd6880548b0bf4e61a078bac2a681ae Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 3 Sep 2023 19:39:47 +0100 Subject: [PATCH] Fixed error when updating a projectile entity's owner --- .../unicopia/projectile/MagicProjectileEntity.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java index 81b27fa2..cff6faf8 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java @@ -69,7 +69,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster physics = new EntityPhysics<>(this, GRAVITY, false); private final EntityReference homingTarget = new EntityReference<>(); - private final EntityReference owner = new EntityReference<>(); + private EntityReference owner; public MagicProjectileEntity(EntityType type, World world) { super(type, world); @@ -115,7 +115,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster getMasterReference() { + if (owner == null) { + owner = new EntityReference<>(); + } return owner; } @@ -256,7 +259,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster { compound.put("effect", Spell.writeNbt(effect)); }); @@ -325,7 +328,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster