Skip to content
Permalink
Browse files

Spigot now erroneously provides tamed entities that don't have an owner

  • Loading branch information
me4502 committed Feb 18, 2020
1 parent 5966180 commit 16a2a40413a5ad047c889a7ea152997f683210b6
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/com/sk89q/craftbook/mechanics/BetterLeads.java
@@ -22,6 +22,7 @@

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class BetterLeads extends AbstractCraftBookMechanic {

@@ -184,8 +185,9 @@ public void onUnleash(PlayerUnleashEntityEvent event) {

if (!EventUtil.passesFilter(event)) return;

if(!((Tameable) event.getEntity()).getOwner().equals(event.getPlayer()))
if(!Objects.equals(((Tameable) event.getEntity()).getOwner(), event.getPlayer())) {
event.setCancelled(true);
}
}

private boolean leadsStopTarget;

0 comments on commit 16a2a40

Please sign in to comment.
You can’t perform that action at this time.