-
-
Save anonymous/b4f73055523e8eae1374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package potato.info; | |
import java.util.Arrays; | |
import org.bukkit.Bukkit; | |
import org.bukkit.ChatColor; | |
import org.bukkit.DyeColor; | |
import org.bukkit.GameMode; | |
import org.bukkit.Location; | |
import org.bukkit.Material; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.inventory.InventoryClickEvent; | |
import org.bukkit.inventory.Inventory; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.ItemMeta; | |
import org.bukkit.material.Wool; | |
import org.bukkit.plugin.Plugin; | |
@SuppressWarnings("unused") | |
public class Menu implements Listener { | |
private Inventory inv; | |
private ItemStack a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p2, q, r, s, t, u, v, w, x, y, z, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; | |
public Menu(Plugin p) { | |
inv = Bukkit.getServer().createInventory(null, 36, ChatColor.BLUE + "Rules/Information"); | |
a = createItem(DyeColor.RED, ChatColor.GRAY + "Always Listen to staff"); | |
b = createItem(DyeColor.ORANGE, ChatColor.GRAY + "Respect all players"); | |
c = createItem(DyeColor.YELLOW, ChatColor.GRAY + "No spamming, swearing, or caps"); | |
d = createItem(DyeColor.LIME, ChatColor.GRAY + "No saying Yolo or Swag"); | |
e = createItem(DyeColor.BLUE, ChatColor.GRAY + "Don't bypass chat filter"); | |
f = createItem(DyeColor.PURPLE, ChatColor.GRAY + "Keep chat G rated"); | |
g = createItem(DyeColor.MAGENTA, ChatColor.GRAY + "English only in chat"); | |
h = createItem(DyeColor.PINK, ChatColor.GRAY + "No noob towers"); | |
i = createItem(DyeColor.RED, ChatColor.GRAY + "Do not scam"); | |
j = createItem(DyeColor.BLUE, ChatColor.BLUE + ""); | |
k = createItem(DyeColor.YELLOW, ChatColor.YELLOW + ""); | |
l = createItem(DyeColor.RED, ChatColor.RED + ""); | |
m = createItem(DyeColor.ORANGE, ChatColor.GRAY + "No exploits"); | |
n = createItem(DyeColor.YELLOW, ChatColor.GRAY + "No refunds w/o pics"); | |
o = createItem(DyeColor.LIME, ChatColor.GRAY + "Don't argue with staff"); | |
p2 = createItem(DyeColor.BLUE, ChatColor.GRAY + "No xray packs or hacked clients"); | |
q = createItem(DyeColor.PURPLE, ChatColor.GRAY + "No hashtags"); | |
r = createItem(DyeColor.MAGENTA, ChatColor.GRAY + "Do not ask for items or ranks"); | |
s = createItem(DyeColor.PINK, ChatColor.GRAY + "No greifing"); | |
t = createItem(DyeColor.WHITE, ChatColor.GOLD + ""); | |
u = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
v = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
w = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
x = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
y = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
z = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a1 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a2 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a3 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a4 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a5 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a6 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a7 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a8 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a9 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
a10 = createItem(DyeColor.BLACK, ChatColor.GRAY + ""); | |
inv.setItem(0, a); | |
inv.setItem(1, b); | |
inv.setItem(2, c); | |
inv.setItem(3, d); | |
inv.setItem(4, e); | |
inv.setItem(5, f); | |
inv.setItem(6, g); | |
inv.setItem(7, h); | |
inv.setItem(8, i); | |
inv.setItem(30, j); | |
inv.setItem(31, k); | |
inv.setItem(32, l); | |
inv.setItem(10, m); | |
inv.setItem(11, n); | |
inv.setItem(12, o); | |
inv.setItem(13, p2); | |
inv.setItem(14, q); | |
inv.setItem(15, r); | |
inv.setItem(16, s); | |
inv.setItem(22, t); | |
inv.setItem(29, u); | |
inv.setItem(33, v); | |
inv.setItem(9, w); | |
inv.setItem(17, x); | |
inv.setItem(18, y); | |
inv.setItem(19, z); | |
inv.setItem(20, a1); | |
inv.setItem(21, a2); | |
inv.setItem(23, a3); | |
inv.setItem(24, a4); | |
inv.setItem(25, a5); | |
inv.setItem(26, a6); | |
inv.setItem(27, a7); | |
inv.setItem(28, a8); | |
inv.setItem(34, a9); | |
inv.setItem(35, a10); | |
Bukkit.getServer().getPluginManager().registerEvents(this, p); | |
} | |
private ItemStack createItem(DyeColor dc, String name) { | |
ItemStack i = new Wool(dc).toItemStack(1); | |
ItemMeta im = i.getItemMeta(); | |
im.setDisplayName(name); | |
i.setItemMeta(im); | |
return i; | |
} | |
public void show(Player p) { | |
p.openInventory(inv); | |
} | |
@EventHandler | |
public void onInventoryClick(InventoryClickEvent e) { | |
if (!e.getInventory().getName().equalsIgnoreCase(inv.getName())) return; | |
if (e.getCurrentItem().getItemMeta() == null) return; | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Always Listen to staff")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Respect all players")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No spamming, swearing, or caps")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No saying Yolo or Swag")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Don't bypass chat filter")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Keep chat G rated")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("English only in chat")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No noob towers")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Do not scam")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No exploits")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No refunds w/o pics")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Don't argue with staff")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No xray packs or hacked clients")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No hashtags")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Do not ask for items or ranks")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("No greifing")) { | |
e.setCancelled(true); | |
} | |
if (e.getCurrentItem().getItemMeta().getDisplayName().contains("")) { | |
e.setCancelled(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment