Skip to content

Commit 7e73a1b

Browse files
committed
fix #99
1 parent 04aedc5 commit 7e73a1b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/dev/sterner/witchery/mixin/possession/LivingEntityMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public LivingEntityMixin(EntityType<?> entityType, Level level) {
5959
@ModifyVariable(method = "dropAllDeathLoot", at = @At(value = "HEAD"), argsOnly = true)
6060
private DamageSource witchery$dropAllDeathLoot(DamageSource deathCause) {
6161
Player possessor = null;
62-
if (deathCause.getEntity() != null) {
63-
possessor = ((Possessable) deathCause.getEntity()).getPossessor();
62+
if (deathCause.getEntity() instanceof Possessable possessable) {
63+
possessor = possessable.getPossessor();
6464
}
6565
if (possessor != null) {
6666
this.lastHurtByPlayerTime = 100;

0 commit comments

Comments
 (0)