com.tchristofferson.pagedinventories.handlers.PagedInventoryHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of PagedInventories Show documentation
Show all versions of PagedInventories Show documentation
API for easily creating multi paged inventory GUIs in Spigot/Bukkit (Minecraft)
The newest version!
package com.tchristofferson.pagedinventories.handlers;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;
public abstract class PagedInventoryHandler {
PagedInventoryHandler() {
}
public static class Handler {
private final InventoryView inventoryView;
private final Player player;
Handler(InventoryView inventoryView, Player player) {
this.inventoryView = inventoryView;
this.player = player;
}
public InventoryView getInventoryView() {
return inventoryView;
}
public Player getPlayer() {
return player;
}
@Override
public boolean equals(Object obj) {
if (obj == this)
return true;
if (!(obj instanceof Handler))
return false;
Handler handler = (Handler) obj;
return inventoryView.equals(handler.inventoryView)
&& player.getUniqueId().equals(handler.player.getUniqueId());
}
}
@Override
public boolean equals(Object obj) {
return obj == this;
}
}