diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
index 16eb77cde..cd4447b88 100644
--- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
+++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
@@ -16,6 +16,8 @@
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_test.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_test.xml
index 8bd2561e4..68645bd5d 100644
--- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_test.xml
+++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_test.xml
@@ -16,6 +16,8 @@
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/libraries/jooq.xml b/Plugins/.idea/libraries/jooq.xml
new file mode 100644
index 000000000..57d4d36ed
--- /dev/null
+++ b/Plugins/.idea/libraries/jooq.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/libraries/jooq_codegen.xml b/Plugins/.idea/libraries/jooq_codegen.xml
new file mode 100644
index 000000000..15bbbf812
--- /dev/null
+++ b/Plugins/.idea/libraries/jooq_codegen.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/libraries/mysql_connector.xml b/Plugins/.idea/libraries/mysql_connector.xml
new file mode 100644
index 000000000..34f02f1ee
--- /dev/null
+++ b/Plugins/.idea/libraries/mysql_connector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/modules.xml b/Plugins/.idea/modules.xml
index 5c820afca..b53f9c93a 100644
--- a/Plugins/.idea/modules.xml
+++ b/Plugins/.idea/modules.xml
@@ -2,9 +2,11 @@
+
+
diff --git a/Plugins/.idea/runConfigurations/Arcade.xml b/Plugins/.idea/runConfigurations/Arcade.xml
index 613c3a843..f57362a28 100644
--- a/Plugins/.idea/runConfigurations/Arcade.xml
+++ b/Plugins/.idea/runConfigurations/Arcade.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/Plugins/.idea/runConfigurations/Database.xml b/Plugins/.idea/runConfigurations/Database.xml
new file mode 100644
index 000000000..cbceafe61
--- /dev/null
+++ b/Plugins/.idea/runConfigurations/Database.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/runConfigurations/Hub.xml b/Plugins/.idea/runConfigurations/Hub.xml
index 76345a76a..d952db1c8 100644
--- a/Plugins/.idea/runConfigurations/Hub.xml
+++ b/Plugins/.idea/runConfigurations/Hub.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/Plugins/.idea/runConfigurations/MapParser.xml b/Plugins/.idea/runConfigurations/MapParser.xml
index ef7fbc8bb..baef816d1 100644
--- a/Plugins/.idea/runConfigurations/MapParser.xml
+++ b/Plugins/.idea/runConfigurations/MapParser.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/Plugins/Classpath.Dummy/Classpath.Dummy.iml b/Plugins/Classpath.Dummy/Classpath.Dummy.iml
new file mode 100644
index 000000000..b59695f8a
--- /dev/null
+++ b/Plugins/Classpath.Dummy/Classpath.Dummy.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plugins/Libraries/jooq-3.4.2-javadoc.jar b/Plugins/Libraries/jooq-3.4.2-javadoc.jar
new file mode 100644
index 000000000..57f36a4f9
Binary files /dev/null and b/Plugins/Libraries/jooq-3.4.2-javadoc.jar differ
diff --git a/Plugins/Libraries/jooq-3.4.2-sources.jar b/Plugins/Libraries/jooq-3.4.2-sources.jar
new file mode 100644
index 000000000..878a76c21
Binary files /dev/null and b/Plugins/Libraries/jooq-3.4.2-sources.jar differ
diff --git a/Plugins/Libraries/jooq-3.4.2.jar b/Plugins/Libraries/jooq-3.4.2.jar
new file mode 100644
index 000000000..52f340acf
Binary files /dev/null and b/Plugins/Libraries/jooq-3.4.2.jar differ
diff --git a/Plugins/Libraries/jooq-codegen-3.4.2.jar b/Plugins/Libraries/jooq-codegen-3.4.2.jar
new file mode 100644
index 000000000..06fa7d7f4
Binary files /dev/null and b/Plugins/Libraries/jooq-codegen-3.4.2.jar differ
diff --git a/Plugins/Libraries/jooq-meta-3.4.2.jar b/Plugins/Libraries/jooq-meta-3.4.2.jar
new file mode 100644
index 000000000..a878aae2e
Binary files /dev/null and b/Plugins/Libraries/jooq-meta-3.4.2.jar differ
diff --git a/Plugins/Libraries/mysql-connector-java-5.1.32-bin.jar b/Plugins/Libraries/mysql-connector-java-5.1.32-bin.jar
new file mode 100644
index 000000000..822b714e5
Binary files /dev/null and b/Plugins/Libraries/mysql-connector-java-5.1.32-bin.jar differ
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/DummyEntity.java
similarity index 90%
rename from Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java
rename to Plugins/Mineplex.Core.Common/src/mineplex/core/common/DummyEntity.java
index 6220170c5..8d47c0a82 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/DummyEntity.java
@@ -1,4 +1,4 @@
-package mineplex.core.disguise.disguises;
+package mineplex.core.common;
import net.minecraft.server.v1_7_R4.Entity;
import net.minecraft.server.v1_7_R4.NBTTagCompound;
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java
index a361633a4..e8b6f90c0 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java
@@ -3,6 +3,7 @@ package mineplex.core.common.util;
import java.lang.reflect.Field;
import java.util.HashMap;
+import mineplex.core.common.DummyEntity;
import net.minecraft.server.v1_7_R4.DataWatcher;
import net.minecraft.server.v1_7_R4.EntityPlayer;
import net.minecraft.server.v1_7_R4.MathHelper;
@@ -12,6 +13,8 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@@ -20,7 +23,7 @@ import org.bukkit.scheduler.BukkitRunnable;
public class UtilDisplay
{
- public static final int ENTITY_ID = 1234;
+ public static final int ENTITY_ID = 777777;
private static HashMap hasHealthBar = new HashMap();
@@ -35,9 +38,9 @@ public class UtilDisplay
PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving();
mobPacket.a = (int) ENTITY_ID; //Entity ID
- mobPacket.b = (byte) EntityType.ENDER_DRAGON.getTypeId(); //Mob type (ID: 64)
+ mobPacket.b = (byte) EntityType.WITHER.getTypeId(); //Mob type (ID: 64)
mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position
- mobPacket.d = (int) MathHelper.floor(-200 * 32.0D); //Y position
+ mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position
mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position
mobPacket.f = (byte) 0; //Pitch
mobPacket.g = (byte) 0; //Head Pitch
@@ -46,7 +49,7 @@ public class UtilDisplay
mobPacket.j = (short) 0; //Y velocity
mobPacket.k = (short) 0; //Z velocity
- DataWatcher watcher = getWatcher(text, healthPercent * 200);
+ DataWatcher watcher = getWatcher(text, 101 + healthPercent * 99, loc.getWorld());
mobPacket.l = watcher;
@@ -76,14 +79,22 @@ public class UtilDisplay
return metaPacket;
}
- public static DataWatcher getWatcher(String text, double health){
- DataWatcher watcher = new DataWatcher(null);
+ public static DataWatcher getWatcher(String text, double health, World world)
+ {
+ DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)world).getHandle()));
- watcher.a(0, (Byte) (byte) 32); //Flags, 0x20 = invisible
+ watcher.a(0, (Byte) (byte) 0); //Flags, 0x20 = invisible
watcher.a(6, (Float) (float) health);
+ watcher.a(2, (String) text); //Entity name
watcher.a(10, (String) text); //Entity name
- watcher.a(11, (Byte) (byte) 1); //Show name, 1 = show, 0 = don't show
+ watcher.a(3, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show
+ watcher.a(11, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show
watcher.a(16, (Integer) (int) health); //Wither health, 200 = full health
+ watcher.a(20, (Integer) (int) 0); //Wither invuln, 200 = full health
+
+ int i1 = watcher.getInt(0);
+ watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5)));
+ watcher.watch(20, 0);
return watcher;
}
@@ -91,7 +102,11 @@ public class UtilDisplay
//Other methods
public static void displayTextBar(JavaPlugin plugin, final Player player, double healthPercent, String text)
{
- PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, healthPercent, player.getLocation());
+ PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
+
+ sendPacket(player, destroyEntityPacket);
+
+ PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, healthPercent, player.getEyeLocation().getDirection().multiply(24).toLocation(player.getWorld()).add(player.getLocation()));
sendPacket(player, mobPacket);
hasHealthBar.put(player.getName(), true);
@@ -108,18 +123,21 @@ public class UtilDisplay
}
public static void displayLoadingBar(final String text, final String completeText, final Player player, final int healthAdd, final long delay, final boolean loadUp, final JavaPlugin plugin){
- PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, 0, player.getLocation());
+ PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
+
+ sendPacket(player, destroyEntityPacket);
+ PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, 0, player.getEyeLocation().getDirection().multiply(24).toLocation(player.getWorld()).add(player.getLocation()));
sendPacket(player, mobPacket);
hasHealthBar.put(player.getName(), true);
new BukkitRunnable(){
- int health = (loadUp ? 0 : 200);
+ int health = (loadUp ? 100 : 200);
- @Override
+ @Override
public void run(){
- if((loadUp ? health < 200 : health > 0)){
- DataWatcher watcher = getWatcher(text, health);
+ if((loadUp ? health < 200 : health > 100)){
+ DataWatcher watcher = getWatcher(text, health, player.getWorld());
PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
sendPacket(player, metaPacket);
@@ -130,7 +148,7 @@ public class UtilDisplay
health -= healthAdd;
}
} else {
- DataWatcher watcher = getWatcher(text, (loadUp ? 200 : 0));
+ DataWatcher watcher = getWatcher(text, (loadUp ? 200 : 100), player.getWorld());
PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
@@ -144,7 +162,7 @@ public class UtilDisplay
sendPacket(player, mobPacket);
hasHealthBar.put(player.getName(), true);
- DataWatcher watcher2 = getWatcher(completeText, 200);
+ DataWatcher watcher2 = getWatcher(completeText, 200, player.getWorld());
PacketPlayOutEntityMetadata metaPacket2 = getMetadataPacket(watcher2);
sendPacket(player, metaPacket2);
@@ -166,7 +184,7 @@ public class UtilDisplay
}
public static void displayLoadingBar(final String text, final String completeText, final Player player, final int secondsDelay, final boolean loadUp, JavaPlugin plugin){
- final int healthChangePerSecond = 200 / secondsDelay;
+ final int healthChangePerSecond = 100 / secondsDelay;
displayLoadingBar(text, completeText, player, healthChangePerSecond, 20L, loadUp, plugin);
}
diff --git a/Plugins/Mineplex.Core/Mineplex.Core.iml b/Plugins/Mineplex.Core/Mineplex.Core.iml
index 14fefcaee..75a9fe5c9 100644
--- a/Plugins/Mineplex.Core/Mineplex.Core.iml
+++ b/Plugins/Mineplex.Core/Mineplex.Core.iml
@@ -15,6 +15,8 @@
+
+
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java
new file mode 100644
index 000000000..fa22e5487
--- /dev/null
+++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java
@@ -0,0 +1,311 @@
+package mineplex.core;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+import mineplex.core.common.DummyEntity;
+import mineplex.core.common.util.NautHashMap;
+import mineplex.core.packethandler.PacketVerifier;
+import mineplex.core.packethandler.PlayerPacketEvent;
+import net.minecraft.server.v1_7_R4.DataWatcher;
+import net.minecraft.server.v1_7_R4.EnumEntitySize;
+import net.minecraft.server.v1_7_R4.MathHelper;
+import net.minecraft.server.v1_7_R4.Packet;
+import net.minecraft.server.v1_7_R4.PacketPlayOutAttachEntity;
+import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
+import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
+import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
+import net.minecraft.server.v1_7_R4.WatchableObject;
+
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
+import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.plugin.java.JavaPlugin;
+
+public class CustomTagFix extends MiniPlugin
+{
+ private static int _fakeIdCounter = 455000;
+ private NautHashMap _entityMap = new NautHashMap();
+
+ private Field _destroyId;
+
+ public CustomTagFix(JavaPlugin plugin)
+ {
+ super("Custom Tag Fix", plugin);
+
+
+ try
+ {
+ _destroyId = PacketPlayOutEntityDestroy.class.getDeclaredField("a");
+ _destroyId.setAccessible(true);
+ }
+ catch (Exception exception)
+ {
+ System.out.println("Field exception in CustomTagFix : ");
+ exception.printStackTrace();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @EventHandler(priority = EventPriority.HIGHEST)
+ public void handlePackets(PlayerPacketEvent event)
+ {
+ Packet packet = event.getPacket();
+ Player owner = event.getPlayer();
+ PacketVerifier verifier = event.getVerifier();
+
+ if (((CraftPlayer)owner).getHandle().playerConnection.networkManager.getVersion() >= 47)
+ {
+ if (packet instanceof PacketPlayOutSpawnEntityLiving)
+ {
+ PacketPlayOutSpawnEntityLiving spawnPacket = (PacketPlayOutSpawnEntityLiving)packet;
+
+ final String entityName = spawnPacket.l.getString(10);
+
+ if (spawnPacket.l.getByte(11) == 1 || spawnPacket.l.getByte(3) == 1)
+ {
+ int newId = _fakeIdCounter++;
+ sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier);
+ _entityMap.put(spawnPacket.a, newId);
+ }
+
+ }
+ else if (packet instanceof PacketPlayOutEntityMetadata)
+ {
+ PacketPlayOutEntityMetadata metaPacket = (PacketPlayOutEntityMetadata)packet;
+
+ if (!_entityMap.containsKey(metaPacket.a) && metaPacket.a != 777777)
+ {
+ String entityName = "";
+ for (WatchableObject watchable : (List)metaPacket.b)
+ {
+ if ((watchable.a() == 10 || watchable.a() == 2) && watchable.b() instanceof String)
+ {
+ entityName = (String)watchable.b();
+ }
+ }
+
+ if (!entityName.isEmpty())
+ {
+ int newId = _fakeIdCounter++;
+ sendProtocolPackets(owner, metaPacket.a, newId, entityName, verifier);
+ _entityMap.put(metaPacket.a, newId);
+ }
+ }
+ }
+ else if (packet instanceof PacketPlayOutEntityDestroy)
+ {
+ try
+ {
+ for (int id : (int[])_destroyId.get(packet))
+ {
+ if (_entityMap.containsKey(id))
+ {
+ verifier.bypassProcess(new PacketPlayOutEntityDestroy(_entityMap.get(id)));
+ _entityMap.remove(id);
+ }
+ }
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace();
+ }
+ }
+ else if (packet instanceof PacketPlayOutAttachEntity)
+ {
+ PacketPlayOutAttachEntity attachPacket = (PacketPlayOutAttachEntity)packet;
+
+ if (attachPacket.c == owner.getEntityId())
+ {
+ event.setCancelled(true);
+ //verifier.bypassProcess(new PacketPlayOutEntityDestroy(attachPacket.b));
+ /*
+ System.out.println("Adding patch item.");
+ PacketPlayOutSpawnEntityLiving armorPacket = new PacketPlayOutSpawnEntityLiving();
+ armorPacket.a = _fakeIdCounter++;
+ armorPacket.b = (byte) EntityType.SLIME.getTypeId();
+ armorPacket.c = (int)EnumEntitySize.SIZE_2.a(100);
+ armorPacket.d = (int)MathHelper.floor(64 * 32.0D);
+ armorPacket.e = (int)EnumEntitySize.SIZE_2.a(100);
+ armorPacket.i = (byte) ((int) (0 * 256.0F / 360.0F));
+ armorPacket.j = (byte) ((int) (0 * 256.0F / 360.0F));
+ armorPacket.k = (byte) ((int) (0 * 256.0F / 360.0F));
+
+ double var2 = 3.9D;
+ double var4 = 0;
+ double var6 = 0;
+ double var8 = 0;
+
+ if (var4 < -var2)
+ {
+ var4 = -var2;
+ }
+
+ if (var6 < -var2)
+ {
+ var6 = -var2;
+ }
+
+ if (var8 < -var2)
+ {
+ var8 = -var2;
+ }
+
+ if (var4 > var2)
+ {
+ var4 = var2;
+ }
+
+ if (var6 > var2)
+ {
+ var6 = var2;
+ }
+
+ if (var8 > var2)
+ {
+ var8 = var2;
+ }
+
+ armorPacket.f = (int)(var4 * 8000.0D);
+ armorPacket.g = (int)(var6 * 8000.0D);
+ armorPacket.h = (int)(var8 * 8000.0D);
+
+ final DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)owner.getWorld()).getHandle()));
+
+ watcher.a(0, Byte.valueOf((byte)0));
+ watcher.a(1, Short.valueOf((short)300));
+ watcher.a(2, "");
+ watcher.a(3, Byte.valueOf((byte) 0));
+ watcher.a(4, Byte.valueOf((byte)0));
+ watcher.a(7, Integer.valueOf(0));
+ watcher.a(8, Byte.valueOf((byte)0));
+ watcher.a(9, Byte.valueOf((byte)0));
+ watcher.a(6, Float.valueOf(1.0F));
+ watcher.a(10, Byte.valueOf((byte)0));
+
+ // Set invisible
+ int i1 = watcher.getInt(0);
+ watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5)));
+
+ // Set small
+ byte b1 = watcher.getByte(10);
+ b1 = (byte)(b1 | 0x1);
+
+ watcher.watch(10, Byte.valueOf(b1));
+
+ armorPacket.l = watcher;
+
+ verifier.bypassProcess(packet);
+
+ attachPacket.c = armorPacket.a;
+
+ PacketPlayOutAttachEntity attachPacket2 = new PacketPlayOutAttachEntity();
+ attachPacket2.c = owner.getEntityId();
+ attachPacket2.b = attachPacket.a;
+ attachPacket2.a = 0;
+ verifier.bypassProcess(packet);
+ */
+ }
+ }
+ }
+ }
+
+ private void sendProtocolPackets(final Player owner, final int entityId, final int newEntityId, final String entityName, final PacketVerifier packetList)
+ {
+ Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
+ {
+ public void run()
+ {
+ final PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
+ packet.a = newEntityId;
+ packet.b = (byte) 30;
+ packet.c = (int)EnumEntitySize.SIZE_2.a(100);
+ packet.d = (int)MathHelper.floor(64 * 32.0D);
+ packet.e = (int)EnumEntitySize.SIZE_2.a(100);
+ packet.i = (byte) ((int) (0 * 256.0F / 360.0F));
+ packet.j = (byte) ((int) (0 * 256.0F / 360.0F));
+ packet.k = (byte) ((int) (0 * 256.0F / 360.0F));
+
+ double var2 = 3.9D;
+ double var4 = 0;
+ double var6 = 0;
+ double var8 = 0;
+
+ if (var4 < -var2)
+ {
+ var4 = -var2;
+ }
+
+ if (var6 < -var2)
+ {
+ var6 = -var2;
+ }
+
+ if (var8 < -var2)
+ {
+ var8 = -var2;
+ }
+
+ if (var4 > var2)
+ {
+ var4 = var2;
+ }
+
+ if (var6 > var2)
+ {
+ var6 = var2;
+ }
+
+ if (var8 > var2)
+ {
+ var8 = var2;
+ }
+
+ packet.f = (int)(var4 * 8000.0D);
+ packet.g = (int)(var6 * 8000.0D);
+ packet.h = (int)(var8 * 8000.0D);
+
+ final DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)owner.getWorld()).getHandle()));
+
+ watcher.a(0, Byte.valueOf((byte)0));
+ watcher.a(1, Short.valueOf((short)300));
+ watcher.a(2, "");
+ watcher.a(3, Byte.valueOf((byte) 0));
+ watcher.a(4, Byte.valueOf((byte)0));
+ watcher.a(7, Integer.valueOf(0));
+ watcher.a(8, Byte.valueOf((byte)0));
+ watcher.a(9, Byte.valueOf((byte)0));
+ watcher.a(6, Float.valueOf(1.0F));
+ watcher.a(10, Byte.valueOf((byte)0));
+
+ // Set invisible
+ int i1 = watcher.getInt(0);
+ watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5)));
+
+ // Set small
+ byte b1 = watcher.getByte(10);
+ b1 = (byte)(b1 | 0x1);
+
+ watcher.watch(10, Byte.valueOf(b1));
+
+ watcher.watch(2, entityName);
+ watcher.watch(3, Byte.valueOf((byte)1));
+
+ packet.l = watcher;
+
+ packetList.bypassProcess(packet);
+
+ PacketPlayOutAttachEntity vehiclePacket = new PacketPlayOutAttachEntity();
+ vehiclePacket.a = 0;
+ vehiclePacket.b = packet.a;
+ vehiclePacket.c = entityId;
+
+ packetList.bypassProcess(vehiclePacket);
+ }
+ });
+ }
+}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
index 5f37cb486..17e3907ef 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
@@ -16,6 +16,7 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
import mineplex.core.cosmetic.ui.button.GadgetButton;
import mineplex.core.donation.DonationManager;
+import mineplex.core.gadget.gadgets.MorphNotch;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.ItemGadget;
@@ -62,6 +63,11 @@ public class GadgetPage extends ShopPageBase
protected void addGadget(Gadget gadget, int slot)
{
+ if (gadget instanceof MorphNotch)
+ {
+ setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false));
+ return;
+ }
List itemLore = new ArrayList();
if (gadget.GetCost(CurrencyType.Coins) >= 0)
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java
index 65732efa3..1131f52b7 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java
@@ -3,6 +3,7 @@ package mineplex.core.disguise;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
@@ -34,23 +35,19 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.plugin.java.JavaPlugin;
-import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.NautHashMap;
-import mineplex.core.common.util.UtilMath;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseInsentient;
-import mineplex.core.disguise.disguises.DisguisePlayer;
-import mineplex.core.packethandler.IPacketRunnable;
-import mineplex.core.packethandler.PacketHandler;
import mineplex.core.packethandler.PacketVerifier;
+import mineplex.core.packethandler.PlayerPacketEvent;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
-public class DisguiseManager extends MiniPlugin implements IPacketRunnable
+public class DisguiseManager extends MiniPlugin
{
private NautHashMap _spawnPacketMap = new NautHashMap();
private NautHashMap _movePacketMap = new NautHashMap();
@@ -61,17 +58,17 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
private HashSet _delTempList = new HashSet();
private NautHashMap> _disguisePlayerMap = new NautHashMap>();
+ private boolean _handlingPacket = false;
+
private Field _attributesA;
private Field _soundB;
private Field _soundC;
private Field _soundD;
- public DisguiseManager(JavaPlugin plugin, PacketHandler packetHandler)
+ public DisguiseManager(JavaPlugin plugin)
{
super("Disguise Manager", plugin);
- packetHandler.AddPacketRunnable(this);
-
try
{
_attributesA = PacketPlayOutUpdateAttributes.class.getDeclaredField("a");
@@ -136,15 +133,14 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{
if (!disguise.GetEntity().isAlive())
return;
-
- if (players == null || players.length == 0)
+
+ if (players != null && players.length != 0)
{
- players = Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().size()]);
+ disguise.Global = false;
}
_spawnPacketMap.put(disguise.GetEntityId(), disguise);
_disguisePlayerMap.put(disguise, new HashSet());
- _disguisePlayerMap.get(disguise).addAll(Arrays.asList(players));
reApplyDisguise(disguise);
}
@@ -158,7 +154,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
_movePacketMap.remove(entity.getEntityId());
_moveTempMap.remove(entity.getEntityId());
- for (Player player : _disguisePlayerMap.get(disguise))
+ Collection extends Player> players = (disguise.Global ? Bukkit.getOnlinePlayers() : _disguisePlayerMap.get(disguise));
+
+ for (Player player : players)
{
if (entity == player)
continue;
@@ -180,9 +178,17 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
public void reApplyDisguise(final DisguiseBase disguise)
{
+ reApplyDisguise(disguise, 1);
+ }
+
+ public void reApplyDisguise(final DisguiseBase disguise, long reapplyTime)
+ {
+ _handlingPacket = true;
PacketPlayOutEntityDestroy destroyPacket = new PacketPlayOutEntityDestroy(disguise.GetEntityId());
- for (Player player : _disguisePlayerMap.get(disguise))
+ Collection extends Player> players = (disguise.Global ? Bukkit.getOnlinePlayers() : _disguisePlayerMap.get(disguise));
+
+ for (Player player : players)
{
if (disguise.GetEntity() == ((CraftPlayer)player).getHandle())
continue;
@@ -191,7 +197,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
entityPlayer.playerConnection.sendPacket(destroyPacket);
}
-
+
List tempArmor = new ArrayList();
if (disguise instanceof DisguiseInsentient && disguise.GetEntity() instanceof LivingEntity)
@@ -205,25 +211,30 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
final List armorPackets = tempArmor;
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
+ Bukkit.getServer().getScheduler().runTaskLater(GetPlugin(), new Runnable()
{
public void run()
{
+ _handlingPacket = true;
+ Packet spawnPacket = disguise.GetSpawnPacket();
for (Player player : _disguisePlayerMap.get(disguise))
{
if (disguise.GetEntity() == ((CraftPlayer)player).getHandle())
continue;
-
+
EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle();
- entityPlayer.playerConnection.sendPacket(disguise.GetSpawnPacket());
+ entityPlayer.playerConnection.sendPacket(spawnPacket);
for (Packet packet : armorPackets)
{
entityPlayer.playerConnection.sendPacket(packet);
}
}
+ _handlingPacket = false;
}
- });
+ }, reapplyTime);
+
+ _handlingPacket = false;
}
public void reApplyDisguise(final DisguiseBase disguise, final Player player)
@@ -267,7 +278,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
public void updateDisguise(DisguiseBase disguise)
{
- for (Player player : _disguisePlayerMap.get(disguise))
+ Collection extends Player> players = (disguise.Global ? Bukkit.getOnlinePlayers() : _disguisePlayerMap.get(disguise));
+
+ for (Player player : players)
{
if (disguise.GetEntity() == ((CraftPlayer)player).getHandle())
continue;
@@ -347,27 +360,34 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
}
- @Override
- public boolean run(final Packet packet, Player owner, final PacketVerifier packetList)
+ @EventHandler
+ public void handlePackets(PlayerPacketEvent event)
{
+ if (_handlingPacket)
+ return;
+
+ final Packet packet = event.getPacket();
+ Player owner = event.getPlayer();
+ final PacketVerifier packetVerifier = event.getVerifier();
+
if (packet instanceof PacketPlayOutNamedEntitySpawn)
{
int entityId = ((PacketPlayOutNamedEntitySpawn)packet).a;
- if (_spawnPacketMap.containsKey(entityId) && _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner))
+ if (_spawnPacketMap.containsKey(entityId) && (_spawnPacketMap.get(entityId).Global || _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner)))
{
- packetList.forceProcess(_spawnPacketMap.get(entityId).GetSpawnPacket());
- return false;
+ handlePacket(_spawnPacketMap.get(entityId).GetSpawnPacket(), packetVerifier);
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutSpawnEntity)
{
int entityId = ((PacketPlayOutSpawnEntity)packet).a;
- if (_spawnPacketMap.containsKey(entityId) && _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner))
+ if (_spawnPacketMap.containsKey(entityId) && (_spawnPacketMap.get(entityId).Global || _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner)))
{
- packetList.forceProcess(_spawnPacketMap.get(entityId).GetSpawnPacket());
- return false;
+ handlePacket(_spawnPacketMap.get(entityId).GetSpawnPacket(), packetVerifier);
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutUpdateAttributes)
@@ -387,11 +407,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
e.printStackTrace();
}
- if (_spawnPacketMap.containsKey(entityId) && owner.getEntityId() != entityId && _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner))
+ if (_spawnPacketMap.containsKey(entityId) && owner.getEntityId() != entityId && (_spawnPacketMap.get(entityId).Global || _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner)))
{
// Crash clients with meta to a block id.
if (_spawnPacketMap.get(entityId) instanceof DisguiseBlock)
- return false;
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutAnimation)
@@ -400,7 +420,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
if (containsSpawnDisguise(owner, entityId) && owner.getEntityId() != entityId)
{
- return false;
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutEntityMetadata)
@@ -409,8 +429,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
if (containsSpawnDisguise(owner, entityId) && owner.getEntityId() != entityId)
{
- packetList.forceProcess(_spawnPacketMap.get(entityId).GetMetaDataPacket());
- return false;
+ handlePacket(_spawnPacketMap.get(entityId).GetMetaDataPacket(), packetVerifier);
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutEntityEquipment)
@@ -421,7 +441,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{
if (!((DisguiseInsentient)_spawnPacketMap.get(entityId)).armorVisible() && ((PacketPlayOutEntityEquipment)packet).b != 0)
{
- return false;
+ event.setCancelled(true);
}
}
}
@@ -437,11 +457,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
else if (velocityPacket.b == 0 && velocityPacket.c == 0 && velocityPacket.d == 0)
{
- return true;
+ return;
}
else if (_spawnPacketMap.containsKey(velocityPacket.a))
{
- return false;
+ event.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutRelEntityMove)
@@ -450,7 +470,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
// Only for viewers
if (movePacket.a == owner.getEntityId())
- return true;
+ return;
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c < 20)
{
@@ -459,7 +479,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
if (!containsSpawnDisguise(owner, movePacket.a))
- return true;
+ return;
final PacketPlayOutEntityVelocity velocityPacket = new PacketPlayOutEntityVelocity();
velocityPacket.a = movePacket.a;
@@ -478,7 +498,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
_movePacketMap.put(movePacket.a, velocityPacket);
- packetList.forceProcess(velocityPacket);
+ packetVerifier.bypassProcess(velocityPacket);
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
{
@@ -486,7 +506,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{
public void run()
{
- packetList.forceProcess(velocityPacket);
+ packetVerifier.bypassProcess(velocityPacket);
}
});
}
@@ -502,7 +522,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
// Only for viewers
if (movePacket.a == owner.getEntityId())
- return true;
+ return;
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c <= 20)
{
@@ -511,7 +531,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
if (!containsSpawnDisguise(owner, movePacket.a))
- return true;
+ return;
final PacketPlayOutEntityVelocity velocityPacket = new PacketPlayOutEntityVelocity();
velocityPacket.a = movePacket.a;
@@ -530,7 +550,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
_movePacketMap.put(movePacket.a, velocityPacket);
- packetList.forceProcess(velocityPacket);
+ packetVerifier.bypassProcess(velocityPacket);
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
{
@@ -538,7 +558,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{
public void run()
{
- packetList.forceProcess(velocityPacket);
+ packetVerifier.bypassProcess(velocityPacket);
}
});
}
@@ -569,13 +589,18 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
}
*/
-
- return true;
}
+ private void handlePacket(Packet packet, PacketVerifier verifier)
+ {
+ _handlingPacket = true;
+ verifier.process(packet);
+ _handlingPacket = false;
+ }
+
private boolean containsSpawnDisguise(Player owner, int entityId)
{
- return _spawnPacketMap.containsKey(entityId) && (_disguisePlayerMap.containsKey(_spawnPacketMap.get(entityId)) && _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner));
+ return _spawnPacketMap.containsKey(entityId) && (_spawnPacketMap.get(entityId).Global || (_disguisePlayerMap.containsKey(_spawnPacketMap.get(entityId)) && _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner)));
}
public void PrepAddDisguise(Player caller, EntityType entityType)
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java
index 9941886d7..b4b215a17 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java
@@ -1,6 +1,7 @@
package mineplex.core.disguise.disguises;
import mineplex.core.common.*;
+
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity;
@@ -9,6 +10,7 @@ import net.minecraft.server.v1_7_R4.DataWatcher;
import net.minecraft.server.v1_7_R4.Entity;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
+
import org.bukkit.entity.*;
public abstract class DisguiseBase
@@ -18,6 +20,8 @@ public abstract class DisguiseBase
private DisguiseBase _soundDisguise;
+ public boolean Global = true;
+
public DisguiseBase(org.bukkit.entity.Entity entity)
{
Entity = ((CraftEntity)entity).getHandle();
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java
index 0894e3642..c0060c8df 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java
@@ -42,7 +42,7 @@ public class DisguiseBlock extends DisguiseBase
packet.h = MathHelper.d(Entity.pitch * 256.0F / 360.0F);
packet.i = MathHelper.d(Entity.yaw * 256.0F / 360.0F);
packet.j = 70;
- packet.k = _blockId | _blockData << 16;
+ packet.k = _blockId | _blockData << 12;
double d1 = Entity.motX;
double d2 = Entity.motY;
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java
index e265d8ca0..1df5aedfd 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java
@@ -1,12 +1,15 @@
package mineplex.core.disguise.disguises;
+import org.spigotmc.ProtocolData;
+
public abstract class DisguiseHuman extends DisguiseLiving
{
public DisguiseHuman(org.bukkit.entity.Entity entity)
{
super(entity);
- DataWatcher.a(16, Byte.valueOf((byte)0));
+ DataWatcher.a(10, new ProtocolData.HiddenByte( (byte) 0 ) ); // Spigot - protocol patch, handle new metadata value
+ DataWatcher.a(16, new ProtocolData.DualByte( (byte) 0, (byte) 0 ) );
DataWatcher.a(17, Float.valueOf(0.0F));
DataWatcher.a(18, Integer.valueOf(0));
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java
index 4e8fcc8b3..738df6891 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java
@@ -1,5 +1,7 @@
package mineplex.core.disguise.disguises;
+import org.spigotmc.ProtocolData;
+
import net.minecraft.server.v1_7_R4.MathHelper;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java
deleted file mode 100644
index 7979ef75e..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java
+++ /dev/null
@@ -1,315 +0,0 @@
-package mineplex.core.fakeEntity;
-
-import java.lang.reflect.Field;
-
-import net.minecraft.server.v1_7_R4.BlockCloth;
-import net.minecraft.server.v1_7_R4.DataWatcher;
-import net.minecraft.server.v1_7_R4.Entity;
-import net.minecraft.server.v1_7_R4.EntityLiving;
-import net.minecraft.server.v1_7_R4.EntitySlime;
-import net.minecraft.server.v1_7_R4.EnumEntitySize;
-import net.minecraft.server.v1_7_R4.MathHelper;
-import net.minecraft.server.v1_7_R4.Packet;
-import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
-import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
-import net.minecraft.server.v1_7_R4.PacketPlayOutAttachEntity;
-import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
-
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
-import org.bukkit.entity.EntityType;
-
-public class FakeEntity
-{
- private static int _entityIdCounter = 50000;
-
- private int _entityId;
- private Location _location;
- private EntityType _entityType;
-
- private static Field _spawnDataWatcherField;
- private static Field _spawnListField;
-
- public FakeEntity(EntityType entityType, Location location)
- {
- _entityId = _entityIdCounter++;
- _entityType = entityType;
- _location = location;
-
- SetSpawnDataWatcherField();
- SetSpawnListField();
- }
-
- public int GetEntityId()
- {
- return _entityId;
- }
-
- public EntityType GetEntityType()
- {
- return _entityType;
- }
-
- public void SetLocation(Location location)
- {
- _location = location;
- }
-
- public Location GetLocation()
- {
- return _location;
- }
-
- public Packet Spawn()
- {
- return Spawn(_entityId);
- }
-
- public Packet Destroy()
- {
- return new PacketPlayOutEntityDestroy(new int[] { GetEntityId() });
- }
-
- public Packet Spawn(int id)
- {
- PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
- packet.a = id;
- packet.b = (byte) _entityType.getTypeId();
- packet.c = (int)EnumEntitySize.SIZE_2.a(_location.getX());
- packet.d = (int)MathHelper.floor(_location.getY() * 32.0D);
- packet.e = (int)EnumEntitySize.SIZE_2.a(_location.getZ());
- packet.i = (byte) ((int) (_location.getYaw() * 256.0F / 360.0F));
- packet.j = (byte) ((int) (_location.getPitch() * 256.0F / 360.0F));
- packet.k = (byte) ((int) (_location.getYaw() * 256.0F / 360.0F));
-
- double var2 = 3.9D;
- double var4 = 0;
- double var6 = 0;
- double var8 = 0;
-
- if (var4 < -var2)
- {
- var4 = -var2;
- }
-
- if (var6 < -var2)
- {
- var6 = -var2;
- }
-
- if (var8 < -var2)
- {
- var8 = -var2;
- }
-
- if (var4 > var2)
- {
- var4 = var2;
- }
-
- if (var6 > var2)
- {
- var6 = var2;
- }
-
- if (var8 > var2)
- {
- var8 = var2;
- }
-
- packet.f = (int)(var4 * 8000.0D);
- packet.g = (int)(var6 * 8000.0D);
- packet.h = (int)(var8 * 8000.0D);
-
- DataWatcher dataWatcher = new DataWatcher(new EntitySlime(((CraftWorld)Bukkit.getWorlds().get(0)).getHandle()));
-
- UpdateDataWatcher(dataWatcher);
-
- try
- {
- _spawnDataWatcherField.set(packet, dataWatcher);
- }
- catch (IllegalArgumentException e)
- {
- e.printStackTrace();
- }
- catch (IllegalAccessException e)
- {
- e.printStackTrace();
- }
-
- try
- {
- _spawnListField.set(packet, dataWatcher.b());
- }
- catch (IllegalArgumentException e)
- {
- e.printStackTrace();
- }
- catch (IllegalAccessException e)
- {
- e.printStackTrace();
- }
-
- return packet;
- }
-
- public Packet Hide()
- {
- return Hide(_entityId);
- }
-
- public Packet Hide(int entityId)
- {
- DataWatcher dataWatcher = new DataWatcher(new EntitySlime(((CraftWorld)Bukkit.getWorlds().get(0)).getHandle()));
-
- UpdateDataWatcher(dataWatcher);
-
- dataWatcher.watch(0, Byte.valueOf((byte) 32));
-
- return new PacketPlayOutEntityMetadata(entityId, dataWatcher, false);
- }
-
- public Packet Show()
- {
- DataWatcher dataWatcher = new DataWatcher(new EntitySlime(((CraftWorld)Bukkit.getWorlds().get(0)).getHandle()));
-
- UpdateDataWatcher(dataWatcher);
-
- return new PacketPlayOutEntityMetadata(_entityId, dataWatcher, true);
- }
-
- public Packet SetVehicle(int vehicleId)
- {
- PacketPlayOutAttachEntity vehiclePacket = new PacketPlayOutAttachEntity();
- vehiclePacket.a = 0;
- vehiclePacket.b = _entityId;
- vehiclePacket.c = vehicleId;
-
- return vehiclePacket;
- }
-
- public Packet SetPassenger(int passengerId)
- {
- return SetPassenger(passengerId, _entityId);
- }
-
- public Packet SetPassenger(int passengerId, int entityId)
- {
- PacketPlayOutAttachEntity vehiclePacket = new PacketPlayOutAttachEntity();
- vehiclePacket.a = 0;
- vehiclePacket.b = passengerId;
- vehiclePacket.c = entityId;
-
- return vehiclePacket;
- }
-
- protected void UpdateDataWatcher(DataWatcher dataWatcher)
- {
- dataWatcher.a(0, Byte.valueOf((byte) 0));
- dataWatcher.a(1, Short.valueOf((short)300));
- dataWatcher.a(6, Float.valueOf(4.0F));
- dataWatcher.a(7, Integer.valueOf(0));
- dataWatcher.a(8, Byte.valueOf((byte)0));
- dataWatcher.a(9, Byte.valueOf((byte) 0));
- dataWatcher.a(10, " ");
- dataWatcher.a(11, Byte.valueOf((byte)0));
-
- switch (_entityType)
- {
- case BAT:
- case BLAZE:
- case PIG:
- case SHEEP:
- case IRON_GOLEM:
- case GHAST:
- dataWatcher.a(16, new Byte((byte) 0));
- break;
- case CREEPER:
- dataWatcher.a(16, Byte.valueOf((byte) -1));
- dataWatcher.a(17, Byte.valueOf((byte) 0));
- break;
- case ENDERMAN:
- dataWatcher.a(16, new Byte((byte) 0));
- dataWatcher.a(17, new Byte((byte) 0));
- dataWatcher.a(18, new Byte((byte) 0));
- break;
- case PLAYER:
- dataWatcher.a(16, Byte.valueOf((byte) 0));
- dataWatcher.a(17, Byte.valueOf((byte) 0));
- break;
- case OCELOT:
- case SPIDER:
- dataWatcher.a(16, new Byte((byte) 0));
- break;
- case WOLF:
- dataWatcher.a(18, new Integer(20));
- dataWatcher.a(19, new Byte((byte) 0));
- dataWatcher.a(20, new Byte((byte) BlockCloth.b(1)));
- case SKELETON:
- dataWatcher.a(13, new Byte((byte) 0));
- break;
- case SLIME:
- dataWatcher.a(16, new Byte((byte) 1));
- break;
- case WITCH:
- dataWatcher.a(21, Byte.valueOf((byte) 0));
- break;
- case WITHER:
- dataWatcher.a(16, new Integer(100));
- dataWatcher.a(17, new Integer(0));
- dataWatcher.a(18, new Integer(0));
- dataWatcher.a(19, new Integer(0));
- dataWatcher.a(20, new Integer(0));
- break;
- case ZOMBIE:
- dataWatcher.a(13, Byte.valueOf((byte) 0));
- dataWatcher.a(14, Byte.valueOf((byte) 0));
- break;
- default:
- break;
-
- }
- }
-
- private void SetSpawnListField()
- {
- if (_spawnListField == null)
- {
- try
- {
- _spawnListField = PacketPlayOutSpawnEntityLiving.class.getDeclaredField("m");
- _spawnListField.setAccessible(true);
- }
- catch (NoSuchFieldException e)
- {
- e.printStackTrace();
- }
- catch (SecurityException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- private void SetSpawnDataWatcherField()
- {
- if (_spawnDataWatcherField == null)
- {
- try
- {
- _spawnDataWatcherField = PacketPlayOutSpawnEntityLiving.class.getDeclaredField("l");
- _spawnDataWatcherField.setAccessible(true);
- }
- catch (NoSuchFieldException e)
- {
- e.printStackTrace();
- }
- catch (SecurityException e)
- {
- e.printStackTrace();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java
deleted file mode 100644
index eb71ba7cc..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package mineplex.core.fakeEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.minecraft.server.v1_7_R4.Packet;
-
-import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.java.JavaPlugin;
-
-import mineplex.core.MiniPlugin;
-import mineplex.core.common.util.NautHashMap;
-import mineplex.core.packethandler.PacketHandler;
-
-public class FakeEntityManager extends MiniPlugin
-{
- public static FakeEntityManager Instance;
-
- private PacketHandler _packetHandler;
-
- private NautHashMap> _playerFakeEntityMap;
-
- public FakeEntityManager(JavaPlugin plugin)
- {
- super("Fake Entity Manager", plugin);
-
- _playerFakeEntityMap = new NautHashMap>();
- }
-
- public static void Initialize(JavaPlugin plugin)
- {
- Instance = new FakeEntityManager(plugin);
- }
-
- public void AddFakeEntity(FakeEntity entity, String name)
- {
- if (!_playerFakeEntityMap.containsKey(name))
- {
- _playerFakeEntityMap.put(name, new ArrayList());
- }
-
- _playerFakeEntityMap.get(name).add(entity);
- }
-
- public void ClearFakes(String name)
- {
- _playerFakeEntityMap.remove(name);
- }
-
- public void ClearFakeFor(FakeEntity entity, String name)
- {
- if (!_playerFakeEntityMap.containsKey(name))
- {
- _playerFakeEntityMap.put(name, new ArrayList());
- }
-
- _playerFakeEntityMap.get(name).remove(entity);
- }
-
- public List GetFakesFor(String name)
- {
- if (!_playerFakeEntityMap.containsKey(name))
- {
- _playerFakeEntityMap.put(name, new ArrayList());
- }
-
- return _playerFakeEntityMap.get(name);
- }
-
- public void SetPacketHandler(PacketHandler packetHandler)
- {
- _packetHandler = packetHandler;
- }
-
- public void RemoveForward(Player viewer)
- {
- _packetHandler.RemoveForward(viewer);
- }
-
- public void ForwardMovement(Player viewer, Player traveller, int entityId)
- {
- _packetHandler.ForwardMovement(viewer, traveller.getEntityId(), entityId);
- }
-
- public void BlockMovement(Player otherPlayer, int entityId)
- {
- _packetHandler.BlockMovement(otherPlayer, entityId);
- }
-
- public void FakePassenger(Player viewer, int entityId, Packet attachPacket)
- {
- _packetHandler.FakePassenger(viewer, entityId, attachPacket);
- }
-
- public void RemoveFakePassenger(Player viewer, int entityId)
- {
- _packetHandler.RemoveFakePassenger(viewer, entityId);
- }
-
- public void FakeVehicle(Player viewer, int entityId, Packet attachPacket)
- {
- _packetHandler.FakeVehicle(viewer, entityId, attachPacket);
- }
-
- public void RemoveFakeVehicle(Player viewer, int entityId)
- {
- _packetHandler.RemoveFakeVehicle(viewer, entityId);
- }
-
- public void SendPacketTo(Packet packet, Player player)
- {
- ((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
- }
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java
deleted file mode 100644
index 3ac51c076..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package mineplex.core.fakeEntity;
-
-import net.minecraft.server.v1_7_R4.EnumEntitySize;
-import net.minecraft.server.v1_7_R4.MathHelper;
-import net.minecraft.server.v1_7_R4.Packet;
-import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
-
-import org.bukkit.Location;
-import org.bukkit.entity.EntityType;
-
-public class FakeFallingBlock extends FakeEntity
-{
- private int _materialId;
- private byte _data;
-
- public FakeFallingBlock(int materialId, byte data, Location location)
- {
- super(EntityType.FALLING_BLOCK, location);
-
- _materialId = materialId;
- _data = data;
- }
-
- public Packet Spawn(int id)
- {
- PacketPlayOutSpawnEntity packet = new PacketPlayOutSpawnEntity();
- packet.a = id;
- packet.b = (int)EnumEntitySize.SIZE_2.a(GetLocation().getX());
- packet.c = (int)MathHelper.floor(GetLocation().getY() * 32.0D);
- packet.d = (int)EnumEntitySize.SIZE_2.a(GetLocation().getZ());
-
- double var4 = 0;
- double var6 = .045;
- double var8 = 0;
- double var10 = 3.9D;
-
- if (var4 < -var10)
- {
- var4 = -var10;
- }
-
- if (var6 < -var10)
- {
- var6 = -var10;
- }
-
- if (var8 < -var10)
- {
- var8 = -var10;
- }
-
- if (var4 > var10)
- {
- var4 = var10;
- }
-
- if (var6 > var10)
- {
- var6 = var10;
- }
-
- if (var8 > var10)
- {
- var8 = var10;
- }
-
- packet.e = (int)(var4 * 8000.0D);
- packet.f = (int)(var6 * 8000.0D);
- packet.g = (int)(var8 * 8000.0D);
- packet.h = 0;
- packet.i = 0;
- packet.j = 70;
- packet.k = _materialId | _data << 16;
-
- System.out.println("Creating fake falling block with entityId " + GetEntityId());
-
- return packet;
- }
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java
deleted file mode 100644
index 9d950fbf1..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package mineplex.core.fakeEntity;
-
-import net.minecraft.server.v1_7_R4.DataWatcher;
-import net.minecraft.server.v1_7_R4.ItemStack;
-import net.minecraft.server.v1_7_R4.MathHelper;
-import net.minecraft.server.v1_7_R4.Packet;
-import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
-
-import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack;
-import org.bukkit.entity.EntityType;
-
-public class FakeItemDrop extends FakeEntity
-{
- private ItemStack _itemStack;
-
- public FakeItemDrop(org.bukkit.inventory.ItemStack itemStack, Location location)
- {
- super(EntityType.DROPPED_ITEM, location);
-
- _itemStack = CraftItemStack.asNMSCopy(itemStack);
- }
-
- public Packet Spawn()
- {
- PacketPlayOutSpawnEntity packet = new PacketPlayOutSpawnEntity();
- packet.a = GetEntityId();
- packet.b = MathHelper.floor(GetLocation().getX() * 32.0D);
- packet.c = MathHelper.floor(GetLocation().getY() * 32.0D);
- packet.d = MathHelper.floor(GetLocation().getZ() * 32.0D);
- packet.h = MathHelper.d(GetLocation().getYaw() * 256.0F / 360.0F);
- packet.i = MathHelper.d(GetLocation().getPitch() * 256.0F / 360.0F);
- packet.j = 2;
- packet.k = 1;
-
- double d0 = 0;
- double d1 = 0;
- double d2 = 0;
- double d3 = 3.9D;
-
- if (d0 < -d3) {
- d0 = -d3;
- }
-
- if (d1 < -d3) {
- d1 = -d3;
- }
-
- if (d2 < -d3) {
- d2 = -d3;
- }
-
- if (d0 > d3) {
- d0 = d3;
- }
-
- if (d1 > d3) {
- d1 = d3;
- }
-
- if (d2 > d3) {
- d2 = d3;
- }
-
- packet.e = (int) (d0 * 8000.0D);
- packet.f = (int) (d1 * 8000.0D);
- packet.g = (int) (d2 * 8000.0D);
-
- return packet;
- }
-
- protected void UpdateDataWatcher(DataWatcher dataWatcher)
- {
- dataWatcher.a(0, Byte.valueOf((byte) 0));
- dataWatcher.a(1, Short.valueOf((short)300));
- dataWatcher.a(8, Integer.valueOf(0));
- dataWatcher.a(9, Byte.valueOf((byte) 0));
- dataWatcher.a(10, new net.minecraft.server.v1_7_R4.ItemStack(_itemStack.getItem(), _itemStack.count));
- }
-
- public void SetItemStack(org.bukkit.inventory.ItemStack itemStack)
- {
- _itemStack = CraftItemStack.asNMSCopy(itemStack);
- }
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java
deleted file mode 100644
index 294982312..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package mineplex.core.fakeEntity;
-
-import java.lang.reflect.Field;
-import java.util.UUID;
-
-import net.minecraft.server.v1_7_R4.DataWatcher;
-import net.minecraft.server.v1_7_R4.EntitySlime;
-import net.minecraft.server.v1_7_R4.MathHelper;
-import net.minecraft.server.v1_7_R4.Packet;
-import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
-import net.minecraft.util.com.mojang.authlib.GameProfile;
-
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
-import org.bukkit.entity.EntityType;
-
-public class FakePlayer extends FakeEntity
-{
- private String _name;
-
- private static Field _spawnDataWatcherField;
-
- public FakePlayer(String name, Location location)
- {
- super(EntityType.PLAYER, location);
-
- _name = name;
- }
-
- public Packet Spawn(int id)
- {
- PacketPlayOutNamedEntitySpawn packet = new PacketPlayOutNamedEntitySpawn();
- packet.a = id;
- packet.b = new GameProfile(UUID.randomUUID(), _name);
- packet.c = MathHelper.floor(GetLocation().getX() * 32.0D);
- packet.d = MathHelper.floor(GetLocation().getY() * 32.0D);
- packet.e = MathHelper.floor(GetLocation().getZ() * 32.0D);
- packet.f = (byte) ((int) (GetLocation().getYaw() * 256.0F / 360.0F));
- packet.g = (byte) ((int) (GetLocation().getPitch() * 256.0F / 360.0F));
-
- DataWatcher dataWatcher = new DataWatcher(new EntitySlime(((CraftWorld)Bukkit.getWorlds().get(0)).getHandle()));
-
- UpdateDataWatcher(dataWatcher);
-
- packet.i = dataWatcher;
-
- return packet;
- }
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/LeashData.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/LeashData.java
deleted file mode 100644
index 4b6f0662d..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/LeashData.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package mineplex.core.fakeEntity;
-
-public class LeashData
-{
- public int LeashedID;
- public int LeasherID;
-
- public boolean LeashedOn;
- public boolean LeasherOn;
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java
index 6bde47c27..99b6ea971 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java
@@ -1,6 +1,5 @@
package mineplex.core.friend;
-import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo;
import org.bukkit.Bukkit;
@@ -21,28 +20,24 @@ import mineplex.core.friend.command.DeleteFriend;
import mineplex.core.friend.data.FriendData;
import mineplex.core.friend.data.FriendRepository;
import mineplex.core.friend.ui.FriendTabList;
-import mineplex.core.packethandler.IPacketRunnable;
-import mineplex.core.packethandler.PacketHandler;
-import mineplex.core.packethandler.PacketVerifier;
+import mineplex.core.packethandler.PlayerPacketEvent;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
-public class FriendManager extends MiniClientPlugin implements IPacketRunnable
+public class FriendManager extends MiniClientPlugin
{
private FriendRepository _repository;
private NautHashMap _playerTabMap;
private boolean _sendingPackets = false;
- public FriendManager(JavaPlugin plugin, PacketHandler packetHandler)
+ public FriendManager(JavaPlugin plugin)
{
super("Friends", plugin);
_repository = new FriendRepository(plugin);
_playerTabMap = new NautHashMap();
-
- packetHandler.AddPacketRunnable(this);
}
@Override
@@ -139,15 +134,16 @@ public class FriendManager extends MiniClientPlugin implements IPack
_playerTabMap.remove(event.getPlayer());
}
- @Override
- public boolean run(Packet packet, Player owner, PacketVerifier packetList)
+ @EventHandler
+ public void handleFriendPackets(PlayerPacketEvent event)
{
- if (packet instanceof PacketPlayOutPlayerInfo)
- {
- return _sendingPackets;
- }
+ if (event.isCancelled())
+ return;
- return true;
+ if (event.getPacket() instanceof PacketPlayOutPlayerInfo)
+ {
+ event.setCancelled(_sendingPackets);
+ }
}
public void addFriend(final Player caller, final String name)
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardRepository.java
new file mode 100644
index 000000000..c742347ea
--- /dev/null
+++ b/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardRepository.java
@@ -0,0 +1,68 @@
+package mineplex.core.leaderboard;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.bukkit.plugin.java.JavaPlugin;
+
+import mineplex.core.database.RepositoryBase;
+import mineplex.database.Tables;
+import org.jooq.DSLContext;
+import org.jooq.Query;
+import org.jooq.impl.DSL;
+
+public class LeaderboardRepository extends RepositoryBase
+{
+ public LeaderboardRepository(JavaPlugin plugin)
+ {
+ super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh");
+ }
+
+ @Override
+ protected void initialize()
+ {
+
+ }
+
+ @Override
+ protected void update()
+ {
+
+ }
+
+ public void saveStats(int tournamentId, int gameId, Map wins)
+ {
+ DSLContext context;
+
+ synchronized (this)
+ {
+ context = DSL.using(getConnection());
+ }
+
+ List queryList = new ArrayList<>(wins.size());
+
+ for (Map.Entry entry : wins.entrySet())
+ {
+ int winIncrement = entry.getValue() ? 1 : 0;
+
+ Query query = context
+ .insertInto(Tables.tournamentLeaderboard)
+ .set(Tables.tournamentLeaderboard.tournamentId, tournamentId)
+ .set(Tables.tournamentLeaderboard.gameId, gameId)
+ .set(Tables.tournamentLeaderboard.accountId, DSL.select(Tables.accounts.id)
+ .from(Tables.accounts)
+ .where(Tables.accounts.uuid.eq(entry.getKey().toString())))
+ .set(Tables.tournamentLeaderboard.wins, winIncrement)
+ .set(Tables.tournamentLeaderboard.total, 1)
+ .onDuplicateKeyUpdate()
+ .set(Tables.tournamentLeaderboard.wins, Tables.tournamentLeaderboard.wins.plus(winIncrement))
+ .set(Tables.tournamentLeaderboard.total, Tables.tournamentLeaderboard.total.plus(1));
+
+ queryList.add(query);
+ }
+
+ context.batch(queryList).execute();
+ }
+}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java
deleted file mode 100644
index 3b456bd40..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package mineplex.core.packethandler;
-
-import org.bukkit.entity.Player;
-
-import net.minecraft.server.v1_7_R4.Packet;
-
-public interface IPacketRunnable
-{
- boolean run(Packet packet, Player owner, PacketVerifier packetList);
-}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java
deleted file mode 100644
index c0098616f..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package mineplex.core.packethandler;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import mineplex.core.MiniPlugin;
-import mineplex.core.common.util.NautHashMap;
-import net.minecraft.server.v1_7_R4.Packet;
-
-import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.player.PlayerJoinEvent;
-import org.bukkit.event.player.PlayerQuitEvent;
-import org.bukkit.plugin.java.JavaPlugin;
-
-public class PacketHandler extends MiniPlugin
-{
- private NautHashMap> _forwardMap;
- private NautHashMap> _blockMap;
- private NautHashMap> _fakeVehicleMap;
- private NautHashMap> _fakePassengerMap;
- private ArrayList _packetRunnables;
-
- public PacketHandler(JavaPlugin plugin)
- {
- super("PacketHandler", plugin);
-
- _forwardMap = new NautHashMap>();
- _blockMap = new NautHashMap>();
- _fakeVehicleMap = new NautHashMap>();
- _fakePassengerMap = new NautHashMap>();
- _packetRunnables = new ArrayList();
- }
-
- public String GetDataType(int c)
- {
- switch (c)
- {
- case 0:
- return "Byte";
- case 1:
- return "Short";
- case 2:
- return "Integer";
- case 3:
- return "Float";
- case 4:
- return "String";
- case 5:
- return "ItemStack";
- case 6:
- return "ChunkCoordinates";
- }
-
- return "Say what?";
- }
-
- public void AddPacketRunnable(IPacketRunnable runnable)
- {
- _packetRunnables.add(runnable);
- }
-
- public void RemovePacketRunnable(IPacketRunnable runnable)
- {
- _packetRunnables.remove(runnable);
- }
-
- public Packet GetFakeAttached(Player owner, int a)
- {
- return _fakeVehicleMap.get(owner.getName()).get(a);
- }
-
- public boolean IsFakeAttached(Player owner, int a)
- {
- return _fakeVehicleMap.containsKey(owner.getName()) && _fakeVehicleMap.get(owner.getName()).containsKey(a);
- }
- public Packet GetFakePassenger(Player owner, int a)
- {
- return _fakePassengerMap.get(owner.getName()).get(a);
- }
-
- public boolean IsFakePassenger(Player owner, int a)
- {
- return _fakePassengerMap.containsKey(owner.getName()) && _fakePassengerMap.get(owner.getName()).containsKey(a);
- }
-
- public boolean IsBlocked(Player owner, int a)
- {
- return _blockMap.containsKey(owner.getName()) && _blockMap.get(owner.getName()).contains(a);
- }
-
- public int GetForwardId(Player owner, int a)
- {
- return _forwardMap.get(owner.getName()).get(a);
- }
-
- public boolean IsForwarded(Player owner, int a)
- {
- return _forwardMap.get(owner.getName()).containsKey(a);
- }
-
- public boolean IsForwarding(Player owner)
- {
- return _forwardMap.containsKey(owner.getName());
- }
-
- @EventHandler(priority = EventPriority.MONITOR)
- public void onPlayerJoin(PlayerJoinEvent event)
- {
- in(event.getPlayer());
- }
-
- @EventHandler(priority = EventPriority.MONITOR)
- public void onPlayerQuit(PlayerQuitEvent event)
- {
- out(event.getPlayer());
- }
-
- public void in(Player player)
- {
- ((CraftPlayer) player).getHandle().playerConnection.PacketVerifier.addPacketVerifier(new PacketVerifier(player, this));
- }
-
- public void out(Player player)
- {
- ((CraftPlayer) player).getHandle().playerConnection.PacketVerifier.clearVerifiers();
- }
-
- public void shutdown()
- {
- for (final Player player : this._plugin.getServer().getOnlinePlayers())
- {
- if (player != null)
- {
- this.out(player);
- }
- }
- }
-
- public void ForwardMovement(Player viewer, int travellerId, int entityId)
- {
- if (!_forwardMap.containsKey(viewer.getName()))
- {
- _forwardMap.put(viewer.getName(), new NautHashMap());
- }
-
- _forwardMap.get(viewer.getName()).put(travellerId, entityId);
- }
-
- public void BlockMovement(Player otherPlayer, int entityId)
- {
- if (!_blockMap.containsKey(otherPlayer.getName()))
- {
- _blockMap.put(otherPlayer.getName(), new HashSet());
- }
-
- _blockMap.get(otherPlayer.getName()).add(entityId);
- }
-
- public void FakeVehicle(Player viewer, int entityId, Packet packet)
- {
- if (!_fakeVehicleMap.containsKey(viewer.getName()))
- {
- _fakeVehicleMap.put(viewer.getName(), new NautHashMap());
- }
-
- _fakeVehicleMap.get(viewer.getName()).put(entityId, packet);
- }
-
- public void RemoveFakeVehicle(Player viewer, int entityId)
- {
- if (_fakeVehicleMap.containsKey(viewer.getName()))
- {
- _fakeVehicleMap.get(viewer.getName()).remove(entityId);
- }
- }
-
- public void FakePassenger(Player viewer, int entityId, Packet packet)
- {
- if (!_fakePassengerMap.containsKey(viewer.getName()))
- {
- _fakePassengerMap.put(viewer.getName(), new NautHashMap());
- }
-
- _fakePassengerMap.get(viewer.getName()).put(entityId, packet);
- }
-
- public void RemoveFakePassenger(Player viewer, int entityId)
- {
- if (_fakePassengerMap.containsKey(viewer.getName()))
- {
- _fakePassengerMap.get(viewer.getName()).remove(entityId);
- }
- }
-
- public void RemoveForward(Player viewer)
- {
- _forwardMap.remove(viewer.getName());
- }
-
- public boolean FireRunnables(Packet o, Player owner, PacketVerifier packetList)
- {
- boolean addOriginal = true;
-
- for (IPacketRunnable packetRunnable : _packetRunnables)
- {
- if (!packetRunnable.run(o, owner, packetList))
- addOriginal = false;
- }
-
- return addOriginal;
- }
-}
\ No newline at end of file
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java
index 2d8b39660..4d9bcb082 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java
@@ -2,33 +2,62 @@ package mineplex.core.packethandler;
import net.minecraft.server.v1_7_R4.IPacketVerifier;
import net.minecraft.server.v1_7_R4.Packet;
+import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation;
+import net.minecraft.server.v1_7_R4.PacketPlayOutAttachEntity;
+import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
+import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
+import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity;
+import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
+import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove;
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook;
-import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport;
+import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
+import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
+import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes;
import net.minecraft.util.io.netty.util.concurrent.GenericFutureListener;
+import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class PacketVerifier implements IPacketVerifier
{
private Player _owner;
- private PacketHandler _handler;
- public PacketVerifier(Player owner, PacketHandler handler)
+ public PacketVerifier(Player owner)
{
_owner = owner;
- _handler = handler;
}
@Override
public boolean verify(Packet o)
{
- return _handler.FireRunnables(o, _owner, this);
+ if (o instanceof PacketPlayOutNamedEntitySpawn
+ || o instanceof PacketPlayOutSpawnEntity
+ || o instanceof PacketPlayOutSpawnEntityLiving
+ || o instanceof PacketPlayOutUpdateAttributes
+ || o instanceof PacketPlayOutAnimation
+ || o instanceof PacketPlayOutEntityMetadata
+ || o instanceof PacketPlayOutEntityEquipment
+ || o instanceof PacketPlayOutEntityVelocity
+ || o instanceof PacketPlayOutRelEntityMove
+ || o instanceof PacketPlayOutRelEntityMoveLook
+ || o instanceof PacketPlayOutPlayerInfo
+ || o instanceof PacketPlayOutEntityDestroy
+ || o instanceof PacketPlayOutAttachEntity)
+ {
+ PlayerPacketEvent event = new PlayerPacketEvent(_owner, o, this);
+
+ Bukkit.getServer().getPluginManager().callEvent(event);
+
+ return !event.isCancelled();
+ }
+
+ return true;
}
- public void forceProcess(Packet packet)
+ public void bypassProcess(Packet packet)
{
((CraftPlayer)_owner).getHandle().playerConnection.networkManager.handle(packet, new GenericFutureListener[0]);
}
@@ -37,4 +66,9 @@ public class PacketVerifier implements IPacketVerifier
{
_owner = null;
}
+
+ public void process(Packet packet)
+ {
+ ((CraftPlayer)_owner).getHandle().playerConnection.sendPacket(packet);
+ }
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PlayerPacketEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PlayerPacketEvent.java
new file mode 100644
index 000000000..c85d82402
--- /dev/null
+++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PlayerPacketEvent.java
@@ -0,0 +1,60 @@
+package mineplex.core.packethandler;
+
+import net.minecraft.server.v1_7_R4.Packet;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+
+public class PlayerPacketEvent extends Event
+{
+ private static final HandlerList handlers = new HandlerList();
+
+ private Player _player;
+ private Packet _packet;
+ private PacketVerifier _verifier;
+
+ private boolean _cancelled = false;
+
+ public PlayerPacketEvent(Player player, Packet packet, PacketVerifier verifier)
+ {
+ _player = player;
+ _packet = packet;
+ _verifier = verifier;
+ }
+
+ public HandlerList getHandlers()
+ {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList()
+ {
+ return handlers;
+ }
+
+ public Packet getPacket()
+ {
+ return _packet;
+ }
+
+ public Player getPlayer()
+ {
+ return _player;
+ }
+
+ public PacketVerifier getVerifier()
+ {
+ return _verifier;
+ }
+
+ public void setCancelled(boolean cancel)
+ {
+ _cancelled = cancel;
+ }
+
+ public boolean isCancelled()
+ {
+ return _cancelled;
+ }
+}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java b/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java
deleted file mode 100644
index 309607c01..000000000
--- a/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package mineplex.core.sound;
-
-import net.minecraft.server.v1_7_R4.Packet;
-
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.java.JavaPlugin;
-
-import mineplex.core.MiniPlugin;
-import mineplex.core.packethandler.IPacketRunnable;
-import mineplex.core.packethandler.PacketHandler;
-import mineplex.core.packethandler.PacketVerifier;
-
-public class SoundManager extends MiniPlugin implements IPacketRunnable
-{
- public SoundManager(JavaPlugin plugin, PacketHandler packetHandler)
- {
- super("Sound Manager", plugin);
-
- packetHandler.AddPacketRunnable(this);
- }
-
- @Override
- public boolean run(Packet packet, Player owner, PacketVerifier packetList)
- {
- return false;
- }
-}
diff --git a/Plugins/Mineplex.Database/Mineplex.Database.iml b/Plugins/Mineplex.Database/Mineplex.Database.iml
new file mode 100644
index 000000000..fa0ef0ae0
--- /dev/null
+++ b/Plugins/Mineplex.Database/Mineplex.Database.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plugins/Mineplex.Database/src/jOOQConfig.xml b/Plugins/Mineplex.Database/src/jOOQConfig.xml
new file mode 100644
index 000000000..a690df4e8
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/jOOQConfig.xml
@@ -0,0 +1,47 @@
+
+
+
+
+ com.mysql.jdbc.Driver
+ jdbc:mysql://db.mineplex.com:3306
+ root
+ tAbechAk3wR7tuTh
+
+
+
+
+ org.jooq.util.DefaultGenerator
+
+
+ mineplex.jooq.AsInDatabaseStrategy
+
+
+
+
+ org.jooq.util.mysql.MySQLDatabase
+
+
+ Account
+
+
+ .*
+
+
+
+
+
+
+
+ mineplex.database
+
+
+ ./src
+
+
+
\ No newline at end of file
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Account.java b/Plugins/Mineplex.Database/src/mineplex/database/Account.java
new file mode 100644
index 000000000..03fb1c54f
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Account.java
@@ -0,0 +1,50 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Account extends org.jooq.impl.SchemaImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -1898637057;
+
+ /**
+ * The singleton instance of Account
+ */
+ public static final Account Account = new Account();
+
+ /**
+ * No further instances allowed
+ */
+ private Account() {
+ super("Account");
+ }
+
+ @Override
+ public final java.util.List> getTables() {
+ java.util.List result = new java.util.ArrayList();
+ result.addAll(getTables0());
+ return result;
+ }
+
+ private final java.util.List> getTables0() {
+ return java.util.Arrays.>asList(
+ mineplex.database.tables.AccountFriend.accountFriend,
+ mineplex.database.tables.AccountInventory.accountInventory,
+ mineplex.database.tables.AccountPolls.accountPolls,
+ mineplex.database.tables.AccountPreferences.accountPreferences,
+ mineplex.database.tables.Accounts.accounts,
+ mineplex.database.tables.AccountStats.accountStats,
+ mineplex.database.tables.ItemCategories.itemCategories,
+ mineplex.database.tables.Items.items,
+ mineplex.database.tables.PlayerMap.playerMap,
+ mineplex.database.tables.Polls.polls,
+ mineplex.database.tables.Stats.stats,
+ mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Keys.java b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java
new file mode 100644
index 000000000..596c58ee7
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java
@@ -0,0 +1,128 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database;
+
+/**
+ * This class is generated by jOOQ.
+ *
+ * A class modelling foreign key relationships between tables of the Account
+ * schema
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Keys {
+
+ // -------------------------------------------------------------------------
+ // IDENTITY definitions
+ // -------------------------------------------------------------------------
+
+ public static final org.jooq.Identity IDENTITY_accountFriend = Identities0.IDENTITY_accountFriend;
+ public static final org.jooq.Identity IDENTITY_accountInventory = Identities0.IDENTITY_accountInventory;
+ public static final org.jooq.Identity IDENTITY_accountPolls = Identities0.IDENTITY_accountPolls;
+ public static final org.jooq.Identity IDENTITY_accountPreferences = Identities0.IDENTITY_accountPreferences;
+ public static final org.jooq.Identity IDENTITY_accounts = Identities0.IDENTITY_accounts;
+ public static final org.jooq.Identity IDENTITY_accountStats = Identities0.IDENTITY_accountStats;
+ public static final org.jooq.Identity IDENTITY_itemCategories = Identities0.IDENTITY_itemCategories;
+ public static final org.jooq.Identity IDENTITY_items = Identities0.IDENTITY_items;
+ public static final org.jooq.Identity IDENTITY_playerMap = Identities0.IDENTITY_playerMap;
+ public static final org.jooq.Identity IDENTITY_polls = Identities0.IDENTITY_polls;
+ public static final org.jooq.Identity IDENTITY_stats = Identities0.IDENTITY_stats;
+ public static final org.jooq.Identity IDENTITY_tournamentLeaderboard = Identities0.IDENTITY_tournamentLeaderboard;
+
+ // -------------------------------------------------------------------------
+ // UNIQUE and PRIMARY KEY definitions
+ // -------------------------------------------------------------------------
+
+ public static final org.jooq.UniqueKey KEY_accountFriend_PRIMARY = UniqueKeys0.KEY_accountFriend_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accountInventory_PRIMARY = UniqueKeys0.KEY_accountInventory_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accountInventory_accountItemIndex = UniqueKeys0.KEY_accountInventory_accountItemIndex;
+ public static final org.jooq.UniqueKey KEY_accountPolls_PRIMARY = UniqueKeys0.KEY_accountPolls_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accountPolls_accountPollIndex = UniqueKeys0.KEY_accountPolls_accountPollIndex;
+ public static final org.jooq.UniqueKey KEY_accountPreferences_PRIMARY = UniqueKeys0.KEY_accountPreferences_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accountPreferences_uuid_index = UniqueKeys0.KEY_accountPreferences_uuid_index;
+ public static final org.jooq.UniqueKey KEY_accounts_PRIMARY = UniqueKeys0.KEY_accounts_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accounts_uuidIndex = UniqueKeys0.KEY_accounts_uuidIndex;
+ public static final org.jooq.UniqueKey KEY_accountStats_PRIMARY = UniqueKeys0.KEY_accountStats_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_accountStats_accountStatIndex = UniqueKeys0.KEY_accountStats_accountStatIndex;
+ public static final org.jooq.UniqueKey KEY_itemCategories_PRIMARY = UniqueKeys0.KEY_itemCategories_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_itemCategories_nameIndex = UniqueKeys0.KEY_itemCategories_nameIndex;
+ public static final org.jooq.UniqueKey KEY_items_PRIMARY = UniqueKeys0.KEY_items_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_items_uniqueNameCategoryIndex = UniqueKeys0.KEY_items_uniqueNameCategoryIndex;
+ public static final org.jooq.UniqueKey KEY_playerMap_PRIMARY = UniqueKeys0.KEY_playerMap_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_playerMap_playerIndex = UniqueKeys0.KEY_playerMap_playerIndex;
+ public static final org.jooq.UniqueKey KEY_polls_PRIMARY = UniqueKeys0.KEY_polls_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_stats_PRIMARY = UniqueKeys0.KEY_stats_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_stats_nameIndex = UniqueKeys0.KEY_stats_nameIndex;
+ public static final org.jooq.UniqueKey KEY_tournamentLeaderboard_PRIMARY = UniqueKeys0.KEY_tournamentLeaderboard_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_tournamentLeaderboard_leaderboard_account_game_UNIQUE = UniqueKeys0.KEY_tournamentLeaderboard_leaderboard_account_game_UNIQUE;
+
+ // -------------------------------------------------------------------------
+ // FOREIGN KEY definitions
+ // -------------------------------------------------------------------------
+
+ public static final org.jooq.ForeignKey accountInventory_ibfk_1 = ForeignKeys0.accountInventory_ibfk_1;
+ public static final org.jooq.ForeignKey accountInventory_ibfk_2 = ForeignKeys0.accountInventory_ibfk_2;
+ public static final org.jooq.ForeignKey accountPolls_ibfk_1 = ForeignKeys0.accountPolls_ibfk_1;
+ public static final org.jooq.ForeignKey accountPolls_ibfk_2 = ForeignKeys0.accountPolls_ibfk_2;
+ public static final org.jooq.ForeignKey accountStats_ibfk_1 = ForeignKeys0.accountStats_ibfk_1;
+ public static final org.jooq.ForeignKey accountStats_ibfk_2 = ForeignKeys0.accountStats_ibfk_2;
+ public static final org.jooq.ForeignKey items_ibfk_1 = ForeignKeys0.items_ibfk_1;
+ public static final org.jooq.ForeignKey FK_tournamentLeaderboard_accounts = ForeignKeys0.FK_tournamentLeaderboard_accounts;
+
+ // -------------------------------------------------------------------------
+ // [#1459] distribute members to avoid static initialisers > 64kb
+ // -------------------------------------------------------------------------
+
+ private static class Identities0 extends org.jooq.impl.AbstractKeys {
+ public static org.jooq.Identity IDENTITY_accountFriend = createIdentity(mineplex.database.tables.AccountFriend.accountFriend, mineplex.database.tables.AccountFriend.accountFriend.id);
+ public static org.jooq.Identity IDENTITY_accountInventory = createIdentity(mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.id);
+ public static org.jooq.Identity IDENTITY_accountPolls = createIdentity(mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.id);
+ public static org.jooq.Identity IDENTITY_accountPreferences = createIdentity(mineplex.database.tables.AccountPreferences.accountPreferences, mineplex.database.tables.AccountPreferences.accountPreferences.id);
+ public static org.jooq.Identity IDENTITY_accounts = createIdentity(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.id);
+ public static org.jooq.Identity IDENTITY_accountStats = createIdentity(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
+ public static org.jooq.Identity IDENTITY_itemCategories = createIdentity(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
+ public static org.jooq.Identity IDENTITY_items = createIdentity(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.id);
+ public static org.jooq.Identity IDENTITY_playerMap = createIdentity(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
+ public static org.jooq.Identity IDENTITY_polls = createIdentity(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
+ public static org.jooq.Identity IDENTITY_stats = createIdentity(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.id);
+ public static org.jooq.Identity IDENTITY_tournamentLeaderboard = createIdentity(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.id);
+ }
+
+ private static class UniqueKeys0 extends org.jooq.impl.AbstractKeys {
+ public static final org.jooq.UniqueKey KEY_accountFriend_PRIMARY = createUniqueKey(mineplex.database.tables.AccountFriend.accountFriend, mineplex.database.tables.AccountFriend.accountFriend.id);
+ public static final org.jooq.UniqueKey KEY_accountInventory_PRIMARY = createUniqueKey(mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.id);
+ public static final org.jooq.UniqueKey KEY_accountInventory_accountItemIndex = createUniqueKey(mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.accountId, mineplex.database.tables.AccountInventory.accountInventory.itemId);
+ public static final org.jooq.UniqueKey KEY_accountPolls_PRIMARY = createUniqueKey(mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.id);
+ public static final org.jooq.UniqueKey KEY_accountPolls_accountPollIndex = createUniqueKey(mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.accountId, mineplex.database.tables.AccountPolls.accountPolls.pollId);
+ public static final org.jooq.UniqueKey KEY_accountPreferences_PRIMARY = createUniqueKey(mineplex.database.tables.AccountPreferences.accountPreferences, mineplex.database.tables.AccountPreferences.accountPreferences.id);
+ public static final org.jooq.UniqueKey KEY_accountPreferences_uuid_index = createUniqueKey(mineplex.database.tables.AccountPreferences.accountPreferences, mineplex.database.tables.AccountPreferences.accountPreferences.uuid);
+ public static final org.jooq.UniqueKey KEY_accounts_PRIMARY = createUniqueKey(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.id);
+ public static final org.jooq.UniqueKey KEY_accounts_uuidIndex = createUniqueKey(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.uuid);
+ public static final org.jooq.UniqueKey KEY_accountStats_PRIMARY = createUniqueKey(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
+ public static final org.jooq.UniqueKey KEY_accountStats_accountStatIndex = createUniqueKey(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.accountId, mineplex.database.tables.AccountStats.accountStats.statId);
+ public static final org.jooq.UniqueKey KEY_itemCategories_PRIMARY = createUniqueKey(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
+ public static final org.jooq.UniqueKey KEY_itemCategories_nameIndex = createUniqueKey(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.name);
+ public static final org.jooq.UniqueKey KEY_items_PRIMARY = createUniqueKey(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.id);
+ public static final org.jooq.UniqueKey KEY_items_uniqueNameCategoryIndex = createUniqueKey(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.name, mineplex.database.tables.Items.items.categoryId);
+ public static final org.jooq.UniqueKey KEY_playerMap_PRIMARY = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
+ public static final org.jooq.UniqueKey KEY_playerMap_playerIndex = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.playerName);
+ public static final org.jooq.UniqueKey KEY_polls_PRIMARY = createUniqueKey(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
+ public static final org.jooq.UniqueKey KEY_stats_PRIMARY = createUniqueKey(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.id);
+ public static final org.jooq.UniqueKey KEY_stats_nameIndex = createUniqueKey(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.name);
+ public static final org.jooq.UniqueKey KEY_tournamentLeaderboard_PRIMARY = createUniqueKey(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.id);
+ public static final org.jooq.UniqueKey KEY_tournamentLeaderboard_leaderboard_account_game_UNIQUE = createUniqueKey(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.gameId, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.accountId, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.tournamentId);
+ }
+
+ private static class ForeignKeys0 extends org.jooq.impl.AbstractKeys {
+ public static final org.jooq.ForeignKey accountInventory_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.accountId);
+ public static final org.jooq.ForeignKey accountInventory_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_items_PRIMARY, mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.itemId);
+ public static final org.jooq.ForeignKey accountPolls_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.accountId);
+ public static final org.jooq.ForeignKey accountPolls_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_polls_PRIMARY, mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.pollId);
+ public static final org.jooq.ForeignKey accountStats_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.accountId);
+ public static final org.jooq.ForeignKey accountStats_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_stats_PRIMARY, mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.statId);
+ public static final org.jooq.ForeignKey items_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_itemCategories_PRIMARY, mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.categoryId);
+ public static final org.jooq.ForeignKey FK_tournamentLeaderboard_accounts = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.accountId);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Tables.java b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java
new file mode 100644
index 000000000..1dd634d0f
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java
@@ -0,0 +1,75 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database;
+
+/**
+ * This class is generated by jOOQ.
+ *
+ * Convenience access to all tables in Account
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Tables {
+
+ /**
+ * The table Account.accountFriend
+ */
+ public static final mineplex.database.tables.AccountFriend accountFriend = mineplex.database.tables.AccountFriend.accountFriend;
+
+ /**
+ * The table Account.accountInventory
+ */
+ public static final mineplex.database.tables.AccountInventory accountInventory = mineplex.database.tables.AccountInventory.accountInventory;
+
+ /**
+ * The table Account.accountPolls
+ */
+ public static final mineplex.database.tables.AccountPolls accountPolls = mineplex.database.tables.AccountPolls.accountPolls;
+
+ /**
+ * The table Account.accountPreferences
+ */
+ public static final mineplex.database.tables.AccountPreferences accountPreferences = mineplex.database.tables.AccountPreferences.accountPreferences;
+
+ /**
+ * The table Account.accounts
+ */
+ public static final mineplex.database.tables.Accounts accounts = mineplex.database.tables.Accounts.accounts;
+
+ /**
+ * The table Account.accountStats
+ */
+ public static final mineplex.database.tables.AccountStats accountStats = mineplex.database.tables.AccountStats.accountStats;
+
+ /**
+ * The table Account.itemCategories
+ */
+ public static final mineplex.database.tables.ItemCategories itemCategories = mineplex.database.tables.ItemCategories.itemCategories;
+
+ /**
+ * The table Account.items
+ */
+ public static final mineplex.database.tables.Items items = mineplex.database.tables.Items.items;
+
+ /**
+ * The table Account.playerMap
+ */
+ public static final mineplex.database.tables.PlayerMap playerMap = mineplex.database.tables.PlayerMap.playerMap;
+
+ /**
+ * The table Account.polls
+ */
+ public static final mineplex.database.tables.Polls polls = mineplex.database.tables.Polls.polls;
+
+ /**
+ * The table Account.stats
+ */
+ public static final mineplex.database.tables.Stats stats = mineplex.database.tables.Stats.stats;
+
+ /**
+ * The table Account.tournamentLeaderboard
+ */
+ public static final mineplex.database.tables.TournamentLeaderboard tournamentLeaderboard = mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard;
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountFriend.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountFriend.java
new file mode 100644
index 000000000..bffd86125
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountFriend.java
@@ -0,0 +1,109 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountFriend extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 288902842;
+
+ /**
+ * The singleton instance of Account.accountFriend
+ */
+ public static final mineplex.database.tables.AccountFriend accountFriend = new mineplex.database.tables.AccountFriend();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.AccountFriend.class;
+ }
+
+ /**
+ * The column Account.accountFriend.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountFriend.uuidSource
.
+ */
+ public final org.jooq.TableField uuidSource = createField("uuidSource", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
+
+ /**
+ * The column Account.accountFriend.uuidTarget
.
+ */
+ public final org.jooq.TableField uuidTarget = createField("uuidTarget", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
+
+ /**
+ * The column Account.accountFriend.mutual
.
+ */
+ public final org.jooq.TableField mutual = createField("mutual", org.jooq.impl.SQLDataType.TINYINT, this, "");
+
+ /**
+ * Create a Account.accountFriend
table reference
+ */
+ public AccountFriend() {
+ this("accountFriend", null);
+ }
+
+ /**
+ * Create an aliased Account.accountFriend
table reference
+ */
+ public AccountFriend(java.lang.String alias) {
+ this(alias, mineplex.database.tables.AccountFriend.accountFriend);
+ }
+
+ private AccountFriend(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private AccountFriend(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accountFriend;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accountFriend_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accountFriend_PRIMARY);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.AccountFriend as(java.lang.String alias) {
+ return new mineplex.database.tables.AccountFriend(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.AccountFriend rename(java.lang.String name) {
+ return new mineplex.database.tables.AccountFriend(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountInventory.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountInventory.java
new file mode 100644
index 000000000..b7c9958d5
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountInventory.java
@@ -0,0 +1,117 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountInventory extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -113543162;
+
+ /**
+ * The singleton instance of Account.accountInventory
+ */
+ public static final mineplex.database.tables.AccountInventory accountInventory = new mineplex.database.tables.AccountInventory();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.AccountInventory.class;
+ }
+
+ /**
+ * The column Account.accountInventory.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountInventory.accountId
.
+ */
+ public final org.jooq.TableField accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountInventory.itemId
.
+ */
+ public final org.jooq.TableField itemId = createField("itemId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountInventory.count
.
+ */
+ public final org.jooq.TableField count = createField("count", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * Create a Account.accountInventory
table reference
+ */
+ public AccountInventory() {
+ this("accountInventory", null);
+ }
+
+ /**
+ * Create an aliased Account.accountInventory
table reference
+ */
+ public AccountInventory(java.lang.String alias) {
+ this(alias, mineplex.database.tables.AccountInventory.accountInventory);
+ }
+
+ private AccountInventory(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private AccountInventory(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accountInventory;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accountInventory_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accountInventory_PRIMARY, mineplex.database.Keys.KEY_accountInventory_accountItemIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getReferences() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.accountInventory_ibfk_1, mineplex.database.Keys.accountInventory_ibfk_2);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.AccountInventory as(java.lang.String alias) {
+ return new mineplex.database.tables.AccountInventory(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.AccountInventory rename(java.lang.String name) {
+ return new mineplex.database.tables.AccountInventory(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPolls.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPolls.java
new file mode 100644
index 000000000..f2abf00be
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPolls.java
@@ -0,0 +1,117 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountPolls extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 295371459;
+
+ /**
+ * The singleton instance of Account.accountPolls
+ */
+ public static final mineplex.database.tables.AccountPolls accountPolls = new mineplex.database.tables.AccountPolls();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.AccountPolls.class;
+ }
+
+ /**
+ * The column Account.accountPolls.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountPolls.accountId
.
+ */
+ public final org.jooq.TableField accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountPolls.pollId
.
+ */
+ public final org.jooq.TableField pollId = createField("pollId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountPolls.value
.
+ */
+ public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.TINYINT.nullable(false), this, "");
+
+ /**
+ * Create a Account.accountPolls
table reference
+ */
+ public AccountPolls() {
+ this("accountPolls", null);
+ }
+
+ /**
+ * Create an aliased Account.accountPolls
table reference
+ */
+ public AccountPolls(java.lang.String alias) {
+ this(alias, mineplex.database.tables.AccountPolls.accountPolls);
+ }
+
+ private AccountPolls(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private AccountPolls(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accountPolls;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accountPolls_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accountPolls_PRIMARY, mineplex.database.Keys.KEY_accountPolls_accountPollIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getReferences() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.accountPolls_ibfk_1, mineplex.database.Keys.accountPolls_ibfk_2);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.AccountPolls as(java.lang.String alias) {
+ return new mineplex.database.tables.AccountPolls(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.AccountPolls rename(java.lang.String name) {
+ return new mineplex.database.tables.AccountPolls(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPreferences.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPreferences.java
new file mode 100644
index 000000000..1105e19c6
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountPreferences.java
@@ -0,0 +1,144 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountPreferences extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -48477652;
+
+ /**
+ * The singleton instance of Account.accountPreferences
+ */
+ public static final mineplex.database.tables.AccountPreferences accountPreferences = new mineplex.database.tables.AccountPreferences();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.AccountPreferences.class;
+ }
+
+ /**
+ * The column Account.accountPreferences.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountPreferences.uuid
.
+ */
+ public final org.jooq.TableField uuid = createField("uuid", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, "");
+
+ /**
+ * The column Account.accountPreferences.filterChat
.
+ */
+ public final org.jooq.TableField filterChat = createField("filterChat", org.jooq.impl.SQLDataType.TINYINT, this, "");
+
+ /**
+ * The column Account.accountPreferences.invisibility
.
+ */
+ public final org.jooq.TableField invisibility = createField("invisibility", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.games
.
+ */
+ public final org.jooq.TableField games = createField("games", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.visibility
.
+ */
+ public final org.jooq.TableField visibility = createField("visibility", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.friendChat
.
+ */
+ public final org.jooq.TableField friendChat = createField("friendChat", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.privateMessaging
.
+ */
+ public final org.jooq.TableField privateMessaging = createField("privateMessaging", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.showChat
.
+ */
+ public final org.jooq.TableField showChat = createField("showChat", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.partyRequests
.
+ */
+ public final org.jooq.TableField partyRequests = createField("partyRequests", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.accountPreferences.forcefield
.
+ */
+ public final org.jooq.TableField forcefield = createField("forcefield", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * Create a Account.accountPreferences
table reference
+ */
+ public AccountPreferences() {
+ this("accountPreferences", null);
+ }
+
+ /**
+ * Create an aliased Account.accountPreferences
table reference
+ */
+ public AccountPreferences(java.lang.String alias) {
+ this(alias, mineplex.database.tables.AccountPreferences.accountPreferences);
+ }
+
+ private AccountPreferences(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private AccountPreferences(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accountPreferences;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accountPreferences_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accountPreferences_PRIMARY, mineplex.database.Keys.KEY_accountPreferences_uuid_index);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.AccountPreferences as(java.lang.String alias) {
+ return new mineplex.database.tables.AccountPreferences(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.AccountPreferences rename(java.lang.String name) {
+ return new mineplex.database.tables.AccountPreferences(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStats.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStats.java
new file mode 100644
index 000000000..f62c52ba3
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStats.java
@@ -0,0 +1,117 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountStats extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 1235880361;
+
+ /**
+ * The singleton instance of Account.accountStats
+ */
+ public static final mineplex.database.tables.AccountStats accountStats = new mineplex.database.tables.AccountStats();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.AccountStats.class;
+ }
+
+ /**
+ * The column Account.accountStats.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountStats.accountId
.
+ */
+ public final org.jooq.TableField accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountStats.statId
.
+ */
+ public final org.jooq.TableField statId = createField("statId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accountStats.value
.
+ */
+ public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * Create a Account.accountStats
table reference
+ */
+ public AccountStats() {
+ this("accountStats", null);
+ }
+
+ /**
+ * Create an aliased Account.accountStats
table reference
+ */
+ public AccountStats(java.lang.String alias) {
+ this(alias, mineplex.database.tables.AccountStats.accountStats);
+ }
+
+ private AccountStats(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private AccountStats(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accountStats;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accountStats_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accountStats_PRIMARY, mineplex.database.Keys.KEY_accountStats_accountStatIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getReferences() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.accountStats_ibfk_1, mineplex.database.Keys.accountStats_ibfk_2);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.AccountStats as(java.lang.String alias) {
+ return new mineplex.database.tables.AccountStats(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.AccountStats rename(java.lang.String name) {
+ return new mineplex.database.tables.AccountStats(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Accounts.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Accounts.java
new file mode 100644
index 000000000..8bbebc5de
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Accounts.java
@@ -0,0 +1,134 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Accounts extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 235426766;
+
+ /**
+ * The singleton instance of Account.accounts
+ */
+ public static final mineplex.database.tables.Accounts accounts = new mineplex.database.tables.Accounts();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.Accounts.class;
+ }
+
+ /**
+ * The column Account.accounts.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.accounts.uuid
.
+ */
+ public final org.jooq.TableField uuid = createField("uuid", org.jooq.impl.SQLDataType.VARCHAR.length(100).nullable(false), this, "");
+
+ /**
+ * The column Account.accounts.name
.
+ */
+ public final org.jooq.TableField name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(40), this, "");
+
+ /**
+ * The column Account.accounts.gems
.
+ */
+ public final org.jooq.TableField gems = createField("gems", org.jooq.impl.SQLDataType.INTEGER, this, "");
+
+ /**
+ * The column Account.accounts.rank
.
+ */
+ public final org.jooq.TableField rank = createField("rank", org.jooq.impl.SQLDataType.VARCHAR.length(40), this, "");
+
+ /**
+ * The column Account.accounts.rankPerm
.
+ */
+ public final org.jooq.TableField rankPerm = createField("rankPerm", org.jooq.impl.SQLDataType.TINYINT, this, "");
+
+ /**
+ * The column Account.accounts.rankExpire
.
+ */
+ public final org.jooq.TableField rankExpire = createField("rankExpire", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
+
+ /**
+ * The column Account.accounts.lastLogin
.
+ */
+ public final org.jooq.TableField lastLogin = createField("lastLogin", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
+
+ /**
+ * The column Account.accounts.totalPlayTime
.
+ */
+ public final org.jooq.TableField totalPlayTime = createField("totalPlayTime", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
+
+ /**
+ * Create a Account.accounts
table reference
+ */
+ public Accounts() {
+ this("accounts", null);
+ }
+
+ /**
+ * Create an aliased Account.accounts
table reference
+ */
+ public Accounts(java.lang.String alias) {
+ this(alias, mineplex.database.tables.Accounts.accounts);
+ }
+
+ private Accounts(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private Accounts(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_accounts;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_accounts_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.Keys.KEY_accounts_uuidIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.Accounts as(java.lang.String alias) {
+ return new mineplex.database.tables.Accounts(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.Accounts rename(java.lang.String name) {
+ return new mineplex.database.tables.Accounts(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/ItemCategories.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/ItemCategories.java
new file mode 100644
index 000000000..ed0376167
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/ItemCategories.java
@@ -0,0 +1,99 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class ItemCategories extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 1789014434;
+
+ /**
+ * The singleton instance of Account.itemCategories
+ */
+ public static final mineplex.database.tables.ItemCategories itemCategories = new mineplex.database.tables.ItemCategories();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.ItemCategories.class;
+ }
+
+ /**
+ * The column Account.itemCategories.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.itemCategories.name
.
+ */
+ public final org.jooq.TableField name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
+
+ /**
+ * Create a Account.itemCategories
table reference
+ */
+ public ItemCategories() {
+ this("itemCategories", null);
+ }
+
+ /**
+ * Create an aliased Account.itemCategories
table reference
+ */
+ public ItemCategories(java.lang.String alias) {
+ this(alias, mineplex.database.tables.ItemCategories.itemCategories);
+ }
+
+ private ItemCategories(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private ItemCategories(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_itemCategories;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_itemCategories_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_itemCategories_PRIMARY, mineplex.database.Keys.KEY_itemCategories_nameIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.ItemCategories as(java.lang.String alias) {
+ return new mineplex.database.tables.ItemCategories(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.ItemCategories rename(java.lang.String name) {
+ return new mineplex.database.tables.ItemCategories(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Items.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Items.java
new file mode 100644
index 000000000..130bd52ce
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Items.java
@@ -0,0 +1,117 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Items extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -2014464691;
+
+ /**
+ * The singleton instance of Account.items
+ */
+ public static final mineplex.database.tables.Items items = new mineplex.database.tables.Items();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.Items.class;
+ }
+
+ /**
+ * The column Account.items.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.items.name
.
+ */
+ public final org.jooq.TableField name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
+
+ /**
+ * The column Account.items.categoryId
.
+ */
+ public final org.jooq.TableField categoryId = createField("categoryId", org.jooq.impl.SQLDataType.INTEGER, this, "");
+
+ /**
+ * The column Account.items.rarity
.
+ */
+ public final org.jooq.TableField rarity = createField("rarity", org.jooq.impl.SQLDataType.INTEGER, this, "");
+
+ /**
+ * Create a Account.items
table reference
+ */
+ public Items() {
+ this("items", null);
+ }
+
+ /**
+ * Create an aliased Account.items
table reference
+ */
+ public Items(java.lang.String alias) {
+ this(alias, mineplex.database.tables.Items.items);
+ }
+
+ private Items(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private Items(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_items;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_items_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_items_PRIMARY, mineplex.database.Keys.KEY_items_uniqueNameCategoryIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getReferences() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.items_ibfk_1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.Items as(java.lang.String alias) {
+ return new mineplex.database.tables.Items(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.Items rename(java.lang.String name) {
+ return new mineplex.database.tables.Items(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/PlayerMap.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/PlayerMap.java
new file mode 100644
index 000000000..67d5fe71e
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/PlayerMap.java
@@ -0,0 +1,109 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
+ comments = "This class is generated by jOOQ")
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class PlayerMap extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -2057076686;
+
+ /**
+ * The singleton instance of Account.playerMap
+ */
+ public static final mineplex.database.tables.PlayerMap playerMap = new mineplex.database.tables.PlayerMap();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.PlayerMap.class;
+ }
+
+ /**
+ * The column Account.playerMap.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.playerMap.playerName
.
+ */
+ public final org.jooq.TableField playerName = createField("playerName", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, "");
+
+ /**
+ * The column Account.playerMap.serverName
.
+ */
+ public final org.jooq.TableField serverName = createField("serverName", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, "");
+
+ /**
+ * The column Account.playerMap.us
.
+ */
+ public final org.jooq.TableField us = createField("us", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
+
+ /**
+ * Create a