mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-24 10:11:24 +01:00
Pass InventoryDragEvent to GUI menu
This commit is contained in:
parent
3ad450b1be
commit
3c1d48137d
@ -9,6 +9,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
@ -62,6 +63,13 @@ public class EquipmentEditor extends Editor {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClick(InventoryDragEvent event) {
|
||||
if (menu != null && event.getWhoClicked().equals(player)) {
|
||||
menu.onInventoryDrag(event);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
if (menu != null && event.getPlayer().equals(player)) {
|
||||
|
@ -41,7 +41,7 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||
|
||||
private boolean canAttack() {
|
||||
BoundingBox handleBB = NMS.getBoundingBox(handle), targetBB = NMS.getBoundingBox(target);
|
||||
return attackTicks == 0 && (handleBB.maxY > targetBB.minY && handleBB.minY < targetBB.maxY)
|
||||
return attackTicks <= 0 && (handleBB.maxY > targetBB.minY && handleBB.minY < targetBB.maxY)
|
||||
&& closeEnough(distanceSquared()) && hasLineOfSight();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user