Skip to content

Commit

Permalink
Fix CraftOminousItemSpawner is not a ProjectileSource. (Closes #1560)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <i@rain.cx>
  • Loading branch information
qyl27 committed Nov 17, 2024
1 parent 17f1124 commit 4b290e2
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public abstract class AbstractArrowMixin extends ProjectileMixin {

@Inject(method = "setOwner", at = @At("HEAD"))
private void arclight$setShooter(Entity entityIn, CallbackInfo ci) {
this.projectileSource = entityIn == null ? null : (ProjectileSource) ((EntityBridge) entityIn).bridge$getBukkitEntity();
if (entityIn != null) {
var craftEntity = entityIn.bridge$getBukkitEntity();
if (craftEntity instanceof ProjectileSource p) {
this.projectileSource = p;
return;
}
}

this.projectileSource = null;
}
}

0 comments on commit 4b290e2

Please sign in to comment.