|
|
|
@ -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."));
|
|
|
|
|