diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..81a5f98
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..2b3d759
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+
+
+ HoundPvP Hub
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..3a21537
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bin/com/houndpvp/hub/Hub.class b/bin/com/houndpvp/hub/Hub.class
new file mode 100644
index 0000000..ad961ae
Binary files /dev/null and b/bin/com/houndpvp/hub/Hub.class differ
diff --git a/bin/com/houndpvp/hub/commands/BuilderCommand.class b/bin/com/houndpvp/hub/commands/BuilderCommand.class
new file mode 100644
index 0000000..02602e0
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/BuilderCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/ClearCommand.class b/bin/com/houndpvp/hub/commands/ClearCommand.class
new file mode 100644
index 0000000..fe4f6c2
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/ClearCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/GamemodeCommand.class b/bin/com/houndpvp/hub/commands/GamemodeCommand.class
new file mode 100644
index 0000000..1fc99be
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/GamemodeCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/InvSelectorCommand.class b/bin/com/houndpvp/hub/commands/InvSelectorCommand.class
new file mode 100644
index 0000000..8ca2f92
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/InvSelectorCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/MsgCommand.class b/bin/com/houndpvp/hub/commands/MsgCommand.class
new file mode 100644
index 0000000..ec2afa8
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/MsgCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/RawcastCommand.class b/bin/com/houndpvp/hub/commands/RawcastCommand.class
new file mode 100644
index 0000000..9a210f4
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/RawcastCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/ReplyCommand.class b/bin/com/houndpvp/hub/commands/ReplyCommand.class
new file mode 100644
index 0000000..89e4c7f
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/ReplyCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/SetSpawnCommand.class b/bin/com/houndpvp/hub/commands/SetSpawnCommand.class
new file mode 100644
index 0000000..b804187
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/SetSpawnCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/SoundsCommand.class b/bin/com/houndpvp/hub/commands/SoundsCommand.class
new file mode 100644
index 0000000..6767e68
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/SoundsCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/TeleportCommand.class b/bin/com/houndpvp/hub/commands/TeleportCommand.class
new file mode 100644
index 0000000..be8622e
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/TeleportCommand.class differ
diff --git a/bin/com/houndpvp/hub/commands/TogglePMCommand.class b/bin/com/houndpvp/hub/commands/TogglePMCommand.class
new file mode 100644
index 0000000..aa62cb7
Binary files /dev/null and b/bin/com/houndpvp/hub/commands/TogglePMCommand.class differ
diff --git a/bin/com/houndpvp/hub/inventory/SelectorInventory.class b/bin/com/houndpvp/hub/inventory/SelectorInventory.class
new file mode 100644
index 0000000..bceab7f
Binary files /dev/null and b/bin/com/houndpvp/hub/inventory/SelectorInventory.class differ
diff --git a/bin/com/houndpvp/hub/listeners/DoubleJumpListener$1.class b/bin/com/houndpvp/hub/listeners/DoubleJumpListener$1.class
new file mode 100644
index 0000000..9492d4b
Binary files /dev/null and b/bin/com/houndpvp/hub/listeners/DoubleJumpListener$1.class differ
diff --git a/bin/com/houndpvp/hub/listeners/DoubleJumpListener.class b/bin/com/houndpvp/hub/listeners/DoubleJumpListener.class
new file mode 100644
index 0000000..fefe2fd
Binary files /dev/null and b/bin/com/houndpvp/hub/listeners/DoubleJumpListener.class differ
diff --git a/bin/com/houndpvp/hub/listeners/Listeners$1.class b/bin/com/houndpvp/hub/listeners/Listeners$1.class
new file mode 100644
index 0000000..8887b3d
Binary files /dev/null and b/bin/com/houndpvp/hub/listeners/Listeners$1.class differ
diff --git a/bin/com/houndpvp/hub/listeners/Listeners.class b/bin/com/houndpvp/hub/listeners/Listeners.class
new file mode 100644
index 0000000..5267478
Binary files /dev/null and b/bin/com/houndpvp/hub/listeners/Listeners.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/ScoreboardProvider.class b/bin/com/houndpvp/hub/scoreboard/ScoreboardProvider.class
new file mode 100644
index 0000000..dc19d2b
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/ScoreboardProvider.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.class b/bin/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.class
new file mode 100644
index 0000000..d70fb57
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.class b/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.class
new file mode 100644
index 0000000..2156832
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.class b/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.class
new file mode 100644
index 0000000..e0f53bd
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$1.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$1.class
new file mode 100644
index 0000000..2f0e276
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$1.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$2.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$2.class
new file mode 100644
index 0000000..641ab3e
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$2.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$3.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$3.class
new file mode 100644
index 0000000..4cb67fa
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$3.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$ConstructorInvoker.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$ConstructorInvoker.class
new file mode 100644
index 0000000..d8dad8d
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$ConstructorInvoker.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$FieldAccessor.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$FieldAccessor.class
new file mode 100644
index 0000000..3255e67
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$FieldAccessor.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$MethodInvoker.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$MethodInvoker.class
new file mode 100644
index 0000000..f350fce
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection$MethodInvoker.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.class
new file mode 100644
index 0000000..1c2f072
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.class differ
diff --git a/bin/com/houndpvp/hub/scoreboard/providers/reflection/ReflectionConstants.class b/bin/com/houndpvp/hub/scoreboard/providers/reflection/ReflectionConstants.class
new file mode 100644
index 0000000..ca84217
Binary files /dev/null and b/bin/com/houndpvp/hub/scoreboard/providers/reflection/ReflectionConstants.class differ
diff --git a/bin/com/houndpvp/hub/tablist/Azazel$1.class b/bin/com/houndpvp/hub/tablist/Azazel$1.class
new file mode 100644
index 0000000..4b39387
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/Azazel$1.class differ
diff --git a/bin/com/houndpvp/hub/tablist/Azazel.class b/bin/com/houndpvp/hub/tablist/Azazel.class
new file mode 100644
index 0000000..3e74780
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/Azazel.class differ
diff --git a/bin/com/houndpvp/hub/tablist/AzazelTask.class b/bin/com/houndpvp/hub/tablist/AzazelTask.class
new file mode 100644
index 0000000..85fcedd
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/AzazelTask.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/Provider/TabProvider.class b/bin/com/houndpvp/hub/tablist/tab/Provider/TabProvider.class
new file mode 100644
index 0000000..9fc7ee7
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/Provider/TabProvider.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/Tab$TabEntryPosition.class b/bin/com/houndpvp/hub/tablist/tab/Tab$TabEntryPosition.class
new file mode 100644
index 0000000..528f750
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/Tab$TabEntryPosition.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/Tab$UpdatedPacketPlayOutPlayerInfo.class b/bin/com/houndpvp/hub/tablist/tab/Tab$UpdatedPacketPlayOutPlayerInfo.class
new file mode 100644
index 0000000..6ef317e
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/Tab$UpdatedPacketPlayOutPlayerInfo.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/Tab.class b/bin/com/houndpvp/hub/tablist/tab/Tab.class
new file mode 100644
index 0000000..bc296eb
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/Tab.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/TabAdapter.class b/bin/com/houndpvp/hub/tablist/tab/TabAdapter.class
new file mode 100644
index 0000000..7546f84
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/TabAdapter.class differ
diff --git a/bin/com/houndpvp/hub/tablist/tab/TabTemplate.class b/bin/com/houndpvp/hub/tablist/tab/TabTemplate.class
new file mode 100644
index 0000000..bb8d832
Binary files /dev/null and b/bin/com/houndpvp/hub/tablist/tab/TabTemplate.class differ
diff --git a/bin/com/houndpvp/hub/utils/Bungee$1.class b/bin/com/houndpvp/hub/utils/Bungee$1.class
new file mode 100644
index 0000000..2ecfbdb
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/Bungee$1.class differ
diff --git a/bin/com/houndpvp/hub/utils/Bungee$2.class b/bin/com/houndpvp/hub/utils/Bungee$2.class
new file mode 100644
index 0000000..323adce
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/Bungee$2.class differ
diff --git a/bin/com/houndpvp/hub/utils/Bungee.class b/bin/com/houndpvp/hub/utils/Bungee.class
new file mode 100644
index 0000000..7813211
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/Bungee.class differ
diff --git a/bin/com/houndpvp/hub/utils/ItemBuilder.class b/bin/com/houndpvp/hub/utils/ItemBuilder.class
new file mode 100644
index 0000000..5b20117
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/ItemBuilder.class differ
diff --git a/bin/com/houndpvp/hub/utils/SpawnUtils.class b/bin/com/houndpvp/hub/utils/SpawnUtils.class
new file mode 100644
index 0000000..271fc3c
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/SpawnUtils.class differ
diff --git a/bin/com/houndpvp/hub/utils/SpigotUtils.class b/bin/com/houndpvp/hub/utils/SpigotUtils.class
new file mode 100644
index 0000000..d8fd773
Binary files /dev/null and b/bin/com/houndpvp/hub/utils/SpigotUtils.class differ
diff --git a/bin/config.yml b/bin/config.yml
new file mode 100644
index 0000000..1b52465
--- /dev/null
+++ b/bin/config.yml
@@ -0,0 +1,80 @@
+scoreboard:
+- '&7&m--------------------'
+- '&5&lConnected Players:'
+- '&7%online%'
+- ''
+- '&5&lNetwork Rank'
+- '&7%rank%'
+- ''
+- '&7&ostore.exempvp.net'
+- '&7&m--------------------'
+scoreboard-inqueue:
+- '&7&m--------------------'
+- '&5&lConnected Players:'
+- '&7%online%'
+- ''
+- '&5&lQueue Info:'
+- ' &7%position%/%inqueue%'
+- ''
+- '&5&lNetwork Rank'
+- '&7%rank%'
+- ''
+- '&7&ostore.exempvp.net'
+- '&7&m--------------------'
+server-selector:
+ oghcf:
+ type: GOLD_SWORD
+ name: '&5Practice'
+ server: practice
+ lore:
+ - ''
+ - '&cOur practice server is currently being developed'
+ - '&cStay Tuned'
+ - ''
+ - '&5Connected Players: &7%count%/1000'
+ - '&5Click here to connect'
+ - ''
+ slot: 11
+ newhcf:
+ type: DIAMOND_SWORD
+ name: '&5HCF (Squads)'
+ server: HCF
+ lore:
+ - ''
+ - '&7- &5MapKit: &7S1, P1'
+ - '&7- &5Border: &7Quite big I think'
+ - '&7- &5Faction Size: &75-Man'
+ - '&7- &5Faction Allies: &70'
+ - ''
+ - '&7- &7Events will take place daily'
+ - ''
+ - '&5Connected Players: &7%count%/1000'
+ - '&5Click here to connect'
+ - ''
+ slot: 13
+ kitmap:
+ type: FISHING_ROD
+ name: '&5Kits'
+ lore:
+ - ''
+ - '&7- &5MapKit: &7S1, P1'
+ - '&7- &5Border: &7Quite big I think'
+ - '&7- &5Faction Size: &75-Man'
+ - '&7- &5Faction Allies: &70'
+ - ''
+ - '&7- &7Events will take place daily'
+ - ''
+ - '&5Connected Players: &7%count%/1000'
+ - '&7Click here to connect'
+ - ''
+ slot: 15
+ server: kitmap
+selector-name: '&7Select a server'
+chat-format: '%prefix% %player%&7: %message%'
+spawn:
+ x: -1625.0
+ y: 198.0
+ z: 1665.0
+ yaw: 0.0
+ pitch: 0.0
+ world: world
diff --git a/bin/plugin.yml b/bin/plugin.yml
new file mode 100644
index 0000000..ba7be3b
--- /dev/null
+++ b/bin/plugin.yml
@@ -0,0 +1,22 @@
+name: Hub
+version: 1.0
+main: com.houndpvp.hub.Hub
+commands:
+ builder:
+ setspawn:
+ rawcast:
+ gamemode:
+ gmc:
+ sounds:
+ aliases: [togglesounds, toggles]
+ gms:
+ gma:
+ msg:
+ aliases: [tell, message, t, w, wisper]
+ reply:
+ aliases: [r]
+ togglepm:
+ sounds:
+ invselector:
+ tp:
+ clear:
\ No newline at end of file
diff --git a/config.yml b/config.yml
new file mode 100644
index 0000000..6bb080f
--- /dev/null
+++ b/config.yml
@@ -0,0 +1,72 @@
+scoreboard:
+- '&7&m--------------------'
+- '&3&lOnline'
+- '&7%online%'
+- ''
+- '&3&lRank'
+- '&7%rank%'
+- ''
+- '&7&ostore.exempvp.net'
+- '&7&m--------------------'
+scoreboard-inqueue:
+- '&7&m--------------------'
+- '&3&lOnline'
+- '&7%online%'
+- ''
+- '&3&lQueue'
+- ' &7%position%/%inqueue%'
+- ''
+- '&3&lRank'
+- '&7%rank%'
+- ''
+- '&7&ostore.exempvp.net'
+- '&7&m--------------------'
+server-selector:
+ oghcf:
+ type: GOLD_SWORD
+ name: '&9Legacy HCF'
+ server: practice
+ lore:
+ - '&3Players: %count%/1000'
+ - ''
+ - '&8* &75 man factions, 0 allies'
+ - '&8* &7MineHQ Style HCF'
+ - '&8* &7Weekly events and games'
+ - ''
+ - '&3Click here to connect'
+ slot: 11
+ newhcf:
+ type: DIAMOND_SWORD
+ name: '&9Regular HCF'
+ server: HCF
+ lore:
+ - '&3Players: %count%/1000'
+ - ''
+ - '&8* &75 man factions, 0 allies'
+ - '&8* &7MineHQ Style HCF'
+ - '&8* &7Weekly events and games'
+ - ''
+ - '&3Click here to connect'
+ slot: 13
+ kitmap:
+ type: DIAMOND_PICKAXE
+ name: '&9Kitmap'
+ lore:
+ - '&3Players: %count%/1000'
+ - ''
+ - '&8* &75 man factions, 0 allies'
+ - '&8* &7MineHQ Style HCF'
+ - '&8* &7Weekly events and games'
+ - ''
+ - '&3Click here to connect'
+ slot: 15
+ server: kitmap
+selector-name: '&7Select a server'
+chat-format: "%prefix% %player%&7: %message%"
+spawn:
+ x: -1625.0
+ y: 198.0
+ z: 1665.0
+ yaw: 0.0
+ pitch: 0.0
+ world: 'world'
diff --git a/out/HoundHub.jar b/out/HoundHub.jar
new file mode 100644
index 0000000..a7ffece
Binary files /dev/null and b/out/HoundHub.jar differ
diff --git a/plugin.yml b/plugin.yml
new file mode 100644
index 0000000..ba7be3b
--- /dev/null
+++ b/plugin.yml
@@ -0,0 +1,22 @@
+name: Hub
+version: 1.0
+main: com.houndpvp.hub.Hub
+commands:
+ builder:
+ setspawn:
+ rawcast:
+ gamemode:
+ gmc:
+ sounds:
+ aliases: [togglesounds, toggles]
+ gms:
+ gma:
+ msg:
+ aliases: [tell, message, t, w, wisper]
+ reply:
+ aliases: [r]
+ togglepm:
+ sounds:
+ invselector:
+ tp:
+ clear:
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/Hub.java b/src/com/houndpvp/hub/Hub.java
new file mode 100644
index 0000000..bfa5348
--- /dev/null
+++ b/src/com/houndpvp/hub/Hub.java
@@ -0,0 +1,107 @@
+package com.houndpvp.hub;
+
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.RegisteredServiceProvider;
+import org.bukkit.plugin.java.JavaPlugin;
+
+import com.houndpvp.hub.commands.BuilderCommand;
+import com.houndpvp.hub.commands.ClearCommand;
+import com.houndpvp.hub.commands.GamemodeCommand;
+import com.houndpvp.hub.commands.InvSelectorCommand;
+import com.houndpvp.hub.commands.MsgCommand;
+import com.houndpvp.hub.commands.RawcastCommand;
+import com.houndpvp.hub.commands.ReplyCommand;
+import com.houndpvp.hub.commands.SetSpawnCommand;
+import com.houndpvp.hub.commands.SoundsCommand;
+import com.houndpvp.hub.commands.TeleportCommand;
+import com.houndpvp.hub.listeners.DoubleJumpListener;
+import com.houndpvp.hub.listeners.Listeners;
+import com.houndpvp.hub.scoreboard.ScoreboardProvider;
+import com.houndpvp.hub.scoreboard.providers.ScoreboardManager;
+import com.houndpvp.hub.tablist.Azazel;
+import com.houndpvp.hub.tablist.tab.Provider.TabProvider;
+import com.houndpvp.hub.utils.Bungee;
+import com.houndpvp.hub.utils.SpawnUtils;
+
+import lombok.Getter;
+import net.milkbowl.vault.chat.Chat;
+import net.milkbowl.vault.permission.Permission;
+
+public class Hub extends JavaPlugin {
+
+ @Getter
+ static Hub instance;
+ @Getter
+ Permission perms = null;
+ @Getter
+ Chat chat = null;
+ @Getter
+ Bungee bungee;
+ private SpawnUtils spawn;
+
+ @Override
+ public void onEnable() {
+ Bukkit.getLogger().warning("----------------------------");
+ Bukkit.getLogger().warning("This hub core has been made");
+ Bukkit.getLogger().warning("for the ExemPvP Network by");
+ Bukkit.getLogger().warning("the development team!");
+ Bukkit.getLogger().warning("----------------------------");
+ (spawn = new SpawnUtils(this)).load();
+ instance = this;
+
+ Bukkit.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
+ bungee = new Bungee(this);
+ Bukkit.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", bungee);
+
+ setupPermissions();
+ setupChat();
+ getConfig().options().copyDefaults(true);
+ saveConfig();
+ new Azazel(this, new TabProvider());
+
+ new ScoreboardManager(this, new ScoreboardProvider(this), "§5§lExemPVP §7| §7Hub-1");
+ Bukkit.getPluginManager().registerEvents(new Listeners(), this);
+ Bukkit.getPluginManager().registerEvents(new DoubleJumpListener(), this);
+
+ getCommand("builder").setExecutor(new BuilderCommand());
+ getCommand("setspawn").setExecutor(new SetSpawnCommand(this));
+ getCommand("rawcast").setExecutor(new RawcastCommand());
+ getCommand("msg").setExecutor(new MsgCommand());
+ getCommand("reply").setExecutor(new ReplyCommand());
+ getCommand("sounds").setExecutor(new SoundsCommand());
+ getCommand("gamemode").setExecutor(new GamemodeCommand());
+ getCommand("invselector").setExecutor(new InvSelectorCommand());
+ getCommand("tp").setExecutor(new TeleportCommand());
+ getCommand("clear").setExecutor(new ClearCommand());
+ }
+
+ @Override
+ public void onDisable() {
+ for (Player pp : Bukkit.getOnlinePlayers()) {
+ pp.kickPlayer("§5ExemPvP §7| Our Hub is Restarting");
+ }
+
+ }
+
+
+
+
+ public SpawnUtils getSpawn() {
+ return this.spawn;
+ }
+
+ public void setSpawn(SpawnUtils spawn) {
+ this.spawn = spawn;
+ }
+
+
+ private boolean setupPermissions() { RegisteredServiceProvider
+ rsp = getServer().getServicesManager().getRegistration(Permission.class);
+ perms = rsp.getProvider(); return perms != null; }
+
+ private boolean setupChat() { RegisteredServiceProvider rsp =
+ getServer().getServicesManager().getRegistration(Chat.class); chat =
+ rsp.getProvider(); return chat != null; }
+
+}
diff --git a/src/com/houndpvp/hub/commands/BuilderCommand.java b/src/com/houndpvp/hub/commands/BuilderCommand.java
new file mode 100644
index 0000000..79f7298
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/BuilderCommand.java
@@ -0,0 +1,47 @@
+package com.houndpvp.hub.commands;
+
+import java.util.ArrayList;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerTeleportEvent;
+
+import lombok.Getter;
+
+public class BuilderCommand implements CommandExecutor {
+
+ @Getter public static ArrayList builders = new ArrayList();
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ if(!(sender instanceof Player)) {
+ sender.sendMessage("§cYou must be a player to use this command.");
+ return true;
+
+ }
+
+ Player p = (Player) sender;
+
+ if(!p.hasPermission("houndpvp.builder")) {
+ p.sendMessage("§cYou do not have permission for this command.");
+ return true;
+ }
+
+ if(builders.contains(p)) {
+ builders.remove(p);
+ p.sendMessage("§cYou have disabled builder mode.");
+ return true;
+ } else if(!builders.contains(p)) {
+ builders.add(p);
+ p.sendMessage("§aYou have enabled builder mode.");
+ return true;
+ }
+
+
+
+ return true;
+ }
+
+}
diff --git a/src/com/houndpvp/hub/commands/ClearCommand.java b/src/com/houndpvp/hub/commands/ClearCommand.java
new file mode 100644
index 0000000..12fbfae
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/ClearCommand.java
@@ -0,0 +1,19 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import net.md_5.bungee.api.ChatColor;
+
+public class ClearCommand implements CommandExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
+ Player p = (Player) sender;
+ p.getInventory().clear();
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aYour inventory has been cleared!"));
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/commands/GamemodeCommand.java b/src/com/houndpvp/hub/commands/GamemodeCommand.java
new file mode 100644
index 0000000..e539ea0
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/GamemodeCommand.java
@@ -0,0 +1,125 @@
+package com.houndpvp.hub.commands;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.GameMode;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.TabExecutor;
+import org.bukkit.entity.Player;
+
+
+public class GamemodeCommand implements CommandExecutor, TabExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ if(!(sender instanceof Player)) {
+ sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou must be a player to use this command."));
+ return true;
+ }
+
+ Player p = (Player) sender;
+ if (p.hasPermission("hub.command.gamemode")) {
+
+ if(c.equalsIgnoreCase("gmc")) {
+ p.setGameMode(GameMode.CREATIVE);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eYour gamemode has been set to &9%gamemode%")
+ .replace("%gamemode%", p.getGameMode().toString()));
+ return true;
+ }
+
+ if(c.equalsIgnoreCase("gms")) {
+ p.setGameMode(GameMode.SURVIVAL);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eYour gamemode has been set to &9%gamemode%")
+ .replace("%gamemode%", p.getGameMode().toString()));
+ return true;
+ }
+
+ if(c.equalsIgnoreCase("gma")) {
+ p.setGameMode(GameMode.ADVENTURE);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eYour gamemode has been set to &9%gamemode%")
+ .replace("%gamemode%", p.getGameMode().toString()));
+ return true;
+ }
+
+ if(c.equalsIgnoreCase("gmc")) {
+ p.setGameMode(GameMode.CREATIVE);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eYour gamemode has been set to &9%gamemode%")
+ .replace("%gamemode%", p.getGameMode().toString()));
+ return true;
+ }
+
+ if(c.equalsIgnoreCase("gamemode")) {
+ if(args.length == 0) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cUsage: /" + c + " "));
+ return true;
+ }
+
+ if(args.length == 1) {
+ if(matchGameMode(args[0]) == null) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + args[0] + " is not a valid gamemode."));
+ } else {
+ p.setGameMode(matchGameMode(args[0]));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eYour gamemode has been set to &9%gamemode%")
+ .replace("%gamemode%", p.getGameMode().toString()));
+ }
+ return true;
+ }
+
+ if(args.length == 2) {
+ if(matchGameMode(args[0]) == null) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + args[0] + " is not a valid gamemode."));
+ return true;
+ }
+ Player target = Bukkit.getPlayer(args[1]);
+
+ if(target != null && !target.isOnline()) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + args[1] + " is not online."));
+ return true;
+ }
+
+ target.setGameMode(matchGameMode(args[0]));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&9%player%s &egamemode has been set to &9%gamemode%")
+ .replace("%player%", target.getName())
+ .replace("%gamemode%", p.getGameMode().toString()));
+ }
+ }
+ }
+ else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cNo permission"));
+ }
+ return true;
+ }
+
+ private GameMode matchGameMode(String modeString) {
+ GameMode mode = null;
+ if(modeString.substring(0, 1).equals("s") || modeString.contains("" + 0)) {
+ mode = GameMode.SURVIVAL;
+ } else if(modeString.substring(0, 1).equals("c") || modeString.contains("" + 1)) {
+ mode = GameMode.CREATIVE;
+ } else if(modeString.substring(0, 1).equals("a") || modeString.contains("" + 2)) {
+ mode = GameMode.ADVENTURE;
+ }
+
+ return mode;
+ }
+
+ @Override
+ public List onTabComplete(CommandSender sender, Command cmd, String c, String[] args) {
+
+ if(args.length == 1) {
+ GameMode mode = matchGameMode(args[0]);
+ if(mode != null) {
+ return Arrays.asList(mode.toString().toLowerCase());
+ }
+ }
+
+ return Arrays.asList("creative", "survival", "adventure");
+ }
+
+}
diff --git a/src/com/houndpvp/hub/commands/InvSelectorCommand.java b/src/com/houndpvp/hub/commands/InvSelectorCommand.java
new file mode 100644
index 0000000..a70db00
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/InvSelectorCommand.java
@@ -0,0 +1,26 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.ChatColor;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import com.houndpvp.hub.inventory.SelectorInventory;
+
+public class InvSelectorCommand implements CommandExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ if(!(sender instanceof Player)) {
+ sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou must be a player to use this command."));
+ return true;
+ }
+
+ Player p = (Player) sender;
+ SelectorInventory.openInventory(p);
+
+
+ return true;
+ }
+}
diff --git a/src/com/houndpvp/hub/commands/MsgCommand.java b/src/com/houndpvp/hub/commands/MsgCommand.java
new file mode 100644
index 0000000..1d259da
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/MsgCommand.java
@@ -0,0 +1,93 @@
+package com.houndpvp.hub.commands;
+
+import java.util.HashMap;
+import java.util.UUID;
+
+import org.bukkit.Bukkit;
+import org.bukkit.Sound;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import net.md_5.bungee.api.ChatColor;
+import ru.tehkode.permissions.bukkit.PermissionsEx;
+
+public class MsgCommand implements CommandExecutor {
+
+ public static HashMap lastplayer;
+ public static HashMap sounds;
+ public static HashMap toggle;
+
+ public MsgCommand() {
+ lastplayer = new HashMap();
+ sounds = new HashMap();
+ toggle = new HashMap();
+ }
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ Player p = (Player) sender;
+ StringBuilder str = new StringBuilder();
+
+ if(c.equalsIgnoreCase("msg")
+ || c.equalsIgnoreCase("m")
+ || c.equalsIgnoreCase("message")
+ || c.equalsIgnoreCase("tell")
+ || c.equalsIgnoreCase("w")) {
+ if(args.length == 0) {
+ p.sendMessage("§cUsage: /" + c + " ");
+ } else if(args.length == 1) {
+ p.sendMessage("§cUsage: /" + c + " ");
+ } else if(args.length >= 2) {
+ for (int i = 1; i < args.length; i++) {
+ str.append(args[i] + " ");
+ }
+ String message = str.toString();
+ Player target = Bukkit.getPlayer(args[0]);
+ if(target != null) {
+ if(target.isOnline()) {
+
+ if (!toggle.containsKey(p.getUniqueId())) {
+ toggle.put(p.getUniqueId(), true);
+ }
+ if (!toggle.containsKey(target.getUniqueId())) {
+ toggle.put(target.getUniqueId(), true);
+ }
+
+ if(toggle.get(p.getUniqueId())) {
+ if(toggle.get(target.getUniqueId())) {
+ target.sendMessage(ChatColor.translateAlternateColorCodes('&',
+ "&7(From &f%player%&7) %msg%".
+ replace("%player%", PermissionsEx.getUser(p).getSuffix() + p.getName()).
+ replace("%msg%", message)));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&',
+ "&7(To &f%player%&7) %msg%".
+ replace("%player%", PermissionsEx.getUser(target).getSuffix() + target.getName())).
+ replace("%msg%", message));
+ lastplayer.put(p.getUniqueId(), target.getName());
+ lastplayer.put(target.getUniqueId(), p.getName());
+ if (!sounds.containsKey(target.getUniqueId())) {
+ sounds.put(target.getUniqueId(), true);
+ }
+ if(sounds.get(target.getUniqueId())) {
+ target.playSound(target.getLocation(), Sound.SUCCESSFUL_HIT, 10, 1);
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "§c" + target.getName() + " has private messages off."));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "§cYou can't message someone with your PMs toggled"));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "§cThat player is not online"));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "§cThat player is not online"));
+ }
+ }
+ }
+ return true;
+ }
+
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/commands/RawcastCommand.java b/src/com/houndpvp/hub/commands/RawcastCommand.java
new file mode 100644
index 0000000..f338e67
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/RawcastCommand.java
@@ -0,0 +1,48 @@
+package com.houndpvp.hub.commands;
+
+import org.apache.commons.lang.StringUtils;
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+
+public class RawcastCommand
+ implements CommandExecutor
+{
+
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
+ {
+ if (args.length < 1)
+ {
+ sender.sendMessage(ChatColor.RED + "Usage: " + "/rawcast");
+ return true;
+ }
+ String arg;
+ String requiredNode;
+ int position = 0;
+ if ((args.length > 2) && ((arg = args[0]).startsWith("-p")))
+ {
+ int position1 = 1;
+ requiredNode = arg.substring(2, arg.length());
+ }
+ else
+ {
+ position = 0;
+ requiredNode = null;
+ }
+ String message = StringUtils.join(args, ' ', position, args.length);
+ if (message.length() < 3)
+ {
+ sender.sendMessage(ChatColor.RED + "Broadcasts must be at least 3 characters.");
+ return true;
+ }
+ message = ChatColor.translateAlternateColorCodes('&', message);
+ if (requiredNode != null) {
+ Bukkit.broadcast(message, requiredNode);
+ } else {
+ Bukkit.broadcastMessage(message);
+ }
+ return true;
+ }
+}
diff --git a/src/com/houndpvp/hub/commands/ReplyCommand.java b/src/com/houndpvp/hub/commands/ReplyCommand.java
new file mode 100644
index 0000000..169bf77
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/ReplyCommand.java
@@ -0,0 +1,47 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import net.md_5.bungee.api.ChatColor;
+import ru.tehkode.permissions.bukkit.PermissionsEx;
+
+public class ReplyCommand implements CommandExecutor {
+
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ Player p = (Player) sender;
+ if(c.equalsIgnoreCase("r") || c.equalsIgnoreCase("reply")) {
+ if(args.length == 0) {
+ p.sendMessage("§cUsage: /" + c + " ");
+ } else if (args.length >= 1) {
+ String message = "";
+ for (int i = 0; i < args.length; i++) {
+ if (message != "") message += " ";
+ String part = args[i];
+ message += part;
+ }
+ if(MsgCommand.lastplayer.get(p.getUniqueId()) != null) {
+ Player target = Bukkit.getPlayer(MsgCommand.lastplayer.get(p.getUniqueId()));
+ if(target != null) {
+ if(target.isOnline()) {
+ target.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7(From &f%player%&7) %msg%".replace("%player%", PermissionsEx.getUser(p).getSuffix() + p.getName()).replace("%msg%", message)));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7(To &f%player%&7) %msg%".replace("%player%", PermissionsEx.getUser(target).getSuffix() + target.getName()).replace("%msg%", message)));
+ } else {
+ p.sendMessage("§cThat player is not online.");
+ }
+ } else {
+ p.sendMessage("§cThat player is not online.");
+ }
+ } else {
+ p.sendMessage("§cYou have not messaged anyone.");
+ }
+ }
+ }
+ return true;
+ }
+
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/commands/SetSpawnCommand.java b/src/com/houndpvp/hub/commands/SetSpawnCommand.java
new file mode 100644
index 0000000..a911af9
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/SetSpawnCommand.java
@@ -0,0 +1,27 @@
+package com.houndpvp.hub.commands;
+
+import com.houndpvp.hub.*;
+
+import org.bukkit.Location;
+import org.bukkit.command.*;
+import org.bukkit.entity.*;
+
+public class SetSpawnCommand implements CommandExecutor {
+
+ private Hub hub;
+
+ public SetSpawnCommand(Hub Hub) {
+ this.hub = Hub;
+ }
+
+ public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
+ if (commandSender instanceof Player && commandSender.hasPermission("command.setspawn")) {
+ Player player = (Player)commandSender;
+ player.sendMessage(("§aYou have set the spawn location."));
+ hub.getSpawn().setSpawn(player.getLocation());
+ hub.getSpawn().save();
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/com/houndpvp/hub/commands/SoundsCommand.java b/src/com/houndpvp/hub/commands/SoundsCommand.java
new file mode 100644
index 0000000..8b1d88b
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/SoundsCommand.java
@@ -0,0 +1,31 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class SoundsCommand implements CommandExecutor {
+
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ Player p = (Player) sender;
+ if(c.equalsIgnoreCase("sounds")) {
+ if (!MsgCommand.sounds.containsKey(p.getUniqueId())) {
+ MsgCommand.sounds.put(p.getUniqueId(), true);
+ }
+ if(MsgCommand.sounds.get(p.getUniqueId()).equals(true)) {
+ MsgCommand.sounds.remove(p.getUniqueId());
+ MsgCommand.sounds.put(p.getUniqueId(), false);
+ p.sendMessage("§cYou will no longer hear message sounds.");
+ } else {
+ MsgCommand.sounds.remove(p.getUniqueId());
+ MsgCommand.sounds.put(p.getUniqueId(), true);
+ p.sendMessage("§aYou will now hear message sounds.");
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/src/com/houndpvp/hub/commands/TeleportCommand.java b/src/com/houndpvp/hub/commands/TeleportCommand.java
new file mode 100644
index 0000000..95ee02a
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/TeleportCommand.java
@@ -0,0 +1,71 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import net.md_5.bungee.api.ChatColor;
+
+
+
+public class TeleportCommand implements CommandExecutor {
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public boolean onCommand(CommandSender s, Command c, String lbl, String[] args) {
+ Player p = (Player) s;
+
+ if (args.length == 2) {
+ if (args[0].equalsIgnoreCase("here")) {
+ if (p.hasPermission("hub.tphere")) {
+ Player t = Bukkit.getPlayer(args[1]);
+ if (t == null) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cThe player " + args[1] + " could not be found."));
+ } else {
+ t.teleport(p);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eTeleported &9" + t.getName() + "&e to your location."));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &cno permission."));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cinvalid arguments."));
+ }
+ } else if (args.length == 1) {
+ if (args[0].equalsIgnoreCase("all")) {
+ if (p.hasPermission("hcessentials.tpall")) {
+ if (!(Bukkit.getOnlinePlayers().length == 1)) {
+ for (Player allPlayers : Bukkit.getOnlinePlayers()) {
+ allPlayers.teleport(p);
+ }
+ Integer playerCount = Bukkit.getOnlinePlayers().length-1;
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eTeleported &9" + playerCount + "&e players to your location."));
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cThere are not enough players to do /tp all"));
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cno permission."));
+ }
+ } else {
+ Player t = Bukkit.getPlayer(args[0]);
+ if (t == null) {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cThe player " + args[0] + " could not be found."));
+ } else {
+ p.teleport(t);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3Teleported to player &9" + t.getName()));
+ }
+ }
+ } else {
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7&m----------------------------------------"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &9Teleport Help"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &3* &7/tp [player] &f- &eteleports you the the player."));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &3* &7/tp all &f- &eteleports everyone to you."));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &3* &7/tp here [player] &f- &eteleports player to you."));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7&m----------------------------------------"));
+ }
+ return true;
+ }
+
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/commands/TogglePMCommand.java b/src/com/houndpvp/hub/commands/TogglePMCommand.java
new file mode 100644
index 0000000..fd6f66a
--- /dev/null
+++ b/src/com/houndpvp/hub/commands/TogglePMCommand.java
@@ -0,0 +1,32 @@
+package com.houndpvp.hub.commands;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import net.md_5.bungee.api.ChatColor;
+
+public class TogglePMCommand implements CommandExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender sender, Command cmd, String c, String[] args) {
+ Player p = (Player) sender;
+ if (c.equalsIgnoreCase("togglepm")) {
+ if (!MsgCommand.toggle.containsKey(p.getUniqueId())) {
+ MsgCommand.toggle.put(p.getUniqueId(), true);
+ }
+ if (MsgCommand.toggle.get(p.getUniqueId()) == true) {
+ MsgCommand.toggle.put(p.getUniqueId(), false);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&',
+ "&7You have toggled your messages &coff"));
+ } else {
+ MsgCommand.toggle.put(p.getUniqueId(), true);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&',
+ "&7You have toggled your messages &aon"));
+ }
+ }
+ return true;
+ }
+
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/inventory/SelectorInventory.java b/src/com/houndpvp/hub/inventory/SelectorInventory.java
new file mode 100644
index 0000000..225697f
--- /dev/null
+++ b/src/com/houndpvp/hub/inventory/SelectorInventory.java
@@ -0,0 +1,50 @@
+package com.houndpvp.hub.inventory;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.ItemStack;
+
+import com.houndpvp.hub.Hub;
+import com.houndpvp.hub.listeners.Listeners;
+import com.houndpvp.hub.utils.Bungee;
+import com.houndpvp.hub.utils.ItemBuilder;
+import com.houndpvp.hub.utils.SpigotUtils;
+
+import net.md_5.bungee.api.ChatColor;
+
+public class SelectorInventory {
+
+ public static void openInventory(Player p) {
+ Inventory inv = Bukkit.createInventory(null, 27);
+
+ for(int x = 0; x < 27; x ++) {
+ inv.setItem(x, new ItemBuilder(Material.STAINED_GLASS_PANE).setName(" §7")
+ .setDurability((short) 15)
+ .toItemStack());
+ }
+
+ ConfigurationSection cs = Hub.getInstance().getConfig().getConfigurationSection("server-selector");
+ for(String s : cs.getKeys(false)) {
+ ItemStack item = new ItemBuilder(Material.valueOf(cs.getString(s + ".type")))
+ .setName(ChatColor.translateAlternateColorCodes('&', cs.getString(s + ".name")))
+ .setLore(SpigotUtils.replaceArray(SpigotUtils.colorArray(cs.getStringList(s + ".lore")), "%count%", Bungee.getCount(cs.getString(s + ".server")) + ""))
+ .addEnchant(Enchantment.DURABILITY, 1)
+ .toItemStack();
+
+ inv.setItem(cs.getInt(s + ".slot"), item);
+
+ }
+ p.openInventory(inv);
+
+
+
+ }
+
+}
diff --git a/src/com/houndpvp/hub/listeners/DoubleJumpListener.java b/src/com/houndpvp/hub/listeners/DoubleJumpListener.java
new file mode 100644
index 0000000..ea65627
--- /dev/null
+++ b/src/com/houndpvp/hub/listeners/DoubleJumpListener.java
@@ -0,0 +1,66 @@
+package com.houndpvp.hub.listeners;
+
+import org.bukkit.Effect;
+import org.bukkit.GameMode;
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.Sound;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.event.player.PlayerMoveEvent;
+import org.bukkit.event.player.PlayerToggleFlightEvent;
+import org.bukkit.plugin.Plugin;
+
+import com.houndpvp.hub.Hub;
+
+
+public class DoubleJumpListener implements Listener {
+
+ @EventHandler
+ public void onPlayerToggleFlight(final PlayerToggleFlightEvent event) {
+ final Player player = event.getPlayer();
+ final Sound sound = Sound.BLAZE_HIT;
+ final Effect effect = Effect.EXPLOSION;
+ if (player.getGameMode() == GameMode.CREATIVE) {
+ return;
+ }
+ event.setCancelled(true);
+ player.setAllowFlight(false);
+ player.setFlying(false);
+ player.setVelocity(player.getLocation().getDirection().multiply(1.5).setY(1));
+ player.playSound(player.getLocation(), sound, 1.0f, 0.0f);
+ player.playEffect(player.getLocation(), effect, (Object)null);
+ }
+
+ @EventHandler
+ public void onPlayerMove(final PlayerMoveEvent event) {
+ final Player player = event.getPlayer();
+ if (player.getGameMode() != GameMode.CREATIVE && player.getLocation().subtract(0.0, 1.0, 0.0).getBlock().getType() != Material.AIR && !player.isFlying()) {
+ player.setAllowFlight(true);
+ }
+ }
+
+ @EventHandler
+ public void onFallDamage(final EntityDamageEvent e) {
+ if (e.getEntity() instanceof Player && e.getCause() == EntityDamageEvent.DamageCause.FALL) {
+ e.setCancelled(true);
+ }
+ }
+
+ @EventHandler
+ public void move(final PlayerMoveEvent e) {
+ final Player f = e.getPlayer();
+ if (e.getTo().getY() < 2.0) {
+ Hub.getInstance().getServer().getScheduler().scheduleSyncDelayedTask((Plugin)Hub.getInstance(), (Runnable)new Runnable() {
+ @Override
+ public void run() {
+ final double y = f.getLocation().getY() - 2.0;
+ final Location l = new Location(f.getLocation().getWorld(), f.getLocation().getX(), y, f.getLocation().getZ(), f.getLocation().getYaw(), f.getLocation().getPitch());
+ f.getWorld().playEffect(l, Effect.ENDER_SIGNAL, 50, 30);
+ }
+ }, 10L);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/com/houndpvp/hub/listeners/Listeners.java b/src/com/houndpvp/hub/listeners/Listeners.java
new file mode 100644
index 0000000..1e6477b
--- /dev/null
+++ b/src/com/houndpvp/hub/listeners/Listeners.java
@@ -0,0 +1,275 @@
+package com.houndpvp.hub.listeners;
+
+import org.bukkit.GameMode;
+import org.bukkit.Material;
+import org.bukkit.Sound;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Item;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.block.Action;
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.event.block.BlockPlaceEvent;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.event.entity.FoodLevelChangeEvent;
+import org.bukkit.event.entity.ProjectileLaunchEvent;
+import org.bukkit.event.inventory.InventoryClickEvent;
+import org.bukkit.event.inventory.InventoryDragEvent;
+import org.bukkit.event.player.AsyncPlayerChatEvent;
+import org.bukkit.event.player.PlayerDropItemEvent;
+import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.event.player.PlayerItemDamageEvent;
+import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.event.player.PlayerMoveEvent;
+import org.bukkit.event.player.PlayerQuitEvent;
+import org.bukkit.event.weather.WeatherChangeEvent;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.scheduler.BukkitRunnable;
+
+import com.houndpvp.hub.Hub;
+import com.houndpvp.hub.commands.BuilderCommand;
+import com.houndpvp.hub.inventory.SelectorInventory;
+import com.houndpvp.hub.utils.Bungee;
+import com.houndpvp.hub.utils.ItemBuilder;
+import com.houndpvp.hub.utils.SpigotUtils;
+
+import lombok.Getter;
+import me.signatured.ezqueuespigot.EzQueueAPI;
+import net.md_5.bungee.api.ChatColor;
+
+public class Listeners implements Listener {
+
+ @EventHandler
+ public void inventoryClick(InventoryClickEvent e) {
+ if(BuilderCommand.getBuilders().contains(e.getWhoClicked())) {
+ return;
+ }
+ e.setCancelled(true);
+
+ }
+ @EventHandler
+ public void onMove(PlayerMoveEvent e) {
+ Player player = e.getPlayer();
+ player.setFoodLevel(20);
+ player.setSaturation(20.0f);
+ }
+
+ @EventHandler
+ public void inventoryDrag(InventoryDragEvent e) {
+ if(BuilderCommand.getBuilders().contains(e.getWhoClicked())) {
+ return;
+ }
+ e.setCancelled(true);
+ }
+
+ @EventHandler
+ public void onDrop(PlayerDropItemEvent e) {
+ e.setCancelled(true);
+
+ }
+
+ @EventHandler
+ public void onDamage(PlayerItemDamageEvent e) {
+ e.setCancelled(true);
+
+
+ }
+
+
+ @EventHandler public void onChat(AsyncPlayerChatEvent e) { Player p =
+ e.getPlayer(); String group =
+ Hub.getInstance().getPerms().getPrimaryGroup(p); String prefix =
+ Hub.getInstance().getChat().getGroupPrefix(p.getWorld(), group);
+
+
+
+
+ e.setFormat(ChatColor.translateAlternateColorCodes('&',
+ Hub.getInstance().getConfig().getString("chat-format") .replace("%prefix%",
+ prefix) .replace("%player%", p.getName()) .replace("%message%",
+ ChatColor.stripColor(e.getMessage()))));
+
+
+
+ }
+
+ @EventHandler
+ public void onBreak(BlockBreakEvent e) {
+ if(BuilderCommand.getBuilders().contains(e.getPlayer())) {
+ return;
+ }
+
+ e.setCancelled(true);
+ }
+
+ @EventHandler
+ public void onPlace(BlockPlaceEvent e) {
+ if(BuilderCommand.getBuilders().contains(e.getPlayer())) {
+ return;
+ }
+
+ e.setCancelled(true);
+ }
+
+ @EventHandler
+ public void onClick(PlayerInteractEvent e) {
+ Player player = e.getPlayer();
+
+ if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
+ if(e.getItem() != null && e.getItem().isSimilar(selector)) {
+ SelectorInventory.openInventory(e.getPlayer());
+ } else if(e.getItem() != null && e.getItem().isSimilar(enderbutt)) {
+ e.setCancelled(true);
+
+ Item item = player.getWorld().dropItem(player.getLocation().add(0.0D, 0.5D, 0.0D), new ItemStack(Material.ENDER_PEARL, 16));
+ item.setPickupDelay(10000);
+ item.setVelocity(player.getLocation().getDirection().normalize().multiply(1.5F));
+ item.setPassenger(player);
+ player.getWorld().playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);
+ this.setupEnderpearlRunnable(item);
+ player.updateInventory();
+
+
+ }
+
+
+ }
+ }
+
+ @EventHandler
+ public void onPearl(ProjectileLaunchEvent e) {
+ Entity projectile = (Entity) e.getEntity();
+ if(e.getEntityType() == EntityType.ENDER_PEARL) {
+ Player p = (Player) e.getEntity().getShooter();
+ projectile.setPassenger(p);
+
+ }
+
+
+
+ }
+
+ @EventHandler
+ public void mobSpawn(CreatureSpawnEvent e) {
+ e.setCancelled(true);
+ }
+
+ @EventHandler
+ public void damageEvent(EntityDamageEvent e) {
+ Entity entity = e.getEntity();
+ if(entity instanceof Player) {
+ e.setCancelled(true);
+ }
+
+
+
+ }
+
+ @EventHandler
+ public void invClick(InventoryClickEvent e) {
+ ConfigurationSection cs = Hub.getInstance().getConfig().getConfigurationSection("server-selector");
+ if(e.getCurrentItem() == null) {
+ return;
+ }
+
+ for(String s : cs.getKeys(false)) {
+ ItemStack item = new ItemBuilder(Material.valueOf(cs.getString(s + ".type")))
+ .setName(ChatColor.translateAlternateColorCodes('&', cs.getString(s + ".name")))
+ .setLore(SpigotUtils.replaceArray(SpigotUtils.colorArray(cs.getStringList(s + ".lore")), "%count%", Bungee.getCount(cs.getString(s + ".server")) + ""))
+ .addEnchant(Enchantment.DURABILITY, 1)
+ .toItemStack();
+
+ if(e.getCurrentItem().isSimilar(item)) {
+ EzQueueAPI.addToQueue((Player) e.getWhoClicked(), s);
+ }
+ }
+
+
+ }
+
+ @Getter static ItemStack selector = new ItemBuilder(Material.BOOK)
+ .setName("§5Server Selector §7(Right Click)")
+ .toItemStack();
+
+ @Getter static ItemStack enderbutt = new ItemBuilder(Material.ENDER_PEARL)
+ .setName("§5Enderpearl §7(Right Click)")
+ .toItemStack();
+
+ @EventHandler
+ public void onWeatherChange(WeatherChangeEvent e) {
+ e.setCancelled(true);
+
+
+ }
+ @EventHandler
+ public void FoodLevelChange(FoodLevelChangeEvent e) {
+ Player player = (Player) e.getEntity();
+ player.setFoodLevel(20);
+ player.setSaturation(20.0f);
+ player.setHealth(20.0);
+ player.setSaturation(10.0f);
+ }
+
+
+ @EventHandler
+ public void onJoin(PlayerJoinEvent e) {
+ Player p = e.getPlayer();
+
+ e.setJoinMessage(null);
+
+ p.getInventory().clear();
+
+ p.getInventory().setItem(4, selector);
+ p.getInventory().setItem(0, enderbutt);
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7&m---------------------------------"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7Welcome &5" + p.getName() + " &7to the &5ExemPvP Network"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', ""));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&5* &7Website: &fexempvp.net"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&5* &7Store: &fstore.exempvp.net"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&5* &7Discord: &fexempvp.net/discord"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&5* &7Teamspeak: &fts.exempvp.net"));
+ p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7&m---------------------------------"));
+ p.teleport(Hub.getInstance().getSpawn().getSpawn());
+ p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 3));
+ p.setGameMode(GameMode.ADVENTURE);
+ p.setHealth(20);
+ p.setFoodLevel(20);
+ }
+
+
+ @EventHandler
+ public void onJoin(PlayerQuitEvent e) {
+ Player p = e.getPlayer();
+
+ e.setQuitMessage(null);
+ }
+
+ public void setupEnderpearlRunnable(final Item item) {
+ (new BukkitRunnable() {
+ public void run() {
+ if (item.isDead()) {
+ this.cancel();
+ }
+
+ if (item.getVelocity().getX() == 0.0D || item.getVelocity().getY() == 0.0D || item.getVelocity().getZ() == 0.0D) {
+ Player player = (Player)item.getPassenger();
+ item.remove();
+ if (player != null) {
+ player.teleport(player.getLocation().add(0.0D, 0.5D, 0.0D));
+ }
+
+ this.cancel();
+ }
+
+ }
+ }).runTaskTimer(Hub.getInstance(), 2L, 1L);
+ }
+
+}
diff --git a/src/com/houndpvp/hub/scoreboard/ScoreboardProvider.java b/src/com/houndpvp/hub/scoreboard/ScoreboardProvider.java
new file mode 100644
index 0000000..1a24816
--- /dev/null
+++ b/src/com/houndpvp/hub/scoreboard/ScoreboardProvider.java
@@ -0,0 +1,57 @@
+package com.houndpvp.hub.scoreboard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+
+import com.houndpvp.hub.Hub;
+import com.houndpvp.hub.scoreboard.providers.ScoreboardEntryProvider;
+import com.houndpvp.hub.utils.Bungee;
+
+import me.signatured.ezqueuespigot.EzQueueAPI;
+import net.minecraft.util.org.apache.commons.lang3.text.WordUtils;
+import ru.tehkode.permissions.bukkit.PermissionsEx;
+
+public class ScoreboardProvider implements ScoreboardEntryProvider
+{
+ private Hub plugin;
+
+ private List template = new ArrayList<>();
+ public static String lastline;
+
+ public ScoreboardProvider(final Hub plugin) {
+ this.plugin = plugin;
+ }
+
+ @Override
+ public List getScoreboardEntries(final Player player) {
+ List lines = new ArrayList();
+ if(EzQueueAPI.getQueue(player.getName()) == null) {
+ for(String s : Hub.getInstance().getConfig().getStringList("scoreboard")) {
+ lines.add(ChatColor.translateAlternateColorCodes('&', s
+ .replace("%online%", Bungee.getCount("ALL") + "")
+ .replace("%rank%", Hub.getInstance().getChat().getGroupSuffix(player.getWorld(), Hub.getInstance().getPerms().getPrimaryGroup(player)) + WordUtils.capitalize(Hub.getInstance().getPerms().getPrimaryGroup(player))))
+ .replace("%user%", player.getName()));
+ }
+ } else {
+ for(String s : Hub.getInstance().getConfig().getStringList("scoreboard-inqueue")) {
+ lines.add(ChatColor.translateAlternateColorCodes('&', s
+ .replace("%position%", EzQueueAPI.getPosition(player) + "")
+ .replace("%inqueue%", EzQueueAPI.getPlayersInQueue(EzQueueAPI.getQueue(player)).size() + "")
+ .replace("%online%", Bungee.getCount("ALL") + "")
+ .replace("%rank%", Hub.getInstance().getChat().getGroupSuffix(player.getWorld(), Hub.getInstance().getPerms().getPrimaryGroup(player)) + WordUtils.capitalize(Hub.getInstance().getPerms().getPrimaryGroup(player))))
+ .replace("%user%", player.getName()));
+ }
+ }
+
+
+ return lines;
+ }
+
+
+
+
+
+}
diff --git a/src/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.java b/src/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.java
new file mode 100644
index 0000000..77d470a
--- /dev/null
+++ b/src/com/houndpvp/hub/scoreboard/providers/PlayerScoreboard.java
@@ -0,0 +1,112 @@
+package com.houndpvp.hub.scoreboard.providers;
+
+import org.bukkit.entity.*;
+
+import com.houndpvp.hub.scoreboard.providers.reflection.ReflectionConstants;
+
+import org.bukkit.craftbukkit.v1_7_R4.entity.*;
+import net.minecraft.server.v1_7_R4.*;
+import org.apache.commons.lang.*;
+import java.util.*;
+import org.bukkit.*;
+
+public class PlayerScoreboard
+{
+ public static final String[] TEAM_NAMES;
+ private final Player player;
+ private final PlayerConnection connection;
+ private final String objectiveName;
+ private int lastSent;
+ private boolean valid;
+
+ @SuppressWarnings("unchecked")
+ public PlayerScoreboard(final Player player) {
+ lastSent = 0;
+ valid = true;
+ this.player = player;
+ connection = ((CraftPlayer)player).getHandle().playerConnection;
+ objectiveName = "Sidebar-" + RandomStringUtils.random(8, "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$_?*+-/()[]{}%!=&@<>~");
+ final PacketPlayOutScoreboardObjective objective = new PacketPlayOutScoreboardObjective();
+ ReflectionConstants.SCOREBOARD_OBJECTIVE_NAME.set(objective, objectiveName);
+ ReflectionConstants.SCOREBOARD_OBJECTIVE_TITLE.set(objective, ScoreboardManager.instance.getTitle());
+ ReflectionConstants.SCOREBOARD_OBJECTIVE_ACTION.set(objective, 0);
+ this.connection.sendPacket((Packet)objective);
+ final PacketPlayOutScoreboardDisplayObjective displayObjective = new PacketPlayOutScoreboardDisplayObjective();
+ ReflectionConstants.SCOREBOARD_DISPLAY_OBJECTIVE_NAME.set(displayObjective, this.objectiveName);
+ ReflectionConstants.SCOREBOARD_DISPLAY_OBJECTIVE_POSITION.set(displayObjective, 1);
+ connection.sendPacket((Packet)displayObjective);
+ for (int i = 0; i < 15; ++i) {
+ final PacketPlayOutScoreboardTeam team = new PacketPlayOutScoreboardTeam();
+ ReflectionConstants.SCOREBOARD_TEAM_NAME.set(team, PlayerScoreboard.TEAM_NAMES[i]);
+ ReflectionConstants.SCOREBOARD_TEAM_PLAYERS.get(team).add(PlayerScoreboard.TEAM_NAMES[i]);
+ this.connection.sendPacket((Packet)team);
+ }
+ }
+
+ public void send() {
+ if (!this.valid) {
+ return;
+ }
+ final List lines = ScoreboardManager.instance.getProvider().getScoreboardEntries(this.player);
+ if (this.lastSent != lines.size()) {
+ for (int i = 0; i < 15; ++i) {
+ final PacketPlayOutScoreboardScore score = new PacketPlayOutScoreboardScore();
+ ReflectionConstants.SCOREBOARD_SCORE_NAME.set(score, PlayerScoreboard.TEAM_NAMES[i]);
+ ReflectionConstants.SCOREBOARD_SCORE_OBJECTIVE.set(score, this.objectiveName);
+ ReflectionConstants.SCOREBOARD_SCORE_ACTION.set(score, 1);
+ this.connection.sendPacket((Packet)score);
+ }
+ }
+ for (int i = 0; i < Math.min(lines.size(), 15); ++i) {
+ final String line = lines.get(i);
+ String right = "";
+ String left;
+ if (line.length() < 17) {
+ left = line;
+ }
+ else {
+ left = line.substring(0, 16);
+ right = line.substring(16, line.length());
+ if (left.endsWith("§")) {
+ left = left.substring(0, left.length() - 1);
+ right = "§" + right;
+ }
+ final String lastColors = ChatColor.getLastColors(left);
+ right = lastColors + right;
+ }
+ final PacketPlayOutScoreboardTeam team = new PacketPlayOutScoreboardTeam();
+ ReflectionConstants.SCOREBOARD_TEAM_NAME.set(team, PlayerScoreboard.TEAM_NAMES[i]);
+ ReflectionConstants.SCOREBOARD_TEAM_PREFIX.set(team, left);
+ ReflectionConstants.SCOREBOARD_TEAM_SUFFIX.set(team, StringUtils.left(right, 16));
+ ReflectionConstants.SCOREBOARD_TEAM_ACTION.set(team, 2);
+ this.connection.sendPacket((Packet)team);
+ final PacketPlayOutScoreboardScore score2 = new PacketPlayOutScoreboardScore();
+ ReflectionConstants.SCOREBOARD_SCORE_NAME.set(score2, PlayerScoreboard.TEAM_NAMES[i]);
+ ReflectionConstants.SCOREBOARD_SCORE_SCORE.set(score2, 15 - i);
+ ReflectionConstants.SCOREBOARD_SCORE_OBJECTIVE.set(score2, this.objectiveName);
+ this.connection.sendPacket((Packet)score2);
+ }
+ this.lastSent = lines.size();
+ }
+
+ public void clean() {
+ for (int i = 0; i < 15; ++i) {
+ final PacketPlayOutScoreboardTeam team = new PacketPlayOutScoreboardTeam();
+ ReflectionConstants.SCOREBOARD_TEAM_NAME.set(team, PlayerScoreboard.TEAM_NAMES[i]);
+ ReflectionConstants.SCOREBOARD_TEAM_ACTION.set(team, 4);
+ this.connection.sendPacket((Packet)team);
+ }
+ this.player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
+ this.valid = false;
+ }
+
+ static {
+ TEAM_NAMES = new String[15];
+ final ChatColor[] colors = ChatColor.values();
+ for (int i = 0; i < 15; ++i) {
+ final ChatColor left = colors[i];
+ final ChatColor right = colors[15 - i];
+ PlayerScoreboard.TEAM_NAMES[i] = left.toString() + ChatColor.RESET + right.toString() + ChatColor.RESET;
+ }
+ }
+}
diff --git a/src/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.java b/src/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.java
new file mode 100644
index 0000000..99ffda5
--- /dev/null
+++ b/src/com/houndpvp/hub/scoreboard/providers/ScoreboardEntryProvider.java
@@ -0,0 +1,9 @@
+package com.houndpvp.hub.scoreboard.providers;
+
+import org.bukkit.entity.*;
+import java.util.*;
+
+public interface ScoreboardEntryProvider
+{
+ List getScoreboardEntries(final Player p0);
+}
diff --git a/src/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.java b/src/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.java
new file mode 100644
index 0000000..439da5a
--- /dev/null
+++ b/src/com/houndpvp/hub/scoreboard/providers/ScoreboardManager.java
@@ -0,0 +1,94 @@
+package com.houndpvp.hub.scoreboard.providers;
+
+import java.util.*;
+import org.bukkit.plugin.java.*;
+import java.util.concurrent.*;
+import org.bukkit.*;
+import org.bukkit.plugin.*;
+import org.bukkit.entity.*;
+import org.bukkit.event.player.*;
+import org.bukkit.event.server.*;
+import org.bukkit.event.*;
+
+public class ScoreboardManager implements Listener
+{
+ public static ScoreboardManager instance;
+ public final ScoreboardEntryProvider provider;
+ private final String title;
+ private final Map scoreboards;
+ private final JavaPlugin plugin;
+ public boolean debugging;
+
+ public ScoreboardManager(final JavaPlugin plugin, final ScoreboardEntryProvider provider, final String title) {
+ ScoreboardManager.instance = this;
+ this.plugin = plugin;
+ this.provider = provider;
+ this.debugging = true;
+ this.title = title;
+ this.scoreboards = new ConcurrentHashMap();
+ Bukkit.getPluginManager().registerEvents((Listener)this, (Plugin)plugin);
+ UUID uniqueId;
+ for(Player pp : Bukkit.getOnlinePlayers()) {
+ if (this.debugging) {
+ plugin.getLogger().info("[ScoreboardManager] Loaded scoreboard for " + pp.getName() + "[" + pp.getUniqueId().toString() + "]");
+ }
+ uniqueId = pp.getUniqueId();
+ this.scoreboards.putIfAbsent(uniqueId, new PlayerScoreboard(pp));
+ }
+ Bukkit.getScheduler().runTaskTimer(plugin, this::update, 0, 1L);
+ }
+
+ @EventHandler
+ public void onJoin(final PlayerJoinEvent event) {
+ final Player player = event.getPlayer();
+ final UUID uuid = player.getUniqueId();
+ Bukkit.getScheduler().runTaskLater((Plugin)this.plugin, () -> {
+ if (this.debugging) {
+ this.plugin.getLogger().info("[ScoreboardManager] Loaded scoreboard for " + player.getName() + "[" + player.getUniqueId().toString() + "]");
+ }
+ this.scoreboards.putIfAbsent(uuid, new PlayerScoreboard(player));
+ }, 2L);
+ }
+
+ @EventHandler
+ public void onQuit(final PlayerQuitEvent event) {
+ final Player player = event.getPlayer();
+ final UUID uniqueId = player.getUniqueId();
+ final PlayerScoreboard scoreboard;
+ if ((scoreboard = this.scoreboards.remove(uniqueId)) != null) {
+ if (this.debugging) {
+ this.plugin.getLogger().info("[ScoreboardManager] Deleted scoreboard of " + player.getName() + "[" + player.getUniqueId().toString() + "]");
+ }
+ scoreboard.clean();
+ }
+ }
+
+ @EventHandler
+ public void onDisable(final PluginDisableEvent event) {
+ if (event.getPlugin() == this.plugin) {
+ this.scoreboards.forEach((id, board) -> board.clean());
+ this.scoreboards.clear();
+ HandlerList.unregisterAll((Listener)this);
+ }
+ }
+
+ public void update() {
+ this.scoreboards.forEach((id, board) -> board.send());
+ }
+
+ public static ScoreboardManager getInstance() {
+ return ScoreboardManager.instance;
+ }
+
+ public ScoreboardEntryProvider getProvider() {
+ return this.provider;
+ }
+
+ public String getTitle() {
+ return this.title;
+ }
+
+ public Map getScoreboards() {
+ return this.scoreboards;
+ }
+}
diff --git a/src/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.java b/src/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.java
new file mode 100644
index 0000000..4f83e3b
--- /dev/null
+++ b/src/com/houndpvp/hub/scoreboard/providers/reflection/Reflection.java
@@ -0,0 +1,200 @@
+package com.houndpvp.hub.scoreboard.providers.reflection;
+
+import java.util.*;
+import java.lang.reflect.*;
+import java.util.regex.*;
+import org.bukkit.*;
+
+public final class Reflection {
+ private static String OBC_PREFIX;
+ private static String NMS_PREFIX;
+ private static String VERSION;
+ private static Pattern MATCH_VARIABLE;
+
+ public static FieldAccessor getField(final Class> target, final String name, final Class fieldType) {
+ return getField(target, name, fieldType, 0);
+ }
+
+ public static FieldAccessor getField(final String className, final String name, final Class fieldType) {
+ return getField(getClass(className), name, fieldType, 0);
+ }
+
+ public static FieldAccessor getField(final Class> target, final Class fieldType, final int index) {
+ return getField(target, null, fieldType, index);
+ }
+
+ public static FieldAccessor getField(final String className, final Class fieldType, final int index) {
+ return getField(getClass(className), fieldType, index);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static FieldAccessor getField(final Class> target, final String name, final Class fieldType,
+ int index) {
+ for (final Field field : target.getDeclaredFields()) {
+ if ((name == null || field.getName().equals(name)) && fieldType.isAssignableFrom(field.getType())
+ && index-- <= 0) {
+ field.setAccessible(true);
+ return new FieldAccessor() {
+ @Override
+ public T get(final Object target) {
+ try {
+ return (T) field.get(target);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Cannot access reflection.", e);
+ }
+ }
+
+ @Override
+ public void set(final Object target, final Object value) {
+ try {
+ field.set(target, value);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Cannot access reflection.", e);
+ }
+ }
+
+ @Override
+ public boolean hasField(final Object target) {
+ return field.getDeclaringClass().isAssignableFrom(target.getClass());
+ }
+ };
+ }
+ }
+ if (target.getSuperclass() != null) {
+ return (FieldAccessor) getField(target.getSuperclass(), name, (Class