@@ -0,0 +1,1979 @@
+package thezaha;%0A%0Aimport java.util.ArrayList;%0A%0Aimport org.bukkit.Bukkit;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.event.EventHandler;%0Aimport org.bukkit.event.EventPriority;%0Aimport org.bukkit.event.Listener;%0Aimport org.bukkit.event.inventory.InventoryClickEvent;%0Aimport org.bukkit.inventory.Inventory;%0A %0Apublic class CustomInventory implements Listener %7B%0A%09%0A%09public static ArrayList%3CCreateInventory%3E list = new ArrayList%3CCreateInventory%3E(); %0A%09%0A    public CustomInventory() %7B%0A        Bukkit.getPluginManager().registerEvents(this, Bukkit.getPluginManager().getPlugins()%5B0%5D);%0A    %7D%0A    %0A    public static class CreateInventory %7B%0A        private Click click;%0A        private Inventory inv;%0A        %0A    %09public CreateInventory(String name, int size, Click click)%7B%0A    %09%09this.click = click;%0A    %09%09this.inv = Bukkit.getServer().createInventory(null, (size*9), name);%0A    %09%09list.add(this);%0A    %09%7D%0A    %09public String getName()%7B%0A    %09%09return inv.getName();%0A    %09%7D%0A    %09public int getSize()%7B%0A    %09%09return inv.getSize();%0A    %09%7D%0A    %09public Click getClick()%7B%0A    %09%09return click;%0A    %09%7D%0A    %09public Inventory getInventory() %7B%0A    %09%09return inv;%0A    %09%7D%0A    %09public CreateInventory getInventory(String name)%7B%0A    %09%09for(CreateInventory ci : CustomInventory.list)%0A    %09%09if(ci.getName().equals(name)) return ci;%0A%09%09%09return null;%0A    %09%7D%0A    %7D%0A    @EventHandler(priority = EventPriority.NORMAL)%0A    public void onInventoryClick(InventoryClickEvent e) %7B%0A    %09for(CreateInventory ci : CustomInventory.list)%7B%0A    %09%09if(ci.getName().equals(e.getInventory().getName()))%7B%0A    %09%09%09e.setCancelled(true);%0A    %09%09%09Player p = (Player) e.getWhoClicked();%0A%09%09%09%09  p.openInventory(ci.getInventory());//debug - nie usuwac, inaczej itemy beda sie klonowa%C4%87 ... %5C%5C no delete, otherwise items will be cloned%0A    %09%09%09if(!ci.getClick().click(p, ci, e))%0A    %09%09%09%09p.closeInventory();%0A    %09%09%7D%0A    %09%7D%0A    %7D%0A%09public interface Click %7B%0A%09%09public abstract boolean click(Player p, CreateInventory ci, InventoryClickEvent e);%0A%09%7D%0A%7D%0A

Create CustomInventory.java