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/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 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 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 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 Account.playerMap table reference + */ + public PlayerMap() { + this("playerMap", null); + } + + /** + * Create an aliased Account.playerMap table reference + */ + public PlayerMap(java.lang.String alias) { + this(alias, mineplex.database.tables.PlayerMap.playerMap); + } + + private PlayerMap(java.lang.String alias, org.jooq.Table aliased) { + this(alias, aliased, null); + } + + private PlayerMap(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_playerMap; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.UniqueKey getPrimaryKey() { + return mineplex.database.Keys.KEY_playerMap_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getKeys() { + return java.util.Arrays.>asList(mineplex.database.Keys.KEY_playerMap_PRIMARY, mineplex.database.Keys.KEY_playerMap_playerIndex); + } + + /** + * {@inheritDoc} + */ + @Override + public mineplex.database.tables.PlayerMap as(java.lang.String alias) { + return new mineplex.database.tables.PlayerMap(alias, this); + } + + /** + * Rename this table + */ + public mineplex.database.tables.PlayerMap rename(java.lang.String name) { + return new mineplex.database.tables.PlayerMap(name, null); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Polls.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Polls.java new file mode 100644 index 000000000..58ee5770e --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Polls.java @@ -0,0 +1,129 @@ +/** + * 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 Polls extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { + + private static final long serialVersionUID = -669090314; + + /** + * The singleton instance of Account.polls + */ + public static final mineplex.database.tables.Polls polls = new mineplex.database.tables.Polls(); + + /** + * The class holding records for this type + */ + @Override + public java.lang.Class getRecordType() { + return mineplex.database.tables.records.Polls.class; + } + + /** + * The column Account.polls.id. + */ + public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.polls.enabled. + */ + public final org.jooq.TableField enabled = createField("enabled", org.jooq.impl.SQLDataType.BIT, this, ""); + + /** + * The column Account.polls.question. + */ + public final org.jooq.TableField question = createField("question", org.jooq.impl.SQLDataType.VARCHAR.length(256).nullable(false), this, ""); + + /** + * The column Account.polls.answerA. + */ + public final org.jooq.TableField answerA = createField("answerA", org.jooq.impl.SQLDataType.VARCHAR.length(256).nullable(false), this, ""); + + /** + * The column Account.polls.answerB. + */ + public final org.jooq.TableField answerB = createField("answerB", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, ""); + + /** + * The column Account.polls.answerC. + */ + public final org.jooq.TableField answerC = createField("answerC", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, ""); + + /** + * The column Account.polls.answerD. + */ + public final org.jooq.TableField answerD = createField("answerD", org.jooq.impl.SQLDataType.VARCHAR.length(256), this, ""); + + /** + * The column Account.polls.coinReward. + */ + public final org.jooq.TableField coinReward = createField("coinReward", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a Account.polls table reference + */ + public Polls() { + this("polls", null); + } + + /** + * Create an aliased Account.polls table reference + */ + public Polls(java.lang.String alias) { + this(alias, mineplex.database.tables.Polls.polls); + } + + private Polls(java.lang.String alias, org.jooq.Table aliased) { + this(alias, aliased, null); + } + + private Polls(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_polls; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.UniqueKey getPrimaryKey() { + return mineplex.database.Keys.KEY_polls_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getKeys() { + return java.util.Arrays.>asList(mineplex.database.Keys.KEY_polls_PRIMARY); + } + + /** + * {@inheritDoc} + */ + @Override + public mineplex.database.tables.Polls as(java.lang.String alias) { + return new mineplex.database.tables.Polls(alias, this); + } + + /** + * Rename this table + */ + public mineplex.database.tables.Polls rename(java.lang.String name) { + return new mineplex.database.tables.Polls(name, null); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Stats.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Stats.java new file mode 100644 index 000000000..ba22d0b42 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Stats.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 Stats extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { + + private static final long serialVersionUID = -1049298598; + + /** + * The singleton instance of Account.stats + */ + public static final mineplex.database.tables.Stats stats = new mineplex.database.tables.Stats(); + + /** + * The class holding records for this type + */ + @Override + public java.lang.Class getRecordType() { + return mineplex.database.tables.records.Stats.class; + } + + /** + * The column Account.stats.id. + */ + public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.stats.name. + */ + public final org.jooq.TableField name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, ""); + + /** + * Create a Account.stats table reference + */ + public Stats() { + this("stats", null); + } + + /** + * Create an aliased Account.stats table reference + */ + public Stats(java.lang.String alias) { + this(alias, mineplex.database.tables.Stats.stats); + } + + private Stats(java.lang.String alias, org.jooq.Table aliased) { + this(alias, aliased, null); + } + + private Stats(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_stats; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.UniqueKey getPrimaryKey() { + return mineplex.database.Keys.KEY_stats_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getKeys() { + return java.util.Arrays.>asList(mineplex.database.Keys.KEY_stats_PRIMARY, mineplex.database.Keys.KEY_stats_nameIndex); + } + + /** + * {@inheritDoc} + */ + @Override + public mineplex.database.tables.Stats as(java.lang.String alias) { + return new mineplex.database.tables.Stats(alias, this); + } + + /** + * Rename this table + */ + public mineplex.database.tables.Stats rename(java.lang.String name) { + return new mineplex.database.tables.Stats(name, null); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/TournamentLeaderboard.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/TournamentLeaderboard.java new file mode 100644 index 000000000..ab519d88e --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/TournamentLeaderboard.java @@ -0,0 +1,132 @@ +/** + * 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 TournamentLeaderboard extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { + + private static final long serialVersionUID = -2050960225; + + /** + * The singleton instance of Account.tournamentLeaderboard + */ + public static final mineplex.database.tables.TournamentLeaderboard tournamentLeaderboard = new mineplex.database.tables.TournamentLeaderboard(); + + /** + * The class holding records for this type + */ + @Override + public java.lang.Class getRecordType() { + return mineplex.database.tables.records.TournamentLeaderboard.class; + } + + /** + * The column Account.tournamentLeaderboard.id. + */ + public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.tournamentLeaderboard.tournamentId. + */ + public final org.jooq.TableField tournamentId = createField("tournamentId", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaulted(true), this, ""); + + /** + * The column Account.tournamentLeaderboard.accountId. + */ + public final org.jooq.TableField accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.tournamentLeaderboard.gameId. + */ + public final org.jooq.TableField gameId = createField("gameId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.tournamentLeaderboard.wins. + */ + public final org.jooq.TableField wins = createField("wins", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaulted(true), this, ""); + + /** + * The column Account.tournamentLeaderboard.total. + */ + public final org.jooq.TableField total = createField("total", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaulted(true), this, ""); + + /** + * The column Account.tournamentLeaderboard.ratio. + */ + public final org.jooq.TableField ratio = createField("ratio", org.jooq.impl.SQLDataType.FLOAT, this, ""); + + /** + * Create a Account.tournamentLeaderboard table reference + */ + public TournamentLeaderboard() { + this("tournamentLeaderboard", null); + } + + /** + * Create an aliased Account.tournamentLeaderboard table reference + */ + public TournamentLeaderboard(java.lang.String alias) { + this(alias, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard); + } + + private TournamentLeaderboard(java.lang.String alias, org.jooq.Table aliased) { + this(alias, aliased, null); + } + + private TournamentLeaderboard(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_tournamentLeaderboard; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.UniqueKey getPrimaryKey() { + return mineplex.database.Keys.KEY_tournamentLeaderboard_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getKeys() { + return java.util.Arrays.>asList(mineplex.database.Keys.KEY_tournamentLeaderboard_PRIMARY, mineplex.database.Keys.KEY_tournamentLeaderboard_leaderboard_account_game_UNIQUE); + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getReferences() { + return java.util.Arrays.>asList(mineplex.database.Keys.FK_tournamentLeaderboard_accounts); + } + + /** + * {@inheritDoc} + */ + @Override + public mineplex.database.tables.TournamentLeaderboard as(java.lang.String alias) { + return new mineplex.database.tables.TournamentLeaderboard(alias, this); + } + + /** + * Rename this table + */ + public mineplex.database.tables.TournamentLeaderboard rename(java.lang.String name) { + return new mineplex.database.tables.TournamentLeaderboard(name, null); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountFriend.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountFriend.java new file mode 100644 index 000000000..71a672229 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountFriend.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = -1730990134; + + /** + * Setter for Account.accountFriend.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accountFriend.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accountFriend.uuidSource. + */ + public void setUuidSource(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.accountFriend.uuidSource. + */ + public java.lang.String getUuidSource() { + return (java.lang.String) getValue(1); + } + + /** + * Setter for Account.accountFriend.uuidTarget. + */ + public void setUuidTarget(java.lang.String value) { + setValue(2, value); + } + + /** + * Getter for Account.accountFriend.uuidTarget. + */ + public java.lang.String getUuidTarget() { + return (java.lang.String) getValue(2); + } + + /** + * Setter for Account.accountFriend.mutual. + */ + public void setMutual(java.lang.Byte value) { + setValue(3, value); + } + + /** + * Getter for Account.accountFriend.mutual. + */ + public java.lang.Byte getMutual() { + return (java.lang.Byte) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.AccountFriend.accountFriend.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.AccountFriend.accountFriend.uuidSource; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.AccountFriend.accountFriend.uuidTarget; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.AccountFriend.accountFriend.mutual; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getUuidSource(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value3() { + return getUuidTarget(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value4() { + return getMutual(); + } + + /** + * {@inheritDoc} + */ + @Override + public AccountFriend value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountFriend value2(java.lang.String value) { + setUuidSource(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountFriend value3(java.lang.String value) { + setUuidTarget(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountFriend value4(java.lang.Byte value) { + setMutual(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountFriend values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Byte value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccountFriend + */ + public AccountFriend() { + super(mineplex.database.tables.AccountFriend.accountFriend); + } + + /** + * Create a detached, initialised AccountFriend + */ + public AccountFriend(java.lang.Integer id, java.lang.String uuidSource, java.lang.String uuidTarget, java.lang.Byte mutual) { + super(mineplex.database.tables.AccountFriend.accountFriend); + + setValue(0, id); + setValue(1, uuidSource); + setValue(2, uuidTarget); + setValue(3, mutual); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountInventory.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountInventory.java new file mode 100644 index 000000000..8851c1982 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountInventory.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = 522435571; + + /** + * Setter for Account.accountInventory.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accountInventory.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accountInventory.accountId. + */ + public void setAccountId(java.lang.Integer value) { + setValue(1, value); + } + + /** + * Getter for Account.accountInventory.accountId. + */ + public java.lang.Integer getAccountId() { + return (java.lang.Integer) getValue(1); + } + + /** + * Setter for Account.accountInventory.itemId. + */ + public void setItemId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.accountInventory.itemId. + */ + public java.lang.Integer getItemId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.accountInventory.count. + */ + public void setCount(java.lang.Integer value) { + setValue(3, value); + } + + /** + * Getter for Account.accountInventory.count. + */ + public java.lang.Integer getCount() { + return (java.lang.Integer) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.AccountInventory.accountInventory.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.AccountInventory.accountInventory.accountId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.AccountInventory.accountInventory.itemId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.AccountInventory.accountInventory.count; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value2() { + return getAccountId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getItemId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value4() { + return getCount(); + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInventory value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInventory value2(java.lang.Integer value) { + setAccountId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInventory value3(java.lang.Integer value) { + setItemId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInventory value4(java.lang.Integer value) { + setCount(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInventory values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccountInventory + */ + public AccountInventory() { + super(mineplex.database.tables.AccountInventory.accountInventory); + } + + /** + * Create a detached, initialised AccountInventory + */ + public AccountInventory(java.lang.Integer id, java.lang.Integer accountId, java.lang.Integer itemId, java.lang.Integer count) { + super(mineplex.database.tables.AccountInventory.accountInventory); + + setValue(0, id); + setValue(1, accountId); + setValue(2, itemId); + setValue(3, count); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPolls.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPolls.java new file mode 100644 index 000000000..5e582d661 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPolls.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = -769198627; + + /** + * Setter for Account.accountPolls.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accountPolls.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accountPolls.accountId. + */ + public void setAccountId(java.lang.Integer value) { + setValue(1, value); + } + + /** + * Getter for Account.accountPolls.accountId. + */ + public java.lang.Integer getAccountId() { + return (java.lang.Integer) getValue(1); + } + + /** + * Setter for Account.accountPolls.pollId. + */ + public void setPollId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.accountPolls.pollId. + */ + public java.lang.Integer getPollId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.accountPolls.value. + */ + public void setValue(java.lang.Byte value) { + setValue(3, value); + } + + /** + * Getter for Account.accountPolls.value. + */ + public java.lang.Byte getValue() { + return (java.lang.Byte) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.AccountPolls.accountPolls.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.AccountPolls.accountPolls.accountId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.AccountPolls.accountPolls.pollId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.AccountPolls.accountPolls.value; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value2() { + return getAccountId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getPollId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value4() { + return getValue(); + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPolls value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPolls value2(java.lang.Integer value) { + setAccountId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPolls value3(java.lang.Integer value) { + setPollId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPolls value4(java.lang.Byte value) { + setValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPolls values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Byte value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccountPolls + */ + public AccountPolls() { + super(mineplex.database.tables.AccountPolls.accountPolls); + } + + /** + * Create a detached, initialised AccountPolls + */ + public AccountPolls(java.lang.Integer id, java.lang.Integer accountId, java.lang.Integer pollId, java.lang.Byte value) { + super(mineplex.database.tables.AccountPolls.accountPolls); + + setValue(0, id); + setValue(1, accountId); + setValue(2, pollId); + setValue(3, value); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPreferences.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPreferences.java new file mode 100644 index 000000000..f453b7108 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountPreferences.java @@ -0,0 +1,514 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record11 { + + private static final long serialVersionUID = -1178063501; + + /** + * Setter for Account.accountPreferences.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accountPreferences.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accountPreferences.uuid. + */ + public void setUuid(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.accountPreferences.uuid. + */ + public java.lang.String getUuid() { + return (java.lang.String) getValue(1); + } + + /** + * Setter for Account.accountPreferences.filterChat. + */ + public void setFilterChat(java.lang.Byte value) { + setValue(2, value); + } + + /** + * Getter for Account.accountPreferences.filterChat. + */ + public java.lang.Byte getFilterChat() { + return (java.lang.Byte) getValue(2); + } + + /** + * Setter for Account.accountPreferences.invisibility. + */ + public void setInvisibility(java.lang.Byte value) { + setValue(3, value); + } + + /** + * Getter for Account.accountPreferences.invisibility. + */ + public java.lang.Byte getInvisibility() { + return (java.lang.Byte) getValue(3); + } + + /** + * Setter for Account.accountPreferences.games. + */ + public void setGames(java.lang.Byte value) { + setValue(4, value); + } + + /** + * Getter for Account.accountPreferences.games. + */ + public java.lang.Byte getGames() { + return (java.lang.Byte) getValue(4); + } + + /** + * Setter for Account.accountPreferences.visibility. + */ + public void setVisibility(java.lang.Byte value) { + setValue(5, value); + } + + /** + * Getter for Account.accountPreferences.visibility. + */ + public java.lang.Byte getVisibility() { + return (java.lang.Byte) getValue(5); + } + + /** + * Setter for Account.accountPreferences.friendChat. + */ + public void setFriendChat(java.lang.Byte value) { + setValue(6, value); + } + + /** + * Getter for Account.accountPreferences.friendChat. + */ + public java.lang.Byte getFriendChat() { + return (java.lang.Byte) getValue(6); + } + + /** + * Setter for Account.accountPreferences.privateMessaging. + */ + public void setPrivateMessaging(java.lang.Byte value) { + setValue(7, value); + } + + /** + * Getter for Account.accountPreferences.privateMessaging. + */ + public java.lang.Byte getPrivateMessaging() { + return (java.lang.Byte) getValue(7); + } + + /** + * Setter for Account.accountPreferences.showChat. + */ + public void setShowChat(java.lang.Byte value) { + setValue(8, value); + } + + /** + * Getter for Account.accountPreferences.showChat. + */ + public java.lang.Byte getShowChat() { + return (java.lang.Byte) getValue(8); + } + + /** + * Setter for Account.accountPreferences.partyRequests. + */ + public void setPartyRequests(java.lang.Byte value) { + setValue(9, value); + } + + /** + * Getter for Account.accountPreferences.partyRequests. + */ + public java.lang.Byte getPartyRequests() { + return (java.lang.Byte) getValue(9); + } + + /** + * Setter for Account.accountPreferences.forcefield. + */ + public void setForcefield(java.lang.Byte value) { + setValue(10, value); + } + + /** + * Getter for Account.accountPreferences.forcefield. + */ + public java.lang.Byte getForcefield() { + return (java.lang.Byte) getValue(10); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row11 fieldsRow() { + return (org.jooq.Row11) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row11 valuesRow() { + return (org.jooq.Row11) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.AccountPreferences.accountPreferences.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.AccountPreferences.accountPreferences.uuid; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.AccountPreferences.accountPreferences.filterChat; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.AccountPreferences.accountPreferences.invisibility; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.AccountPreferences.accountPreferences.games; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.AccountPreferences.accountPreferences.visibility; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.AccountPreferences.accountPreferences.friendChat; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field8() { + return mineplex.database.tables.AccountPreferences.accountPreferences.privateMessaging; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field9() { + return mineplex.database.tables.AccountPreferences.accountPreferences.showChat; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field10() { + return mineplex.database.tables.AccountPreferences.accountPreferences.partyRequests; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field11() { + return mineplex.database.tables.AccountPreferences.accountPreferences.forcefield; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getUuid(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value3() { + return getFilterChat(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value4() { + return getInvisibility(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value5() { + return getGames(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value6() { + return getVisibility(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value7() { + return getFriendChat(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value8() { + return getPrivateMessaging(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value9() { + return getShowChat(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value10() { + return getPartyRequests(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value11() { + return getForcefield(); + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value2(java.lang.String value) { + setUuid(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value3(java.lang.Byte value) { + setFilterChat(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value4(java.lang.Byte value) { + setInvisibility(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value5(java.lang.Byte value) { + setGames(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value6(java.lang.Byte value) { + setVisibility(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value7(java.lang.Byte value) { + setFriendChat(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value8(java.lang.Byte value) { + setPrivateMessaging(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value9(java.lang.Byte value) { + setShowChat(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value10(java.lang.Byte value) { + setPartyRequests(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences value11(java.lang.Byte value) { + setForcefield(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPreferences values(java.lang.Integer value1, java.lang.String value2, java.lang.Byte value3, java.lang.Byte value4, java.lang.Byte value5, java.lang.Byte value6, java.lang.Byte value7, java.lang.Byte value8, java.lang.Byte value9, java.lang.Byte value10, java.lang.Byte value11) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccountPreferences + */ + public AccountPreferences() { + super(mineplex.database.tables.AccountPreferences.accountPreferences); + } + + /** + * Create a detached, initialised AccountPreferences + */ + public AccountPreferences(java.lang.Integer id, java.lang.String uuid, java.lang.Byte filterChat, java.lang.Byte invisibility, java.lang.Byte games, java.lang.Byte visibility, java.lang.Byte friendChat, java.lang.Byte privateMessaging, java.lang.Byte showChat, java.lang.Byte partyRequests, java.lang.Byte forcefield) { + super(mineplex.database.tables.AccountPreferences.accountPreferences); + + setValue(0, id); + setValue(1, uuid); + setValue(2, filterChat); + setValue(3, invisibility); + setValue(4, games); + setValue(5, visibility); + setValue(6, friendChat); + setValue(7, privateMessaging); + setValue(8, showChat); + setValue(9, partyRequests); + setValue(10, forcefield); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStats.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStats.java new file mode 100644 index 000000000..91a939036 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStats.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = -802873941; + + /** + * Setter for Account.accountStats.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accountStats.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accountStats.accountId. + */ + public void setAccountId(java.lang.Integer value) { + setValue(1, value); + } + + /** + * Getter for Account.accountStats.accountId. + */ + public java.lang.Integer getAccountId() { + return (java.lang.Integer) getValue(1); + } + + /** + * Setter for Account.accountStats.statId. + */ + public void setStatId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.accountStats.statId. + */ + public java.lang.Integer getStatId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.accountStats.value. + */ + public void setValue(java.lang.Integer value) { + setValue(3, value); + } + + /** + * Getter for Account.accountStats.value. + */ + public java.lang.Integer getValue() { + return (java.lang.Integer) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.AccountStats.accountStats.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.AccountStats.accountStats.accountId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.AccountStats.accountStats.statId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.AccountStats.accountStats.value; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value2() { + return getAccountId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getStatId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value4() { + return getValue(); + } + + /** + * {@inheritDoc} + */ + @Override + public AccountStats value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountStats value2(java.lang.Integer value) { + setAccountId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountStats value3(java.lang.Integer value) { + setStatId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountStats value4(java.lang.Integer value) { + setValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountStats values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AccountStats + */ + public AccountStats() { + super(mineplex.database.tables.AccountStats.accountStats); + } + + /** + * Create a detached, initialised AccountStats + */ + public AccountStats(java.lang.Integer id, java.lang.Integer accountId, java.lang.Integer statId, java.lang.Integer value) { + super(mineplex.database.tables.AccountStats.accountStats); + + setValue(0, id); + setValue(1, accountId); + setValue(2, statId); + setValue(3, value); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Accounts.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Accounts.java new file mode 100644 index 000000000..940398825 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Accounts.java @@ -0,0 +1,434 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9 { + + private static final long serialVersionUID = -1222920421; + + /** + * Setter for Account.accounts.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.accounts.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.accounts.uuid. + */ + public void setUuid(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.accounts.uuid. + */ + public java.lang.String getUuid() { + return (java.lang.String) getValue(1); + } + + /** + * Setter for Account.accounts.name. + */ + public void setName(java.lang.String value) { + setValue(2, value); + } + + /** + * Getter for Account.accounts.name. + */ + public java.lang.String getName() { + return (java.lang.String) getValue(2); + } + + /** + * Setter for Account.accounts.gems. + */ + public void setGems(java.lang.Integer value) { + setValue(3, value); + } + + /** + * Getter for Account.accounts.gems. + */ + public java.lang.Integer getGems() { + return (java.lang.Integer) getValue(3); + } + + /** + * Setter for Account.accounts.rank. + */ + public void setRank(java.lang.String value) { + setValue(4, value); + } + + /** + * Getter for Account.accounts.rank. + */ + public java.lang.String getRank() { + return (java.lang.String) getValue(4); + } + + /** + * Setter for Account.accounts.rankPerm. + */ + public void setRankPerm(java.lang.Byte value) { + setValue(5, value); + } + + /** + * Getter for Account.accounts.rankPerm. + */ + public java.lang.Byte getRankPerm() { + return (java.lang.Byte) getValue(5); + } + + /** + * Setter for Account.accounts.rankExpire. + */ + public void setRankExpire(java.lang.String value) { + setValue(6, value); + } + + /** + * Getter for Account.accounts.rankExpire. + */ + public java.lang.String getRankExpire() { + return (java.lang.String) getValue(6); + } + + /** + * Setter for Account.accounts.lastLogin. + */ + public void setLastLogin(java.lang.String value) { + setValue(7, value); + } + + /** + * Getter for Account.accounts.lastLogin. + */ + public java.lang.String getLastLogin() { + return (java.lang.String) getValue(7); + } + + /** + * Setter for Account.accounts.totalPlayTime. + */ + public void setTotalPlayTime(java.lang.String value) { + setValue(8, value); + } + + /** + * Getter for Account.accounts.totalPlayTime. + */ + public java.lang.String getTotalPlayTime() { + return (java.lang.String) getValue(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row9 fieldsRow() { + return (org.jooq.Row9) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row9 valuesRow() { + return (org.jooq.Row9) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.Accounts.accounts.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.Accounts.accounts.uuid; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.Accounts.accounts.name; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.Accounts.accounts.gems; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.Accounts.accounts.rank; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.Accounts.accounts.rankPerm; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.Accounts.accounts.rankExpire; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field8() { + return mineplex.database.tables.Accounts.accounts.lastLogin; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field9() { + return mineplex.database.tables.Accounts.accounts.totalPlayTime; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getUuid(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value4() { + return getGems(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value5() { + return getRank(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value6() { + return getRankPerm(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value7() { + return getRankExpire(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value8() { + return getLastLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value9() { + return getTotalPlayTime(); + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value2(java.lang.String value) { + setUuid(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value3(java.lang.String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value4(java.lang.Integer value) { + setGems(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value5(java.lang.String value) { + setRank(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value6(java.lang.Byte value) { + setRankPerm(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value7(java.lang.String value) { + setRankExpire(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value8(java.lang.String value) { + setLastLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts value9(java.lang.String value) { + setTotalPlayTime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Accounts values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4, java.lang.String value5, java.lang.Byte value6, java.lang.String value7, java.lang.String value8, java.lang.String value9) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached Accounts + */ + public Accounts() { + super(mineplex.database.tables.Accounts.accounts); + } + + /** + * Create a detached, initialised Accounts + */ + public Accounts(java.lang.Integer id, java.lang.String uuid, java.lang.String name, java.lang.Integer gems, java.lang.String rank, java.lang.Byte rankPerm, java.lang.String rankExpire, java.lang.String lastLogin, java.lang.String totalPlayTime) { + super(mineplex.database.tables.Accounts.accounts); + + setValue(0, id); + setValue(1, uuid); + setValue(2, name); + setValue(3, gems); + setValue(4, rank); + setValue(5, rankPerm); + setValue(6, rankExpire); + setValue(7, lastLogin); + setValue(8, totalPlayTime); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/ItemCategories.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/ItemCategories.java new file mode 100644 index 000000000..6ef65fec2 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/ItemCategories.java @@ -0,0 +1,154 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record2 { + + private static final long serialVersionUID = -374955621; + + /** + * Setter for Account.itemCategories.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.itemCategories.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.itemCategories.name. + */ + public void setName(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.itemCategories.name. + */ + public java.lang.String getName() { + return (java.lang.String) getValue(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row2 fieldsRow() { + return (org.jooq.Row2) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row2 valuesRow() { + return (org.jooq.Row2) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.ItemCategories.itemCategories.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.ItemCategories.itemCategories.name; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public ItemCategories value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ItemCategories value2(java.lang.String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ItemCategories values(java.lang.Integer value1, java.lang.String value2) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ItemCategories + */ + public ItemCategories() { + super(mineplex.database.tables.ItemCategories.itemCategories); + } + + /** + * Create a detached, initialised ItemCategories + */ + public ItemCategories(java.lang.Integer id, java.lang.String name) { + super(mineplex.database.tables.ItemCategories.itemCategories); + + setValue(0, id); + setValue(1, name); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Items.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Items.java new file mode 100644 index 000000000..41eb34b30 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Items.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = -1795250209; + + /** + * Setter for Account.items.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.items.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.items.name. + */ + public void setName(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.items.name. + */ + public java.lang.String getName() { + return (java.lang.String) getValue(1); + } + + /** + * Setter for Account.items.categoryId. + */ + public void setCategoryId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.items.categoryId. + */ + public java.lang.Integer getCategoryId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.items.rarity. + */ + public void setRarity(java.lang.Integer value) { + setValue(3, value); + } + + /** + * Getter for Account.items.rarity. + */ + public java.lang.Integer getRarity() { + return (java.lang.Integer) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.Items.items.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.Items.items.name; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.Items.items.categoryId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.Items.items.rarity; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getCategoryId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value4() { + return getRarity(); + } + + /** + * {@inheritDoc} + */ + @Override + public Items value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Items value2(java.lang.String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Items value3(java.lang.Integer value) { + setCategoryId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Items value4(java.lang.Integer value) { + setRarity(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Items values(java.lang.Integer value1, java.lang.String value2, java.lang.Integer value3, java.lang.Integer value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached Items + */ + public Items() { + super(mineplex.database.tables.Items.items); + } + + /** + * Create a detached, initialised Items + */ + public Items(java.lang.Integer id, java.lang.String name, java.lang.Integer categoryId, java.lang.Integer rarity) { + super(mineplex.database.tables.Items.items); + + setValue(0, id); + setValue(1, name); + setValue(2, categoryId); + setValue(3, rarity); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/PlayerMap.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/PlayerMap.java new file mode 100644 index 000000000..552c0000e --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/PlayerMap.java @@ -0,0 +1,234 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4 { + + private static final long serialVersionUID = -1149558408; + + /** + * Setter for Account.playerMap.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.playerMap.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.playerMap.playerName. + */ + public void setPlayerName(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.playerMap.playerName. + */ + public java.lang.String getPlayerName() { + return (java.lang.String) getValue(1); + } + + /** + * Setter for Account.playerMap.serverName. + */ + public void setServerName(java.lang.String value) { + setValue(2, value); + } + + /** + * Getter for Account.playerMap.serverName. + */ + public java.lang.String getServerName() { + return (java.lang.String) getValue(2); + } + + /** + * Setter for Account.playerMap.us. + */ + public void setUs(java.lang.Byte value) { + setValue(3, value); + } + + /** + * Getter for Account.playerMap.us. + */ + public java.lang.Byte getUs() { + return (java.lang.Byte) getValue(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 fieldsRow() { + return (org.jooq.Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row4 valuesRow() { + return (org.jooq.Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.PlayerMap.playerMap.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.PlayerMap.playerMap.playerName; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.PlayerMap.playerMap.serverName; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.PlayerMap.playerMap.us; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getPlayerName(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value3() { + return getServerName(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Byte value4() { + return getUs(); + } + + /** + * {@inheritDoc} + */ + @Override + public PlayerMap value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PlayerMap value2(java.lang.String value) { + setPlayerName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PlayerMap value3(java.lang.String value) { + setServerName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PlayerMap value4(java.lang.Byte value) { + setUs(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PlayerMap values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Byte value4) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PlayerMap + */ + public PlayerMap() { + super(mineplex.database.tables.PlayerMap.playerMap); + } + + /** + * Create a detached, initialised PlayerMap + */ + public PlayerMap(java.lang.Integer id, java.lang.String playerName, java.lang.String serverName, java.lang.Byte us) { + super(mineplex.database.tables.PlayerMap.playerMap); + + setValue(0, id); + setValue(1, playerName); + setValue(2, serverName); + setValue(3, us); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Polls.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Polls.java new file mode 100644 index 000000000..c73208ed1 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Polls.java @@ -0,0 +1,394 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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 Polls extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record8 { + + private static final long serialVersionUID = 1807349031; + + /** + * Setter for Account.polls.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.polls.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.polls.enabled. + */ + public void setEnabled(java.lang.Boolean value) { + setValue(1, value); + } + + /** + * Getter for Account.polls.enabled. + */ + public java.lang.Boolean getEnabled() { + return (java.lang.Boolean) getValue(1); + } + + /** + * Setter for Account.polls.question. + */ + public void setQuestion(java.lang.String value) { + setValue(2, value); + } + + /** + * Getter for Account.polls.question. + */ + public java.lang.String getQuestion() { + return (java.lang.String) getValue(2); + } + + /** + * Setter for Account.polls.answerA. + */ + public void setAnswerA(java.lang.String value) { + setValue(3, value); + } + + /** + * Getter for Account.polls.answerA. + */ + public java.lang.String getAnswerA() { + return (java.lang.String) getValue(3); + } + + /** + * Setter for Account.polls.answerB. + */ + public void setAnswerB(java.lang.String value) { + setValue(4, value); + } + + /** + * Getter for Account.polls.answerB. + */ + public java.lang.String getAnswerB() { + return (java.lang.String) getValue(4); + } + + /** + * Setter for Account.polls.answerC. + */ + public void setAnswerC(java.lang.String value) { + setValue(5, value); + } + + /** + * Getter for Account.polls.answerC. + */ + public java.lang.String getAnswerC() { + return (java.lang.String) getValue(5); + } + + /** + * Setter for Account.polls.answerD. + */ + public void setAnswerD(java.lang.String value) { + setValue(6, value); + } + + /** + * Getter for Account.polls.answerD. + */ + public java.lang.String getAnswerD() { + return (java.lang.String) getValue(6); + } + + /** + * Setter for Account.polls.coinReward. + */ + public void setCoinReward(java.lang.Integer value) { + setValue(7, value); + } + + /** + * Getter for Account.polls.coinReward. + */ + public java.lang.Integer getCoinReward() { + return (java.lang.Integer) getValue(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row8 fieldsRow() { + return (org.jooq.Row8) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row8 valuesRow() { + return (org.jooq.Row8) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.Polls.polls.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.Polls.polls.enabled; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.Polls.polls.question; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.Polls.polls.answerA; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.Polls.polls.answerB; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.Polls.polls.answerC; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.Polls.polls.answerD; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field8() { + return mineplex.database.tables.Polls.polls.coinReward; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Boolean value2() { + return getEnabled(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value3() { + return getQuestion(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value4() { + return getAnswerA(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value5() { + return getAnswerB(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value6() { + return getAnswerC(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value7() { + return getAnswerD(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value8() { + return getCoinReward(); + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value2(java.lang.Boolean value) { + setEnabled(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value3(java.lang.String value) { + setQuestion(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value4(java.lang.String value) { + setAnswerA(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value5(java.lang.String value) { + setAnswerB(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value6(java.lang.String value) { + setAnswerC(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value7(java.lang.String value) { + setAnswerD(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls value8(java.lang.Integer value) { + setCoinReward(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Polls values(java.lang.Integer value1, java.lang.Boolean value2, java.lang.String value3, java.lang.String value4, java.lang.String value5, java.lang.String value6, java.lang.String value7, java.lang.Integer value8) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached Polls + */ + public Polls() { + super(mineplex.database.tables.Polls.polls); + } + + /** + * Create a detached, initialised Polls + */ + public Polls(java.lang.Integer id, java.lang.Boolean enabled, java.lang.String question, java.lang.String answerA, java.lang.String answerB, java.lang.String answerC, java.lang.String answerD, java.lang.Integer coinReward) { + super(mineplex.database.tables.Polls.polls); + + setValue(0, id); + setValue(1, enabled); + setValue(2, question); + setValue(3, answerA); + setValue(4, answerB); + setValue(5, answerC); + setValue(6, answerD); + setValue(7, coinReward); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Stats.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Stats.java new file mode 100644 index 000000000..69daf4fce --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/Stats.java @@ -0,0 +1,154 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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 Stats extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record2 { + + private static final long serialVersionUID = 1558297009; + + /** + * Setter for Account.stats.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.stats.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.stats.name. + */ + public void setName(java.lang.String value) { + setValue(1, value); + } + + /** + * Getter for Account.stats.name. + */ + public java.lang.String getName() { + return (java.lang.String) getValue(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row2 fieldsRow() { + return (org.jooq.Row2) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row2 valuesRow() { + return (org.jooq.Row2) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.Stats.stats.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.Stats.stats.name; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value2() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Stats value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Stats value2(java.lang.String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Stats values(java.lang.Integer value1, java.lang.String value2) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached Stats + */ + public Stats() { + super(mineplex.database.tables.Stats.stats); + } + + /** + * Create a detached, initialised Stats + */ + public Stats(java.lang.Integer id, java.lang.String name) { + super(mineplex.database.tables.Stats.stats); + + setValue(0, id); + setValue(1, name); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/TournamentLeaderboard.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/TournamentLeaderboard.java new file mode 100644 index 000000000..7ceda5586 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/TournamentLeaderboard.java @@ -0,0 +1,354 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables.records; + +/** + * 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 TournamentLeaderboard extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record7 { + + private static final long serialVersionUID = -1193236965; + + /** + * Setter for Account.tournamentLeaderboard.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.tournamentLeaderboard.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.tournamentLeaderboard.tournamentId. + */ + public void setTournamentId(java.lang.Integer value) { + setValue(1, value); + } + + /** + * Getter for Account.tournamentLeaderboard.tournamentId. + */ + public java.lang.Integer getTournamentId() { + return (java.lang.Integer) getValue(1); + } + + /** + * Setter for Account.tournamentLeaderboard.accountId. + */ + public void setAccountId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.tournamentLeaderboard.accountId. + */ + public java.lang.Integer getAccountId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.tournamentLeaderboard.gameId. + */ + public void setGameId(java.lang.Integer value) { + setValue(3, value); + } + + /** + * Getter for Account.tournamentLeaderboard.gameId. + */ + public java.lang.Integer getGameId() { + return (java.lang.Integer) getValue(3); + } + + /** + * Setter for Account.tournamentLeaderboard.wins. + */ + public void setWins(java.lang.Integer value) { + setValue(4, value); + } + + /** + * Getter for Account.tournamentLeaderboard.wins. + */ + public java.lang.Integer getWins() { + return (java.lang.Integer) getValue(4); + } + + /** + * Setter for Account.tournamentLeaderboard.total. + */ + public void setTotal(java.lang.Integer value) { + setValue(5, value); + } + + /** + * Getter for Account.tournamentLeaderboard.total. + */ + public java.lang.Integer getTotal() { + return (java.lang.Integer) getValue(5); + } + + /** + * Setter for Account.tournamentLeaderboard.ratio. + */ + public void setRatio(java.lang.Double value) { + setValue(6, value); + } + + /** + * Getter for Account.tournamentLeaderboard.ratio. + */ + public java.lang.Double getRatio() { + return (java.lang.Double) getValue(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row7 fieldsRow() { + return (org.jooq.Row7) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row7 valuesRow() { + return (org.jooq.Row7) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.tournamentId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.accountId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.gameId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.wins; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.total; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.ratio; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value2() { + return getTournamentId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getAccountId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value4() { + return getGameId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value5() { + return getWins(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value6() { + return getTotal(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Double value7() { + return getRatio(); + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value2(java.lang.Integer value) { + setTournamentId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value3(java.lang.Integer value) { + setAccountId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value4(java.lang.Integer value) { + setGameId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value5(java.lang.Integer value) { + setWins(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value6(java.lang.Integer value) { + setTotal(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard value7(java.lang.Double value) { + setRatio(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TournamentLeaderboard values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4, java.lang.Integer value5, java.lang.Integer value6, java.lang.Double value7) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TournamentLeaderboard + */ + public TournamentLeaderboard() { + super(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard); + } + + /** + * Create a detached, initialised TournamentLeaderboard + */ + public TournamentLeaderboard(java.lang.Integer id, java.lang.Integer tournamentId, java.lang.Integer accountId, java.lang.Integer gameId, java.lang.Integer wins, java.lang.Integer total, java.lang.Double ratio) { + super(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard); + + setValue(0, id); + setValue(1, tournamentId); + setValue(2, accountId); + setValue(3, gameId); + setValue(4, wins); + setValue(5, total); + setValue(6, ratio); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/jooq/AsInDatabaseStrategy.java b/Plugins/Mineplex.Database/src/mineplex/jooq/AsInDatabaseStrategy.java new file mode 100644 index 000000000..ee098569d --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/jooq/AsInDatabaseStrategy.java @@ -0,0 +1,126 @@ +package mineplex.jooq; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; + +import org.jooq.util.DefaultGeneratorStrategy; +import org.jooq.util.Definition; + +/** + * It is recommended that you extend the DefaultGeneratorStrategy. Most of the + * GeneratorStrategy API is already declared final. You only need to override any + * of the following methods, for whatever generation behaviour you'd like to achieve + *

+ * Beware that most methods also receive a "Mode" object, to tell you whether a + * TableDefinition is being rendered as a Table, Record, POJO, etc. Depending on + * that information, you can add a suffix only for TableRecords, not for Tables + */ +public class AsInDatabaseStrategy extends DefaultGeneratorStrategy +{ + /** + * Override this to specify what identifiers in Java should look like. + * This will just take the identifier as defined in the database. + */ + @Override + public String getJavaIdentifier(Definition definition) + { + return definition.getOutputName(); + } + + /** + * Override these to specify what a setter in Java should look like. Setters + * are used in TableRecords, UDTRecords, and POJOs. This example will name + * setters "set[NAME_IN_DATABASE]" + */ + @Override + public String getJavaSetterName(Definition definition, Mode mode) + { + return "set" + definition.getOutputName().substring(0, 1).toUpperCase() + definition.getOutputName().substring(1); + } + + /** + * Just like setters... + */ + @Override + public String getJavaGetterName(Definition definition, Mode mode) + { + return "get" + definition.getOutputName().substring(0, 1).toUpperCase() + definition.getOutputName().substring(1); + } + + /** + * Override this method to define what a Java method generated from a database + * Definition should look like. This is used mostly for convenience methods + * when calling stored procedures and functions. This example shows how to + * set a prefix to a CamelCase version of your procedure + */ + @Override + public String getJavaMethodName(Definition definition, Mode mode) + { + return "call" + org.jooq.tools.StringUtils.toCamelCase(definition.getOutputName()); + } + + /** + * Override this method to define how your Java classes and Java files should + * be named. This example applies no custom setting and uses CamelCase versions + * instead + */ + @Override + public String getJavaClassName(Definition definition, Mode mode) + { + return definition.getOutputName().substring(0, 1).toUpperCase() + definition.getOutputName().substring(1); + } + + /** + * Override this method to re-define the package names of your generated + * artefacts. + */ + @Override + public String getJavaPackageName(Definition definition, Mode mode) + { + return super.getJavaPackageName(definition, mode); + } + + /** + * Override this method to define how Java members should be named. This is + * used for POJOs and method arguments + */ + @Override + public String getJavaMemberName(Definition definition, Mode mode) + { + return definition.getOutputName(); + } + + /** + * Override this method to define the base class for those artifacts that + * allow for custom base classes + */ + @Override + public String getJavaClassExtends(Definition definition, Mode mode) + { + return Object.class.getName(); + } + + /** + * Override this method to define the interfaces to be implemented by those + * artefacts that allow for custom interface implementation + */ + @Override + public List getJavaClassImplements(Definition definition, Mode mode) + { + return Arrays.asList(Serializable.class.getName(), Cloneable.class.getName()); + } + + /** + * Override this method to define the suffix to apply to routines when + * they are overloaded. + *

+ * Use this to resolve compile-time conflicts in generated source code, in + * case you make heavy use of procedure overloading + */ + @Override + public String getOverloadSuffix(Definition definition, Mode mode, String overloadIndex) + { + return "_OverloadIndex_" + overloadIndex; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index 34dc35492..d565f52bb 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -1,10 +1,9 @@ package mineplex.hub; -import net.minecraft.server.v1_7_R4.MinecraftServer; - import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.CustomTagFix; import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; import mineplex.core.antistack.AntiStack; @@ -92,12 +91,12 @@ public class Hub extends JavaPlugin implements IRelation //Main Modules ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager)); - PacketHandler packetHandler = new PacketHandler(this); //new FriendManager(this, packetHandler); PartyManager partyManager = new PartyManager(this, clientManager, preferenceManager); Portal portal = new Portal(this, serverStatusManager.getCurrentServerName()); AntiHack.Initialize(this, punish, portal); - HubManager hubManager = new HubManager(this, new BlockRestore(this), clientManager, donationManager, new ConditionManager(this), new DisguiseManager(this, packetHandler), new TaskManager(this, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager); + DisguiseManager disguiseManager = new DisguiseManager(this); + HubManager hubManager = new HubManager(this, new BlockRestore(this), clientManager, donationManager, new ConditionManager(this), disguiseManager, new TaskManager(this, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager); new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs()); QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this), partyManager); @@ -106,13 +105,15 @@ public class Hub extends JavaPlugin implements IRelation new Chat(this, clientManager, preferenceManager, serverStatusManager.getCurrentServerName()); new MemoryFix(this); new FileUpdater(this, portal); + new CustomTagFix(this); + new PacketHandler(this); CombatManager combatManager = new CombatManager(this); BlockRestore blockRestore = new BlockRestore(this); ProjectileManager throwManager = new ProjectileManager(this); SkillConditionManager conditionManager = new SkillConditionManager(this); - DamageManager damage = new DamageManager(this, combatManager, npcManager, new DisguiseManager(this, packetHandler)); + DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager); Fire fire = new Fire(this, conditionManager, damage); Teleport teleport = new Teleport(this, clientManager, new Spawn(this)); Energy energy = new Energy(this); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 05c6b7458..a0651240d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -54,7 +54,6 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; -import mineplex.core.treasure.TreasureManager; import mineplex.minecraft.game.core.condition.ConditionManager; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.disguise.DisguiseManager; @@ -115,7 +114,6 @@ public class HubManager extends MiniClientPlugin private InventoryManager _inventoryManager; private NewsManager _news; private AchievementManager _achievementManager; - private PollManager _pollManager; private Location _spawn; private int _scoreboardTick = 0; @@ -164,7 +162,6 @@ public class HubManager extends MiniClientPlugin _partyManager = partyManager; _preferences = preferences; - _pollManager = pollManager; _tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator); _visibilityManager = new VisibilityManager(this); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 41f61537d..8c96368f1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -42,6 +42,7 @@ public class ServerGameMenu extends ShopPageBase BuildPage(); } + @SuppressWarnings("deprecation") @Override protected void BuildPage() { @@ -118,6 +119,7 @@ public class ServerGameMenu extends ShopPageBase ButtonMap.put(26, new SelectMINButton(this)); } + @SuppressWarnings("deprecation") private void createMinigameCycle() { _minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index d9f6a9fa7..97bf8a546 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -25,7 +25,6 @@ import mineplex.hub.server.ui.button.JoinServerButton; public class ServerNpcPage extends ShopPageBase implements IServerPage { // Shop Item Messages - private static final String MESSAGE_SHOP_URL = ChatColor.RESET + "www.mineplex.com/shop"; private static final String MESSAGE_BETA_GET_ULTRA = ChatColor.RESET + C.Line + "Get Ultra to join Beta servers!"; private static final String MESSAGE_JOIN = ChatColor.RESET + C.Line + "Click to Join"; private static final String MESSAGE_IN_PROGRESS = ChatColor.RESET + C.Line + "Game in Progress."; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index fffe47c93..dd25b37b9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -8,6 +8,7 @@ import java.io.FileInputStream; import java.io.FileWriter; import java.io.InputStreamReader; +import mineplex.core.CustomTagFix; import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; import mineplex.core.antistack.AntiStack; @@ -44,7 +45,6 @@ import mineplex.core.updater.Updater; import mineplex.minecraft.game.core.combat.CombatManager; import mineplex.minecraft.game.core.damage.DamageManager; import nautilus.game.arcade.game.GameServerConfig; -import net.minecraft.server.*; import net.minecraft.server.v1_7_R4.MinecraftServer; import org.bukkit.entity.Player; @@ -97,8 +97,7 @@ public class Arcade extends JavaPlugin Portal portal = new Portal(this, serverStatusManager.getCurrentServerName()); new FileUpdater(this, portal); - PacketHandler packetHandler = new PacketHandler(this); - DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler); + DisguiseManager disguiseManager = new DisguiseManager(this); _damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager); @@ -116,9 +115,11 @@ public class Arcade extends JavaPlugin GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager); CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, true); cosmeticManager.setInterfaceSlot(7); + new CustomTagFix(this); + new PacketHandler(this); //Arcade Manager - _gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, packetHandler, preferenceManager, inventoryManager, cosmeticManager, projectileManager, webServerAddress); + _gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, preferenceManager, inventoryManager, cosmeticManager, projectileManager, webServerAddress); new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs()); new MemoryFix(this); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index a7c1aa048..a778ebc43 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import mineplex.core.leaderboard.LeaderboardRepository; import nautilus.game.arcade.addons.*; import nautilus.game.arcade.command.*; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -63,13 +64,11 @@ import mineplex.core.chat.Chat; import mineplex.core.common.Rank; import mineplex.core.common.util.*; import mineplex.minecraft.game.core.condition.ConditionManager; -import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.creature.Creature; import mineplex.core.disguise.DisguiseManager; import mineplex.core.donation.DonationManager; import mineplex.core.movement.Movement; -import mineplex.core.packethandler.PacketHandler; import mineplex.core.elo.EloManager; import mineplex.core.energy.Energy; import mineplex.core.explosion.Explosion; @@ -122,6 +121,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation private ClassShopManager _classShopManager; private ClassCombatShop _classShop; private TaskManager _taskManager; + private LeaderboardRepository _leaderboardRepository; private EloManager _eloManager; @@ -139,7 +139,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation public ArcadeManager(Arcade plugin, ServerStatusManager serverStatusManager, GameServerConfig serverConfig, CoreClientManager clientManager, DonationManager donationManager, DamageManager damageManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, AntiStack antistack, - Portal portal, PacketHandler packetHandler, PreferencesManager preferences, InventoryManager inventoryManager, + Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, CosmeticManager cosmeticManager, ProjectileManager projectileManager, String webAddress) { super("Game Manager", plugin); @@ -227,7 +227,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation _gameCreationManager = new GameCreationManager(this); _gameGemManager = new GameGemManager(this); _gameManager = new GameManager(this); - _gameLobbyManager = new GameLobbyManager(this, packetHandler); + _gameLobbyManager = new GameLobbyManager(this); new GameFlagManager(this); _gamePlayerManager = new GamePlayerManager(this); new GameAchievementManager(this); @@ -235,6 +235,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation new MiscManager(this); new IdleManager(this); + _leaderboardRepository = new LeaderboardRepository(plugin); + // Game Addons new CompassAddon(plugin, this); new SoupAddon(plugin, this); @@ -952,4 +954,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation } } } + + public LeaderboardRepository getLeaderboardRepository() + { + return _leaderboardRepository; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/TournamentType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/TournamentType.java new file mode 100644 index 000000000..63e4899d0 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/TournamentType.java @@ -0,0 +1,42 @@ +package nautilus.game.arcade; + +import java.util.EnumSet; +import java.util.Set; + +public enum TournamentType +{ + SUPER_SMASH_MOBS(GameType.Smash), + SURVIVAL_GAMES(GameType.SurvivalGames), + MIXED_ARCADE( + GameType.Dragons, + GameType.DragonEscape, + GameType.DeathTag, + GameType.Runner, + GameType.Snake, + GameType.Spleef, + GameType.SneakyAssassins, + GameType.Quiver); + + private final Set _gameTypes; + + TournamentType(GameType firstGameType, GameType... rest) + { + _gameTypes = EnumSet.of(firstGameType, rest); + } + + public Set getGameTypes() + { + return _gameTypes; + } + + public static TournamentType getTournamentType(GameType gameType) + { + for (TournamentType type : values()) + { + if (type.getGameTypes().contains(gameType)) + return type; + } + + return null; + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 75d7af6cf..e8b51bb50 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -10,6 +10,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeFormat; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; +import nautilus.game.arcade.TournamentType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.PlayerGameRespawnEvent; import nautilus.game.arcade.events.PlayerStateChangeEvent; @@ -1145,6 +1146,31 @@ public abstract class Game implements Listener { for (StatTracker tracker : getStatTrackers()) HandlerList.unregisterAll(tracker); + + if (Manager.IsTournamentServer() && CanAddStats) + { + final TournamentType type = TournamentType.getTournamentType(GetType()); + + if (type != null) + { + final Map data = new HashMap<>(); + + for (Player loser : getLosers()) + data.put(loser.getUniqueId(), false); + + for (Player winner : getWinners()) + data.put(winner.getUniqueId(), true); + + Bukkit.getScheduler().runTaskAsynchronously(Manager.GetPlugin(), new Runnable() + { + @Override + public void run() + { + Manager.getLeaderboardRepository().saveStats(0, type.ordinal(), data); + } + }); + } + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index 23955f66c..ffb647176 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -310,7 +310,7 @@ public class Draw extends SoloGame if (!IsLive()) return; - if (event.getType() != UpdateType.TICK) + if (event.getType() != UpdateType.FAST) return; if (_round == null) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderQuick.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderQuick.java index 27310cb4d..c97599c6e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderQuick.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderQuick.java @@ -1,6 +1,11 @@ package nautilus.game.arcade.game.games.hideseek.kits; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -53,40 +58,6 @@ public class KitHiderQuick extends KitHider slime.SetName(GetAvailability().GetColor() + GetName()); slime.SetCustomNameVisible(true); - DisguiseBlock block = new DisguiseBlock(ent, 46, 0); - - ToBlock(block, slime); - } - - public void ToBlock(final DisguiseBlock block, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - - Manager.GetDisguise().disguise(block); - - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToSlime(block, slime); - } - }, 60); - } - - public void ToSlime(final DisguiseBlock block, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - - Manager.GetDisguise().disguise(slime); - - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToBlock(block, slime); - } - }, 60); + Manager.GetDisguise().disguise(new DisguiseBlock(ent, 46, 0)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderShocker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderShocker.java index 83d23ce0a..d86b557ae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderShocker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderShocker.java @@ -1,6 +1,11 @@ package nautilus.game.arcade.game.games.hideseek.kits; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -52,41 +57,7 @@ public class KitHiderShocker extends KitHider slime.SetSize(2); slime.SetName(GetAvailability().GetColor() + GetName()); slime.SetCustomNameVisible(true); - - DisguiseBlock block = new DisguiseBlock(ent, 61, 0); - - ToBlock(block, slime); - } - - public void ToBlock(final DisguiseBlock block, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - - Manager.GetDisguise().disguise(block); - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToSlime(block, slime); - } - }, 60); - } - - public void ToSlime(final DisguiseBlock block, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - - Manager.GetDisguise().disguise(slime); - - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToBlock(block, slime); - } - }, 60); + Manager.GetDisguise().disguise(new DisguiseBlock(ent, 61, 0)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderSwapper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderSwapper.java index c4dbe3930..32906d002 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderSwapper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/kits/KitHiderSwapper.java @@ -1,6 +1,11 @@ package nautilus.game.arcade.game.games.hideseek.kits; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -52,43 +57,11 @@ public class KitHiderSwapper extends KitHider slime.SetName(GetAvailability().GetColor() + GetName()); slime.SetCustomNameVisible(true); - ToBlock(ent, slime); - } - - public void ToBlock(final LivingEntity ent, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - double r = Math.random(); if (r > 0.75) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 54, 0)); else if (r > 0.5) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 145, 0)); else if (r > 0.25) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 140, 11)); else Manager.GetDisguise().disguise(new DisguiseBlock(ent, 47, 0)); - - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToSlime(ent, slime); - } - }, 60); - } - - public void ToSlime(final LivingEntity ent, final DisguiseSlime slime) - { - if (Manager.GetGame() == null || Manager.GetGame().InProgress()) - return; - - Manager.GetDisguise().disguise(slime); - - UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() - { - public void run() - { - ToBlock(ent, slime); - } - }, 60); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index d591c5116..e9b20582d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -31,7 +31,6 @@ import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryType; -import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.scoreboard.DisplaySlot; @@ -44,23 +43,17 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilText.TextAlign; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; import mineplex.core.cosmetic.event.ActivateGemBoosterEvent; import mineplex.core.donation.Donor; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.packethandler.IPacketRunnable; -import mineplex.core.packethandler.PacketHandler; import mineplex.core.packethandler.PacketVerifier; +import mineplex.core.packethandler.PlayerPacketEvent; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -79,7 +72,7 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; import net.minecraft.server.v1_7_R4.WatchableObject; -public class GameLobbyManager implements IPacketRunnable, Listener +public class GameLobbyManager implements Listener { public ArcadeManager Manager; @@ -111,11 +104,12 @@ public class GameLobbyManager implements IPacketRunnable, Listener private NautHashMap _kitMap = new NautHashMap(); private int _oldPlayerCount = 0; + + private boolean _handlingPacket = false; - public GameLobbyManager(ArcadeManager manager, PacketHandler packetHandler) + public GameLobbyManager(ArcadeManager manager) { Manager = manager; - packetHandler.AddPacketRunnable(this); World world = UtilWorld.getWorld("world"); @@ -1037,19 +1031,22 @@ public class GameLobbyManager implements IPacketRunnable, Listener } @SuppressWarnings("unchecked") - @Override - public boolean run(Packet packet, Player owner, PacketVerifier packetList) + @EventHandler + public void handlePacket(PlayerPacketEvent event) { + if (_handlingPacket) + return; + + Packet packet = event.getPacket(); + Player owner = event.getPlayer(); + PacketVerifier packetVerifier = event.getVerifier(); + int entityId = -1; if (packet instanceof PacketPlayOutEntityMetadata) { entityId = ((PacketPlayOutEntityMetadata)packet).a; } - else if (packet instanceof PacketPlayOutSpawnEntityLiving) - { - //entityId = ((Packet24MobSpawn)packet).a; - } if (entityId != -1) { @@ -1089,15 +1086,11 @@ public class GameLobbyManager implements IPacketRunnable, Listener newPacket.a = entityId; newPacket.b = watchables; - packetList.forceProcess(newPacket); + _handlingPacket = true; + packetVerifier.process(newPacket); + _handlingPacket = false; - return false; - } - else if (packet instanceof PacketPlayOutSpawnEntityLiving) - { - DataWatcher watcher = ((PacketPlayOutSpawnEntityLiving)packet).l; - watcher.watch(10, customName); - watcher.watch(11, Byte.valueOf((byte)1)); + event.setCancelled(true); } } catch (IllegalArgumentException e) @@ -1106,8 +1099,6 @@ public class GameLobbyManager implements IPacketRunnable, Listener } } } - - return true; } public void AddPlayerToScoreboards(Player player, String teamName)