Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2014-10-19 00:08:13 -05:00
commit a47be7a2f6
216 changed files with 7393 additions and 2850 deletions

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="commons-dbcp2">
<CLASSES>
<root url="jar://$PROJECT_DIR$/Libraries/commons-dbcp2-2.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="commons-logging">
<CLASSES>
<root url="jar://$PROJECT_DIR$/Libraries/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -20,6 +20,8 @@
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
<method>
<option name="Make" enabled="false" />
</method>
</configuration>
</component>

View File

@ -12,11 +12,13 @@
<option name="PASS_PARENT_ENVS" value="true" />
<module name="Classpath.Dummy" />
<envs />
<RunnerSettings RunnerId="Cover" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<ConfigurationWrapper RunnerId="Cover" />
<ConfigurationWrapper RunnerId="Debug" />
<method>
<option name="BuildArtifacts" enabled="true">

View File

@ -16,9 +16,17 @@
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/jooq-3.4.2.jar" />
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
</jar>
<copy file="../bin/EnjinTranslator.jar" todir="../../Testing/EnjinTranslator/plugins"/>
</target>

View File

@ -35,8 +35,10 @@
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
</jar>
<copy file="../bin/Arcade.jar" todir="../../Testing/Arcade/plugins"/>
</target>
@ -74,10 +76,12 @@
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/commons-io-2.4.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
<zipfileset src="../Libraries/jooq-3.4.2.jar" />
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
</jar>
<copy file="../bin/Hub.jar" todir="../../Testing/Hub/plugins"/>
</target>
@ -95,20 +99,25 @@
<fileset dir="../Mineplex.StaffServer">
<include name="*.yml"/>
</fileset>
<fileset dir="../Mineplex.Database/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.ServerData/bin">
<include name="**/*.class"/>
</fileset>
<zipfileset src="../Libraries/jooq-3.4.2.jar" />
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/commons-io-2.4.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
<zipfileset src="../Libraries/commons-dbcp2-2.0.1.jar" />
</jar>
<copy file="../bin/StaffServer.jar" todir="../../Testing/StaffServer/plugins"/>
</target>

View File

@ -8,6 +8,9 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="craftbukkit" level="project" />
<orderEntry type="library" name="commons-dbcp2" level="project" />
<orderEntry type="library" name="commons-pool2" level="project" />
<orderEntry type="library" name="commons-logging" level="project" />
</component>
</module>

View File

@ -0,0 +1,73 @@
package net.minecraft.server.v1_7_R4;
import java.io.IOException;
public class PacketPlayOutChat
extends Packet
{
private IChatBaseComponent a;
private boolean b;
private byte _chatType = 0;
public PacketPlayOutChat()
{
this.b = true;
}
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent)
{
this(ichatbasecomponent, true);
}
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, boolean flag)
{
this.b = true;
this.a = ichatbasecomponent;
this.b = flag;
}
public PacketPlayOutChat(String text)
{
this(ChatSerializer.a(text));
}
public void a(PacketDataSerializer packetdataserializer)
throws IOException
{
this.a = ChatSerializer.a(packetdataserializer.c(32767));
}
public void b(PacketDataSerializer packetdataserializer)
throws IOException
{
packetdataserializer.a(ChatSerializer.a(this.a));
if (packetdataserializer.version >= 16) {
packetdataserializer.writeByte(_chatType);
}
}
public void setChatType(byte chatType)
{
_chatType = chatType;
}
public void a(PacketPlayOutListener packetplayoutlistener)
{
packetplayoutlistener.a(this);
}
public String b()
{
return String.format("message='%s'", new Object[] { this.a });
}
public boolean d()
{
return this.b;
}
public void handle(PacketListener packetlistener)
{
a((PacketPlayOutListener)packetlistener);
}
}

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,11 @@
package mineplex.core.common.jsonchat;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_7_R4.ChatSerializer;
import net.minecraft.server.v1_7_R4.PacketPlayOutChat;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
public class JsonMessage
@ -63,4 +67,53 @@ public class JsonMessage
{
UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "tellraw " + player.getName() + " " + toString());
}
/**
* Send a message to players using the new 1.8 message types
*
* @param messageType Message type to send
* @param players Players to send to
*/
public void send(MessageType messageType, Player... players)
{
send(messageType, false, players);
}
/**
* Send a message to players using the new 1.8 message types
*
* @param messageType Message type to send
* @param defaultToChat Only applies to MessageType.ABOVE_HOTBAR. If true, it will send this to chat for 1.7 clients
* @param players Players to send to
*/
public void send(MessageType messageType, boolean defaultToChat, Player... players)
{
PacketPlayOutChat chatPacket = new PacketPlayOutChat(ChatSerializer.a(toString()));
chatPacket.setChatType(messageType.getId());
for (Player player : players)
{
if (defaultToChat || messageType != MessageType.ABOVE_HOTBAR || UtilPlayer.is1_8(player))
((CraftPlayer) player).getHandle().playerConnection.sendPacket(chatPacket);
}
}
public static enum MessageType
{
CHAT_BOX((byte) 0), // Inside Chat Box
SYSTEM_MESSAGE((byte) 1), // Inside Chat Box - This is used for the client to identify difference between chat message and server messages
ABOVE_HOTBAR((byte) 2); // Shows above hotbar
private byte _id;
MessageType(byte id)
{
_id = id;
}
public byte getId()
{
return _id;
}
}
}

View File

@ -7,6 +7,7 @@ public class C
public static String Scramble = "§k";
public static String Bold = "§l";
public static String Strike = "§m";
public static String BoldStrike = "§l§m";
public static String Line = "§n";
public static String Italics = "§o";

View File

@ -150,6 +150,11 @@ public class MapUtil
((CraftWorld) world).getHandle().notify(x, y, z);
}
}
public static void ChunkBlockSet(World world, int x, int y, int z, int id, byte data, boolean notifyPlayers)
{
world.getBlockAt(x, y, z).setTypeIdAndData(id, data, notifyPlayers);
}
private static boolean changeChunkBlock(int x, int y, int z, net.minecraft.server.v1_7_R4.Chunk chunk, Block block,
byte data)

View File

@ -302,6 +302,21 @@ public class UtilBlock
return blockList;
}
public static ArrayList<Block> getInSquare(Block block, double dR)
{
ArrayList<Block> blockList = new ArrayList<Block>();
int iR = (int)dR + 1;
for (int x=-iR ; x <= iR ; x++)
for (int z=-iR ; z <= iR ; z++)
for (int y=-iR ; y <= iR ; y++)
{
blockList.add(block.getRelative(x, y, z));
}
return blockList;
}
public static boolean isBlock(ItemStack item)
{
if (item == null)

View File

@ -515,6 +515,7 @@ public class UtilEnt
Material beneath = player.getLocation().add(x, -1.5, z).getBlock().getType();
if (player.getLocation().getY() % 0.5 == 0 &&
(beneath == Material.FENCE ||
beneath == Material.FENCE_GATE ||
beneath == Material.NETHER_FENCE ||
beneath == Material.COBBLE_WALL))
return true;
@ -535,11 +536,11 @@ public class UtilEnt
EntityCreature ec = ((CraftCreature)ent).getHandle();
Navigation nav = ec.getNavigation();
if (UtilMath.offset(ent.getLocation(), target) > 24)
if (UtilMath.offset(ent.getLocation(), target) > 16)
{
Location newTarget = ent.getLocation();
newTarget.add(UtilAlg.getTrajectory(ent.getLocation(), target).multiply(24));
newTarget.add(UtilAlg.getTrajectory(ent.getLocation(), target).multiply(16));
nav.a(newTarget.getX(), newTarget.getY(), newTarget.getZ(), speed);
}

View File

@ -139,21 +139,21 @@ public class UtilText
if (align == TextAlign.CENTER)
for (int i=-64 ; i<=64 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
if (align == TextAlign.LEFT)
for (int i=0 ; i<=128 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
if (align == TextAlign.RIGHT)
for (int i=-128 ; i<=0 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
@ -181,7 +181,7 @@ public class UtilText
if (letter[x][y] == 1)
{
changes.add(world.getBlockAt(bX, bY, bZ));
MapUtil.ChunkBlockChange(world, bX, bY, bZ, id, data, true);
MapUtil.ChunkBlockSet(world, bX, bY, bZ, id, data, true);
}
//Forward

View File

@ -10,6 +10,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.ServerData"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jedis-2.4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-pool2-2.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-dbcp2-2.0.1.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Database"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jooq-3.4.2.jar"/>
<classpathentry kind="output" path="bin"/>

View File

@ -17,6 +17,7 @@
<orderEntry type="library" name="craftbukkit" level="project" />
<orderEntry type="module" module-name="Mineplex.Database" />
<orderEntry type="library" name="jooq" level="project" />
<orderEntry type="library" name="commons-dbcp2" level="project" />
</component>
</module>

View File

@ -26,7 +26,6 @@ import net.minecraft.server.v1_7_R4.WatchableObject;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
@ -35,6 +34,8 @@ import org.bukkit.plugin.java.JavaPlugin;
public class CustomTagFix extends MiniPlugin implements IPacketHandler
{
private NautHashMap<Player, NautHashMap<Integer, Integer>> _entityMap = new NautHashMap<Player, NautHashMap<Integer, Integer>>();
private NautHashMap<Player, NautHashMap<Integer, String>> _entityNameMap = new NautHashMap<Player, NautHashMap<Integer, String>>();
private NautHashMap<Player, NautHashMap<Integer, Integer>> _entityVehicleMap = new NautHashMap<Player, NautHashMap<Integer, Integer>>();
private NautHashMap<Player, Long> _loggedIn = new NautHashMap<Player, Long>();
private Field _destroyId;
@ -61,6 +62,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
public void playerQuit(PlayerQuitEvent event)
{
_entityMap.remove(event.getPlayer());
_entityNameMap.remove(event.getPlayer());
_entityVehicleMap.remove(event.getPlayer());
_loggedIn.remove(event.getPlayer());
}
@ -78,6 +81,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
{
iterator.remove();
_entityMap.remove(player);
_entityNameMap.remove(player);
_entityVehicleMap.remove(player);
System.out.println("Found broken player in CustomTagFix.... '" + player.getName() + "'");
}
}
@ -98,6 +103,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
if (owner.isOnline() && !_entityMap.containsKey(owner))
{
_entityMap.put(owner, new NautHashMap<Integer, Integer>());
_entityNameMap.put(owner, new NautHashMap<Integer, String>());
_entityVehicleMap.put(owner, new NautHashMap<Integer, Integer>());
_loggedIn.put(owner, System.currentTimeMillis());
}
@ -113,12 +120,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
for (WatchableObject watchable : (List<WatchableObject>)spawnPacket.l.c())
{
if ((watchable.a() == 11 || watchable.a() == 3) && watchable.b() instanceof Byte)
if ((watchable.a() == 11 || watchable.a() == 3) && watchable.b() instanceof Byte && ((Byte)watchable.b()) == 1)
{
final String entityName = spawnPacket.l.getString(10);
if (entityName.isEmpty())
{
_entityNameMap.get(owner).remove(spawnPacket.a);
return;
}
if (_entityMap.get(owner).containsKey(spawnPacket.a))
{
@ -128,6 +138,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
int newId = UtilEnt.getNewEntityId();
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier);
_entityMap.get(owner).put(spawnPacket.a, newId);
_entityNameMap.get(owner).put(spawnPacket.a, entityName);
break;
}
@ -140,19 +151,30 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
if (!_entityMap.get(owner).containsKey(metaPacket.a) && metaPacket.a != 777777)
{
String entityName = "";
boolean nameShowing = false;
for (WatchableObject watchable : (List<WatchableObject>)metaPacket.b)
{
if ((watchable.a() == 11 || watchable.a() == 3) && watchable.b() instanceof Byte && ((Byte)watchable.b()) == 1)
{
nameShowing = true;
}
if ((watchable.a() == 10 || watchable.a() == 2) && watchable.b() instanceof String)
{
entityName = (String)watchable.b();
}
}
if (!entityName.isEmpty())
if (nameShowing && !entityName.isEmpty())
{
int newId = UtilEnt.getNewEntityId();
sendProtocolPackets(owner, metaPacket.a, newId, entityName, verifier);
_entityMap.get(owner).put(metaPacket.a, newId);
_entityNameMap.get(owner).put(metaPacket.a, entityName);
}
else if (!entityName.isEmpty())
{
_entityNameMap.get(owner).remove(metaPacket.a);
}
}
}
@ -166,6 +188,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
{
verifier.bypassProcess(new PacketPlayOutEntityDestroy(_entityMap.get(owner).get(id)));
_entityMap.get(owner).remove(id);
_entityVehicleMap.get(owner).remove(id);
_entityNameMap.get(owner).remove(id);
}
}
}
@ -178,9 +202,33 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
{
PacketPlayOutAttachEntity attachPacket = (PacketPlayOutAttachEntity)packet;
/* TODO dynamic attach handling?
if (attachPacket.c == -1)
{
if (_entityVehicleMap.get(owner).containsKey(attachPacket.b) && _entityNameMap.get(owner).containsKey(_entityVehicleMap.get(owner).get(attachPacket.b)))
{
int newId = UtilEnt.getNewEntityId();
sendProtocolPackets(owner, _entityVehicleMap.get(owner).get(attachPacket.b), newId, _entityNameMap.get(owner).get(_entityVehicleMap.get(owner).get(attachPacket.b)), verifier);
_entityMap.get(owner).put(attachPacket.b, newId);
_entityVehicleMap.get(owner).remove(attachPacket.b);
packetInfo.setCancelled(true);
}
}
else
{
_entityVehicleMap.get(owner).put(attachPacket.b, attachPacket.c);
}
if (_entityMap.get(owner).containsKey(attachPacket.c))
{
verifier.bypassProcess(new PacketPlayOutEntityDestroy(_entityMap.get(owner).get(attachPacket.c)));
_entityMap.get(owner).remove(attachPacket.c);
}
else
*/
if (attachPacket.c == owner.getEntityId())
{
System.out.println("Yea, adding patch mount item.");
if (_entityMap.get(owner).containsKey(attachPacket.b))
{
verifier.bypassProcess(new PacketPlayOutEntityDestroy(_entityMap.get(owner).get(attachPacket.b)));
@ -371,7 +419,24 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
vehiclePacket.c = entityId;
packetList.bypassProcess(vehiclePacket);
/* TODO dynamic attach handling?
if (_entityVehicleMap.get(owner).containsValue(entityId))
{
vehiclePacket = new PacketPlayOutAttachEntity();
vehiclePacket.a = 0;
for (Entry<Integer, Integer> entry : _entityVehicleMap.get(owner).entrySet())
{
if (entry.getValue() == entityId)
vehiclePacket.b = entry.getKey();
}
vehiclePacket.c = packet.a;
}
*/
}
});
}
}

View File

@ -0,0 +1,79 @@
package mineplex.core;
import java.util.Iterator;
import java.util.Map.Entry;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
public class Replay extends MiniPlugin implements IPacketHandler
{
private NautHashMap<PacketInfo, Long> _packetList = new NautHashMap<PacketInfo, Long>();
private long _startTime = 0;
private long _replayTime = 0;
private boolean _replay = false;
private long _speed = 20;
public Replay(JavaPlugin plugin, PacketHandler packetHandler)
{
super("Replay", plugin);
}
@EventHandler
public void interact(PlayerInteractEvent event)
{
if (event.getItem().getType() == Material.WEB)
{
event.getPlayer().setItemInHand(new ItemStack(Material.STICK, 1));
_replay = true;
_replayTime = System.currentTimeMillis();
}
}
@EventHandler
public void replay(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK || !_replay)
return;
for (Iterator<Entry<PacketInfo, Long>> entryIterator = _packetList.entrySet().iterator(); entryIterator.hasNext();)
{
Entry<PacketInfo, Long> entry = entryIterator.next();
if ((System.currentTimeMillis() + _speed) - _replayTime > entry.getValue())
{
entry.getKey().getVerifier().bypassProcess(entry.getKey().getPacket());
entryIterator.remove();
}
}
}
@SuppressWarnings("unchecked")
public void handle(PacketInfo packetInfo)
{
if (_replay)
{
packetInfo.setCancelled(true);
return;
}
if (_startTime == 0)
_startTime = System.currentTimeMillis();
_packetList.put(packetInfo, System.currentTimeMillis() - _startTime);
// write out packets?
if (packetInfo.isCancelled())
return;
}
}

View File

@ -1,5 +1,7 @@
package mineplex.core.account;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@ -13,7 +15,6 @@ import mineplex.core.account.event.ClientUnloadEvent;
import mineplex.core.account.event.ClientWebResponseEvent;
import mineplex.core.account.event.RetrieveClientInformationEvent;
import mineplex.core.account.repository.AccountRepository;
import mineplex.core.account.repository.MysqlAccountRepository;
import mineplex.core.account.repository.token.ClientToken;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
@ -42,7 +43,6 @@ public class CoreClientManager extends MiniPlugin
{
private JavaPlugin _plugin;
private AccountRepository _repository;
private MysqlAccountRepository _mysqlRepository;
private NautHashMap<String, CoreClient> _clientList;
private HashSet<String> _duplicateLoginGlitchPreventionList;
@ -53,8 +53,7 @@ public class CoreClientManager extends MiniPlugin
super("Client Manager", plugin);
_plugin = plugin;
_repository = new AccountRepository(webServer);
_mysqlRepository = new MysqlAccountRepository(plugin);
_repository = new AccountRepository(plugin, webServer);
_clientList = new NautHashMap<String, CoreClient>();
_duplicateLoginGlitchPreventionList = new HashSet<String>();
}
@ -175,7 +174,7 @@ public class CoreClientManager extends MiniPlugin
{
public void run()
{
_mysqlRepository.login(uuid.toString(), client.GetPlayerName());
_repository.login(uuid.toString(), client.GetPlayerName());
Bukkit.getServer().getPluginManager().callEvent(clientInformationEvent);
clientInformationEvent.decreaseProcessingCount();
@ -183,7 +182,7 @@ public class CoreClientManager extends MiniPlugin
});
// JSON sql response
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response));
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid));
// Load client in miniplugins
Bukkit.getServer().getPluginManager().callEvent(new AsyncClientLoadEvent(token, client));
@ -225,7 +224,7 @@ public class CoreClientManager extends MiniPlugin
{
public void run()
{
_mysqlRepository.login(uuid.toString(), client.GetPlayerName());
_repository.login(uuid.toString(), client.GetPlayerName());
Bukkit.getServer().getPluginManager().callEvent(clientInformationEvent);
}
@ -237,8 +236,10 @@ public class CoreClientManager extends MiniPlugin
client.SetAccountId(token.AccountId);
client.SetRank(Rank.valueOf(token.Rank));
_repository.updateMysqlRank(uuid.toString(), token.Rank, token.RankPerm, new Timestamp(Date.parse(token.RankExpire)).toString());
// JSON sql response
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response));
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid));
// Load client in miniplugins
Bukkit.getServer().getPluginManager().callEvent(new AsyncClientLoadEvent(token, client));
@ -322,7 +323,7 @@ public class CoreClientManager extends MiniPlugin
public void SaveRank(final String name, Rank rank, boolean perm)
{
_repository.SaveRank(new Callback<Rank>()
_repository.saveRank(new Callback<Rank>()
{
public void run(Rank newRank)
{

View File

@ -86,7 +86,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
return;
}
Plugin.getRepository().SaveRank(new Callback<Rank>()
Plugin.getRepository().saveRank(new Callback<Rank>()
{
public void run(Rank rank)
{

View File

@ -1,5 +1,7 @@
package mineplex.core.account.event;
import java.util.UUID;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
@ -8,10 +10,12 @@ public class ClientWebResponseEvent extends Event
private static final HandlerList handlers = new HandlerList();
private String _response;
private UUID _uuid;
public ClientWebResponseEvent(String response)
public ClientWebResponseEvent(String response, UUID uuid)
{
_response = response;
_uuid = uuid;
}
public String GetResponse()
@ -28,4 +32,9 @@ public class ClientWebResponseEvent extends Event
{
return handlers;
}
public UUID getUniqueId()
{
return _uuid;
}
}

View File

@ -1,26 +1,58 @@
package mineplex.core.account.repository;
import java.sql.Timestamp;
import java.util.List;
import java.util.UUID;
import org.bukkit.craftbukkit.libs.com.google.gson.reflect.TypeToken;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.account.repository.token.LoginToken;
import mineplex.core.account.repository.token.RankUpdateToken;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.server.remotecall.AsyncJsonWebCall;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.database.DatabaseRunnable;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.column.ColumnBoolean;
import mineplex.core.database.column.ColumnTimestamp;
import mineplex.core.database.column.ColumnVarChar;
import mineplex.core.server.remotecall.JsonWebCall;
public class AccountRepository
public class AccountRepository extends RepositoryBase
{
private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS accounts (id INT NOT NULL AUTO_INCREMENT, uuid VARCHAR(100), name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id), UNIQUE INDEX uuidIndex (uuid), UNIQUE INDEX nameIndex (name), INDEX rankIndex (rank));";
private static String ACCOUNT_LOGIN_NEW = "INSERT INTO accounts (uuid, name, lastLogin) values(?, ?, now()) ON DUPLICATE KEY UPDATE name=VALUES(name), lastLogin=VALUES(lastLogin);";
private static String ACCOUNT_LOGIN_UPDATE = "UPDATE accounts SET uuid=?, name=?, lastLogin=now() WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_RANK = "UPDATE accounts SET rank=?, rankPerm=false, rankExpire=now() + INTERVAL 1 MONTH WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_RANK_DONOR = "UPDATE accounts SET rank=?, donorRank=?, rankPerm=false, rankExpire=now() + INTERVAL 1 MONTH WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_RANK_PERM = "UPDATE accounts SET rank=?, rankPerm=true WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_RANK_DONOR_PERM = "UPDATE accounts SET rank=?, donorRank=?, rankPerm=true WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_NULL_RANK = "UPDATE accounts SET rank=?, donorRank=?, rankPerm=?, rankExpire=? WHERE uuid = ? AND rank IS NULL;";
private String _webAddress;
public AccountRepository(String webAddress)
public AccountRepository(JavaPlugin plugin, String webAddress)
{
super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh");
_webAddress = webAddress;
}
@Override
protected void initialize()
{
executeUpdate(CREATE_ACCOUNT_TABLE);
}
public void login(String uuid, String name)
{
int affectedRows = executeUpdate(ACCOUNT_LOGIN_UPDATE, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("name", 40, name), new ColumnVarChar("uuid", 100, uuid));
if (affectedRows == 0)
executeUpdate(ACCOUNT_LOGIN_NEW, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("name", 40, name));
}
public String GetClient(String name, UUID uuid, String ipAddress)
{
LoginToken token = new LoginToken();
@ -36,14 +68,44 @@ public class AccountRepository
return new JsonWebCall(_webAddress + "PlayerAccount/GetAccountByUUID").ExecuteReturnStream(uuid.toString());
}
public void SaveRank(Callback<Rank> callback, String name, Rank rank, boolean perm)
public void saveRank(final Callback<Rank> callback, final String name, final Rank rank, final boolean perm)
{
RankUpdateToken token = new RankUpdateToken();
final RankUpdateToken token = new RankUpdateToken();
token.Name = name;
token.Rank = rank.toString();
token.Perm = perm;
new AsyncJsonWebCall(_webAddress + "PlayerAccount/RankUpdate").Execute(Rank.class, callback, token);
final Callback<Rank> extraCallback = new Callback<Rank>()
{
public void run(Rank response)
{
if (rank == Rank.ULTRA || rank == Rank.HERO)
{
if (perm)
executeUpdate(UPDATE_ACCOUNT_RANK_DONOR_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString()));
else
executeUpdate(UPDATE_ACCOUNT_RANK_DONOR, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString()));
}
else
{
if (perm)
executeUpdate(UPDATE_ACCOUNT_RANK_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString()));
else
executeUpdate(UPDATE_ACCOUNT_RANK, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString()));
}
callback.run(response);
}
};
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
new JsonWebCall(_webAddress + "PlayerAccount/RankUpdate").Execute(Rank.class, extraCallback, token);
}
}), "Error saving player " + token.Name + "'s rank in AccountRepository : ");
}
public void MatchPlayerName(final Callback<List<String>> callback, final String userName)
@ -59,4 +121,20 @@ public class AccountRepository
asyncThread.start();
}
@Override
protected void update()
{
}
public void updateMysqlRank(final String uuid, final String rank, final boolean perm, final String rankExpire)
{
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
executeUpdate(UPDATE_ACCOUNT_NULL_RANK, new ColumnVarChar("rank", 100, rank), new ColumnVarChar("donorRank", 100, rank), new ColumnBoolean("rankPerm", perm), new ColumnTimestamp("rankExpire", Timestamp.valueOf(rankExpire)), new ColumnVarChar("uuid", 100, uuid));
}
}), "Error updating player's mysql rank AccountRepository : ");
}
}

View File

@ -1,35 +0,0 @@
package mineplex.core.account.repository;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.column.ColumnVarChar;
public class MysqlAccountRepository extends RepositoryBase
{
private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS accounts (id INT NOT NULL AUTO_INCREMENT, uuid VARCHAR(100), name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id), UNIQUE INDEX uuidIndex (uuid), UNIQUE INDEX nameIndex (name), INDEX rankIndex (rank));";
private static String ACCOUNT_LOGIN_NEW = "INSERT INTO accounts (uuid, name, lastLogin) values(?, ?, now()) ON DUPLICATE KEY UPDATE name=VALUES(name), lastLogin=VALUES(lastLogin);";
private static String ACCOUNT_LOGIN_UPDATE = "UPDATE accounts SET uuid=?, name=?, lastLogin=now() WHERE uuid = ?;";
public MysqlAccountRepository(JavaPlugin plugin)
{
super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh");
}
@Override
protected void initialize()
{
executeUpdate(CREATE_ACCOUNT_TABLE);
}
@Override
protected void update() { }
public void login(String uuid, String name)
{
int affectedRows = executeUpdate(ACCOUNT_LOGIN_UPDATE, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("name", 40, name), new ColumnVarChar("uuid", 100, uuid));
if (affectedRows == 0)
executeUpdate(ACCOUNT_LOGIN_NEW, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("name", 40, name));
}
}

View File

@ -5,6 +5,8 @@ public class ClientToken
public int AccountId;
public String Name;
public String Rank;
public boolean RankPerm;
public String RankExpire;
public int EconomyBalance;
public AccountToken AccountToken;

View File

@ -3,475 +3,568 @@ package mineplex.core.achievement;
public enum Achievement
{
GLOBAL_GEM_HUNTER("Gem Hunter", 10000,
new String[] {"Global.GemsEarned"},
new String[] {"+1 for every Gem earned in any game."},
new int[] {10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000},
new String[]{"Global.GemsEarned"},
new String[]{"+1 for every Gem earned in any game."},
new int[]{10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000},
AchievementCategory.GLOBAL),
//Bridges
BRIDGES_WINS("Bridge Champion", 600,
new String[] {"The Bridges.Wins"},
new String[] {"Win 50 games of The Bridges"},
new int[] {50},
new String[]{"The Bridges.Wins"},
new String[]{"Win 30 games of The Bridges"},
new int[]{30},
AchievementCategory.BRIDGES),
BRIDGES_FOOD("Food for the Masses", 600,
new String[] {"The Bridges.FoodForTheMasses"},
new String[] {"Get 20 kills with Apples"},
new int[] {20},
new String[]{"The Bridges.FoodForTheMasses"},
new String[]{"Get 20 kills with Apples"},
new int[]{20},
AchievementCategory.BRIDGES),
BRIDGES_SNIPER("Sniper", 600,
new String[] {"The Bridges.Sniper"},
new String[] {"Kill an enemy with Archery before Bridges fall"},
new int[] {1},
new String[]{"The Bridges.Sniper"},
new String[]{"Kill an enemy with Archery before Bridges fall"},
new int[]{1},
AchievementCategory.BRIDGES),
BRIDGES_FORTUNE_BOMBER("Fortune Bomber", 600,
new String[] {"The Bridges.FortuneBomber"},
new String[] {"Mine 30 Diamond Ore using TNT"},
new int[] {30},
new String[]{"The Bridges.FortuneBomber"},
new String[]{"Mine 30 Diamond Ore using TNT"},
new int[]{30},
AchievementCategory.BRIDGES),
BRIDGES_RAMPAGE("Rampage", 1200,
new String[] {"The Bridges.Rampage"},
new String[] {"Get 4 kills in a row, with no more than", "10 seconds between each kill"},
new int[] {1},
new String[]{"The Bridges.Rampage"},
new String[]{"Get 4 kills in a row, with no more than", "10 seconds between each kill"},
new int[]{1},
AchievementCategory.BRIDGES),
BRIDGES_DEATH_BOMBER("Death Bomber", 1000,
new String[] {"The Bridges.DeathBomber"},
new String[] {"Get 5 Kills in a single game with TNT"},
new int[] {1},
new String[]{"The Bridges.DeathBomber"},
new String[]{"Get 5 Kills in a single game with TNT"},
new int[]{1},
AchievementCategory.BRIDGES),
//Survival Games
SURVIVAL_GAMES_WINS("Katniss Everdeen", 600,
new String[] {"Survival Games.Wins"},
new String[] {"Win 50 games of Survival Games"},
new int[] {50},
new String[]{"Survival Games.Wins"},
new String[]{"Win 30 games of Survival Games"},
new int[]{30},
AchievementCategory.SURVIVAL_GAMES),
SURVIVAL_GAMES_LIGHT_WEIGHT("Light Weight", 1000,
new String[] {"Survival Games.NoArmor"},
new String[] {"Win a game without wearing any armor"},
new int[] {1},
new String[]{"Survival Games.NoArmor"},
new String[]{"Win a game without wearing any armor"},
new int[]{1},
AchievementCategory.SURVIVAL_GAMES),
SURVIVAL_GAMES_BLOODLUST("Bloodlust", 1200,
new String[] {"Survival Games.Bloodlust"},
new String[] {"Kill 3 other players in the first minute"},
new int[] {1},
new String[]{"Survival Games.Bloodlust"},
new String[]{"Kill 3 other players in the first minute"},
new int[]{1},
AchievementCategory.SURVIVAL_GAMES),
SURVIVAL_GAMES_LOOT("Loot Hoarder", 600,
new String[] {"Survival Games.SupplyDropsOpened"},
new String[] {"Be the first to open 50 Supply Drops"},
new int[] {50},
new String[]{"Survival Games.SupplyDropsOpened"},
new String[]{"Be the first to open 50 Supply Drops"},
new int[]{50},
AchievementCategory.SURVIVAL_GAMES),
SURVIVAL_GAMES_SKELETONS("Skeletal Army", 1000,
new String[] {"Survival Games.Skeletons"},
new String[] {"Have 5 Necromanced Skeletons alive"},
new int[] {1},
new String[]{"Survival Games.Skeletons"},
new String[]{"Have 5 Necromanced Skeletons alive"},
new int[]{1},
AchievementCategory.SURVIVAL_GAMES),
//Survival Games
UHC_WINS("Ultimate Winner", 600,
new String[] {"Ultra Hardcore.Wins"},
new String[] {"Win 20 games of Ultra Hardcore"},
new int[] {20},
new String[]{"Ultra Hardcore.Wins"},
new String[]{"Win 10 games of Ultra Hardcore"},
new int[]{10},
AchievementCategory.UHC),
//Smash Mobs
SMASH_MOBS_WINS("SO SUPER!", 600,
new String[] {"Super Smash Mobs.Wins"},
new String[] {"Win 100 games of Super Smash Mobs"},
new int[] {100},
new String[]{"Super Smash Mobs.Wins"},
new String[]{"Win 100 games of Super Smash Mobs"},
new int[]{100},
AchievementCategory.SMASH_MOBS),
SMASH_MOBS_MLG_PRO("MLG Pro", 1200,
new String[] {"Super Smash Mobs.MLGPro"},
new String[] {"Win a game without dying"},
new int[] {1},
new String[]{"Super Smash Mobs.MLGPro"},
new String[]{"Win a game without dying"},
new int[]{1},
AchievementCategory.SMASH_MOBS),
SMASH_MOBS_FREE_KITS("Free Kits Forever", 800,
new String[] {"Super Smash Mobs.FreeKitsForever"},
new String[] {"Win 100 games using only Free Kits"},
new int[] {100},
new String[]{"Super Smash Mobs.FreeKitsForever"},
new String[]{"Win 100 games using only Free Kits"},
new int[]{100},
AchievementCategory.SMASH_MOBS),
SMASH_MOBS_1V3("1v3", 2000,
new String[] {"Super Smash Mobs.1v3"},
new String[] {"Get 10 kills in a game with 4 players"},
new int[] {1},
new String[]{"Super Smash Mobs.1v3"},
new String[]{"Get 10 kills in a game with 4 players"},
new int[]{1},
AchievementCategory.SMASH_MOBS),
SMASH_MOBS_TRIPLE_KILL("Triple Kill", 1200,
new String[] {"Super Smash Mobs.TripleKill"},
new String[] {"Get 3 kills in a row, with no more than", "10 seconds between each kill"},
new int[] {1},
new String[]{"Super Smash Mobs.TripleKill"},
new String[]{"Get 3 kills in a row, with no more than", "10 seconds between each kill"},
new int[]{1},
AchievementCategory.SMASH_MOBS),
SMASH_MOBS_RECOVERY_MASTER("Recovery Master", 800,
new String[] {"Super Smash Mobs.RecoveryMaster"},
new String[] {"Take 200 damage in a single life"},
new int[] {1},
new String[]{"Super Smash Mobs.RecoveryMaster"},
new String[]{"Take 200 damage in a single life"},
new int[]{1},
AchievementCategory.SMASH_MOBS),
//Block Hunt
BLOCK_HUNT_WINS("The Blockiest Block", 600,
new String[] {"Block Hunt.Wins"},
new String[] {"Win 50 games of Block Hunt"},
new int[] {50},
new String[]{"Block Hunt.Wins"},
new String[]{"Win 50 games of Block Hunt"},
new int[]{50},
AchievementCategory.BLOCK_HUNT),
BLOCK_HUNT_HUNTER_KILLER("Hunter Killer", 1200,
new String[] {"Block Hunt.HunterKiller"},
new String[] {"Kill 10 Hunters in a single game"},
new int[] {1},
new String[]{"Block Hunt.HunterKiller"},
new String[]{"Kill 10 Hunters in a single game"},
new int[]{1},
AchievementCategory.BLOCK_HUNT),
BLOCK_HUNT_MEOW("Meow Meow Meow Meow", 800,
new String[] {"Block Hunt.Meow"},
new String[] {"Meow 50 times in a single game"},
new int[] {1},
new String[]{"Block Hunt.Meow"},
new String[]{"Meow 50 times in a single game"},
new int[]{1},
AchievementCategory.BLOCK_HUNT),
BLOCK_HUNT_HUNTER_OF_THE_YEAR("Hunter of the Year", 1200,
new String[] {"Block Hunt.HunterOfTheYear"},
new String[] {"Kill 7 Hiders in a single game"},
new int[] {1},
new String[]{"Block Hunt.HunterOfTheYear"},
new String[]{"Kill 7 Hiders in a single game"},
new int[]{1},
AchievementCategory.BLOCK_HUNT),
BLOCK_HUNT_BAD_HIDER("Bad Hider", 1000,
new String[] {"Block Hunt.BadHider"},
new String[] {"Win as Hider without disguising"},
new int[] {1},
new String[]{"Block Hunt.BadHider"},
new String[]{"Win as Hider without disguising"},
new int[]{1},
AchievementCategory.BLOCK_HUNT),
//Draw My Thing
DRAW_MY_THING_WINS("Art Hipster", 600,
new String[] {"Draw My Thing.Wins"},
new String[] {"Win 50 games of Draw My Thing"},
new int[] {50},
new String[]{"Draw My Thing.Wins"},
new String[]{"Win 50 games of Draw My Thing"},
new int[]{50},
AchievementCategory.DRAW_MY_THING),
DRAW_MY_THING_MR_SQUIGGLE("Mr. Squiggle", 800,
new String[] {"Draw My Thing.MrSquiggle"},
new String[] {"Both your drawings are guessed", "within the first 15 seconds."},
new int[] {1},
new String[]{"Draw My Thing.MrSquiggle"},
new String[]{"Both your drawings are guessed", "within the first 15 seconds."},
new int[]{1},
AchievementCategory.DRAW_MY_THING),
DRAW_MY_THING_KEEN_EYE("Keen Eye", 1200,
new String[] {"Draw My Thing.KeenEye"},
new String[] {"Guess every single drawing in a game"},
new int[] {1},
new String[]{"Draw My Thing.KeenEye"},
new String[]{"Guess every single drawing in a game"},
new int[]{1},
AchievementCategory.DRAW_MY_THING),
DRAW_MY_THING_PURE_LUCK("Pure Luck", 800,
new String[] {"Draw My Thing.PureLuck"},
new String[] {"Guess a word in the first 5 seconds"},
new int[] {1},
new String[]{"Draw My Thing.PureLuck"},
new String[]{"Guess a word in the first 5 seconds"},
new int[]{1},
AchievementCategory.DRAW_MY_THING),
//Castle Siege
CASTLE_SIEGE_WINS("FOR THE KING!", 600,
new String[] {"Castle Siege.ForTheKing"},
new String[] {"Win as Defenders 50 times"},
new int[] {50},
new String[]{"Castle Siege.ForTheKing"},
new String[]{"Win as Defenders 50 times"},
new int[]{50},
AchievementCategory.CASTLE_SIEGE),
CASTLE_SIEGE_KINGSLAYER("Kingslayer", 800,
new String[] {"Castle Siege.KingSlayer"},
new String[] {"Get the killing blow on the King"},
new int[] {1},
new String[]{"Castle Siege.KingSlayer"},
new String[]{"Get the killing blow on the King"},
new int[]{1},
AchievementCategory.CASTLE_SIEGE),
CASTLE_SIEGE_BLOOD_THIRSTY("Blood Thirsty", 1200,
new String[] {"Castle Siege.BloodThirsty"},
new String[] {"Kill 50 Undead in a single game"},
new int[] {1},
new String[]{"Castle Siege.BloodThirsty"},
new String[]{"Kill 50 Undead in a single game"},
new int[]{1},
AchievementCategory.CASTLE_SIEGE),
CASTLE_SIEGE_ASSASSIN("Assassin", 1000,
new String[] {"Castle Siege.Assassin"},
new String[] {"Do 50% or more of the damage to the king"},
new int[] {1},
new String[]{"Castle Siege.Assassin"},
new String[]{"Do 50% or more of the damage to the king"},
new int[]{1},
AchievementCategory.CASTLE_SIEGE),
//Champions
CHAMPIONS_WINS("Champion", 600,
new String[] {"Champions Domination.Wins", "Champions TDM.Wins"},
new String[] {"Win 80 games of Dominate or TDM"},
new int[] {80},
new String[]{"Champions Domination.Wins", "Champions TDM.Wins"},
new String[]{"Win 80 games of Dominate or TDM"},
new int[]{80},
AchievementCategory.CHAMPIONS),
CHAMPIONS_FLAWLESS_VICTORY("Flawless Victory", 800,
new String[] {"Champions TDM.FlawlessVictory"},
new String[] {"Win TDM without losing a player"},
new int[] {1},
new String[]{"Champions TDM.FlawlessVictory"},
new String[]{"Win TDM without losing a player"},
new int[]{1},
AchievementCategory.CHAMPIONS),
CHAMPIONS_ACE("Ace", 2000,
new String[] {"Champions TDM.Ace"},
new String[] {"Kill all enemies in a game of TDM"},
new int[] {1},
new String[]{"Champions TDM.Ace"},
new String[]{"Kill all enemies in a game of TDM"},
new int[]{1},
AchievementCategory.CHAMPIONS),
CHAMPIONS_ASSASSINATION("Assassination", 1000,
new String[] {"Champions Domination.Assassination", "Champions TDM.Assassination"},
new String[] {"Kill 40 players with Backstab without", "taking any damage from them"},
new int[] {40},
new String[]{"Champions Domination.Assassination", "Champions TDM.Assassination"},
new String[]{"Kill 40 players with Backstab without", "taking any damage from them"},
new int[]{40},
AchievementCategory.CHAMPIONS),
CHAMPIONS_MASS_ELECTROCUTION("Mass Electrocution", 1200,
new String[] {"Champions Domination.MassElectrocution", "Champions TDM.MassElectrocution"},
new String[] {"Hit 4 enemies with a Lightning Orb"},
new int[] {1},
new String[]{"Champions Domination.MassElectrocution", "Champions TDM.MassElectrocution"},
new String[]{"Hit 4 enemies with a Lightning Orb"},
new int[]{1},
AchievementCategory.CHAMPIONS),
CHAMPIONS_THE_LONGEST_SHOT("The Longest Shot", 1200,
new String[] {"Champions Domination.TheLongestShot", "Champions TDM.TheLongestShot"},
new String[] {"Kill someone using Longshot who", "is over 64 Blocks away from you"},
new int[] {1},
new String[]{"Champions Domination.TheLongestShot", "Champions TDM.TheLongestShot"},
new String[]{"Kill someone using Longshot who", "is over 64 Blocks away from you"},
new int[]{1},
AchievementCategory.CHAMPIONS),
CHAMPIONS_EARTHQUAKE("Earthquake", 1200,
new String[] {"Champions Domination.Earthquake", "Champions TDM.Earthquake"},
new String[] {"Launch 5 enemies using Seismic Slam"},
new int[] {1},
new String[]{"Champions Domination.Earthquake", "Champions TDM.Earthquake"},
new String[]{"Launch 5 enemies using Seismic Slam"},
new int[]{1},
AchievementCategory.CHAMPIONS),
//Paintball
SUPER_PAINTBALL_WINS("Paintball King", 600,
new String[] {"Super Paintball.Wins"},
new String[] {"Win 50 games of Paintball"},
new int[] {50},
AchievementCategory.SUPER_PAINTBALL),
new String[]{"Super Paintball.Wins"},
new String[]{"Win 50 games of Paintball"},
new int[]{50},
AchievementCategory.SUPER_PAINTBALL),
SUPER_PAINTBALL_KILLING_SPREE("Killing Spree", 1200,
new String[] {"Super Paintball.KillingSpree"},
new String[] {"Get 4 kills in a row, with no more than", "5 seconds between each kill"},
new int[] {1},
new String[]{"Super Paintball.KillingSpree"},
new String[]{"Get 4 kills in a row, with no more than", "5 seconds between each kill"},
new int[]{1},
AchievementCategory.SUPER_PAINTBALL),
SUPER_PAINTBALL_FLAWLESS_VICTORY("Flawless Victory", 1000,
new String[] {"Super Paintball.Wins"},
new String[] {"Win a team with your entire team alive"},
new int[] {1},
new String[]{"Super Paintball.Wins"},
new String[]{"Win a team with your entire team alive"},
new int[]{1},
AchievementCategory.SUPER_PAINTBALL),
SUPER_PAINTBALL_MEDIC("Medic!", 800,
new String[] {"Super Paintball.Medic"},
new String[] {"Revive 200 team members"},
new int[] {200},
new String[]{"Super Paintball.Medic"},
new String[]{"Revive 200 team members"},
new int[]{200},
AchievementCategory.SUPER_PAINTBALL),
SUPER_PAINTBALL_SPEEDRUNNER("Speedrunner", 1000,
new String[] {"Super Paintball.Speedrunner"},
new String[] {"Win a game in 20 seconds"},
new int[] {1},
new String[]{"Super Paintball.Speedrunner"},
new String[]{"Win a game in 20 seconds"},
new int[]{1},
AchievementCategory.SUPER_PAINTBALL),
SUPER_PAINTBALL_LAST_STAND("Last Stand", 1200,
new String[] {"Super Paintball.LastStand"},
new String[] {"Be the last alive on your team", "and kill 3 enemy players"},
new int[] {1},
new String[]{"Super Paintball.LastStand"},
new String[]{"Be the last alive on your team", "and kill 3 enemy players"},
new int[]{1},
AchievementCategory.SUPER_PAINTBALL),
//Sheep Quest
SHEEP_QUEST_WINS("Hungry Hungry Hippo", 600,
new String[] {"Sheep Quest.Wins"},
new String[] {"Win 50 games of Sheep Quest"},
new int[] {50},
AchievementCategory.SHEEP_QUEST),
new String[]{"Sheep Quest.Wins"},
new String[]{"Win 50 games of Sheep Quest"},
new int[]{50},
AchievementCategory.SHEEP_QUEST),
SHEEP_QUEST_THIEF("Thief", 800,
new String[] {"Sheep Quest.Thief"},
new String[] {"Steal 300 Sheep from enemy pens"},
new int[] {300},
AchievementCategory.SHEEP_QUEST),
new String[]{"Sheep Quest.Thief"},
new String[]{"Steal 300 Sheep from enemy pens"},
new int[]{300},
AchievementCategory.SHEEP_QUEST),
SHEEP_QUEST_ANIMAL_RESCUE("Animal Rescue", 800,
new String[] {"Sheep Quest.AnimalRescue"},
new String[] {"Make 300 enemies drop their Sheep"},
new int[] {300},
AchievementCategory.SHEEP_QUEST),
new String[]{"Sheep Quest.AnimalRescue"},
new String[]{"Make 300 enemies drop their Sheep"},
new int[]{300},
AchievementCategory.SHEEP_QUEST),
SHEEP_QUEST_SELFISH("Selfish", 1200,
new String[] {"Sheep Quest.Selfish"},
new String[] {"Win with more than 12 Sheep"},
new int[] {1},
AchievementCategory.SHEEP_QUEST),
new String[]{"Sheep Quest.Selfish"},
new String[]{"Win with more than 12 Sheep"},
new int[]{1},
AchievementCategory.SHEEP_QUEST),
//Snake
SNAKE_WINS("Nokia 3310", 600,
new String[] {"Snake.Wins"},
new String[] {"Win 50 games of Snake"},
new int[] {50},
AchievementCategory.SNAKE),
new String[]{"Snake.Wins"},
new String[]{"Win 50 games of Snake"},
new int[]{50},
AchievementCategory.SNAKE),
SNAKE_CANNIBAL("Cannibal", 1600,
new String[] {"Snake.Cannibal"},
new String[] {"Kill 8 players in a single game"},
new int[] {1},
AchievementCategory.SNAKE),
new String[]{"Snake.Cannibal"},
new String[]{"Kill 8 players in a single game"},
new int[]{1},
AchievementCategory.SNAKE),
SNAKE_CHOO_CHOO("Choo Choo", 1000,
new String[] {"Snake.ChooChoo"},
new String[] {"Grow to be 60 Sheep or longer"},
new int[] {1},
AchievementCategory.SNAKE),
new String[]{"Snake.ChooChoo"},
new String[]{"Grow to be 60 Sheep or longer"},
new int[]{1},
AchievementCategory.SNAKE),
SNAKE_SLIMY_SHEEP("Slimy Sheep", 800,
new String[] {"Snake.SlimySheep"},
new String[] {"Eat 20 slimes in a single game"},
new int[] {1},
AchievementCategory.SNAKE),
new String[]{"Snake.SlimySheep"},
new String[]{"Eat 20 slimes in a single game"},
new int[]{1},
AchievementCategory.SNAKE),
//Dragons
DRAGONS_WINS("Dragon Tamer", 600,
new String[] {"Dragons.Wins"},
new String[] {"Win 50 games of Dragons"},
new int[] {50},
AchievementCategory.DRAGONS),
new String[]{"Dragons.Wins"},
new String[]{"Win 50 games of Dragons"},
new int[]{50},
AchievementCategory.DRAGONS),
DRAGONS_SPARKLEZ("Sparklez", 400,
new String[] {"Dragons.Sparklez"},
new String[] {"Throw 100 Sparklers"},
new int[] {100},
AchievementCategory.DRAGONS),
new String[]{"Dragons.Sparklez"},
new String[]{"Throw 100 Sparklers"},
new int[]{100},
AchievementCategory.DRAGONS),
//Turf Wars
TURF_WARS_WINS("Turf Master 3000", 600,
new String[] {"Turf Wars.Wins"},
new String[] {"Win 50 games of Turf Wars"},
new int[] {50},
AchievementCategory.TURF_WARS),
TURF_WARS_SHREDDINATOR("The Shreddinator", 800,
new String[] {"Turf Wars.TheShreddinator"},
new String[] {"Destroy 2000 blocks as Shredder"},
new int[] {2000},
AchievementCategory.TURF_WARS),
TURF_WARS_BEHIND_ENEMY_LINES("Behind Enemy Lines", 1000,
new String[] {"Turf Wars.BehindEnemyLines"},
new String[] {"Stay on enemy turf for 15 seconds"},
new int[] {1},
AchievementCategory.TURF_WARS),
TURF_WARS_COMEBACK("The Comeback", 2000,
new String[] {"Turf Wars.TheComeback"},
new String[] {"Win a game after having 5 or less turf"},
new int[] {1},
new String[]{"Turf Wars.Wins"},
new String[]{"Win 50 games of Turf Wars"},
new int[]{50},
AchievementCategory.TURF_WARS),
TURF_WARS_SHREDDINATOR("The Shreddinator", 800,
new String[]{"Turf Wars.TheShreddinator"},
new String[]{"Destroy 2000 blocks as Shredder"},
new int[]{2000},
AchievementCategory.TURF_WARS),
TURF_WARS_BEHIND_ENEMY_LINES("Behind Enemy Lines", 1000,
new String[]{"Turf Wars.BehindEnemyLines"},
new String[]{"Stay on enemy turf for 15 seconds"},
new int[]{1},
AchievementCategory.TURF_WARS),
TURF_WARS_COMEBACK("The Comeback", 2000,
new String[]{"Turf Wars.TheComeback"},
new String[]{"Win a game after having 5 or less turf"},
new int[]{1},
AchievementCategory.TURF_WARS),
//Death Tag
DEATH_TAG_WINS("Death Proof", 600,
new String[] {"Death Tag.Wins"},
new String[] {"Win 50 games of Death Tag"},
new int[] {50},
AchievementCategory.DEATH_TAG),
DEATH_TAG_COME_AT_ME_BRO("Come At Me Bro!", 1200,
new String[] {"Death Tag.ComeAtMeBro"},
new String[] {"Kill 2 Undead Chasers in a single game"},
new int[] {1},
new String[]{"Death Tag.Wins"},
new String[]{"Win 50 games of Death Tag"},
new int[]{50},
AchievementCategory.DEATH_TAG),
DEATH_TAG_COME_AT_ME_BRO("Come At Me Bro!", 1200,
new String[]{"Death Tag.ComeAtMeBro"},
new String[]{"Kill 2 Undead Chasers in a single game"},
new int[]{1},
AchievementCategory.DEATH_TAG),
//Runner
RUNNER_WINS("Hot Feet", 600,
new String[] {"Runner.Wins"},
new String[] {"Win 50 games of Runner"},
new int[] {50},
AchievementCategory.RUNNER),
new String[]{"Runner.Wins"},
new String[]{"Win 50 games of Runner"},
new int[]{50},
AchievementCategory.RUNNER),
RUNNER_MARATHON_RUNNER("Marathon Runner", 1000,
new String[]{"Runner.MarathonRunner"},
new String[]{"Run over 20,000 blocks"},
new int[]{20000},
AchievementCategory.RUNNER),
//Dragon Escape
DRAGON_ESCAPE_WINS("Douglas Defeater", 600,
new String[] {"Dragon Escape.Wins"},
new String[] {"Win 50 games of Dragon Escape"},
new int[] {50},
AchievementCategory.DRAGON_ESCAPE),
new String[]{"Dragon Escape.Wins"},
new String[]{"Win 50 games of Dragon Escape"},
new int[]{50},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_PARALYMPICS("Paralympics", 1200,
new String[] {"Dragon Escape.Wins"},
new String[] {"Win a game without using Leap"},
new int[] {1},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_SKYLANDS("Skylands Master", 1000,
new String[] {"Dragon Escape.Win.Skylands"},
new String[] {"Win by finishing Skylands 5 times"},
new int[] {5},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_THROUGH_HELL("To Hell and Back", 1000,
new String[] {"Dragon Escape.Win.Through Hell"},
new String[] {"Win by finishing Through Hell 5 times"},
new int[] {5},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_PIRATE_BAY("Plundered", 1000,
new String[] {"Dragon Escape.Win.Pirate Bay"},
new String[] {"Win by finishing Pirate Bay 5 times"},
new int[] {5},
new String[]{"Dragon Escape.Wins"},
new String[]{"Win a game without using Leap"},
new int[]{1},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_SKYLANDS("Skylands Master", 1000,
new String[]{"Dragon Escape.Win.Skylands"},
new String[]{"Win by finishing Skylands 5 times"},
new int[]{5},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_THROUGH_HELL("To Hell and Back", 1000,
new String[]{"Dragon Escape.Win.Through Hell"},
new String[]{"Win by finishing Through Hell 5 times"},
new int[]{5},
AchievementCategory.DRAGON_ESCAPE),
DRAGON_ESCAPE_PIRATE_BAY("Plundered", 1000,
new String[]{"Dragon Escape.Win.Pirate Bay"},
new String[]{"Win by finishing Pirate Bay 5 times"},
new int[]{5},
AchievementCategory.DRAGON_ESCAPE),
//OITQ
OITQ_WINS("One of a Kind", 600,
new String[] {"One in the Quiver.Wins"},
new String[] {"Win 50 games of One in the Quiver"},
new int[] {50},
AchievementCategory.ONE_IN_THE_QUIVER),
new String[]{"One in the Quiver.Wins"},
new String[]{"Win 50 games of One in the Quiver"},
new int[]{50},
AchievementCategory.ONE_IN_THE_QUIVER),
OITQ_PERFECTIONIST("The Perfect Game", 3000,
new String[] {"One in the Quiver.Perfectionist"},
new String[] {"Win without dying"},
new int[] {1},
AchievementCategory.ONE_IN_THE_QUIVER),
new String[]{"One in the Quiver.Perfectionist"},
new String[]{"Win without dying"},
new int[]{1},
AchievementCategory.ONE_IN_THE_QUIVER),
OITQ_SHARPSHOOTER("SharpShooter", 1200,
new String[] {"One in the Quiver.Sharpshooter"},
new String[] {"Hit with 8 Arrows in a row"},
new int[] {1},
AchievementCategory.ONE_IN_THE_QUIVER),
new String[]{"One in the Quiver.Sharpshooter"},
new String[]{"Hit with 8 Arrows in a row"},
new int[]{1},
AchievementCategory.ONE_IN_THE_QUIVER),
OITQ_WHATS_A_BOW("What's A Bow?", 1200,
new String[]{"One in the Quiver.WhatsABow"},
new String[]{"Win a game without using a bow"},
new int[]{1},
AchievementCategory.ONE_IN_THE_QUIVER),
//Super Spleef
SPLEEF_WINS("Spleef King (or Queen)", 600,
new String[] {"Super Spleef.Wins"},
new String[] {"Win 50 games of Super Spleef"},
new int[] {50},
AchievementCategory.SPLEEF),
new String[]{"Super Spleef.Wins"},
new String[]{"Win 50 games of Super Spleef"},
new int[]{50},
AchievementCategory.SPLEEF),
SPLEEF_DEMOLITIONIST("Demolitionist", 1000,
new String[]{"Super Spleef.SpleefBlocks"},
new String[]{"Destroy 20,000 blocks."},
new int[]{20000},
AchievementCategory.SPLEEF),
//Bacon Brawl
BACON_BRAWL_WINS("King of Bacon", 600,
new String[] {"Bacon Brawl.Wins"},
new String[] {"Win 50 games of Bacon Brawl"},
new int[] {50},
AchievementCategory.BACON_BRAWL),
new String[]{"Bacon Brawl.Wins"},
new String[]{"Win 50 games of Bacon Brawl"},
new int[]{50},
AchievementCategory.BACON_BRAWL),
//Sneaky Assassins
SNEAKY_ASSASSINS_WINS("So So Sneaky", 600,
new String[] {"Sneaky Assassins.Wins"},
new String[] {"Win 50 games of Sneaky Assassins"},
new int[] {50},
AchievementCategory.SNEAKY_ASSASSINS),
new String[]{"Sneaky Assassins.Wins"},
new String[]{"Win 50 games of Sneaky Assassins"},
new int[]{50},
AchievementCategory.SNEAKY_ASSASSINS),
SNEAK_ASSASSINS_MASTER_ASSASSIN("Master Assassin", 600,
new String[]{"Sneaky Assassins.MasterAssassin"},
new String[]{"Get Master Assassin 10 times"},
new int[]{10},
AchievementCategory.SNEAKY_ASSASSINS),
SNEAK_ASSASSINS_THE_MASTERS_MASTER("The Master's Master", 700,
new String[]{"Sneaky Assassins.TheMastersMaster"},
new String[]{"Kill a Master Assassin without", "having a single power-up."},
new int[]{1},
AchievementCategory.SNEAKY_ASSASSINS),
SNEAK_ASSASSINS_INCOMPETENCE("Incompetence", 600,
new String[]{"Sneaky Assassins.Incompetence"},
new String[]{"Kill 500 NPCs."},
new int[]{500},
AchievementCategory.SNEAKY_ASSASSINS),
SNEAK_ASSASSINS_I_SEE_YOU("I See You", 800,
new String[]{"Sneaky Assassins.ISeeYou"},
new String[]{"Reveal 250 players."},
new int[]{250},
AchievementCategory.SNEAKY_ASSASSINS),
//Micro Battle
MICRO_BATTLE_WINS("Micro Champion", 600,
new String[] {"Micro Battle.Wins"},
new String[] {"Win 100 games of Micro Battle"},
new int[] {100},
AchievementCategory.MICRO_BATTLE),
;
new String[]{"Micro Battle.Wins"},
new String[]{"Win 100 games of Micro Battle"},
new int[]{100},
AchievementCategory.MICRO_BATTLE),
MICRO_BATTLE_ANNIHILATION("Annihilation", 1200,
new String[]{"Micro Battle.Annihilation"},
new String[]{"Kill 12 players in one game"},
new int[]{1},
AchievementCategory.MICRO_BATTLE),
//MineStrike
MINE_STRIKE_WINS("Striker", 800,
new String[]{"MineStrike.Wins"},
new String[]{"Win 50 games of MineStrike"},
new int[]{50},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_BOOM_HEADSHOT("BOOM! HEADSHOT!", 1000,
new String[]{"MineStrike.BoomHeadshot"},
new String[]{"Kill 500 people with headshots"},
new int[]{500},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_ACE("Ace", 2000,
new String[]{"MineStrike.Ace"},
new String[]{"Get the kill on all enemies in a single round"},
new int[]{1},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_KABOOM("Kaboom!", 1000,
new String[]{"MineStrike.Kaboom"},
new String[]{"Kill two people with a single", "High Explosive Grenade"},
new int[]{1},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_ASSASSINATION("Assassination", 800,
new String[]{"MineStrike.Assassination"},
new String[]{"Get 20 backstab kills with the knife"},
new int[]{20},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_CLUTCH_OR_KICK("Clutch or Kick", 1200,
new String[]{"MineStrike.ClutchOrKick"},
new String[]{"Be the last one alive, and kill", "3 or more enemies to achieve victory"},
new int[]{1},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_KILLING_SPREE("Killing Spree", 1600,
new String[]{"MineStrike.KillingSpree"},
new String[]{"Kill 4 enemies in a row with no more", "than 5 seconds between each kill"},
new int[]{1},
AchievementCategory.MINE_STRIKE),
MINE_STRIKE_BLINDFOLDED("Blindfolded", 1000,
new String[]{"MineStrike.Blindfolded"},
new String[]{"Kill 2 enemies while blinded from", "a single flashbang"},
new int[]{1},
AchievementCategory.MINE_STRIKE),
;
private String _name;
private String[] _desc;
private String[] _stats;
@ -488,32 +581,32 @@ public enum Achievement
_levels = levels;
_category = category;
}
public String getName()
{
return _name;
}
public String[] getDesc()
{
return _desc;
}
public String[] getStats()
{
return _stats;
}
public int[] getLevels()
{
return _levels;
}
public int getMaxLevel()
{
return _levels.length;
}
public boolean isOngoing()
{
return _levels[0] > 1;
@ -528,23 +621,23 @@ public enum Achievement
{
return _category;
}
public AchievementData getLevelData(int exp)
{
for (int i=0 ; i<_levels.length ; i++)
for (int i = 0; i < _levels.length; i++)
{
int req = _levels[i];
//Has Experience, Level Up!
if (exp >= req)
{
exp -= req;
continue;
}
return new AchievementData(i, exp, req);
}
return new AchievementData(getMaxLevel(), -1, -1);
}

View File

@ -33,12 +33,12 @@ public enum AchievementCategory
new String[] { "Wins", "Losses", "Kills", "Deaths", "GemsEarned" },
new String[] { "Wins", "Losses", "Kills", "Deaths", "Gems Earned" },
Material.IRON_SWORD, 0, GameCategory.SURVIVAL),
UHC("Ultra Hardcore", null,
new String[] { "Wins", "Losses", "Kills", "Deaths", "GemsEarned" },
new String[] { "Wins", "Losses", "Kills", "Deaths", "Gems Earned" },
Material.GOLD_INGOT, 0, GameCategory.SURVIVAL),
MINE_STRIKE("MineStrike", null,
new String[] {"Wins", "Losses", "Kills", "Deaths", "GemsEarned"},
new String[] {"Wins", "Losses", "Kills", "Deaths", "Gems Earned"},
Material.TNT, 0, GameCategory.CLASSICS),
//Classics
SMASH_MOBS("Super Smash Mobs", null,
new String[] { "Wins", "Losses", "Kills", "Deaths", "GemsEarned" },
@ -65,6 +65,11 @@ public enum AchievementCategory
new String[] {"Wins", "Losses", "Kills", "Deaths", "GemsEarned"},
new String[] {"Wins", "Losses", "Kills", "Deaths", "Gems Earned"},
Material.BEACON, 0, GameCategory.CHAMPIONS),
UHC("Ultra Hardcore", null,
new String[] { "Wins", "Losses", "Kills", "Deaths", "GemsEarned" },
new String[] { "Wins", "Losses", "Kills", "Deaths", "Gems Earned" },
Material.GOLD_INGOT, 0, GameCategory.SURVIVAL),
//Arcade
DRAGONS("Dragons", null,
@ -130,7 +135,9 @@ public enum AchievementCategory
MICRO_BATTLE("Micro Battle", null,
new String[] {"Wins", "Losses", "Kills", "Deaths", "GemsEarned"},
new String[] {"Wins", "Losses", "Kills", "Deaths", "Gems Earned"},
Material.LAVA, 0, GameCategory.ARCADE);
Material.LAVA, 0, GameCategory.ARCADE),
;
private String _name;

View File

@ -83,9 +83,9 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
protected void addArcadeButton()
{
ArcadeButton button = new ArcadeButton(Shop, Plugin, _statsManager, DonationManager, ClientManager, _target);
ShopItem shopItem = new ShopItem(Material.TNT, (byte) 0, C.Bold + "Arcade Games", new String[] {" ", ChatColor.RESET + "Click for more!"}, 1, false, false);
ShopItem shopItem = new ShopItem(Material.BOW, (byte) 0, C.Bold + "Arcade Games", new String[] {" ", ChatColor.RESET + "Click for more!"}, 1, false, false);
AddButton(42, shopItem, button);
AddButton(44, shopItem, button);
}
protected void addAchievements(AchievementCategory category, List<String> lore, int max)

View File

@ -7,14 +7,15 @@ import java.util.Iterator;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.event.player.PlayerVelocityEvent;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.plugin.java.JavaPlugin;
@ -44,6 +45,8 @@ public class AntiHack extends MiniPlugin
public static AntiHack Instance;
private boolean _enabled = true;
private boolean _strict = true;
private boolean _kick = true;
public Punish Punish;
public Portal Portal;
@ -51,9 +54,6 @@ public class AntiHack extends MiniPlugin
private CoreClientManager _clientManager;
//Record Offenses
private HashMap<Player, HashMap<String, ArrayList<Long>>> _suspicion = new HashMap<Player, HashMap<String, ArrayList<Long>>>();
//Some suspicions will not become offenses, for example, using double jump will remove suspicion 2 seconds prior
private HashMap<Player, HashMap<String, ArrayList<Long>>> _offense = new HashMap<Player, HashMap<String, ArrayList<Long>>>();
//Ignore Player
@ -64,12 +64,14 @@ public class AntiHack extends MiniPlugin
private HashMap<Player, Long> _lastMoveEvent = new HashMap<Player, Long>();
//Hack Requirements
public int FloatHackTicks = 6;
public int HoverHackTicks = 3;
public int FloatHackTicks = 10;
public int HoverHackTicks = 4;
public int RiseHackTicks = 6;
public int SpeedHackTicks = 6;
public int IdleTime = 20000;
public int KeepOffensesFor = 30000;
//Other Times
public int FlightTriggerCancel = 2000;
@ -121,7 +123,7 @@ public class AntiHack extends MiniPlugin
synchronized (_antiHackLock)
{
_ignore.put(event.getPlayer(), System.currentTimeMillis() + 2000);
setIgnore(event.getPlayer(), 2000);
}
}
@ -137,35 +139,6 @@ public class AntiHack extends MiniPlugin
}
}
@EventHandler
public void playerToggleFly(PlayerToggleFlightEvent event)
{
if (!_enabled)
return;
Player player = event.getPlayer();
synchronized (_antiHackLock)
{
if (!_suspicion.containsKey(player))
return;
//Remove all infractions within last 2 seconds.
for (ArrayList<Long> offenseList : _suspicion.get(player).values())
{
Iterator<Long> offenseIterator = offenseList.iterator();
while (offenseIterator.hasNext())
{
long time = offenseIterator.next();
if (!UtilTime.elapsed(time, FlightTriggerCancel))
offenseIterator.remove();
}
}
}
}
@EventHandler
public void playerQuit(PlayerQuitEvent event)
{
@ -197,7 +170,7 @@ public class AntiHack extends MiniPlugin
if (timeBetweenPackets > 500)
{
setIgnore(player, 5000);
setIgnore(player, Math.min(4000, timeBetweenPackets));
}
}
}
@ -235,70 +208,58 @@ public class AntiHack extends MiniPlugin
}
}
return (_ignore.containsKey(player) && System.currentTimeMillis() < _ignore.get(player));
if ((_ignore.containsKey(player) && System.currentTimeMillis() < _ignore.get(player)))
{
return true;
}
return false;
}
public void addSuspicion(Player player, String type)
{
if (!_enabled)
return;
System.out.println(C.cRed + C.Bold + player.getName() + " suspected for " + type + ".");
synchronized (_antiHackLock)
{
//Add Offense
if (!_suspicion.containsKey(player))
_suspicion.put(player, new HashMap<String, ArrayList<Long>>());
if (!_offense.containsKey(player))
_offense.put(player, new HashMap<String, ArrayList<Long>>());
if (!_suspicion.get(player).containsKey(type))
_suspicion.get(player).put(type, new ArrayList<Long>());
if (!_offense.get(player).containsKey(type))
_offense.get(player).put(type, new ArrayList<Long>());
_suspicion.get(player).get(type).add(System.currentTimeMillis());
}
_offense.get(player).get(type).add(System.currentTimeMillis());
for (Player admin : UtilServer.getPlayers())
if (_clientManager.Get(admin).GetRank().Has(Rank.MODERATOR) && _preferences.Get(admin).ShowMacReports)
UtilPlayer.message(admin, C.cRed + C.Bold + player.getName() + " suspected for " + type + ".");
// Print (Debug)
System.out.println("[Offense] " + player.getName() + " received suspicion for " + type + ".");
}
@EventHandler
public void processOffenses(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.SEC)
return;
synchronized (_antiHackLock)
{
for (Player player : _suspicion.keySet())
//Cull & Count
int total = 0;
for (String curType : _offense.get(player).keySet())
{
if (!_offense.containsKey(player))
_offense.put(player, new HashMap<String, ArrayList<Long>>());
for (String type : _suspicion.get(player).keySet())
//Remove Old Offenses
Iterator<Long> offenseIterator = _offense.get(player).get(curType).iterator();
while (offenseIterator.hasNext())
{
if (!_offense.get(player).containsKey(type))
_offense.get(player).put(type, new ArrayList<Long>());
Iterator<Long> offenseIterator = _suspicion.get(player).get(type).iterator();
while (offenseIterator.hasNext())
{
long time = offenseIterator.next();
//Suspicion turns into Offense
if (UtilTime.elapsed(time, FlightTriggerCancel))
{
offenseIterator.remove();
_offense.get(player).get(type).add(time);
}
}
if (UtilTime.elapsed(offenseIterator.next(), KeepOffensesFor))
offenseIterator.remove();
}
//Count
total += _offense.get(player).get(curType).size();
}
//Inform
for (Player admin : UtilServer.getPlayers())
if (_clientManager.Get(admin).GetRank().Has(Rank.MODERATOR) && _preferences.Get(admin).ShowMacReports)
{
UtilPlayer.message(admin, "#" + total + ": " + C.cRed + C.Bold + player.getName() + " suspected for " + type + ".");
}
// Print (Debug)
System.out.println("[Offense] #" + total + ": "+ player.getName() + " received suspicion for " + type + ".");
}
}
@ -308,7 +269,7 @@ public class AntiHack extends MiniPlugin
if (!_enabled)
return;
if (event.getType() != UpdateType.SLOW)
if (event.getType() != UpdateType.SEC)
return;
synchronized (_antiHackLock)
@ -321,12 +282,12 @@ public class AntiHack extends MiniPlugin
for (String type : _offense.get(player).keySet())
{
//Remove Old Offenses
Iterator<Long> offenseIterator = _suspicion.get(player).get(type).iterator();
Iterator<Long> offenseIterator = _offense.get(player).get(type).iterator();
while (offenseIterator.hasNext())
{
long time = offenseIterator.next();
if (UtilTime.elapsed(time, 300000))
if (UtilTime.elapsed(time, KeepOffensesFor))
offenseIterator.remove();
}
@ -340,11 +301,11 @@ public class AntiHack extends MiniPlugin
if (out.length() > 0)
out = out.substring(0, out.length() - 2);
String severity = "";
if (total > 24) severity = "Extreme";
else if (total > 16) severity = "High";
else if (total > 8) severity = "Medium";
else severity = "Low";
String severity;
if (total > (_strict ? 6 : 18)) severity = "Extreme";
else if (total > (_strict ? 4 : 12)) severity = "High";
else if (total > (_strict ? 2 : 6)) severity = "Medium";
else severity = "Low";
//Send Report
sendReport(player, out, severity);
@ -356,15 +317,53 @@ public class AntiHack extends MiniPlugin
{
if (severity.equals("Extreme"))
{
player.kickPlayer(
C.cGold + "Mineplex Anti-Cheat" + "\n" +
C.cWhite + "You were kicked for suspicious movement." + "\n" +
C.cWhite + "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + "." + "\n" +
C.cWhite + "If you were not cheating, you will not be banned."
);
ResetAll(player);
UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement."));
//Staff
boolean handled = false;
for (Player staff : UtilServer.getPlayers())
{
if (_clientManager.Get(staff).GetRank().Has(Rank.MODERATOR))
{
UtilPlayer.message(staff, C.cAqua + C.Scramble + "A" + ChatColor.RESET + C.cRed + C.Bold + " MAC > " + ChatColor.RESET + C.cYellow + report);
UtilPlayer.message(staff, C.cAqua + C.Scramble + "A" + ChatColor.RESET + C.cRed + C.Bold + " MAC > " + ChatColor.RESET + C.cGold + player.getName() + C.cYellow + " has extreme violation. Please investigate.");
handled = true;
}
}
//Auto-Kick
if (!handled)
{
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 0.5f);
if (_kick)
{
player.kickPlayer(
C.cGold + "Mineplex Anti-Cheat" + "\n" +
C.cWhite + "You were kicked for suspicious movement." + "\n" +
C.cWhite + "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + "." + "\n" +
C.cWhite + "If you were not cheating, you will not be banned."
);
}
else
{
UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
UtilPlayer.message(player, "");
UtilPlayer.message(player, C.cGold + "Mineplex Anti-Cheat");
UtilPlayer.message(player, "");
UtilPlayer.message(player, "You were kicked from the game for suspicious movement.");
UtilPlayer.message(player, "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + ".");
UtilPlayer.message(player, "If you were not cheating, you will not be banned.");
UtilPlayer.message(player, "");
UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
Portal.SendPlayerToServer(player, "Lobby");
}
UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement."));
}
//Record
ServerListPingEvent event = new ServerListPingEvent(null, Bukkit.getServer().getMotd(), Bukkit.getServer().getOnlinePlayers().size(), Bukkit.getServer().getMaxPlayers());
GetPluginManager().callEvent(event);
@ -387,6 +386,12 @@ public class AntiHack extends MiniPlugin
}
}
private void Reset()
{
for (Player player : UtilServer.getPlayers())
ResetAll(player);
}
private void ResetAll(Player player)
{
synchronized (_antiHackLock)
@ -397,7 +402,6 @@ public class AntiHack extends MiniPlugin
_offense.remove(player);
_suspicion.remove(player);
for (Detector detector : _detectors)
detector.Reset(player);
@ -413,39 +417,52 @@ public class AntiHack extends MiniPlugin
if (event.getType() != UpdateType.SLOW)
return;
for (Iterator<Entry<Player, Long>> playerIterator = _ignore.entrySet().iterator(); playerIterator.hasNext();)
synchronized (_antiHackLock)
{
Player player = playerIterator.next().getKey();
for (Iterator<Entry<Player, Long>> playerIterator = _ignore.entrySet().iterator(); playerIterator.hasNext();)
{
Player player = playerIterator.next().getKey();
if (!player.isOnline() || player.isDead() || !player.isValid())
{
playerIterator.remove();
if (!player.isOnline() || player.isDead() || !player.isValid())
{
playerIterator.remove();
_velocityEvent.remove(player);
_lastMoveEvent.remove(player);
_velocityEvent.remove(player);
_lastMoveEvent.remove(player);
_offense.remove(player);
_suspicion.remove(player);
_offense.remove(player);
for (Detector detector : _detectors)
detector.Reset(player);
for (Detector detector : _detectors)
detector.Reset(player);
}
}
}
}
public HashMap<Player, HashMap<String, ArrayList<Long>>> getOffenses()
{
return _offense;
}
public void SetEnabled(boolean b)
{
_enabled = b;
System.out.println("MAC Enabled: " + b);
}
public boolean IsEnabled()
{
return _enabled;
}
public void setStrict(boolean strict)
{
_strict = strict;
Reset();
System.out.println("MAC Strict: " + strict);
}
public void setKick(boolean kick)
{
_kick = kick;
System.out.println("MAC Kick: " + kick);
}
}

View File

@ -44,7 +44,7 @@ public class Fly extends MiniPlugin implements Detector
//100% Valid
if (Host.isValid(player, true))
return;
Reset(player);
//Hasn't moved, just looking around
if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0)
@ -52,6 +52,10 @@ public class Fly extends MiniPlugin implements Detector
updateFloat(player);
return;
}
else
{
_floatTicks.remove(player);
}
updateHover(player);
updateRise(player);
@ -76,7 +80,7 @@ public class Fly extends MiniPlugin implements Detector
if (count > Host.FloatHackTicks)
{
Host.addSuspicion(player, "Fly (Float)");
count = 0;
count -= 2;
}
_floatTicks.put(player, new AbstractMap.SimpleEntry<Integer, Double>(count, player.getLocation().getY()));
@ -96,14 +100,16 @@ public class Fly extends MiniPlugin implements Detector
{
count = 0;
}
//player.sendMessage(count + " - " + player.getLocation().getY() + " vs " + _hoverTicks.get(player).getValue());
}
if (count > Host.HoverHackTicks)
{
Host.addSuspicion(player, "Fly (Hover)");
count = 0;
count -= 2;
}
_hoverTicks.put(player, new AbstractMap.SimpleEntry<Integer, Double>(count, player.getLocation().getY()));
}
@ -113,7 +119,7 @@ public class Fly extends MiniPlugin implements Detector
if (_riseTicks.containsKey(player))
{
if (player.getLocation().getY() > _riseTicks.get(player).getValue())
if (player.getLocation().getY() >= _riseTicks.get(player).getValue())
{
boolean nearBlocks = false;
for (Block block : UtilBlock.getSurrounding(player.getLocation().getBlock(), true))
@ -143,8 +149,11 @@ public class Fly extends MiniPlugin implements Detector
if (count > Host.RiseHackTicks)
{
Host.addSuspicion(player, "Fly (Rise)");
count = 0;
//Only give Offense if actually rising - initial ticks can be trigged via Hover.
if (player.getLocation().getY() > _riseTicks.get(player).getValue())
Host.addSuspicion(player, "Fly (Rise)");
count -= 2;
}
_riseTicks.put(player, new AbstractMap.SimpleEntry<Integer, Double>(count, player.getLocation().getY()));

View File

@ -91,7 +91,7 @@ public class Speed extends MiniPlugin implements Detector
if (count > Host.SpeedHackTicks)
{
Host.addSuspicion(player, "Speed (Fly/Move)");
count = 0;
count -= 2;
}
_speedTicks.put(player, new AbstractMap.SimpleEntry<Integer, Long>(count, System.currentTimeMillis()));

View File

@ -9,6 +9,7 @@ import net.minecraft.server.v1_7_R4.Items;
import net.minecraft.server.v1_7_R4.PacketPlayOutOpenWindow;
import net.minecraft.server.v1_7_R4.PacketPlayOutSetSlot;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Creature;
@ -54,25 +55,45 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
{
List<String> itemLore = new ArrayList<String>();
itemLore.add(C.cYellow + pet.GetCost(CurrencyType.Coins) + " Coins");
itemLore.add(C.cBlack);
//Halloween Name
if (pet.GetCost(CurrencyType.Coins) == -1)
{
itemLore.add(C.cBlack);
itemLore.add(ChatColor.RESET + C.cYellow + "Earned by defeating the Pumpkin King");
itemLore.add(ChatColor.RESET + C.cYellow + "in the 2014 Halloween Horror Event.");
}
//Owned
if (DonationManager.Get(Player.getName()).OwnsUnknownPackage(pet.GetPetName()))
{
if (Plugin.getPetManager().hasActivePet(Player.getName()) && Plugin.getPetManager().getActivePet(Player.getName()).getType() == pet.GetPetType())
{
AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Deactivate " + Plugin.getPetManager().Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new DeactivatePetButton(this, Plugin.getPetManager()));
AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(),
"Deactivate " + pet.GetPetName() + " (" + C.cWhite + Plugin.getPetManager().Get(Player).GetPets().get(pet.GetPetType()) + C.cGreen + ")",
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, Plugin.getPetManager()));
addGlow(slot);
}
else
{
AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Activate " + Plugin.getPetManager().Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new ActivatePetButton(pet, this));
AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(),
"Activate " + pet.GetPetName() + " (" + C.cWhite + Plugin.getPetManager().Get(Player).GetPets().get(pet.GetPetType()) + C.cGreen + ")",
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this));
}
}
//Not Owned
else
{
if (DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins))
//Cost Lore
if (pet.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cYellow + pet.GetCost(CurrencyType.Coins) + " Coins");
itemLore.add(C.cBlack);
}
if (pet.GetCost(CurrencyType.Coins) == -1)
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
else if (DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins))
AddButton(slot, new ShopItem(Material.INK_SACK, (byte)8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new PetButton(pet, this));
else
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));

View File

@ -0,0 +1,51 @@
package mineplex.core.database;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.dbcp2.BasicDataSource;
public class DBPool
{
private static final DBPool _instance = new DBPool();
public static DBPool getInstance()
{
return _instance;
}
private BasicDataSource _source = null;
public synchronized BasicDataSource source()
{
if (_source == null || _source.isClosed())
{
_source = new BasicDataSource();
_source.addConnectionProperty("autoReconnect", "true");
_source.setDefaultAutoCommit(true);
_source.setEnableAutoCommitOnReturn(true);
_source.setDefaultTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
_source.setDriverClassName("com.mysql.jdbc.Driver");
_source.setUrl("jdbc:mysql://db.mineplex.com/Account");
_source.setUsername("root");
_source.setPassword("tAbechAk3wR7tuTh");
}
return _source;
}
public synchronized Connection getConnection() throws SQLException
{
return source().getConnection();
}
public synchronized void close() throws SQLException
{
if (_source != null)
{
_source.close();
_source = null;
}
}
}

View File

@ -0,0 +1,27 @@
package mineplex.core.database;
public class DatabaseRunnable
{
private Runnable _runnable;
private int _failedAttempts = 0;
public DatabaseRunnable(Runnable runnable)
{
_runnable = runnable;
}
public void run()
{
_runnable.run();
}
public void incrementFailCount()
{
_failedAttempts++;
}
public int getFailedCounts()
{
return _failedAttempts;
}
}

View File

@ -5,24 +5,39 @@ import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.database.column.Column;
import mineplex.core.logger.Logger;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public abstract class RepositoryBase
public abstract class RepositoryBase implements Listener
{
protected static Object _connectionLock = new Object();
private Connection _connection = null;
private static Object _queueLock = new Object();
private NautHashMap<DatabaseRunnable, String> _failedQueue = new NautHashMap<DatabaseRunnable, String>();
private String _connectionString;
private String _userName;
private String _password;
protected JavaPlugin Plugin;
public RepositoryBase(JavaPlugin plugin, String connectionString, String username, String password)
{
Plugin = plugin;
_connectionString = connectionString;
_userName = username;
_password = password;
@ -38,6 +53,8 @@ public abstract class RepositoryBase
}
}
});
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
protected abstract void initialize();
@ -189,4 +206,81 @@ public abstract class RepositoryBase
return affectedRows;
}
protected void handleDatabaseCall(final DatabaseRunnable databaseRunnable, final String errorMessage)
{
Thread asyncThread = new Thread(new Runnable()
{
public void run()
{
try
{
databaseRunnable.run();
}
catch (Exception exception)
{
Logger.Instance.log(errorMessage + exception.getMessage());
databaseRunnable.incrementFailCount();
synchronized (_queueLock)
{
_failedQueue.put(databaseRunnable, errorMessage);
}
}
}
});
asyncThread.start();
}
@EventHandler
public void processDatabaseQueue(UpdateEvent event)
{
if (event.getType() != UpdateType.MIN_01)
return;
processFailedQueue();
}
private void processFailedQueue()
{
synchronized (_queueLock)
{
for (Iterator<DatabaseRunnable> runnablesIterator = _failedQueue.keySet().iterator(); runnablesIterator.hasNext();)
{
final DatabaseRunnable databaseRunnable = runnablesIterator.next();
Thread asyncThread = new Thread(new Runnable()
{
public void run()
{
try
{
databaseRunnable.run();
}
catch (Exception exception)
{
Logger.Instance.log(_failedQueue.get(databaseRunnable) + exception.getMessage());
if (databaseRunnable.getFailedCounts() < 4)
{
synchronized (_queueLock)
{
_failedQueue.put(databaseRunnable, _failedQueue.get(databaseRunnable));
}
}
else
{
Logger.Instance.log("Abandoning database call : " + _failedQueue.get(databaseRunnable));
}
}
}
});
runnablesIterator.remove();
asyncThread.start();
}
}
}
}

View File

@ -0,0 +1,42 @@
package mineplex.core.database.column;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ColumnBoolean extends Column<Boolean>
{
public ColumnBoolean(String name)
{
super(name);
}
public ColumnBoolean(String name, boolean value)
{
super(name, value);
}
@Override
public String getCreateString()
{
return Name + " BOOLEAN";
}
@Override
public Boolean getValue(ResultSet resultSet) throws SQLException
{
return resultSet.getBoolean(Name);
}
@Override
public void setValue(PreparedStatement preparedStatement, int columnNumber) throws SQLException
{
preparedStatement.setBoolean(columnNumber, Value);
}
@Override
public ColumnBoolean clone()
{
return new ColumnBoolean(Name, Value);
}
}

View File

@ -0,0 +1,43 @@
package mineplex.core.database.column;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
public class ColumnTimestamp extends Column<Timestamp>
{
public ColumnTimestamp(String name)
{
super(name);
}
public ColumnTimestamp(String name, Timestamp value)
{
super(name, value);
}
@Override
public String getCreateString()
{
return Name + " TIMESTAMP";
}
@Override
public Timestamp getValue(ResultSet resultSet) throws SQLException
{
return resultSet.getTimestamp(Name);
}
@Override
public void setValue(PreparedStatement preparedStatement, int columnNumber) throws SQLException
{
preparedStatement.setTimestamp(columnNumber, Value);
}
@Override
public ColumnTimestamp clone()
{
return new ColumnTimestamp(Name, Value);
}
}

View File

@ -0,0 +1,51 @@
package mineplex.core.donation;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
public class CoinCommand extends CommandBase<DonationManager>
{
public CoinCommand(DonationManager plugin)
{
super(plugin, Rank.ADMIN, "coin");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args.length < 2)
{
UtilPlayer.message(caller, F.main("Coin", "Missing Args"));
return;
}
//Try Online
final Player target = UtilPlayer.searchOnline(caller, args[0], true);
if (target == null)
return;
//Give Coins to Target
try
{
final int coins = Integer.parseInt(args[1]);
Plugin.RewardCoins(new Callback<Boolean>()
{
public void run(Boolean completed)
{
UtilPlayer.message(caller, F.main("Coin", "You gave " + F.elem(coins + " Coins") + " to " + F.name(target.getName()) + "."));
UtilPlayer.message(target, F.main("Coin", F.name(caller.getName()) + " gave you " + F.elem(coins + " Coins") + "."));
}
}, caller.getName(), target.getName(), target.getUniqueId(), coins);
}
catch (Exception e)
{
UtilPlayer.message(caller, F.main("Coin", "Invalid Coins Amount"));
}
}
}

View File

@ -1,5 +1,12 @@
package mineplex.core.donation;
import java.util.UUID;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.event.ClientUnloadEvent;
import mineplex.core.account.event.ClientWebResponseEvent;
@ -12,10 +19,6 @@ import mineplex.core.server.util.TransactionResponse;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
public class DonationManager extends MiniPlugin
{
private DonationRepository _repository;
@ -24,13 +27,13 @@ public class DonationManager extends MiniPlugin
private Object _donorLock = new Object();
private NautHashMap<String, NautHashMap<String, Integer>> _gemQueue = new NautHashMap<String, NautHashMap<String, Integer>>();
private NautHashMap<Player, NautHashMap<String, Integer>> _gemQueue = new NautHashMap<Player, NautHashMap<String, Integer>>();
public DonationManager(JavaPlugin plugin, String webAddress)
{
super("Donation", plugin);
_repository = new DonationRepository(webAddress);
_repository = new DonationRepository(plugin, webAddress);
_donors = new NautHashMap<String, Donor>();
}
@ -39,13 +42,14 @@ public class DonationManager extends MiniPlugin
public void AddCommands()
{
AddCommand(new GemCommand(this));
AddCommand(new CoinCommand(this));
}
@EventHandler
public void OnClientWebResponse(ClientWebResponseEvent event)
{
DonorTokenWrapper token = new Gson().fromJson(event.GetResponse(), DonorTokenWrapper.class);
LoadDonor(token);
LoadDonor(token, event.getUniqueId());
}
@EventHandler
@ -57,11 +61,12 @@ public class DonationManager extends MiniPlugin
}
}
private void LoadDonor(DonorTokenWrapper token)
private void LoadDonor(DonorTokenWrapper token, UUID uuid)
{
synchronized (_donorLock)
{
_donors.put(token.Name, new Donor(token.DonorToken));
_repository.updateGemsAndCoins(uuid, Get(token.Name).GetGems(), Get(token.Name).getCoins());
}
}
@ -73,7 +78,7 @@ public class DonationManager extends MiniPlugin
}
}
public void PurchaseUnknownSalesPackage(final Callback<TransactionResponse> callback, final String name, final String packageName, final boolean coinPurchase, final int cost, boolean oneTimePurchase)
public void PurchaseUnknownSalesPackage(final Callback<TransactionResponse> callback, final String name, final UUID uuid, final String packageName, final boolean coinPurchase, final int cost, boolean oneTimePurchase)
{
Donor donor = Get(name);
@ -106,10 +111,10 @@ public class DonationManager extends MiniPlugin
if (callback != null)
callback.run(response);
}
}, name, packageName, coinPurchase, cost);
}, name, uuid.toString(), packageName, coinPurchase, cost);
}
public void PurchaseKnownSalesPackage(final Callback<TransactionResponse> callback, final String name, final int salesPackageId)
public void PurchaseKnownSalesPackage(final Callback<TransactionResponse> callback, final String name, final UUID uuid, final int cost, final int salesPackageId)
{
_repository.PurchaseKnownSalesPackage(new Callback<TransactionResponse>()
{
@ -128,17 +133,17 @@ public class DonationManager extends MiniPlugin
if (callback != null)
callback.run(response);
}
}, name, salesPackageId);
}, name, uuid.toString(), cost, salesPackageId);
}
public void RewardGems(final Callback<Boolean> callback, final String caller, final String name, final int amount)
public void RewardGems(Callback<Boolean> callback, String caller, String name, UUID uuid, int amount)
{
RewardGems(callback, caller, name, amount, true);
RewardGems(callback, caller, name, uuid, amount, true);
}
public void RewardGems(final Callback<Boolean> callback, final String caller, final String name, final int amount, final boolean updateTotal)
public void RewardGems(final Callback<Boolean> callback, final String caller, final String name, final UUID uuid, final int amount, final boolean updateTotal)
{
_repository.PlayerUpdate(new Callback<Boolean>()
_repository.gemReward(new Callback<Boolean>()
{
public void run(Boolean success)
{
@ -158,23 +163,23 @@ public class DonationManager extends MiniPlugin
callback.run(true);
}
}
}, caller, name, amount);
}, caller, name, uuid.toString(), amount);
}
public void RewardGemsLater(final String caller, final String name, final int amount)
public void RewardGemsLater(final String caller, final Player player, final int amount)
{
if (!_gemQueue.containsKey(name))
_gemQueue.put(name, new NautHashMap<String, Integer>());
if (!_gemQueue.containsKey(player))
_gemQueue.put(player, new NautHashMap<String, Integer>());
int totalAmount = amount;
if (_gemQueue.get(name).containsKey(caller))
totalAmount += _gemQueue.get(name).get(caller);
if (_gemQueue.get(player).containsKey(caller))
totalAmount += _gemQueue.get(player).get(caller);
_gemQueue.get(name).put(caller, totalAmount);
_gemQueue.get(player).put(caller, totalAmount);
//Do Temp Change
Donor donor = Get(name);
Donor donor = Get(player.getName());
if (donor != null)
donor.AddGems(amount);
@ -186,39 +191,39 @@ public class DonationManager extends MiniPlugin
if (event.getType() != UpdateType.SLOWER)
return;
for (String name : _gemQueue.keySet())
for (Player player : _gemQueue.keySet())
{
String caller = null;
int total = 0;
for (String curCaller : _gemQueue.get(name).keySet())
for (String curCaller : _gemQueue.get(player).keySet())
{
caller = curCaller;
total += _gemQueue.get(name).get(curCaller);
total += _gemQueue.get(player).get(curCaller);
}
if (caller == null)
continue;
//Actually Add Gems
RewardGems(null, caller, name, total, false);
RewardGems(null, caller, player.getName(), player.getUniqueId(), total, false);
System.out.println("Queue Added [" + name + "] with Gems [" + total + "] for [" + caller + "]");
System.out.println("Queue Added [" + player + "] with Gems [" + total + "] for [" + caller + "]");
//Clean
_gemQueue.get(name).clear();
_gemQueue.get(player).clear();
}
//Clean
_gemQueue.clear();
}
public void RewardCoins(final Callback<Boolean> callback, final String caller, final String name, final int amount)
public void RewardCoins(Callback<Boolean> callback, String caller, String name, UUID uuid, int amount)
{
RewardCoins(callback, caller, name, amount, true);
RewardCoins(callback, caller, name, uuid, amount, true);
}
public void RewardCoins(final Callback<Boolean> callback, final String caller, final String name, final int amount, final boolean updateTotal)
public void RewardCoins(final Callback<Boolean> callback, final String caller, final String name, final UUID uuid, final int amount, final boolean updateTotal)
{
_repository.rewardCoins(new Callback<Boolean>()
{
@ -240,6 +245,6 @@ public class DonationManager extends MiniPlugin
callback.run(true);
}
}
}, caller, name, amount);
}, caller, name, uuid.toString(), amount);
}
}

View File

@ -41,7 +41,7 @@ public class GemCommand extends CommandBase<DonationManager>
UtilPlayer.message(caller, F.main("Gem", "You gave " + F.elem(gems + " Gems") + " to " + F.name(target.getName()) + "."));
UtilPlayer.message(target, F.main("Gem", F.name(caller.getName()) + " gave you " + F.elem(gems + " Gems") + "."));
}
}, caller.getName(), target.getName(), gems);
}, caller.getName(), target.getName(), target.getUniqueId(), gems);
}
catch (Exception e)
{

View File

@ -1,58 +1,187 @@
package mineplex.core.donation.repository;
import java.util.UUID;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.database.DatabaseRunnable;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.column.ColumnInt;
import mineplex.core.database.column.ColumnVarChar;
import mineplex.core.donation.repository.token.GemRewardToken;
import mineplex.core.donation.repository.token.PurchaseToken;
import mineplex.core.donation.repository.token.UnknownPurchaseToken;
import mineplex.core.server.remotecall.AsyncJsonWebCall;
import mineplex.core.server.remotecall.JsonWebCall;
import mineplex.core.server.util.TransactionResponse;
public class DonationRepository
public class DonationRepository extends RepositoryBase
{
private static String CREATE_COIN_TRANSACTION_TABLE = "CREATE TABLE IF NOT EXISTS accountCoinTransactions (id INT NOT NULL AUTO_INCREMENT, accounts_uuid VARCHAR(100), reason VARCHAR(100), coins INT, PRIMARY KEY (id), FOREIGN KEY (accounts_uuid) REFERENCES accounts(uuid), INDEX coinUuidIndex (accounts_uuid));";
private static String CREATE_GEM_TRANSACTION_TABLE = "CREATE TABLE IF NOT EXISTS accountGemTransactions (id INT NOT NULL AUTO_INCREMENT, accounts_uuid VARCHAR(100), reason VARCHAR(100), gems INT, PRIMARY KEY (id), FOREIGN KEY (accounts_uuid) REFERENCES accounts(uuid), INDEX gemUuidIndex (accounts_uuid));";
private static String INSERT_COIN_TRANSACTION = "INSERT INTO accountCoinTransactions(accounts_uuid, reason, coins) VALUES(?, ?, ?);";
private static String INSERT_GEM_TRANSACTION = "INSERT INTO accountGemTransactions(accounts_uuid, reason, gems) VALUES(?, ?, ?);";
private static String UPDATE_ACCOUNT_COINS = "UPDATE accounts SET coins = coins + ? WHERE uuid = ?;";
private static String UPDATE_ACCOUNT_GEMS = "UPDATE accounts SET gems = gems + ? WHERE uuid = ?;";
private static String UPDATE_NULL_ACCOUNT_GEMS_AND_COINS_ = "UPDATE accounts SET gems = ?, coins = ? WHERE uuid = ? AND gems IS NULL AND coins IS NULL;";
private String _webAddress;
public DonationRepository(String webAddress)
public DonationRepository(JavaPlugin plugin, String webAddress)
{
super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh");
_webAddress = webAddress;
}
public void PurchaseKnownSalesPackage(Callback<TransactionResponse> callback, String name, int salesPackageId)
public void PurchaseKnownSalesPackage(final Callback<TransactionResponse> callback, String name, final String uuid, final int cost, final int salesPackageId)
{
PurchaseToken token = new PurchaseToken();
final PurchaseToken token = new PurchaseToken();
token.AccountName = name;
token.UsingCredits = false;
token.SalesPackageId = salesPackageId;
new AsyncJsonWebCall(_webAddress + "PlayerAccount/PurchaseKnownSalesPackage").Execute(TransactionResponse.class, callback, token);
final Callback<TransactionResponse> extraCallback = new Callback<TransactionResponse>()
{
public void run(TransactionResponse response)
{
if (response == TransactionResponse.Success)
executeUpdate(UPDATE_ACCOUNT_GEMS, new ColumnInt("gems", cost), new ColumnVarChar("uuid", 100, uuid));
callback.run(response);
}
};
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
new JsonWebCall(_webAddress + "PlayerAccount/PurchaseKnownSalesPackage").Execute(TransactionResponse.class, extraCallback, token);
}
}), "Error purchasing known sales package in DonationRepository : ");
}
public void PurchaseUnknownSalesPackage(Callback<TransactionResponse> callback, String name, String packageName, boolean coinPurchase, int cost)
public void PurchaseUnknownSalesPackage(final Callback<TransactionResponse> callback, final String name, final String uuid, final String packageName, final boolean coinPurchase, final int cost)
{
UnknownPurchaseToken token = new UnknownPurchaseToken();
final UnknownPurchaseToken token = new UnknownPurchaseToken();
token.AccountName = name;
token.SalesPackageName = packageName;
token.CoinPurchase = coinPurchase;
token.Cost = cost;
token.Premium = false;
new AsyncJsonWebCall(_webAddress + "PlayerAccount/PurchaseUnknownSalesPackage").Execute(TransactionResponse.class, callback, token);
final Callback<TransactionResponse> extraCallback = new Callback<TransactionResponse>()
{
public void run(TransactionResponse response)
{
if (response == TransactionResponse.Success)
{
if (coinPurchase)
{
executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", -cost), new ColumnVarChar("uuid", 100, uuid));
executeUpdate(INSERT_COIN_TRANSACTION, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("reason", 100, "Purchased " + packageName), new ColumnInt("coins", -cost));
}
else
{
executeUpdate(UPDATE_ACCOUNT_GEMS, new ColumnInt("gems", -cost), new ColumnVarChar("uuid", 100, uuid));
executeUpdate(INSERT_GEM_TRANSACTION, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("reason", 100, "Purchased " + packageName), new ColumnInt("gems", -cost));
}
}
callback.run(response);
}
};
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
new JsonWebCall(_webAddress + "PlayerAccount/PurchaseUnknownSalesPackage").Execute(TransactionResponse.class, extraCallback, token);
}
}), "Error purchasing unknown sales package in DonationRepository : ");
}
public void PlayerUpdate(Callback<Boolean> callback, String giver, String name, int greenGems)
public void gemReward(final Callback<Boolean> callback, final String giver, String name, final String uuid, final int greenGems)
{
GemRewardToken token = new GemRewardToken();
final GemRewardToken token = new GemRewardToken();
token.Source = giver;
token.Name = name;
token.Amount = greenGems;
new AsyncJsonWebCall(_webAddress + "PlayerAccount/GemReward").Execute(Boolean.class, callback, token);
final Callback<Boolean> extraCallback = new Callback<Boolean>()
{
public void run(Boolean response)
{
if (response)
{
executeUpdate(UPDATE_ACCOUNT_GEMS, new ColumnInt("gems", greenGems), new ColumnVarChar("uuid", 100, uuid));
executeUpdate(INSERT_GEM_TRANSACTION, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("reason", 100, "Given by " + giver), new ColumnInt("gems", greenGems));
}
callback.run(response);
}
};
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
new JsonWebCall(_webAddress + "PlayerAccount/GemReward").Execute(Boolean.class, extraCallback, token);
}
}), "Error updating player gem amount in DonationRepository : ");
}
public void rewardCoins(Callback<Boolean> callback, String giver, String name, int coins)
public void rewardCoins(final Callback<Boolean> callback, final String giver, String name, final String uuid, final int coins)
{
GemRewardToken token = new GemRewardToken();
final GemRewardToken token = new GemRewardToken();
token.Source = giver;
token.Name = name;
token.Amount = coins;
new AsyncJsonWebCall(_webAddress + "PlayerAccount/CoinReward").Execute(Boolean.class, callback, token);
final Callback<Boolean> extraCallback = new Callback<Boolean>()
{
public void run(Boolean response)
{
if (response)
{
executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", coins), new ColumnVarChar("uuid", 100, uuid));
executeUpdate(INSERT_COIN_TRANSACTION, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("reason", 100, "Rewarded by " + giver), new ColumnInt("coins", coins));
}
callback.run(response);
}
};
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
new JsonWebCall(_webAddress + "PlayerAccount/CoinReward").Execute(Boolean.class, extraCallback, token);
}
}), "Error updating player coin amount in DonationRepository : ");
}
@Override
protected void initialize()
{
executeUpdate(CREATE_COIN_TRANSACTION_TABLE);
executeUpdate(CREATE_GEM_TRANSACTION_TABLE);
}
@Override
protected void update()
{
}
public void updateGemsAndCoins(final UUID uuid, final int gems, final int coins)
{
handleDatabaseCall(new DatabaseRunnable(new Runnable()
{
public void run()
{
executeUpdate(UPDATE_NULL_ACCOUNT_GEMS_AND_COINS_, new ColumnInt("gems", gems), new ColumnInt("coins", coins), new ColumnVarChar("uuid", 100, uuid.toString()));
}
}), "Error updating player's null gems and coins DonationRepository : ");
}
}

View File

@ -74,6 +74,8 @@ public class ItemCoinBomb extends ItemGadget
{
if (Math.random() > 0.80)
UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BURST).trail(false).build());
else
item.getWorld().playSound(item.getLocation(), Sound.FIREWORK_LAUNCH, 1f, 1f);
Item coin = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.getMaterial(175)));
@ -108,7 +110,7 @@ public class ItemCoinBomb extends ItemGadget
event.setCancelled(true);
event.getItem().remove();
Manager.getDonationManager().RewardCoins(null, this.GetName() + " Pickup", event.getPlayer().getName(), 4);
Manager.getDonationManager().RewardCoins(null, this.GetName() + " Pickup", event.getPlayer().getName(), event.getPlayer().getUniqueId(), 4);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);

View File

@ -108,7 +108,7 @@ public class ItemGemBomb extends ItemGadget
event.setCancelled(true);
event.getItem().remove();
Manager.getDonationManager().RewardGems(null, this.GetName() + " Pickup", event.getPlayer().getName(), 4);
Manager.getDonationManager().RewardGems(null, this.GetName() + " Pickup", event.getPlayer().getName(), event.getPlayer().getUniqueId(), 4);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);

View File

@ -5,25 +5,21 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.BlockIterator;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.event.StackerEvent;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetActivateEvent;
import mineplex.core.gadget.event.GadgetBlockEvent;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
@ -122,7 +118,10 @@ public class MorphBlock extends MorphGadget
public void fallingBlockForm(EntityChangeBlockEvent event)
{
if (_blocks.remove(event.getEntity()))
{
event.getEntity().remove();
event.setCancelled(true);
}
}
@EventHandler
@ -144,4 +143,22 @@ public class MorphBlock extends MorphGadget
}
}
}
@EventHandler
public void itemSpawnCancel(ItemSpawnEvent event)
{
Iterator<FallingBlock> blockIterator = _blocks.iterator();
while (blockIterator.hasNext())
{
FallingBlock block = blockIterator.next();
if (UtilMath.offset(block, event.getEntity()) < 0.1)
{
block.remove();
blockIterator.remove();
event.setCancelled(true);
}
}
}
}

View File

@ -55,6 +55,9 @@ public class MorphEnderman extends MorphGadget
{
this.RemoveArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);
player.setFlying(false);
}
@EventHandler

View File

@ -37,6 +37,8 @@ public abstract class ParticleGadget extends Gadget
if (player.getGameMode() != GameMode.SURVIVAL)
return false;
if (Manager.hideParticles())
return false;

View File

@ -52,6 +52,8 @@ public class Logger
public void log(final String message)
{
System.out.println(message);
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable()
{
public void run()

View File

@ -1,89 +0,0 @@
package mineplex.core.npc.Commands;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnum;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.npc.NpcManager;
public class AddCommand extends CommandBase<NpcManager>
{
public AddCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "add");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args == null)
{
Plugin.Help(caller);
}
else
{
try
{
int radius = Integer.parseInt(args[0]);
String mobName = null;
if (args.length > 1)
{
mobName = args[1];
if (args.length > 2)
{
for (int i = 2; i < args.length; i++)
{
mobName += " " + args[i];
}
}
while (mobName.indexOf('(') != -1)
{
int startIndex = mobName.indexOf('(');
if (mobName.indexOf(')') == -1)
break;
int endIndex = mobName.indexOf(')');
if (endIndex < startIndex)
break;
String originalText = mobName.substring(startIndex, endIndex + 1);
String colorString = mobName.substring(startIndex + 1, endIndex);
ChatColor color = UtilEnum.fromString(ChatColor.class, colorString);
mobName = mobName.replace(originalText, color + "");
}
}
/*
if (mobName.indexOf('_') != -1)
{
String[] mobParts = mobName.split("_");
mobName = mobParts[0];
mobSecondLine = mobParts[1];
}
*/
Plugin.SetNpcInfo(caller, radius, mobName, caller.getLocation());
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Location set, now right click entity."));
}
catch(NumberFormatException exception)
{
Plugin.Help(caller, "Invalid radius.");
}
catch(IllegalArgumentException exception)
{
Plugin.Help(caller, "Invalid color.");
}
}
}
}

View File

@ -1,31 +0,0 @@
package mineplex.core.npc.Commands;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.npc.NpcManager;
import org.bukkit.entity.Player;
public class ReattachCommand extends CommandBase<NpcManager>
{
public ReattachCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "reattach");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args != null)
{
Plugin.Help(caller);
}
else
{
Plugin.ReattachNpcs();
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Npcs reattached."));
}
}
}

View File

@ -1,132 +0,0 @@
package mineplex.core.npc;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.creature.Creature;
import mineplex.database.Tables;
import mineplex.database.tables.records.NpcsRecord;
import org.jooq.DSLContext;
import org.jooq.Query;
import org.jooq.Result;
import org.jooq.impl.DSL;
public class DatabaseNpcManager extends NpcManager
{
private final Connection _connection;
public DatabaseNpcManager(JavaPlugin plugin, Creature creature, Connection connection)
{
super(plugin, creature);
_connection = connection;
}
public Connection getConnection()
{
return _connection;
}
@Override
public void SaveNpcs()
{
String serverType = GetPlugin().getClass().getSimpleName();
DSLContext context = DSL.using(getConnection());
List<Query> queryList = new ArrayList<>();
Query query = context
.delete(Tables.npcs)
.where(Tables.npcs.server.eq(serverType));
queryList.add(query);
for (Map.Entry<String, NpcEntry> entry : _npcs.entrySet())
{
String helmet = null;
String chestplate = null;
String leggings = null;
String boots = null;
String inHand = null;
if (entry.getValue().Entity instanceof LivingEntity)
{
LivingEntity livingEntity = (LivingEntity) entry.getValue().Entity;
helmet = getItemStackYaml(livingEntity.getEquipment().getHelmet());
chestplate = getItemStackYaml(livingEntity.getEquipment().getChestplate());
leggings = getItemStackYaml(livingEntity.getEquipment().getLeggings());
boots = getItemStackYaml(livingEntity.getEquipment().getBoots());
inHand = getItemStackYaml(livingEntity.getEquipment().getItemInHand());
}
query = context
.insertInto(Tables.npcs)
.set(Tables.npcs.server, serverType)
.set(Tables.npcs.uuid, entry.getKey())
.set(Tables.npcs.name, entry.getValue().Name)
.set(Tables.npcs.world, entry.getValue().Location.getWorld().getName())
.set(Tables.npcs.x, entry.getValue().Location.getX())
.set(Tables.npcs.y, entry.getValue().Location.getY())
.set(Tables.npcs.z, entry.getValue().Location.getZ())
.set(Tables.npcs.radius, entry.getValue().Radius)
.set(Tables.npcs.entityType, entry.getValue().Entity.getType().name())
.set(Tables.npcs.adult, !(entry.getValue().Entity instanceof Ageable) || ((Ageable) entry.getValue().Entity).isAdult())
.set(Tables.npcs.helmet, helmet)
.set(Tables.npcs.chestplate, chestplate)
.set(Tables.npcs.leggings, leggings)
.set(Tables.npcs.boots, boots)
.set(Tables.npcs.inHand, inHand);
queryList.add(query);
}
context.batch(queryList).execute();
}
@Override
public void LoadNpcs()
{
String serverType = GetPlugin().getClass().getSimpleName();
DSLContext context = DSL.using(getConnection());
Result<NpcsRecord> result = context
.selectFrom(Tables.npcs)
.where(Tables.npcs.server.eq(serverType))
.fetch();
for (NpcsRecord record : result)
{
UUID uuid = UUID.fromString(record.getUuid());
Location location = new Location(Bukkit.getWorld(record.getWorld()), record.getX(), record.getY(), record.getZ());
int radius = record.getRadius();
_npcs.put(uuid.toString(), new NpcEntry(record.getName(), null, radius, location));
}
}
private static String getItemStackYaml(ItemStack stack)
{
if (stack == null || stack.getType() == Material.AIR)
return null;
else
{
YamlConfiguration configuration = new YamlConfiguration();
configuration.set("stack", stack);
return configuration.saveToString();
}
}
}

View File

@ -0,0 +1,116 @@
package mineplex.core.npc;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import net.minecraft.server.v1_7_R4.EntityCreature;
import mineplex.database.tables.records.NpcsRecord;
public class Npc
{
private final NpcManager _npcManager;
private final NpcsRecord _databaseRecord;
private final Location _location;
private LivingEntity _entity;
private int _failedAttempts = 0;
private boolean _returning = false;
public Npc(NpcManager npcManager, NpcsRecord databaseRecord)
{
_npcManager = npcManager;
_databaseRecord = databaseRecord;
_location = new Location(Bukkit.getWorld(getDatabaseRecord().getWorld()), getDatabaseRecord().getX(), getDatabaseRecord().getY(), getDatabaseRecord().getZ());
}
public void setEntity(LivingEntity entity)
{
if (_entity != null)
getNpcManager()._npcMap.remove(_entity.getUniqueId());
_entity = entity;
if (_entity != null)
getNpcManager()._npcMap.put(_entity.getUniqueId(), this);
}
public LivingEntity getEntity()
{
return _entity;
}
public NpcsRecord getDatabaseRecord()
{
return _databaseRecord;
}
public int getFailedAttempts()
{
return _failedAttempts;
}
public void setFailedAttempts(int failedAttempts)
{
_failedAttempts = failedAttempts;
}
public int incrementFailedAttempts()
{
return ++_failedAttempts;
}
public Location getLocation()
{
return _location;
}
public double getRadius()
{
return getDatabaseRecord().getRadius();
}
public boolean isInRadius(Location location)
{
if (location.getWorld() != getLocation().getWorld())
return false;
return location.distanceSquared(getLocation()) <= getRadius() * getRadius();
}
public void returnToPost()
{
EntityCreature ec = ((CraftCreature) _entity).getHandle();
ec.getNavigation().a(getLocation().getX(), getLocation().getY(), getLocation().getZ(), .8f);
_returning = true;
}
public boolean isReturning()
{
return _returning;
}
public void clearGoals(Entity entity)
{
_returning = false;
Location entityLocation = entity.getLocation();
EntityCreature ec = ((CraftCreature) entity).getHandle();
ec.getNavigation().a(entityLocation.getX(), entityLocation.getY(), entityLocation.getZ(), .8f);
}
public NpcManager getNpcManager()
{
return _npcManager;
}
public Chunk getChunk()
{
return getLocation().getChunk();
}
}

View File

@ -1,53 +0,0 @@
package mineplex.core.npc;
import net.minecraft.server.v1_7_R4.EntityCreature;
import org.bukkit.entity.Entity;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
import org.bukkit.Location;
public class NpcEntry
{
public String Name;
public Entity Entity;
public int Radius;
public Location Location;
private boolean _returning = false;
public NpcEntry(String name, Entity entity, int radius, Location location)
{
Name = name;
Entity = entity;
Radius = radius;
Location = location;
}
public void ReturnToPost()
{
EntityCreature ec = ((CraftCreature)Entity).getHandle();
ec.getNavigation().a(Location.getX(), Location.getY(), Location.getZ(), .8f);
_returning = true;
}
public boolean IsInRadius()
{
Location entityLocation = Entity.getLocation();
return Math.abs(entityLocation.getBlockX() - Location.getBlockX()) + Math.abs(entityLocation.getBlockY() - Location.getBlockY()) + Math.abs(entityLocation.getBlockZ() - Location.getBlockZ()) <= Radius;
}
public boolean Returning()
{
return _returning;
}
public void ClearGoals()
{
_returning = false;
Location entityLocation = Entity.getLocation();
EntityCreature ec = ((CraftCreature)Entity).getHandle();
ec.getNavigation().a(entityLocation.getX(), entityLocation.getY(), entityLocation.getZ(), .8f);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
package mineplex.core.npc.command;
import java.sql.SQLException;
import org.bukkit.ChatColor;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.npc.NpcManager;
public class AddCommand extends CommandBase<NpcManager>
{
public AddCommand(NpcManager plugin)
{
super(plugin, Rank.DEVELOPER, "add");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args == null)
Plugin.help(caller);
else
{
EntityType type;
try
{
type = EntityType.valueOf(args[0].toUpperCase());
}
catch (IllegalArgumentException e)
{
Plugin.help(caller, "Invalid entity.");
return;
}
double radius = 0;
if (args.length >= 2)
{
try
{
radius = Double.parseDouble(args[1]);
}
catch (NumberFormatException e)
{
Plugin.help(caller, "Invalid radius.");
return;
}
}
boolean adult = true;
if (args.length >= 3)
adult = Boolean.parseBoolean(args[2]);
String name = null;
if (args.length >= 4)
{
name = args[3];
for (int i = 4; i < args.length; i++)
name += " " + args[i];
}
try
{
Plugin.addNpc(caller, type, radius, adult, name, null);
}
catch (SQLException e)
{
Plugin.help(caller, "Database error.");
}
}
}
}

View File

@ -1,4 +1,6 @@
package mineplex.core.npc.Commands;
package mineplex.core.npc.command;
import java.sql.SQLException;
import org.bukkit.entity.Player;
@ -12,20 +14,26 @@ public class ClearCommand extends CommandBase<NpcManager>
{
public ClearCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "clear");
super(plugin, Rank.DEVELOPER, "clear");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args != null)
{
Plugin.Help(caller);
}
Plugin.help(caller);
else
{
Plugin.ClearNpcs();
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Cleared npcs."));
try
{
Plugin.clearNpcs(true);
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Cleared NPCs."));
}
catch (SQLException e)
{
Plugin.help(caller, "Database error.");
}
}
}
}
}

View File

@ -1,4 +1,4 @@
package mineplex.core.npc.Commands;
package mineplex.core.npc.command;
import org.bukkit.entity.Player;
@ -12,19 +12,18 @@ public class DeleteCommand extends CommandBase<NpcManager>
{
public DeleteCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "del");
super(plugin, Rank.DEVELOPER, "del");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args != null)
{
Plugin.Help(caller);
}
Plugin.help(caller);
else
{
Plugin.PrepDeleteNpc(caller);
Plugin.prepDeleteNpc(caller);
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Now right click npc."));
}
}

View File

@ -1,4 +1,4 @@
package mineplex.core.npc.Commands;
package mineplex.core.npc.command;
import org.bukkit.entity.Player;
@ -12,19 +12,18 @@ public class HomeCommand extends CommandBase<NpcManager>
{
public HomeCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "home");
super(plugin, Rank.DEVELOPER, "home");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args != null)
{
Plugin.Help(caller);
}
Plugin.help(caller);
else
{
Plugin.TeleportNpcsHome();
Plugin.teleportNpcsHome();
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Npcs teleported to home locations."));
}
}

View File

@ -1,4 +1,4 @@
package mineplex.core.npc.Commands;
package mineplex.core.npc.command;
import org.bukkit.entity.Player;
@ -10,18 +10,18 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
{
public NpcCommand(NpcManager plugin)
{
super(plugin, Rank.OWNER, "npc");
super(plugin, Rank.DEVELOPER, "npc");
AddCommand(new AddCommand(plugin));
AddCommand(new DeleteCommand(plugin));
AddCommand(new ClearCommand(plugin));
AddCommand(new HomeCommand(plugin));
AddCommand(new ReattachCommand(plugin));
AddCommand(new ClearCommand(plugin));
AddCommand(new RefreshCommand(plugin));
}
@Override
protected void Help(Player caller, String args[])
{
Plugin.Help(caller);
Plugin.help(caller);
}
}

View File

@ -0,0 +1,40 @@
package mineplex.core.npc.command;
import java.sql.SQLException;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.npc.NpcManager;
public class RefreshCommand extends CommandBase<NpcManager>
{
public RefreshCommand(NpcManager plugin)
{
super(plugin, Rank.DEVELOPER, "refresh");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args != null)
Plugin.help(caller);
else
{
try
{
Plugin.clearNpcs(false);
Plugin.loadNpcs();
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Refreshed NPCs."));
}
catch (SQLException e)
{
Plugin.help(caller, "Database error.");
}
}
}
}

View File

@ -8,6 +8,7 @@ import mineplex.core.common.util.NautHashMap;
import mineplex.core.pet.repository.PetRepository;
import mineplex.core.pet.repository.token.PetExtraToken;
import mineplex.core.pet.repository.token.PetSalesToken;
import mineplex.core.pet.types.Pumpkin;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
@ -30,13 +31,14 @@ public class PetFactory
private void CreatePets()
{
_pets.put(EntityType.ZOMBIE, new Pumpkin());
_pets.put(EntityType.PIG, new Pet("Pig", EntityType.PIG, 5000));
_pets.put(EntityType.SHEEP, new Pet("Sheep", EntityType.SHEEP, 3000));
_pets.put(EntityType.COW, new Pet("Cow", EntityType.COW, 2000));
_pets.put(EntityType.CHICKEN, new Pet("Chicken", EntityType.CHICKEN, 7000));
_pets.put(EntityType.WOLF, new Pet("Dog", EntityType.WOLF, 8000));
_pets.put(EntityType.OCELOT, new Pet("Cat", EntityType.OCELOT, 6000));
_pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000));
_pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000));
List<PetSalesToken> petTokens = new ArrayList<PetSalesToken>();

View File

@ -14,6 +14,7 @@ import mineplex.core.account.event.ClientWebResponseEvent;
import mineplex.core.account.event.RetrieveClientInformationEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.donation.DonationManager;
@ -45,6 +46,8 @@ import org.bukkit.entity.Ageable;
import org.bukkit.entity.Creature;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent;
@ -56,7 +59,10 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class PetManager extends MiniClientPlugin<PetClient>
{
@ -158,6 +164,14 @@ public class PetManager extends MiniClientPlugin<PetClient>
pet.setCustomNameVisible(true);
pet.setCustomName(Get(player).GetPets().get(entityType));
if (pet instanceof Zombie)
{
((Zombie) pet).setBaby(true);
pet.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN));
pet.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0));
UtilEnt.silence(pet, true);
}
_activePetOwners.put(player.getName(), pet);
_failedAttempts.put(player.getName(), 0);
@ -295,7 +309,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
pet.teleport(owner);
_failedAttempts.put(playerName, 0);
}
else if (!nav.a(targetBlock.getX(), targetBlock.getY() + 1, targetBlock.getZ(), 1.5f))
else if (!nav.a(targetBlock.getX(), targetBlock.getY() + 1, targetBlock.getZ(), 0.9f))
{
if (pet.getFallDistance() == 0)
{

View File

@ -0,0 +1,14 @@
package mineplex.core.pet.types;
import org.bukkit.entity.EntityType;
import mineplex.core.pet.Pet;
public class Pumpkin extends Pet
{
public Pumpkin()
{
super("Pumpling", EntityType.ZOMBIE, -1);
}
}

View File

@ -53,7 +53,7 @@ public class CoinReward extends Reward
{
}
}, "Treasure Chest", player.getName(), gemsToReward);
}, "Treasure Chest", player.getName(), player.getUniqueId(), gemsToReward);
return new RewardData(getRarity().getColor() + gemsToReward + " Coins", new ItemStack(175));
}

View File

@ -31,7 +31,7 @@ public class UnknownPackageReward extends Reward
@Override
protected RewardData giveRewardCustom(Player player)
{
_donationManager.PurchaseUnknownSalesPackage(null, player.getName(), _packageName, true, 0, true);
_donationManager.PurchaseUnknownSalesPackage(null, player.getName(), player.getUniqueId(), _packageName, true, 0, true);
return new RewardData(getRarity().getColor() + _name, _itemStack);
}

View File

@ -1,13 +1,13 @@
package mineplex.core.shop.item;
import mineplex.core.common.util.UtilInv;
import net.minecraft.server.v1_7_R4.NBTTagList;
import net.minecraft.server.v1_7_R4.NBTTagString;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import net.minecraft.server.v1_7_R4.NBTTagList;
import net.minecraft.server.v1_7_R4.NBTTagString;
import mineplex.core.common.util.UtilInv;
public class ShopItem extends CraftItemStack
{
@ -27,7 +27,8 @@ public class ShopItem extends CraftItemStack
_displayItem = displayItem;
_deliveryAmount = deliveryAmount;
getHandle().tag = ((CraftItemStack)itemStack).getHandle().tag;
CraftItemStack craftItem = CraftItemStack.asCraftCopy(itemStack);
getHandle().tag = craftItem.getHandle().tag;
UpdateVisual(true);
getHandle().tag.set("AttributeModifiers", new NBTTagList());

View File

@ -146,7 +146,7 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
{
ShowResultsPage(response);
}
}, Player.getName(), _salesItem.GetSalesPackageId());
}, Player.getName(), Player.getUniqueId(), _salesItem.GetCost(SelectedCurrency), _salesItem.GetSalesPackageId());
}
else
{
@ -156,7 +156,7 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
{
ShowResultsPage(response);
}
}, Player.getName(), _salesItem.GetName(), SelectedCurrency == CurrencyType.Coins, _salesItem.GetCost(SelectedCurrency), _salesItem.OneTimePurchase());
}, Player.getName(), Player.getUniqueId(), _salesItem.GetName(), SelectedCurrency == CurrencyType.Coins, _salesItem.GetCost(SelectedCurrency), _salesItem.OneTimePurchase());
}
_taskId = Plugin.GetScheduler().scheduleSyncRepeatingTask(Plugin.GetPlugin(), this, 2L, 2L);

View File

@ -74,6 +74,7 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
}
_statUploadQueue.get(uuidString).put(statName, value);
System.out.println("added to stat upload queue.");
}
protected void saveStats()
@ -81,8 +82,6 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
if (_statUploadQueue.isEmpty())
return;
PreparedStatement preparedStatement = null;
try
{
NautHashMap<String, NautHashMap<Integer, Integer>> uploadQueue = new NautHashMap<String, NautHashMap<Integer, Integer>>();
@ -109,20 +108,6 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
{
exception.printStackTrace();
}
finally
{
if (preparedStatement != null)
{
try
{
preparedStatement.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
}
@Override

View File

@ -4,6 +4,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.plugin.java.JavaPlugin;
@ -16,8 +17,14 @@ import mineplex.database.Tables;
import mineplex.database.tables.records.AccountStatsRecord;
import mineplex.database.tables.records.StatsRecord;
import org.jooq.DSLContext;
import org.jooq.Insert;
import org.jooq.InsertQuery;
import org.jooq.Query;
import org.jooq.Record;
import org.jooq.Record2;
import org.jooq.Result;
import org.jooq.Update;
import org.jooq.UpdateQuery;
import org.jooq.impl.DSL;
public class StatsRepository extends RepositoryBase
@ -26,7 +33,6 @@ public class StatsRepository extends RepositoryBase
private static String CREATE_STAT_RELATION_TABLE = "CREATE TABLE IF NOT EXISTS accountStats (id INT NOT NULL AUTO_INCREMENT, accountId INT NOT NULL, statId INT NOT NULL, value INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (accountId) REFERENCES accounts(id), FOREIGN KEY (statId) REFERENCES stats(id), UNIQUE INDEX accountStatIndex (accountId, statId));";
private static String RETRIEVE_PLAYER_STATS = "SELECT stats.name, value FROM accountStats INNER JOIN stats ON stats.id = accountStats.statId INNER JOIN accounts ON accountStats.accountId = accounts.id WHERE accounts.uuid = ?;";
private static String INSERT_PLAYER_STAT = "INSERT INTO accountStats (accountId, statId, value) SELECT accounts.id, ?, ? FROM accounts WHERE accounts.uuid = ? ON DUPLICATE KEY UPDATE value=value+VALUES(value);";
private static String RETRIEVE_STATS = "SELECT id, name FROM stats;";
private static String INSERT_STAT = "INSERT INTO stats (name) VALUES (?);";
@ -77,44 +83,55 @@ public class StatsRepository extends RepositoryBase
public void saveStats(NautHashMap<String, NautHashMap<Integer, Integer>> uploadQueue)
{
PreparedStatement preparedStatement = null;
System.out.println("saving stats.");
try
{
preparedStatement = getConnection().prepareStatement(INSERT_PLAYER_STAT);
DSLContext context = DSL.using(getConnection());
List<Update> updates = new ArrayList<>();
List<Insert> inserts = new ArrayList<>();
for (String uuid : uploadQueue.keySet())
{
for (Integer statId : uploadQueue.get(uuid).keySet())
{
preparedStatement.setInt(1, statId);
preparedStatement.setInt(2, uploadQueue.get(uuid).get(statId));
preparedStatement.setString(3, uuid);
preparedStatement.addBatch();
System.out.println("saving stat : uuid=" + uuid + " " + statId + "=" + uploadQueue.get(uuid).get(statId));
Update update = context
.update(Tables.accountStats)
.set(Tables.accountStats.value, Tables.accountStats.value.plus(uploadQueue.get(uuid).get(statId)))
.where(Tables.accountStats.accountId.eq(context.select(Tables.accounts.id).from(Tables.accounts).where(Tables.accounts.uuid.eq(uuid))))
.and(Tables.accountStats.statId.eq(statId));
updates.add(update);
Insert insert = context
.insertInto(Tables.accountStats)
.set(Tables.accountStats.accountId, context.select(Tables.accounts.id).from(Tables.accounts).where(Tables.accounts.uuid.eq(uuid)))
.set(Tables.accountStats.statId, statId)
.set(Tables.accountStats.value, uploadQueue.get(uuid).get(statId));
inserts.add(insert);
}
}
preparedStatement.executeBatch();
int[] updateResult = context.batch(updates).execute();
for (int i = 0; i < updateResult.length; i++)
{
if (updateResult[i] > 0)
inserts.set(i, null);
}
inserts.removeAll(Collections.singleton(null));
context.batch(inserts).execute();
}
catch (SQLException e)
catch (Exception e)
{
e.printStackTrace();
}
finally
{
if (preparedStatement != null)
{
try
{
preparedStatement.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
}
public PlayerStats loadOfflinePlayerStats(String playerName)

View File

@ -38,7 +38,7 @@ public class ServerStatusManager extends MiniPlugin
{
super("Server Status Manager", plugin);
_startUpDate = Utility.currentTimeMillis();
_startUpDate = Utility.currentTimeSeconds();
_lagMeter = lagMeter;
if (new File("IgnoreUpdates.dat").exists())

View File

@ -11,7 +11,7 @@ package mineplex.database;
@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 = 1511797714;
private static final long serialVersionUID = 163654509;
/**
* The singleton instance of <code>Account</code>
@ -34,12 +34,15 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
private final java.util.List<org.jooq.Table<?>> getTables0() {
return java.util.Arrays.<org.jooq.Table<?>>asList(
mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions,
mineplex.database.tables.AccountFriend.accountFriend,
mineplex.database.tables.AccountGemTransactions.accountGemTransactions,
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.CurrencyTransactionLog.currencyTransactionLog,
mineplex.database.tables.GamePlayers.gamePlayers,
mineplex.database.tables.Games.games,
mineplex.database.tables.ItemCategories.itemCategories,

View File

@ -18,12 +18,15 @@ public class Keys {
// IDENTITY definitions
// -------------------------------------------------------------------------
public static final org.jooq.Identity<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.Integer> IDENTITY_accountCoinTransactions = Identities0.IDENTITY_accountCoinTransactions;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountFriendRecord, java.lang.Integer> IDENTITY_accountFriend = Identities0.IDENTITY_accountFriend;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.Integer> IDENTITY_accountGemTransactions = Identities0.IDENTITY_accountGemTransactions;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountInventoryRecord, java.lang.Integer> IDENTITY_accountInventory = Identities0.IDENTITY_accountInventory;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountPollsRecord, java.lang.Integer> IDENTITY_accountPolls = Identities0.IDENTITY_accountPolls;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Integer> IDENTITY_accountPreferences = Identities0.IDENTITY_accountPreferences;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> IDENTITY_accounts = Identities0.IDENTITY_accounts;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountStatsRecord, java.lang.Integer> IDENTITY_accountStats = Identities0.IDENTITY_accountStats;
public static final org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> IDENTITY_currencyTransactionLog = Identities0.IDENTITY_currencyTransactionLog;
public static final org.jooq.Identity<mineplex.database.tables.records.GamePlayersRecord, java.lang.Integer> IDENTITY_gamePlayers = Identities0.IDENTITY_gamePlayers;
public static final org.jooq.Identity<mineplex.database.tables.records.GamesRecord, java.lang.Integer> IDENTITY_games = Identities0.IDENTITY_games;
public static final org.jooq.Identity<mineplex.database.tables.records.ItemCategoriesRecord, java.lang.Integer> IDENTITY_itemCategories = Identities0.IDENTITY_itemCategories;
@ -40,7 +43,10 @@ public class Keys {
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountCoinTransactionsRecord> KEY_accountCoinTransactions_PRIMARY = UniqueKeys0.KEY_accountCoinTransactions_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord> KEY_accountFriend_PRIMARY = UniqueKeys0.KEY_accountFriend_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord> KEY_accountFriend_uuidIndex = UniqueKeys0.KEY_accountFriend_uuidIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountGemTransactionsRecord> KEY_accountGemTransactions_PRIMARY = UniqueKeys0.KEY_accountGemTransactions_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountInventoryRecord> KEY_accountInventory_PRIMARY = UniqueKeys0.KEY_accountInventory_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountInventoryRecord> KEY_accountInventory_accountItemIndex = UniqueKeys0.KEY_accountInventory_accountItemIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountPollsRecord> KEY_accountPolls_PRIMARY = UniqueKeys0.KEY_accountPolls_PRIMARY;
@ -51,6 +57,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountsRecord> KEY_accounts_uuidIndex = UniqueKeys0.KEY_accounts_uuidIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_PRIMARY = UniqueKeys0.KEY_accountStats_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_accountStatIndex = UniqueKeys0.KEY_accountStats_accountStatIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord> KEY_currencyTransactionLog_PRIMARY = UniqueKeys0.KEY_currencyTransactionLog_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamePlayersRecord> KEY_gamePlayers_PRIMARY = UniqueKeys0.KEY_gamePlayers_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamesRecord> KEY_games_PRIMARY = UniqueKeys0.KEY_games_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemCategoriesRecord> KEY_itemCategories_PRIMARY = UniqueKeys0.KEY_itemCategories_PRIMARY;
@ -72,12 +79,15 @@ public class Keys {
// FOREIGN KEY definitions
// -------------------------------------------------------------------------
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountCoinTransactionsRecord, mineplex.database.tables.records.AccountsRecord> accountCoinTransactions_ibfk_1 = ForeignKeys0.accountCoinTransactions_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountGemTransactionsRecord, mineplex.database.tables.records.AccountsRecord> accountGemTransactions_ibfk_1 = ForeignKeys0.accountGemTransactions_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountInventoryRecord, mineplex.database.tables.records.AccountsRecord> accountInventory_ibfk_1 = ForeignKeys0.accountInventory_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountInventoryRecord, mineplex.database.tables.records.ItemsRecord> accountInventory_ibfk_2 = ForeignKeys0.accountInventory_ibfk_2;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.AccountsRecord> accountPolls_ibfk_1 = ForeignKeys0.accountPolls_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.PollsRecord> accountPolls_ibfk_2 = ForeignKeys0.accountPolls_ibfk_2;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.AccountsRecord> accountStats_ibfk_1 = ForeignKeys0.accountStats_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.StatsRecord> accountStats_ibfk_2 = ForeignKeys0.accountStats_ibfk_2;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, mineplex.database.tables.records.AccountsRecord> FK_currencyTransactionLog_accounts = ForeignKeys0.FK_currencyTransactionLog_accounts;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.GamesRecord> FK_gamePlayers_games = ForeignKeys0.FK_gamePlayers_games;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.AccountsRecord> FK_gamePlayers_accounts = ForeignKeys0.FK_gamePlayers_accounts;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ItemsRecord, mineplex.database.tables.records.ItemCategoriesRecord> items_ibfk_1 = ForeignKeys0.items_ibfk_1;
@ -89,12 +99,15 @@ public class Keys {
// -------------------------------------------------------------------------
private static class Identities0 extends org.jooq.impl.AbstractKeys {
public static org.jooq.Identity<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.Integer> IDENTITY_accountCoinTransactions = createIdentity(mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions, mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountFriendRecord, java.lang.Integer> IDENTITY_accountFriend = createIdentity(mineplex.database.tables.AccountFriend.accountFriend, mineplex.database.tables.AccountFriend.accountFriend.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.Integer> IDENTITY_accountGemTransactions = createIdentity(mineplex.database.tables.AccountGemTransactions.accountGemTransactions, mineplex.database.tables.AccountGemTransactions.accountGemTransactions.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountInventoryRecord, java.lang.Integer> IDENTITY_accountInventory = createIdentity(mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountPollsRecord, java.lang.Integer> IDENTITY_accountPolls = createIdentity(mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Integer> IDENTITY_accountPreferences = createIdentity(mineplex.database.tables.AccountPreferences.accountPreferences, mineplex.database.tables.AccountPreferences.accountPreferences.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> IDENTITY_accounts = createIdentity(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountStatsRecord, java.lang.Integer> IDENTITY_accountStats = createIdentity(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
public static org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> IDENTITY_currencyTransactionLog = createIdentity(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id);
public static org.jooq.Identity<mineplex.database.tables.records.GamePlayersRecord, java.lang.Integer> IDENTITY_gamePlayers = createIdentity(mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.id);
public static org.jooq.Identity<mineplex.database.tables.records.GamesRecord, java.lang.Integer> IDENTITY_games = createIdentity(mineplex.database.tables.Games.games, mineplex.database.tables.Games.games.id);
public static org.jooq.Identity<mineplex.database.tables.records.ItemCategoriesRecord, java.lang.Integer> IDENTITY_itemCategories = createIdentity(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
@ -109,7 +122,10 @@ public class Keys {
}
private static class UniqueKeys0 extends org.jooq.impl.AbstractKeys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountCoinTransactionsRecord> KEY_accountCoinTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions, mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord> KEY_accountFriend_PRIMARY = createUniqueKey(mineplex.database.tables.AccountFriend.accountFriend, mineplex.database.tables.AccountFriend.accountFriend.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord> KEY_accountFriend_uuidIndex = createUniqueKey(mineplex.database.tables.AccountFriend.accountFriend, mineplex.database.tables.AccountFriend.accountFriend.uuidSource, mineplex.database.tables.AccountFriend.accountFriend.uuidTarget);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountGemTransactionsRecord> KEY_accountGemTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountGemTransactions.accountGemTransactions, mineplex.database.tables.AccountGemTransactions.accountGemTransactions.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountInventoryRecord> KEY_accountInventory_PRIMARY = createUniqueKey(mineplex.database.tables.AccountInventory.accountInventory, mineplex.database.tables.AccountInventory.accountInventory.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountInventoryRecord> 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<mineplex.database.tables.records.AccountPollsRecord> KEY_accountPolls_PRIMARY = createUniqueKey(mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.id);
@ -120,6 +136,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountsRecord> KEY_accounts_uuidIndex = createUniqueKey(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.uuid);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_PRIMARY = createUniqueKey(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> 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<mineplex.database.tables.records.CurrencyTransactionLogRecord> KEY_currencyTransactionLog_PRIMARY = createUniqueKey(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamePlayersRecord> KEY_gamePlayers_PRIMARY = createUniqueKey(mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamesRecord> KEY_games_PRIMARY = createUniqueKey(mineplex.database.tables.Games.games, mineplex.database.tables.Games.games.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemCategoriesRecord> KEY_itemCategories_PRIMARY = createUniqueKey(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
@ -139,12 +156,15 @@ public class Keys {
}
private static class ForeignKeys0 extends org.jooq.impl.AbstractKeys {
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountCoinTransactionsRecord, mineplex.database.tables.records.AccountsRecord> accountCoinTransactions_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_uuidIndex, mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions, mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.accounts_uuid);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountGemTransactionsRecord, mineplex.database.tables.records.AccountsRecord> accountGemTransactions_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_uuidIndex, mineplex.database.tables.AccountGemTransactions.accountGemTransactions, mineplex.database.tables.AccountGemTransactions.accountGemTransactions.accounts_uuid);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountInventoryRecord, mineplex.database.tables.records.AccountsRecord> 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<mineplex.database.tables.records.AccountInventoryRecord, mineplex.database.tables.records.ItemsRecord> 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<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.AccountsRecord> 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<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.PollsRecord> 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<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.AccountsRecord> 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<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.StatsRecord> 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<mineplex.database.tables.records.CurrencyTransactionLogRecord, mineplex.database.tables.records.AccountsRecord> FK_currencyTransactionLog_accounts = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.accountId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.GamesRecord> FK_gamePlayers_games = createForeignKey(mineplex.database.Keys.KEY_games_PRIMARY, mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.gameId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.AccountsRecord> FK_gamePlayers_accounts = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.accountId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ItemsRecord, mineplex.database.tables.records.ItemCategoriesRecord> items_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_itemCategories_PRIMARY, mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.categoryId);

View File

@ -13,11 +13,21 @@ package mineplex.database;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables {
/**
* The table Account.accountCoinTransactions
*/
public static final mineplex.database.tables.AccountCoinTransactions accountCoinTransactions = mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions;
/**
* The table Account.accountFriend
*/
public static final mineplex.database.tables.AccountFriend accountFriend = mineplex.database.tables.AccountFriend.accountFriend;
/**
* The table Account.accountGemTransactions
*/
public static final mineplex.database.tables.AccountGemTransactions accountGemTransactions = mineplex.database.tables.AccountGemTransactions.accountGemTransactions;
/**
* The table Account.accountInventory
*/
@ -43,6 +53,11 @@ public class Tables {
*/
public static final mineplex.database.tables.AccountStats accountStats = mineplex.database.tables.AccountStats.accountStats;
/**
* The table Account.currencyTransactionLog
*/
public static final mineplex.database.tables.CurrencyTransactionLog currencyTransactionLog = mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog;
/**
* The table Account.gamePlayers
*/

View File

@ -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 AccountCoinTransactions extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountCoinTransactionsRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 2022908788;
/**
* The singleton instance of <code>Account.accountCoinTransactions</code>
*/
public static final mineplex.database.tables.AccountCoinTransactions accountCoinTransactions = new mineplex.database.tables.AccountCoinTransactions();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<mineplex.database.tables.records.AccountCoinTransactionsRecord> getRecordType() {
return mineplex.database.tables.records.AccountCoinTransactionsRecord.class;
}
/**
* The column <code>Account.accountCoinTransactions.id</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.accountCoinTransactions.accounts_uuid</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.String> accounts_uuid = createField("accounts_uuid", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* The column <code>Account.accountCoinTransactions.reason</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.String> reason = createField("reason", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* The column <code>Account.accountCoinTransactions.coins</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.Integer> coins = createField("coins", org.jooq.impl.SQLDataType.INTEGER, this, "");
/**
* Create a <code>Account.accountCoinTransactions</code> table reference
*/
public AccountCoinTransactions() {
this("accountCoinTransactions", null);
}
/**
* Create an aliased <code>Account.accountCoinTransactions</code> table reference
*/
public AccountCoinTransactions(java.lang.String alias) {
this(alias, mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions);
}
private AccountCoinTransactions(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.AccountCoinTransactionsRecord> aliased) {
this(alias, aliased, null);
}
private AccountCoinTransactions(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.AccountCoinTransactionsRecord> aliased, org.jooq.Field<?>[] parameters) {
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.AccountCoinTransactionsRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_accountCoinTransactions;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<mineplex.database.tables.records.AccountCoinTransactionsRecord> getPrimaryKey() {
return mineplex.database.Keys.KEY_accountCoinTransactions_PRIMARY;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.AccountCoinTransactionsRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.AccountCoinTransactionsRecord>>asList(mineplex.database.Keys.KEY_accountCoinTransactions_PRIMARY);
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.AccountCoinTransactionsRecord, ?>> getReferences() {
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.AccountCoinTransactionsRecord, ?>>asList(mineplex.database.Keys.accountCoinTransactions_ibfk_1);
}
/**
* {@inheritDoc}
*/
@Override
public mineplex.database.tables.AccountCoinTransactions as(java.lang.String alias) {
return new mineplex.database.tables.AccountCoinTransactions(alias, this);
}
/**
* Rename this table
*/
public mineplex.database.tables.AccountCoinTransactions rename(java.lang.String name) {
return new mineplex.database.tables.AccountCoinTransactions(name, null);
}
}

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountFriend extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountFriendRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 35533677;
private static final long serialVersionUID = -547231162;
/**
* The singleton instance of <code>Account.accountFriend</code>
@ -42,9 +42,9 @@ public class AccountFriend extends org.jooq.impl.TableImpl<mineplex.database.tab
public final org.jooq.TableField<mineplex.database.tables.records.AccountFriendRecord, java.lang.String> uuidTarget = createField("uuidTarget", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* The column <code>Account.accountFriend.mutual</code>.
* The column <code>Account.accountFriend.status</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountFriendRecord, java.lang.Byte> mutual = createField("mutual", org.jooq.impl.SQLDataType.TINYINT, this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountFriendRecord, java.lang.String> status = createField("status", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* Create a <code>Account.accountFriend</code> table reference
@ -89,7 +89,7 @@ public class AccountFriend extends org.jooq.impl.TableImpl<mineplex.database.tab
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord>>asList(mineplex.database.Keys.KEY_accountFriend_PRIMARY);
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.AccountFriendRecord>>asList(mineplex.database.Keys.KEY_accountFriend_PRIMARY, mineplex.database.Keys.KEY_accountFriend_uuidIndex);
}
/**

View File

@ -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 AccountGemTransactions extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountGemTransactionsRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 565873060;
/**
* The singleton instance of <code>Account.accountGemTransactions</code>
*/
public static final mineplex.database.tables.AccountGemTransactions accountGemTransactions = new mineplex.database.tables.AccountGemTransactions();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<mineplex.database.tables.records.AccountGemTransactionsRecord> getRecordType() {
return mineplex.database.tables.records.AccountGemTransactionsRecord.class;
}
/**
* The column <code>Account.accountGemTransactions.id</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.accountGemTransactions.accounts_uuid</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.String> accounts_uuid = createField("accounts_uuid", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* The column <code>Account.accountGemTransactions.reason</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.String> reason = createField("reason", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
/**
* The column <code>Account.accountGemTransactions.gems</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.Integer> gems = createField("gems", org.jooq.impl.SQLDataType.INTEGER, this, "");
/**
* Create a <code>Account.accountGemTransactions</code> table reference
*/
public AccountGemTransactions() {
this("accountGemTransactions", null);
}
/**
* Create an aliased <code>Account.accountGemTransactions</code> table reference
*/
public AccountGemTransactions(java.lang.String alias) {
this(alias, mineplex.database.tables.AccountGemTransactions.accountGemTransactions);
}
private AccountGemTransactions(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.AccountGemTransactionsRecord> aliased) {
this(alias, aliased, null);
}
private AccountGemTransactions(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.AccountGemTransactionsRecord> aliased, org.jooq.Field<?>[] parameters) {
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.AccountGemTransactionsRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_accountGemTransactions;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<mineplex.database.tables.records.AccountGemTransactionsRecord> getPrimaryKey() {
return mineplex.database.Keys.KEY_accountGemTransactions_PRIMARY;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.AccountGemTransactionsRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.AccountGemTransactionsRecord>>asList(mineplex.database.Keys.KEY_accountGemTransactions_PRIMARY);
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.AccountGemTransactionsRecord, ?>> getReferences() {
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.AccountGemTransactionsRecord, ?>>asList(mineplex.database.Keys.accountGemTransactions_ibfk_1);
}
/**
* {@inheritDoc}
*/
@Override
public mineplex.database.tables.AccountGemTransactions as(java.lang.String alias) {
return new mineplex.database.tables.AccountGemTransactions(alias, this);
}
/**
* Rename this table
*/
public mineplex.database.tables.AccountGemTransactions rename(java.lang.String name) {
return new mineplex.database.tables.AccountGemTransactions(name, null);
}
}

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountPreferences extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountPreferencesRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -1892251736;
private static final long serialVersionUID = -780380646;
/**
* The singleton instance of <code>Account.accountPreferences</code>
@ -81,6 +81,21 @@ public class AccountPreferences extends org.jooq.impl.TableImpl<mineplex.databas
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Byte> forcefield = createField("forcefield", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accountPreferences.showMacReports</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Byte> showMacReports = createField("showMacReports", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accountPreferences.ignoreVelocity</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Byte> ignoreVelocity = createField("ignoreVelocity", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accountPreferences.pendingFriendRequests</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Byte> pendingFriendRequests = createField("pendingFriendRequests", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "");
/**
* Create a <code>Account.accountPreferences</code> table reference
*/

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -2025748114;
private static final long serialVersionUID = -1971089065;
/**
* The singleton instance of <code>Account.accounts</code>
@ -44,12 +44,22 @@ public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.r
/**
* The column <code>Account.accounts.gems</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> gems = createField("gems", org.jooq.impl.SQLDataType.INTEGER, this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> gems = createField("gems", org.jooq.impl.SQLDataType.INTEGER.defaulted(true), this, "");
/**
* The column <code>Account.accounts.coins</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> coins = createField("coins", org.jooq.impl.SQLDataType.INTEGER.defaulted(true), this, "");
/**
* The column <code>Account.accounts.donorRank</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> donorRank = createField("donorRank", org.jooq.impl.SQLDataType.VARCHAR.length(20).defaulted(true), this, "");
/**
* The column <code>Account.accounts.rank</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> rank = createField("rank", org.jooq.impl.SQLDataType.VARCHAR.length(40), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> rank = createField("rank", org.jooq.impl.SQLDataType.VARCHAR.length(20).defaulted(true), this, "");
/**
* The column <code>Account.accounts.rankPerm</code>.
@ -59,12 +69,12 @@ public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.r
/**
* The column <code>Account.accounts.rankExpire</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> rankExpire = createField("rankExpire", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.sql.Timestamp> rankExpire = createField("rankExpire", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accounts.lastLogin</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> lastLogin = createField("lastLogin", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.sql.Timestamp> lastLogin = createField("lastLogin", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accounts.totalPlayTime</code>.

View File

@ -0,0 +1,127 @@
/**
* 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 CurrencyTransactionLog extends org.jooq.impl.TableImpl<mineplex.database.tables.records.CurrencyTransactionLogRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 1764100855;
/**
* The singleton instance of <code>Account.currencyTransactionLog</code>
*/
public static final mineplex.database.tables.CurrencyTransactionLog currencyTransactionLog = new mineplex.database.tables.CurrencyTransactionLog();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<mineplex.database.tables.records.CurrencyTransactionLogRecord> getRecordType() {
return mineplex.database.tables.records.CurrencyTransactionLogRecord.class;
}
/**
* The column <code>Account.currencyTransactionLog.id</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.accountId</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.currencyType</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> currencyType = createField("currencyType", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.change</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> change = createField("change", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.total</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> total = createField("total", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.timestamp</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.sql.Timestamp> timestamp = createField("timestamp", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* Create a <code>Account.currencyTransactionLog</code> table reference
*/
public CurrencyTransactionLog() {
this("currencyTransactionLog", null);
}
/**
* Create an aliased <code>Account.currencyTransactionLog</code> table reference
*/
public CurrencyTransactionLog(java.lang.String alias) {
this(alias, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
}
private CurrencyTransactionLog(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.CurrencyTransactionLogRecord> aliased) {
this(alias, aliased, null);
}
private CurrencyTransactionLog(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.CurrencyTransactionLogRecord> aliased, org.jooq.Field<?>[] parameters) {
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_currencyTransactionLog;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord> getPrimaryKey() {
return mineplex.database.Keys.KEY_currencyTransactionLog_PRIMARY;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord>>asList(mineplex.database.Keys.KEY_currencyTransactionLog_PRIMARY);
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, ?>> getReferences() {
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, ?>>asList(mineplex.database.Keys.FK_currencyTransactionLog_accounts);
}
/**
* {@inheritDoc}
*/
@Override
public mineplex.database.tables.CurrencyTransactionLog as(java.lang.String alias) {
return new mineplex.database.tables.CurrencyTransactionLog(alias, this);
}
/**
* Rename this table
*/
public mineplex.database.tables.CurrencyTransactionLog rename(java.lang.String name) {
return new mineplex.database.tables.CurrencyTransactionLog(name, null);
}
}

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Npcs extends org.jooq.impl.TableImpl<mineplex.database.tables.records.NpcsRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -1825231460;
private static final long serialVersionUID = -1554338732;
/**
* The singleton instance of <code>Account.npcs</code>
@ -36,15 +36,10 @@ public class Npcs extends org.jooq.impl.TableImpl<mineplex.database.tables.recor
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> server = createField("server", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, "");
/**
* The column <code>Account.npcs.uuid</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> uuid = createField("uuid", org.jooq.impl.SQLDataType.CHAR.length(36).nullable(false), this, "");
/**
* The column <code>Account.npcs.name</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> name = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
/**
* The column <code>Account.npcs.world</code>.
@ -69,13 +64,18 @@ public class Npcs extends org.jooq.impl.TableImpl<mineplex.database.tables.recor
/**
* The column <code>Account.npcs.radius</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> radius = createField("radius", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.Double> radius = createField("radius", org.jooq.impl.SQLDataType.FLOAT.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.npcs.entityType</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> entityType = createField("entityType", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, "");
/**
* The column <code>Account.npcs.entityMeta</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> entityMeta = createField("entityMeta", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
/**
* The column <code>Account.npcs.adult</code>.
*/
@ -84,27 +84,27 @@ public class Npcs extends org.jooq.impl.TableImpl<mineplex.database.tables.recor
/**
* The column <code>Account.npcs.helmet</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> helmet = createField("helmet", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> helmet = createField("helmet", org.jooq.impl.SQLDataType.CLOB.length(65535), this, "");
/**
* The column <code>Account.npcs.chestplate</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> chestplate = createField("chestplate", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> chestplate = createField("chestplate", org.jooq.impl.SQLDataType.CLOB.length(65535), this, "");
/**
* The column <code>Account.npcs.leggings</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> leggings = createField("leggings", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> leggings = createField("leggings", org.jooq.impl.SQLDataType.CLOB.length(65535), this, "");
/**
* The column <code>Account.npcs.boots</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> boots = createField("boots", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> boots = createField("boots", org.jooq.impl.SQLDataType.CLOB.length(65535), this, "");
/**
* The column <code>Account.npcs.inHand</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> inHand = createField("inHand", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.String> inHand = createField("inHand", org.jooq.impl.SQLDataType.CLOB.length(65535), this, "");
/**
* Create a <code>Account.npcs</code> table reference

View File

@ -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 AccountCoinTransactionsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountCoinTransactionsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> {
private static final long serialVersionUID = -1674238317;
/**
* Setter for <code>Account.accountCoinTransactions.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.accountCoinTransactions.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.accountCoinTransactions.accounts_uuid</code>.
*/
public void setAccounts_uuid(java.lang.String value) {
setValue(1, value);
}
/**
* Getter for <code>Account.accountCoinTransactions.accounts_uuid</code>.
*/
public java.lang.String getAccounts_uuid() {
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>Account.accountCoinTransactions.reason</code>.
*/
public void setReason(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>Account.accountCoinTransactions.reason</code>.
*/
public java.lang.String getReason() {
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>Account.accountCoinTransactions.coins</code>.
*/
public void setCoins(java.lang.Integer value) {
setValue(3, value);
}
/**
* Getter for <code>Account.accountCoinTransactions.coins</code>.
*/
public java.lang.Integer getCoins() {
return (java.lang.Integer) getValue(3);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record4 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> fieldsRow() {
return (org.jooq.Row4) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> valuesRow() {
return (org.jooq.Row4) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field2() {
return mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.accounts_uuid;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.reason;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions.coins;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value2() {
return getAccounts_uuid();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getReason();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getCoins();
}
/**
* {@inheritDoc}
*/
@Override
public AccountCoinTransactionsRecord value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountCoinTransactionsRecord value2(java.lang.String value) {
setAccounts_uuid(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountCoinTransactionsRecord value3(java.lang.String value) {
setReason(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountCoinTransactionsRecord value4(java.lang.Integer value) {
setCoins(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountCoinTransactionsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached AccountCoinTransactionsRecord
*/
public AccountCoinTransactionsRecord() {
super(mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions);
}
/**
* Create a detached, initialised AccountCoinTransactionsRecord
*/
public AccountCoinTransactionsRecord(java.lang.Integer id, java.lang.String accounts_uuid, java.lang.String reason, java.lang.Integer coins) {
super(mineplex.database.tables.AccountCoinTransactions.accountCoinTransactions);
setValue(0, id);
setValue(1, accounts_uuid);
setValue(2, reason);
setValue(3, coins);
}
}

View File

@ -9,9 +9,9 @@ package mineplex.database.tables.records;
@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 AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountFriendRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte> {
public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountFriendRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String> {
private static final long serialVersionUID = -437854439;
private static final long serialVersionUID = -1139709892;
/**
* Setter for <code>Account.accountFriend.id</code>.
@ -56,17 +56,17 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
}
/**
* Setter for <code>Account.accountFriend.mutual</code>.
* Setter for <code>Account.accountFriend.status</code>.
*/
public void setMutual(java.lang.Byte value) {
public void setStatus(java.lang.String value) {
setValue(3, value);
}
/**
* Getter for <code>Account.accountFriend.mutual</code>.
* Getter for <code>Account.accountFriend.status</code>.
*/
public java.lang.Byte getMutual() {
return (java.lang.Byte) getValue(3);
public java.lang.String getStatus() {
return (java.lang.String) getValue(3);
}
// -------------------------------------------------------------------------
@ -89,7 +89,7 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte> fieldsRow() {
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row4) super.fieldsRow();
}
@ -97,7 +97,7 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte> valuesRow() {
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row4) super.valuesRow();
}
@ -129,8 +129,8 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field4() {
return mineplex.database.tables.AccountFriend.accountFriend.mutual;
public org.jooq.Field<java.lang.String> field4() {
return mineplex.database.tables.AccountFriend.accountFriend.status;
}
/**
@ -161,8 +161,8 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public java.lang.Byte value4() {
return getMutual();
public java.lang.String value4() {
return getStatus();
}
/**
@ -196,8 +196,8 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public AccountFriendRecord value4(java.lang.Byte value) {
setMutual(value);
public AccountFriendRecord value4(java.lang.String value) {
setStatus(value);
return this;
}
@ -205,7 +205,7 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
* {@inheritDoc}
*/
@Override
public AccountFriendRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Byte value4) {
public AccountFriendRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.String value4) {
return this;
}
@ -223,12 +223,12 @@ public class AccountFriendRecord extends org.jooq.impl.UpdatableRecordImpl<minep
/**
* Create a detached, initialised AccountFriendRecord
*/
public AccountFriendRecord(java.lang.Integer id, java.lang.String uuidSource, java.lang.String uuidTarget, java.lang.Byte mutual) {
public AccountFriendRecord(java.lang.Integer id, java.lang.String uuidSource, java.lang.String uuidTarget, java.lang.String status) {
super(mineplex.database.tables.AccountFriend.accountFriend);
setValue(0, id);
setValue(1, uuidSource);
setValue(2, uuidTarget);
setValue(3, mutual);
setValue(3, status);
}
}

View File

@ -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 AccountGemTransactionsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountGemTransactionsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> {
private static final long serialVersionUID = 1444170773;
/**
* Setter for <code>Account.accountGemTransactions.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.accountGemTransactions.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.accountGemTransactions.accounts_uuid</code>.
*/
public void setAccounts_uuid(java.lang.String value) {
setValue(1, value);
}
/**
* Getter for <code>Account.accountGemTransactions.accounts_uuid</code>.
*/
public java.lang.String getAccounts_uuid() {
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>Account.accountGemTransactions.reason</code>.
*/
public void setReason(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>Account.accountGemTransactions.reason</code>.
*/
public java.lang.String getReason() {
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>Account.accountGemTransactions.gems</code>.
*/
public void setGems(java.lang.Integer value) {
setValue(3, value);
}
/**
* Getter for <code>Account.accountGemTransactions.gems</code>.
*/
public java.lang.Integer getGems() {
return (java.lang.Integer) getValue(3);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record4 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> fieldsRow() {
return (org.jooq.Row4) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer> valuesRow() {
return (org.jooq.Row4) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.AccountGemTransactions.accountGemTransactions.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field2() {
return mineplex.database.tables.AccountGemTransactions.accountGemTransactions.accounts_uuid;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return mineplex.database.tables.AccountGemTransactions.accountGemTransactions.reason;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return mineplex.database.tables.AccountGemTransactions.accountGemTransactions.gems;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value2() {
return getAccounts_uuid();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getReason();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getGems();
}
/**
* {@inheritDoc}
*/
@Override
public AccountGemTransactionsRecord value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountGemTransactionsRecord value2(java.lang.String value) {
setAccounts_uuid(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountGemTransactionsRecord value3(java.lang.String value) {
setReason(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountGemTransactionsRecord value4(java.lang.Integer value) {
setGems(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountGemTransactionsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached AccountGemTransactionsRecord
*/
public AccountGemTransactionsRecord() {
super(mineplex.database.tables.AccountGemTransactions.accountGemTransactions);
}
/**
* Create a detached, initialised AccountGemTransactionsRecord
*/
public AccountGemTransactionsRecord(java.lang.Integer id, java.lang.String accounts_uuid, java.lang.String reason, java.lang.Integer gems) {
super(mineplex.database.tables.AccountGemTransactions.accountGemTransactions);
setValue(0, id);
setValue(1, accounts_uuid);
setValue(2, reason);
setValue(3, gems);
}
}

View File

@ -9,9 +9,9 @@ package mineplex.database.tables.records;
@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 AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountPreferencesRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record11<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> {
public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountPreferencesRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record14<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> {
private static final long serialVersionUID = -1987641641;
private static final long serialVersionUID = 1651524548;
/**
* Setter for <code>Account.accountPreferences.id</code>.
@ -167,6 +167,48 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
return (java.lang.Byte) getValue(10);
}
/**
* Setter for <code>Account.accountPreferences.showMacReports</code>.
*/
public void setShowMacReports(java.lang.Byte value) {
setValue(11, value);
}
/**
* Getter for <code>Account.accountPreferences.showMacReports</code>.
*/
public java.lang.Byte getShowMacReports() {
return (java.lang.Byte) getValue(11);
}
/**
* Setter for <code>Account.accountPreferences.ignoreVelocity</code>.
*/
public void setIgnoreVelocity(java.lang.Byte value) {
setValue(12, value);
}
/**
* Getter for <code>Account.accountPreferences.ignoreVelocity</code>.
*/
public java.lang.Byte getIgnoreVelocity() {
return (java.lang.Byte) getValue(12);
}
/**
* Setter for <code>Account.accountPreferences.pendingFriendRequests</code>.
*/
public void setPendingFriendRequests(java.lang.Byte value) {
setValue(13, value);
}
/**
* Getter for <code>Account.accountPreferences.pendingFriendRequests</code>.
*/
public java.lang.Byte getPendingFriendRequests() {
return (java.lang.Byte) getValue(13);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@ -180,23 +222,23 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
}
// -------------------------------------------------------------------------
// Record11 type implementation
// Record14 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row11<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> fieldsRow() {
return (org.jooq.Row11) super.fieldsRow();
public org.jooq.Row14<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> fieldsRow() {
return (org.jooq.Row14) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row11<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> valuesRow() {
return (org.jooq.Row11) super.valuesRow();
public org.jooq.Row14<java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte, java.lang.Byte> valuesRow() {
return (org.jooq.Row14) super.valuesRow();
}
/**
@ -287,6 +329,30 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
return mineplex.database.tables.AccountPreferences.accountPreferences.forcefield;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field12() {
return mineplex.database.tables.AccountPreferences.accountPreferences.showMacReports;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field13() {
return mineplex.database.tables.AccountPreferences.accountPreferences.ignoreVelocity;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field14() {
return mineplex.database.tables.AccountPreferences.accountPreferences.pendingFriendRequests;
}
/**
* {@inheritDoc}
*/
@ -375,6 +441,30 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
return getForcefield();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Byte value12() {
return getShowMacReports();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Byte value13() {
return getIgnoreVelocity();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Byte value14() {
return getPendingFriendRequests();
}
/**
* {@inheritDoc}
*/
@ -478,7 +568,34 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
* {@inheritDoc}
*/
@Override
public AccountPreferencesRecord 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) {
public AccountPreferencesRecord value12(java.lang.Byte value) {
setShowMacReports(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountPreferencesRecord value13(java.lang.Byte value) {
setIgnoreVelocity(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountPreferencesRecord value14(java.lang.Byte value) {
setPendingFriendRequests(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountPreferencesRecord 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, java.lang.Byte value12, java.lang.Byte value13, java.lang.Byte value14) {
return this;
}
@ -496,7 +613,7 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
/**
* Create a detached, initialised AccountPreferencesRecord
*/
public AccountPreferencesRecord(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) {
public AccountPreferencesRecord(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, java.lang.Byte showMacReports, java.lang.Byte ignoreVelocity, java.lang.Byte pendingFriendRequests) {
super(mineplex.database.tables.AccountPreferences.accountPreferences);
setValue(0, id);
@ -510,5 +627,8 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
setValue(8, showChat);
setValue(9, partyRequests);
setValue(10, forcefield);
setValue(11, showMacReports);
setValue(12, ignoreVelocity);
setValue(13, pendingFriendRequests);
}
}

View File

@ -9,9 +9,9 @@ package mineplex.database.tables.records;
@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 AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> {
public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record11<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.sql.Timestamp, java.sql.Timestamp, java.lang.String> {
private static final long serialVersionUID = 902357087;
private static final long serialVersionUID = -1996366804;
/**
* Setter for <code>Account.accounts.id</code>.
@ -69,74 +69,102 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
return (java.lang.Integer) getValue(3);
}
/**
* Setter for <code>Account.accounts.coins</code>.
*/
public void setCoins(java.lang.Integer value) {
setValue(4, value);
}
/**
* Getter for <code>Account.accounts.coins</code>.
*/
public java.lang.Integer getCoins() {
return (java.lang.Integer) getValue(4);
}
/**
* Setter for <code>Account.accounts.donorRank</code>.
*/
public void setDonorRank(java.lang.String value) {
setValue(5, value);
}
/**
* Getter for <code>Account.accounts.donorRank</code>.
*/
public java.lang.String getDonorRank() {
return (java.lang.String) getValue(5);
}
/**
* Setter for <code>Account.accounts.rank</code>.
*/
public void setRank(java.lang.String value) {
setValue(4, value);
setValue(6, value);
}
/**
* Getter for <code>Account.accounts.rank</code>.
*/
public java.lang.String getRank() {
return (java.lang.String) getValue(4);
return (java.lang.String) getValue(6);
}
/**
* Setter for <code>Account.accounts.rankPerm</code>.
*/
public void setRankPerm(java.lang.Byte value) {
setValue(5, value);
setValue(7, value);
}
/**
* Getter for <code>Account.accounts.rankPerm</code>.
*/
public java.lang.Byte getRankPerm() {
return (java.lang.Byte) getValue(5);
return (java.lang.Byte) getValue(7);
}
/**
* Setter for <code>Account.accounts.rankExpire</code>.
*/
public void setRankExpire(java.lang.String value) {
setValue(6, value);
public void setRankExpire(java.sql.Timestamp value) {
setValue(8, value);
}
/**
* Getter for <code>Account.accounts.rankExpire</code>.
*/
public java.lang.String getRankExpire() {
return (java.lang.String) getValue(6);
public java.sql.Timestamp getRankExpire() {
return (java.sql.Timestamp) getValue(8);
}
/**
* Setter for <code>Account.accounts.lastLogin</code>.
*/
public void setLastLogin(java.lang.String value) {
setValue(7, value);
public void setLastLogin(java.sql.Timestamp value) {
setValue(9, value);
}
/**
* Getter for <code>Account.accounts.lastLogin</code>.
*/
public java.lang.String getLastLogin() {
return (java.lang.String) getValue(7);
public java.sql.Timestamp getLastLogin() {
return (java.sql.Timestamp) getValue(9);
}
/**
* Setter for <code>Account.accounts.totalPlayTime</code>.
*/
public void setTotalPlayTime(java.lang.String value) {
setValue(8, value);
setValue(10, value);
}
/**
* Getter for <code>Account.accounts.totalPlayTime</code>.
*/
public java.lang.String getTotalPlayTime() {
return (java.lang.String) getValue(8);
return (java.lang.String) getValue(10);
}
// -------------------------------------------------------------------------
@ -152,23 +180,23 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
}
// -------------------------------------------------------------------------
// Record9 type implementation
// Record11 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row9) super.fieldsRow();
public org.jooq.Row11<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.sql.Timestamp, java.sql.Timestamp, java.lang.String> fieldsRow() {
return (org.jooq.Row11) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row9) super.valuesRow();
public org.jooq.Row11<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.sql.Timestamp, java.sql.Timestamp, java.lang.String> valuesRow() {
return (org.jooq.Row11) super.valuesRow();
}
/**
@ -207,16 +235,16 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
return mineplex.database.tables.Accounts.accounts.rank;
public org.jooq.Field<java.lang.Integer> field5() {
return mineplex.database.tables.Accounts.accounts.coins;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field6() {
return mineplex.database.tables.Accounts.accounts.rankPerm;
public org.jooq.Field<java.lang.String> field6() {
return mineplex.database.tables.Accounts.accounts.donorRank;
}
/**
@ -224,6 +252,22 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
*/
@Override
public org.jooq.Field<java.lang.String> field7() {
return mineplex.database.tables.Accounts.accounts.rank;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Byte> field8() {
return mineplex.database.tables.Accounts.accounts.rankPerm;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field9() {
return mineplex.database.tables.Accounts.accounts.rankExpire;
}
@ -231,7 +275,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field8() {
public org.jooq.Field<java.sql.Timestamp> field10() {
return mineplex.database.tables.Accounts.accounts.lastLogin;
}
@ -239,7 +283,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field9() {
public org.jooq.Field<java.lang.String> field11() {
return mineplex.database.tables.Accounts.accounts.totalPlayTime;
}
@ -279,16 +323,16 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public java.lang.String value5() {
return getRank();
public java.lang.Integer value5() {
return getCoins();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Byte value6() {
return getRankPerm();
public java.lang.String value6() {
return getDonorRank();
}
/**
@ -296,6 +340,22 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
*/
@Override
public java.lang.String value7() {
return getRank();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Byte value8() {
return getRankPerm();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value9() {
return getRankExpire();
}
@ -303,7 +363,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public java.lang.String value8() {
public java.sql.Timestamp value10() {
return getLastLogin();
}
@ -311,7 +371,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public java.lang.String value9() {
public java.lang.String value11() {
return getTotalPlayTime();
}
@ -355,8 +415,8 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord value5(java.lang.String value) {
setRank(value);
public AccountsRecord value5(java.lang.Integer value) {
setCoins(value);
return this;
}
@ -364,8 +424,8 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord value6(java.lang.Byte value) {
setRankPerm(value);
public AccountsRecord value6(java.lang.String value) {
setDonorRank(value);
return this;
}
@ -374,6 +434,24 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
*/
@Override
public AccountsRecord value7(java.lang.String value) {
setRank(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountsRecord value8(java.lang.Byte value) {
setRankPerm(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public AccountsRecord value9(java.sql.Timestamp value) {
setRankExpire(value);
return this;
}
@ -382,7 +460,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord value8(java.lang.String value) {
public AccountsRecord value10(java.sql.Timestamp value) {
setLastLogin(value);
return this;
}
@ -391,7 +469,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord value9(java.lang.String value) {
public AccountsRecord value11(java.lang.String value) {
setTotalPlayTime(value);
return this;
}
@ -400,7 +478,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord 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) {
public AccountsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4, java.lang.Integer value5, java.lang.String value6, java.lang.String value7, java.lang.Byte value8, java.sql.Timestamp value9, java.sql.Timestamp value10, java.lang.String value11) {
return this;
}
@ -418,17 +496,19 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
/**
* Create a detached, initialised AccountsRecord
*/
public AccountsRecord(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) {
public AccountsRecord(java.lang.Integer id, java.lang.String uuid, java.lang.String name, java.lang.Integer gems, java.lang.Integer coins, java.lang.String donorRank, java.lang.String rank, java.lang.Byte rankPerm, java.sql.Timestamp rankExpire, java.sql.Timestamp 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);
setValue(4, coins);
setValue(5, donorRank);
setValue(6, rank);
setValue(7, rankPerm);
setValue(8, rankExpire);
setValue(9, lastLogin);
setValue(10, totalPlayTime);
}
}

View File

@ -0,0 +1,314 @@
/**
* 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 CurrencyTransactionLogRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.CurrencyTransactionLogRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> {
private static final long serialVersionUID = -1864583043;
/**
* Setter for <code>Account.currencyTransactionLog.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.currencyTransactionLog.accountId</code>.
*/
public void setAccountId(java.lang.Integer value) {
setValue(1, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.accountId</code>.
*/
public java.lang.Integer getAccountId() {
return (java.lang.Integer) getValue(1);
}
/**
* Setter for <code>Account.currencyTransactionLog.currencyType</code>.
*/
public void setCurrencyType(java.lang.Integer value) {
setValue(2, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.currencyType</code>.
*/
public java.lang.Integer getCurrencyType() {
return (java.lang.Integer) getValue(2);
}
/**
* Setter for <code>Account.currencyTransactionLog.change</code>.
*/
public void setChange(java.lang.Integer value) {
setValue(3, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.change</code>.
*/
public java.lang.Integer getChange() {
return (java.lang.Integer) getValue(3);
}
/**
* Setter for <code>Account.currencyTransactionLog.total</code>.
*/
public void setTotal(java.lang.Integer value) {
setValue(4, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.total</code>.
*/
public java.lang.Integer getTotal() {
return (java.lang.Integer) getValue(4);
}
/**
* Setter for <code>Account.currencyTransactionLog.timestamp</code>.
*/
public void setTimestamp(java.sql.Timestamp value) {
setValue(5, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.timestamp</code>.
*/
public java.sql.Timestamp getTimestamp() {
return (java.sql.Timestamp) getValue(5);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record6 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> fieldsRow() {
return (org.jooq.Row6) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> valuesRow() {
return (org.jooq.Row6) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.accountId;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field3() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.currencyType;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.change;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field5() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.total;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field6() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.timestamp;
}
/**
* {@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 getCurrencyType();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getChange();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value5() {
return getTotal();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value6() {
return getTimestamp();
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value2(java.lang.Integer value) {
setAccountId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value3(java.lang.Integer value) {
setCurrencyType(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value4(java.lang.Integer value) {
setChange(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value5(java.lang.Integer value) {
setTotal(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value6(java.sql.Timestamp value) {
setTimestamp(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4, java.lang.Integer value5, java.sql.Timestamp value6) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached CurrencyTransactionLogRecord
*/
public CurrencyTransactionLogRecord() {
super(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
}
/**
* Create a detached, initialised CurrencyTransactionLogRecord
*/
public CurrencyTransactionLogRecord(java.lang.Integer id, java.lang.Integer accountId, java.lang.Integer currencyType, java.lang.Integer change, java.lang.Integer total, java.sql.Timestamp timestamp) {
super(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
setValue(0, id);
setValue(1, accountId);
setValue(2, currencyType);
setValue(3, change);
setValue(4, total);
setValue(5, timestamp);
}
}

View File

@ -9,9 +9,9 @@ package mineplex.database.tables.records;
@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 NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.NpcsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Integer, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> {
public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.NpcsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> {
private static final long serialVersionUID = 370528549;
private static final long serialVersionUID = -1872308957;
/**
* Setter for <code>Account.npcs.id</code>.
@ -41,115 +41,115 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>Account.npcs.uuid</code>.
*/
public void setUuid(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>Account.npcs.uuid</code>.
*/
public java.lang.String getUuid() {
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>Account.npcs.name</code>.
*/
public void setName(java.lang.String value) {
setValue(3, value);
setValue(2, value);
}
/**
* Getter for <code>Account.npcs.name</code>.
*/
public java.lang.String getName() {
return (java.lang.String) getValue(3);
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>Account.npcs.world</code>.
*/
public void setWorld(java.lang.String value) {
setValue(4, value);
setValue(3, value);
}
/**
* Getter for <code>Account.npcs.world</code>.
*/
public java.lang.String getWorld() {
return (java.lang.String) getValue(4);
return (java.lang.String) getValue(3);
}
/**
* Setter for <code>Account.npcs.x</code>.
*/
public void setX(java.lang.Double value) {
setValue(5, value);
setValue(4, value);
}
/**
* Getter for <code>Account.npcs.x</code>.
*/
public java.lang.Double getX() {
return (java.lang.Double) getValue(5);
return (java.lang.Double) getValue(4);
}
/**
* Setter for <code>Account.npcs.y</code>.
*/
public void setY(java.lang.Double value) {
setValue(6, value);
setValue(5, value);
}
/**
* Getter for <code>Account.npcs.y</code>.
*/
public java.lang.Double getY() {
return (java.lang.Double) getValue(6);
return (java.lang.Double) getValue(5);
}
/**
* Setter for <code>Account.npcs.z</code>.
*/
public void setZ(java.lang.Double value) {
setValue(7, value);
setValue(6, value);
}
/**
* Getter for <code>Account.npcs.z</code>.
*/
public java.lang.Double getZ() {
return (java.lang.Double) getValue(7);
return (java.lang.Double) getValue(6);
}
/**
* Setter for <code>Account.npcs.radius</code>.
*/
public void setRadius(java.lang.Integer value) {
setValue(8, value);
public void setRadius(java.lang.Double value) {
setValue(7, value);
}
/**
* Getter for <code>Account.npcs.radius</code>.
*/
public java.lang.Integer getRadius() {
return (java.lang.Integer) getValue(8);
public java.lang.Double getRadius() {
return (java.lang.Double) getValue(7);
}
/**
* Setter for <code>Account.npcs.entityType</code>.
*/
public void setEntityType(java.lang.String value) {
setValue(9, value);
setValue(8, value);
}
/**
* Getter for <code>Account.npcs.entityType</code>.
*/
public java.lang.String getEntityType() {
return (java.lang.String) getValue(8);
}
/**
* Setter for <code>Account.npcs.entityMeta</code>.
*/
public void setEntityMeta(java.lang.String value) {
setValue(9, value);
}
/**
* Getter for <code>Account.npcs.entityMeta</code>.
*/
public java.lang.String getEntityMeta() {
return (java.lang.String) getValue(9);
}
@ -257,7 +257,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Integer, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
public org.jooq.Row16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row16) super.fieldsRow();
}
@ -265,7 +265,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Integer, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
public org.jooq.Row16<java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.Double, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row16) super.valuesRow();
}
@ -290,14 +290,6 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return mineplex.database.tables.Npcs.npcs.uuid;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field4() {
return mineplex.database.tables.Npcs.npcs.name;
}
@ -305,7 +297,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
public org.jooq.Field<java.lang.String> field4() {
return mineplex.database.tables.Npcs.npcs.world;
}
@ -313,7 +305,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Double> field6() {
public org.jooq.Field<java.lang.Double> field5() {
return mineplex.database.tables.Npcs.npcs.x;
}
@ -321,7 +313,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Double> field7() {
public org.jooq.Field<java.lang.Double> field6() {
return mineplex.database.tables.Npcs.npcs.y;
}
@ -329,7 +321,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Double> field8() {
public org.jooq.Field<java.lang.Double> field7() {
return mineplex.database.tables.Npcs.npcs.z;
}
@ -337,7 +329,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field9() {
public org.jooq.Field<java.lang.Double> field8() {
return mineplex.database.tables.Npcs.npcs.radius;
}
@ -345,10 +337,18 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field10() {
public org.jooq.Field<java.lang.String> field9() {
return mineplex.database.tables.Npcs.npcs.entityType;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field10() {
return mineplex.database.tables.Npcs.npcs.entityMeta;
}
/**
* {@inheritDoc}
*/
@ -418,14 +418,6 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
*/
@Override
public java.lang.String value3() {
return getUuid();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value4() {
return getName();
}
@ -433,7 +425,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.String value5() {
public java.lang.String value4() {
return getWorld();
}
@ -441,7 +433,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.Double value6() {
public java.lang.Double value5() {
return getX();
}
@ -449,7 +441,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.Double value7() {
public java.lang.Double value6() {
return getY();
}
@ -457,7 +449,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.Double value8() {
public java.lang.Double value7() {
return getZ();
}
@ -465,7 +457,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.Integer value9() {
public java.lang.Double value8() {
return getRadius();
}
@ -473,10 +465,18 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.String value10() {
public java.lang.String value9() {
return getEntityType();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value10() {
return getEntityMeta();
}
/**
* {@inheritDoc}
*/
@ -548,15 +548,6 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
*/
@Override
public NpcsRecord value3(java.lang.String value) {
setUuid(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public NpcsRecord value4(java.lang.String value) {
setName(value);
return this;
}
@ -565,7 +556,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value5(java.lang.String value) {
public NpcsRecord value4(java.lang.String value) {
setWorld(value);
return this;
}
@ -574,7 +565,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value6(java.lang.Double value) {
public NpcsRecord value5(java.lang.Double value) {
setX(value);
return this;
}
@ -583,7 +574,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value7(java.lang.Double value) {
public NpcsRecord value6(java.lang.Double value) {
setY(value);
return this;
}
@ -592,7 +583,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value8(java.lang.Double value) {
public NpcsRecord value7(java.lang.Double value) {
setZ(value);
return this;
}
@ -601,7 +592,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value9(java.lang.Integer value) {
public NpcsRecord value8(java.lang.Double value) {
setRadius(value);
return this;
}
@ -610,11 +601,20 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value10(java.lang.String value) {
public NpcsRecord value9(java.lang.String value) {
setEntityType(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public NpcsRecord value10(java.lang.String value) {
setEntityMeta(value);
return this;
}
/**
* {@inheritDoc}
*/
@ -673,7 +673,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.String value4, java.lang.String value5, java.lang.Double value6, java.lang.Double value7, java.lang.Double value8, java.lang.Integer value9, java.lang.String value10, java.lang.Boolean value11, java.lang.String value12, java.lang.String value13, java.lang.String value14, java.lang.String value15, java.lang.String value16) {
public NpcsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.String value4, java.lang.Double value5, java.lang.Double value6, java.lang.Double value7, java.lang.Double value8, java.lang.String value9, java.lang.String value10, java.lang.Boolean value11, java.lang.String value12, java.lang.String value13, java.lang.String value14, java.lang.String value15, java.lang.String value16) {
return this;
}
@ -691,19 +691,19 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
/**
* Create a detached, initialised NpcsRecord
*/
public NpcsRecord(java.lang.Integer id, java.lang.String server, java.lang.String uuid, java.lang.String name, java.lang.String world, java.lang.Double x, java.lang.Double y, java.lang.Double z, java.lang.Integer radius, java.lang.String entityType, java.lang.Boolean adult, java.lang.String helmet, java.lang.String chestplate, java.lang.String leggings, java.lang.String boots, java.lang.String inHand) {
public NpcsRecord(java.lang.Integer id, java.lang.String server, java.lang.String name, java.lang.String world, java.lang.Double x, java.lang.Double y, java.lang.Double z, java.lang.Double radius, java.lang.String entityType, java.lang.String entityMeta, java.lang.Boolean adult, java.lang.String helmet, java.lang.String chestplate, java.lang.String leggings, java.lang.String boots, java.lang.String inHand) {
super(mineplex.database.tables.Npcs.npcs);
setValue(0, id);
setValue(1, server);
setValue(2, uuid);
setValue(3, name);
setValue(4, world);
setValue(5, x);
setValue(6, y);
setValue(7, z);
setValue(8, radius);
setValue(9, entityType);
setValue(2, name);
setValue(3, world);
setValue(4, x);
setValue(5, y);
setValue(6, z);
setValue(7, radius);
setValue(8, entityType);
setValue(9, entityMeta);
setValue(10, adult);
setValue(11, helmet);
setValue(12, chestplate);

View File

@ -10,5 +10,5 @@
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${BUILD_FILES}/EnjinTranslator.xml"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${${build_files}:/EnjinTranslator}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/EnjinTranslator}"/>
</launchConfiguration>

View File

@ -14,6 +14,8 @@ import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.donation.DonationManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.punish.Category;
@ -72,7 +74,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
String name = args[1];
int amount = Integer.parseInt(args[2]);
_donationManager.RewardGems(null, "purchase", name, amount);
_donationManager.RewardGems(null, "purchase", name, UUIDFetcher.getUUIDOf(name), amount);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + amount + " gems.");
}
else if (args.length == 3 && args[0].equalsIgnoreCase("coin"))
@ -80,7 +82,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
String name = args[1];
int amount = Integer.parseInt(args[2]);
_donationManager.RewardCoins(null, "purchase", name, amount);
_donationManager.RewardCoins(null, "purchase", name, UUIDFetcher.getUUIDOf(name), amount);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + amount + " coins.");
}
else if (args.length == 3 && args[0].equalsIgnoreCase("booster"))
@ -88,18 +90,31 @@ public class Enjin extends MiniPlugin implements CommandExecutor
String name = args[1];
int amount = Integer.parseInt(args[2]);
_donationManager.PurchaseUnknownSalesPackage(null, name, "Gem Booster " + amount, false, 0, false);
_donationManager.PurchaseUnknownSalesPackage(null, name, UUIDFetcher.getUUIDOf(name), "Gem Booster " + amount, false, 0, false);
_repository.addGemBooster(name, amount);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + amount + " Gem Boosters" + ".");
}
else if (args.length == 4 && args[0].equalsIgnoreCase("rank"))
{
String name = args[1];
String rank = args[2];
boolean perm = Boolean.parseBoolean(args[3]);
final String name = args[1];
final String rank = args[2];
final boolean perm = Boolean.parseBoolean(args[3]);
_clientManager.SaveRank(name, mineplex.core.common.Rank.valueOf(rank), perm);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + rank + " " + (perm ? "permanently." : "for 1 month."));
_clientManager.loadClientByName(name, new Runnable()
{
public void run()
{
if (_clientManager.Get(name).GetRank() == Rank.ALL || _clientManager.Get(name).GetRank() == Rank.ULTRA || _clientManager.Get(name).GetRank() == Rank.HERO)
{
_clientManager.SaveRank(name, mineplex.core.common.Rank.valueOf(rank), perm);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + rank + " " + (perm ? "permanently." : "for 1 month."));
}
else
{
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " DENIED INFERIOR " + rank + " " + (perm ? "permanently." : "for 1 month."));
}
}
});
}
else if (args.length >= 3 && args[0].equalsIgnoreCase("purchase"))
{
@ -112,7 +127,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
packageName += " " + args[i];
}
_donationManager.PurchaseUnknownSalesPackage(null, name, packageName, false, 0, false);
_donationManager.PurchaseUnknownSalesPackage(null, name, UUIDFetcher.getUUIDOf(name), packageName, false, 0, false);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + packageName + ".");
}
else if (args.length >= 3 && args[0].equalsIgnoreCase("unban"))

View File

@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.CustomTagFix;
import mineplex.core.Replay;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.antistack.AntiStack;
@ -108,6 +109,7 @@ public class Hub extends JavaPlugin implements IRelation
new MemoryFix(this);
new FileUpdater(this, portal);
new CustomTagFix(this, packetHandler);
//new Replay(this, packetHandler);
CombatManager combatManager = new CombatManager(this);
BlockRestore blockRestore = new BlockRestore(this);

View File

@ -62,10 +62,12 @@ import mineplex.core.disguise.DisguiseManager;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetActivateEvent;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.mount.MountManager;
import mineplex.core.mount.event.MountActivateEvent;
import mineplex.core.pet.PetManager;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
@ -76,6 +78,7 @@ import mineplex.core.treasure.TreasureManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.commands.ForcefieldRadius;
import mineplex.hub.commands.GadgetToggle;
import mineplex.hub.commands.GameModeCommand;
import mineplex.hub.commands.NewsCommand;
import mineplex.hub.modules.ForcefieldManager;
@ -85,6 +88,7 @@ import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.TextManager;
import mineplex.hub.modules.TournamentInviter;
import mineplex.hub.modules.UHCManager;
import mineplex.hub.modules.VisibilityManager;
import mineplex.hub.modules.WorldManager;
import mineplex.hub.party.Party;
@ -98,7 +102,8 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class HubManager extends MiniClientPlugin<HubClient>
{
public String Mode = "Normal";
// Snowman!
public HubType Type = HubType.Halloween;
private BlockRestore _blockRestore;
private CoreClientManager _clientManager;
@ -106,7 +111,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
private DonationManager _donationManager;
private DisguiseManager _disguiseManager;
private PartyManager _partyManager;
private ForcefieldManager _forcefieldManager;
private ForcefieldManager _forcefieldManager;
private Portal _portal;
private StatsManager _statsManager;
private GadgetManager _gadgetManager;
@ -157,9 +162,9 @@ public class HubManager extends MiniClientPlugin<HubClient>
new MapManager(this);
new WorldManager(this);
new JumpManager(this);
//new UHCManager(this);
new UHCManager(this);
//new TournamentInviter(this);
_news = new NewsManager(this);
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
@ -317,6 +322,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
@Override
public void AddCommands()
{
AddCommand(new GadgetToggle(this));
AddCommand(new NewsCommand(this));
AddCommand(new GameModeCommand(this));
}
@ -347,7 +353,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
@EventHandler
public void SnowballPickup(BlockDamageEvent event)
{
if (!Mode.equals("Christmas"))
if (Type != HubType.Christmas)
return;
if (event.getBlock().getType() != Material.SNOW)
@ -363,7 +369,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
@EventHandler
public void SnowballHit(CustomDamageEvent event)
{
if (!Mode.equals("Christmas"))
if (Type != HubType.Christmas)
return;
Projectile proj = event.GetProjectile();
@ -588,7 +594,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
return;
//Dont Let Chat Near Spawn!
if (UtilMath.offset2d(GetSpawn(), event.getPlayer().getLocation()) == 0)
if (UtilMath.offset2d(GetSpawn(), event.getPlayer().getLocation()) == 0 && !_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.HELPER))
{
UtilPlayer.message(event.getPlayer(), F.main("Chat", "You must leave spawn before you can chat!"));
event.setCancelled(true);
@ -939,10 +945,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
return _gadgetsEnabled;
}
public void SetGadgetEnabled(boolean _enabled)
{
this._gadgetsEnabled = _enabled;
}
public NewsManager GetNewsManager()
{
@ -963,4 +965,32 @@ public class HubManager extends MiniClientPlugin<HubClient>
event.setCancelled(true);
}
}
public void ToggleGadget(Player caller)
{
_gadgetsEnabled = !_gadgetsEnabled;
if (!_gadgetsEnabled)
{
GetMount().DisableAll();
GetGadget().DisableAll();
}
for (Player player : UtilServer.getPlayers())
player.sendMessage(C.cWhite + C.Bold + "Gadgets/Mounts are now " + F.elem(_gadgetsEnabled ? C.cGreen + C.Bold + "Enabled" : C.cRed + C.Bold + "Disabled"));
}
@EventHandler
public void GadgetActivate(GadgetActivateEvent event)
{
if (!_gadgetsEnabled)
event.setCancelled(true);
}
@EventHandler
public void MountActivate(MountActivateEvent event)
{
if (!_gadgetsEnabled)
event.setCancelled(true);
}
}

View File

@ -0,0 +1,8 @@
package mineplex.hub;
public enum HubType
{
Normal,
Halloween,
Christmas
}

View File

@ -0,0 +1,21 @@
package mineplex.hub.commands;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.hub.HubManager;
public class GadgetToggle extends CommandBase<HubManager>
{
public GadgetToggle(HubManager plugin)
{
super(plugin, Rank.ADMIN, new String[] {"gadget"});
}
@Override
public void Execute(Player caller, String[] args)
{
Plugin.ToggleGadget(caller);
}
}

View File

@ -8,7 +8,6 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.server.ServerListPingEvent;
import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
@ -240,7 +239,10 @@ public class NewsManager extends MiniPlugin
{
_newsIndex = (_newsIndex + 1)%_news.length;
_newsTime = System.currentTimeMillis();
}
// JsonMessage jsonMessage = new JsonMessage(_news[_newsIndex]);
// jsonMessage.send(JsonMessage.MessageType.ABOVE_HOTBAR, UtilServer.getPlayers());
}
if (_newsIndex >= _news.length)
{
// Resets newsIndex if outside of bounds of news array after RefreshNews but before UtilTime.elapsed above

View File

@ -389,7 +389,7 @@ public class ParkourManager extends MiniPlugin
//Sound
player.playSound(player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
}, "Parkour " + data.Name, player.getName(), data.Gems);
}, "Parkour " + data.Name, player.getName(), player.getUniqueId(), data.Gems);
}
}
}

View File

@ -6,6 +6,7 @@ import mineplex.core.common.util.UtilText.TextAlign;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
import mineplex.hub.HubType;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
@ -29,7 +30,7 @@ public class TextManager extends MiniPlugin
int arcadeIndex = 0;
int smashIndex = 0;
public TextManager(HubManager manager)
{
super("Text Creator", manager.GetPlugin());
@ -55,55 +56,55 @@ public class TextManager extends MiniPlugin
{
//Comp
UtilText.MakeText("CHAMPIONS", locComp, faceComp, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Arcade
UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Survival
UtilText.MakeText("SURVIVAL", locSurvival, faceSurvival, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-15, 14, 0), faceSurvival, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-15, 21, 0), faceSurvival, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER);
//UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Other
UtilText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -15), faceOther, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -15), faceOther, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
}
/*
@ -114,13 +115,13 @@ public class TextManager extends MiniPlugin
return;
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
arcadeIndex = (arcadeIndex + 3)%arcadeGames.length;
}
@ -148,13 +149,13 @@ public class TextManager extends MiniPlugin
if (smashIndex == 1) color = 0;
//UtilText.MakeText("SUPER SMASH MOBS", locOther, faceOther, 159, color, TextAlign.CENTER);
//UtilText.MakeText("SUPER SMASH MOBS", locOther.clone().add(0, 0, -1), faceOther, 159, (byte)15, TextAlign.CENTER);
//UtilText.MakeText("SUPER SMASH MOBS", locOther.clone().add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, color, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, color, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//System.out.println("TextCreator : " + (System.currentTimeMillis() - startTime) + "ms");
}
*/

View File

@ -1,5 +1,6 @@
package mineplex.hub.modules;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -8,9 +9,11 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTitle;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
import mineplex.serverdata.Utility;
public class UHCManager extends MiniPlugin
{
@ -32,49 +35,66 @@ public class UHCManager extends MiniPlugin
@EventHandler
public void AnnounceUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
if (event.getType() != UpdateType.SEC)
return;
System.out.println("UHC in " + UtilTime.MakeStr(_delay - (System.currentTimeMillis() % _delay)));
//Reset
if (System.currentTimeMillis() % _delay > 30000 && System.currentTimeMillis() % _delay < _delay - 180000)
Bukkit.getScheduler().runTaskAsynchronously(Manager.GetPlugin(), new Runnable()
{
_canAnnounce3 = true;
_canAnnounce2 = true;
_canAnnounce1 = true;
_canAnnounce0 = true;
}
//Announce
else
{
if (_canAnnounce3 && System.currentTimeMillis() % _delay > _delay - 180000)
@Override
public void run()
{
_canAnnounce3 = false;
announce("Starting in 3 minutes...");
}
long time = Utility.currentTimeMillis();
//System.out.println("UHC in " + UtilTime.MakeStr(_delay - (time % _delay)));
else if (_canAnnounce2 && System.currentTimeMillis() % _delay > _delay - 120000)
{
_canAnnounce2 = false;
announce("Starting in 2 minutes...");
//Reset
if (time % _delay > 30000 && time % _delay < _delay - 180000)
{
_canAnnounce3 = true;
_canAnnounce2 = true;
_canAnnounce1 = true;
_canAnnounce0 = true;
}
//Announce
else
{
if (_canAnnounce3 && time % _delay > _delay - 180000)
{
_canAnnounce3 = false;
announce("Opening in 3 minutes...");
UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 3 minutes...", 10, 100, 20);
}
else if (_canAnnounce2 && time % _delay > _delay - 120000)
{
_canAnnounce2 = false;
announce("Opening in 2 minutes...");
UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 2 minutes...", 10, 100, 20);
}
else if (_canAnnounce1 && time % _delay > _delay - 60000)
{
_canAnnounce1 = false;
announce("Opening in 1 minute...");
UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 1 minute...", 10, 100, 20);
}
else if (_canAnnounce0 && time % _delay < 30000)
{
_canAnnounce0 = false;
announce("UHC Open! Join at the Ultra Hardcore NPC!");
UtilTitle.display(C.cRed + "Ultra Hardcore", "Join at the NPC to play", 10, 100, 20);
}
}
}
else if (_canAnnounce1 && System.currentTimeMillis() % _delay > _delay - 60000)
{
_canAnnounce1 = false;
announce("Starting in 1 minute...");
}
else if (_canAnnounce0 && System.currentTimeMillis() % _delay < 30000)
{
_canAnnounce0 = false;
announce("Join at the Ultra Hardcore NPC!");
}
}
});
}
private void announce(String message)
public void announce(String message)
{
for (Player player : UtilServer.getPlayers())
UtilPlayer.message(player, C.cDPurple + "[Ultra Hardcore] " + C.cPurple + C.Bold + message);

View File

@ -19,11 +19,13 @@ import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
import mineplex.hub.HubType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Boat;
@ -31,6 +33,7 @@ import org.bukkit.entity.Chicken;
import org.bukkit.entity.Cow;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Minecart;
@ -49,6 +52,7 @@ import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
@ -103,7 +107,7 @@ public class WorldManager extends MiniPlugin
else loc = new Location(Manager.GetSpawn().getWorld(), 43, 72, 5);
//Spawn
if (Manager.Mode.equals("Halloween"))
if (Manager.Type == HubType.Halloween)
{
Skeleton ent = loc.getWorld().spawn(loc, Skeleton.class);
@ -113,13 +117,14 @@ public class WorldManager extends MiniPlugin
ent.getEquipment().setHelmet(ItemStackFactory.Instance.CreateStack(Material.PUMPKIN));
ent.setCustomName(C.cYellow + "Pumpkin Minion");
ent.setCustomNameVisible(false);
_mobs.add(ent);
Manager.GetCondition().Factory().Invisible("Perm", ent, ent, 999999999, 0, false, false, true);
Manager.GetCondition().Factory().Slow("Perm", ent, ent, 999999999, 1, false, false, false, true);
}
else if (Manager.Mode.equals("Christmas"))
else if (Manager.Type == HubType.Christmas)
{
_mobs.add(loc.getWorld().spawn(loc, Snowman.class));
}
@ -207,7 +212,7 @@ public class WorldManager extends MiniPlugin
@EventHandler(priority = EventPriority.LOW)
public void ItemDespawn(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
if (event.getType() != UpdateType.SEC)
return;
for (Entity ent : UtilWorld.getWorld("world").getEntities())
@ -215,7 +220,7 @@ public class WorldManager extends MiniPlugin
if (!(ent instanceof Item))
continue;
if (ent.getTicksLived() > 600)
if (ent.getTicksLived() > 1200)
ent.remove();
}
}
@ -228,7 +233,7 @@ public class WorldManager extends MiniPlugin
World world = UtilWorld.getWorld("world");
if (Manager.Mode.equals("Halloween"))
if (Manager.Type == HubType.Halloween)
world.setTime(16000);
else
world.setTime(6000);
@ -242,7 +247,7 @@ public class WorldManager extends MiniPlugin
if (event.getType() != UpdateType.FAST)
return;
if (!Manager.Mode.equals("Halloween"))
if (Manager.Type != HubType.Halloween)
return;
//Block Lightup
@ -274,6 +279,22 @@ public class WorldManager extends MiniPlugin
}
}
@EventHandler
public void SoundUpdate(UpdateEvent event)
{
if (Manager.Type != HubType.Halloween)
return;
if (event.getType() != UpdateType.SLOW)
return;
if (Math.random() > 0.1)
return;
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 3f, 1f);
}
@EventHandler
public void BlockForm(BlockFormEvent event)
{
@ -283,7 +304,7 @@ public class WorldManager extends MiniPlugin
@EventHandler
public void CreatureTarget(EntityTargetEvent event)
{
if (Manager.Mode.equals("Christmas"))
if (Manager.Type == HubType.Christmas)
{
event.setCancelled(true);
}

View File

@ -191,7 +191,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
}
});
}
}, "Poll", name, poll.getCoinReward());
}, "Poll", name, uuid, poll.getCoinReward());
}
}
});

View File

@ -763,4 +763,9 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Team Deathmatch");
}
public ShopBase<ServerManager> getMinestrikeShop()
{
return _serverNpcShopMap.get("Mine-Strike");
}
}

Some files were not shown because too many files have changed in this diff Show More