Change ClickInventoryEvent to InteractInventoryEvent
@@ -13,6 +13,7 @@ import org.spongepowered.api.event.filter.Getter;
import org.spongepowered.api.event.filter.cause.Root;
import org.spongepowered.api.event.filter.type.Exclude;
import org.spongepowered.api.event.item.inventory.ClickInventoryEvent;
+import org.spongepowered.api.event.item.inventory.InteractInventoryEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.item.inventory.Container;
import org.spongepowered.api.item.inventory.Inventory;
@@ -37,8 +38,8 @@ public class InvSeeListener extends ListenerBase {
* @param targetInventory The {@link CarriedInventory} that is being interacted with.
*/
@Listener
- @Exclude({ClickInventoryEvent.Open.class, ClickInventoryEvent.Close.class})
- public void onInventoryChange(ClickInventoryEvent event, @Root Player player, @Getter("getTargetInventory") Container targetInventory) {
+ @Exclude({InteractInventoryEvent.Open.class, InteractInventoryEvent.Close.class})
+ public void onInventoryChange(InteractInventoryEvent event, @Root Player player, @Getter("getTargetInventory") Container targetInventory) {
if (preventModify.get(player.getUniqueId()) == targetInventory) {
event.setCancelled(true);
@@ -48,7 +49,7 @@ public class InvSeeListener extends ListenerBase {
}
@Listener(order = Order.POST)
- public void onInventoryClose(ClickInventoryEvent.Close event, @Root Player player, @Getter("getTargetInventory") Container targetInventory) {
+ public void onInventoryClose(InteractInventoryEvent.Close event, @Root Player player, @Getter("getTargetInventory") Container targetInventory) {
if (preventModify.get(player.getUniqueId()) == targetInventory) {
preventModify.remove(player.getUniqueId());
}
