master
loganb1max 2020-01-05 15:15:05 +07:00
parent a4e76e8383
commit c621a0ed07
2 changed files with 2 additions and 1 deletions

@ -111,7 +111,7 @@ public class MinionManager implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onRightClick(final PlayerArmorStandManipulateEvent e) {
this.minions.stream().filter(minion -> minion.getId().equals(e.getRightClicked().getUniqueId())).findFirst().ifPresent(minion -> {
this.minions.stream().filter(minion -> minion.getId() != null).filter(minion -> minion.getId().equals(e.getRightClicked().getUniqueId())).findFirst().ifPresent(minion -> {
e.setCancelled(true);
if (!minion.getOwner().equals(e.getPlayer().getUniqueId())) {
e.getPlayer().sendMessage(Text.color("&cOnly the owner of the minion can interact with it."));

@ -248,6 +248,7 @@ public abstract class Minion {
toReturn = new BreederMinion(owner, ownerName, location, energy, level, linkedBlocks);
break;
}
toReturn.findStand();
return toReturn;
}