Update entity data when attaching firework to entity

== AT ==
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ATTACHED_TO_TARGET
This commit is contained in:
booky10 2023-08-27 16:11:31 +02:00
parent 9f09c7a54d
commit efc4457fa1

View file

@ -69,6 +69,10 @@ public class CraftFirework extends CraftProjectile implements Firework {
}
this.getHandle().attachedToEntity = (entity != null) ? ((CraftLivingEntity) entity).getHandle() : null;
// Paper start - update entity data
this.getHandle().getEntityData().set(FireworkRocketEntity.DATA_ATTACHED_TO_TARGET,
entity != null ? java.util.OptionalInt.of(entity.getEntityId()) : java.util.OptionalInt.empty());
// Paper end - update entity data
return true;
}