Database implementation of NpcManager partially complete

This commit is contained in:
CoderTim 2014-09-21 15:45:15 -04:00
parent edce1c9f90
commit 1949de4fd7
12 changed files with 470 additions and 20 deletions

View File

@ -0,0 +1,132 @@
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

@ -51,7 +51,7 @@ import mineplex.core.npc.event.NpcInteractEntityEvent;
public class NpcManager extends MiniPlugin
{
private Creature _creature;
private NautHashMap<String, NpcEntry> _npcs;
protected NautHashMap<String, NpcEntry> _npcs;
private NautHashMap<String, Integer> _failedAttempts;
private NautHashMap<String, NpcEntry> _addTempList;

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 = -1984121749;
private static final long serialVersionUID = 1511797714;
/**
* The singleton instance of <code>Account</code>
@ -47,6 +47,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
mineplex.database.tables.Npcs.npcs,
mineplex.database.tables.PlayerMap.playerMap,
mineplex.database.tables.Polls.polls,
mineplex.database.tables.RankBenefits.rankBenefits,
mineplex.database.tables.RewardLog.rewardLog,
mineplex.database.tables.Stats.stats,
mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard);

View File

@ -31,6 +31,8 @@ public class Keys {
public static final org.jooq.Identity<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> IDENTITY_npcs = Identities0.IDENTITY_npcs;
public static final org.jooq.Identity<mineplex.database.tables.records.PlayerMapRecord, java.lang.Integer> IDENTITY_playerMap = Identities0.IDENTITY_playerMap;
public static final org.jooq.Identity<mineplex.database.tables.records.PollsRecord, java.lang.Integer> IDENTITY_polls = Identities0.IDENTITY_polls;
public static final org.jooq.Identity<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> IDENTITY_rankBenefits = Identities0.IDENTITY_rankBenefits;
public static final org.jooq.Identity<mineplex.database.tables.records.RewardLogRecord, java.lang.Integer> IDENTITY_rewardLog = Identities0.IDENTITY_rewardLog;
public static final org.jooq.Identity<mineplex.database.tables.records.StatsRecord, java.lang.Integer> IDENTITY_stats = Identities0.IDENTITY_stats;
public static final org.jooq.Identity<mineplex.database.tables.records.TournamentLeaderboardRecord, java.lang.Integer> IDENTITY_tournamentLeaderboard = Identities0.IDENTITY_tournamentLeaderboard;
@ -59,6 +61,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_PRIMARY = UniqueKeys0.KEY_playerMap_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_playerIndex = UniqueKeys0.KEY_playerMap_playerIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PollsRecord> KEY_polls_PRIMARY = UniqueKeys0.KEY_polls_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord> KEY_rankBenefits_PRIMARY = UniqueKeys0.KEY_rankBenefits_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RewardLogRecord> KEY_rewardLog_PRIMARY = UniqueKeys0.KEY_rewardLog_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatsRecord> KEY_stats_PRIMARY = UniqueKeys0.KEY_stats_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatsRecord> KEY_stats_nameIndex = UniqueKeys0.KEY_stats_nameIndex;
@ -99,6 +102,8 @@ public class Keys {
public static org.jooq.Identity<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> IDENTITY_npcs = createIdentity(mineplex.database.tables.Npcs.npcs, mineplex.database.tables.Npcs.npcs.id);
public static org.jooq.Identity<mineplex.database.tables.records.PlayerMapRecord, java.lang.Integer> IDENTITY_playerMap = createIdentity(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
public static org.jooq.Identity<mineplex.database.tables.records.PollsRecord, java.lang.Integer> IDENTITY_polls = createIdentity(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
public static org.jooq.Identity<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> IDENTITY_rankBenefits = createIdentity(mineplex.database.tables.RankBenefits.rankBenefits, mineplex.database.tables.RankBenefits.rankBenefits.id);
public static org.jooq.Identity<mineplex.database.tables.records.RewardLogRecord, java.lang.Integer> IDENTITY_rewardLog = createIdentity(mineplex.database.tables.RewardLog.rewardLog, mineplex.database.tables.RewardLog.rewardLog.id);
public static org.jooq.Identity<mineplex.database.tables.records.StatsRecord, java.lang.Integer> IDENTITY_stats = createIdentity(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.id);
public static org.jooq.Identity<mineplex.database.tables.records.TournamentLeaderboardRecord, java.lang.Integer> IDENTITY_tournamentLeaderboard = createIdentity(mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard, mineplex.database.tables.TournamentLeaderboard.tournamentLeaderboard.id);
}
@ -125,6 +130,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_PRIMARY = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_playerIndex = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.playerName);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PollsRecord> KEY_polls_PRIMARY = createUniqueKey(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord> KEY_rankBenefits_PRIMARY = createUniqueKey(mineplex.database.tables.RankBenefits.rankBenefits, mineplex.database.tables.RankBenefits.rankBenefits.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RewardLogRecord> KEY_rewardLog_PRIMARY = createUniqueKey(mineplex.database.tables.RewardLog.rewardLog, mineplex.database.tables.RewardLog.rewardLog.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatsRecord> KEY_stats_PRIMARY = createUniqueKey(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatsRecord> KEY_stats_nameIndex = createUniqueKey(mineplex.database.tables.Stats.stats, mineplex.database.tables.Stats.stats.name);

View File

@ -78,6 +78,11 @@ public class Tables {
*/
public static final mineplex.database.tables.Polls polls = mineplex.database.tables.Polls.polls;
/**
* The table Account.rankBenefits
*/
public static final mineplex.database.tables.RankBenefits rankBenefits = mineplex.database.tables.RankBenefits.rankBenefits;
/**
* The table Account.rewardLog
*/

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Games extends org.jooq.impl.TableImpl<mineplex.database.tables.records.GamesRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 1977514584;
private static final long serialVersionUID = 768428281;
/**
* The singleton instance of <code>Account.games</code>
@ -39,7 +39,7 @@ public class Games extends org.jooq.impl.TableImpl<mineplex.database.tables.reco
/**
* The column <code>Account.games.server</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.GamesRecord, java.lang.String> server = createField("server", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.GamesRecord, java.lang.String> server = createField("server", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, "");
/**
* The column <code>Account.games.type</code>.

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 = -1072109459;
private static final long serialVersionUID = -1825231460;
/**
* The singleton instance of <code>Account.npcs</code>
@ -69,7 +69,7 @@ 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.Double> radius = createField("radius", org.jooq.impl.SQLDataType.FLOAT.nullable(false), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> radius = createField("radius", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.npcs.entityType</code>.

View File

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

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RewardLog extends org.jooq.impl.TableImpl<mineplex.database.tables.records.RewardLogRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -2067456689;
private static final long serialVersionUID = 503144315;
/**
* The singleton instance of <code>Account.rewardLog</code>
@ -78,6 +78,14 @@ public class RewardLog extends org.jooq.impl.TableImpl<mineplex.database.tables.
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.RewardLogRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_rewardLog;
}
/**
* {@inheritDoc}
*/

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.Double, 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.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> {
private static final long serialVersionUID = 870408054;
private static final long serialVersionUID = 370528549;
/**
* Setter for <code>Account.npcs.id</code>.
@ -128,15 +128,15 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
/**
* Setter for <code>Account.npcs.radius</code>.
*/
public void setRadius(java.lang.Double value) {
public void setRadius(java.lang.Integer value) {
setValue(8, value);
}
/**
* Getter for <code>Account.npcs.radius</code>.
*/
public java.lang.Double getRadius() {
return (java.lang.Double) getValue(8);
public java.lang.Integer getRadius() {
return (java.lang.Integer) getValue(8);
}
/**
@ -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.Double, 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.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() {
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.Double, 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.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() {
return (org.jooq.Row16) super.valuesRow();
}
@ -337,7 +337,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Double> field9() {
public org.jooq.Field<java.lang.Integer> field9() {
return mineplex.database.tables.Npcs.npcs.radius;
}
@ -465,7 +465,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public java.lang.Double value9() {
public java.lang.Integer value9() {
return getRadius();
}
@ -601,7 +601,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
* {@inheritDoc}
*/
@Override
public NpcsRecord value9(java.lang.Double value) {
public NpcsRecord value9(java.lang.Integer value) {
setRadius(value);
return this;
}
@ -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.Double 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.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) {
return this;
}
@ -691,7 +691,7 @@ 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.Double 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 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) {
super(mineplex.database.tables.Npcs.npcs);
setValue(0, id);

View File

@ -0,0 +1,194 @@
/**
* 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 RankBenefitsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.RankBenefitsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3<java.lang.Integer, java.lang.String, java.lang.String> {
private static final long serialVersionUID = 483537505;
/**
* Setter for <code>Account.rankBenefits.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.rankBenefits.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.rankBenefits.uuid</code>.
*/
public void setUuid(java.lang.String value) {
setValue(1, value);
}
/**
* Getter for <code>Account.rankBenefits.uuid</code>.
*/
public java.lang.String getUuid() {
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>Account.rankBenefits.benefit</code>.
*/
public void setBenefit(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>Account.rankBenefits.benefit</code>.
*/
public java.lang.String getBenefit() {
return (java.lang.String) getValue(2);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record3 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row3<java.lang.Integer, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row3) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row3<java.lang.Integer, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row3) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.RankBenefits.rankBenefits.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field2() {
return mineplex.database.tables.RankBenefits.rankBenefits.uuid;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return mineplex.database.tables.RankBenefits.rankBenefits.benefit;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value2() {
return getUuid();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getBenefit();
}
/**
* {@inheritDoc}
*/
@Override
public RankBenefitsRecord value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public RankBenefitsRecord value2(java.lang.String value) {
setUuid(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public RankBenefitsRecord value3(java.lang.String value) {
setBenefit(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public RankBenefitsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached RankBenefitsRecord
*/
public RankBenefitsRecord() {
super(mineplex.database.tables.RankBenefits.rankBenefits);
}
/**
* Create a detached, initialised RankBenefitsRecord
*/
public RankBenefitsRecord(java.lang.Integer id, java.lang.String uuid, java.lang.String benefit) {
super(mineplex.database.tables.RankBenefits.rankBenefits);
setValue(0, id);
setValue(1, uuid);
setValue(2, benefit);
}
}

View File

@ -48,7 +48,7 @@ public class DeathBomberStatTracker extends StatTracker<Game>
if (player == null)
return;
if ("Explosion".equals(event.GetLog().GetLastDamager().GetLastDamageSource()))
if ("Explosion".equals(event.GetLog().GetLastDamager().GetName()))
{
Integer count = _killCount.get(killer.getUniqueId());