Merge branch 'feature/currency-log'
This commit is contained in:
commit
3ba748f2de
9
Plugins/.idea/libraries/commons_dbcp2.xml
Normal file
9
Plugins/.idea/libraries/commons_dbcp2.xml
Normal 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>
|
9
Plugins/.idea/libraries/commons_logging.xml
Normal file
9
Plugins/.idea/libraries/commons_logging.xml
Normal 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>
|
@ -20,6 +20,8 @@
|
||||
<RunnerSettings RunnerId="Run" />
|
||||
<ConfigurationWrapper RunnerId="Debug" />
|
||||
<ConfigurationWrapper RunnerId="Run" />
|
||||
<method />
|
||||
<method>
|
||||
<option name="Make" enabled="false" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
@ -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>
|
||||
|
||||
|
BIN
Plugins/Libraries/commons-dbcp2-2.0.1.jar
Normal file
BIN
Plugins/Libraries/commons-dbcp2-2.0.1.jar
Normal file
Binary file not shown.
@ -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"/>
|
||||
|
@ -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>
|
||||
|
||||
|
51
Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java
Normal file
51
Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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."));
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
102
Plugins/Mineplex.Core/src/mineplex/core/npc/Npc.java
Normal file
102
Plugins/Mineplex.Core/src/mineplex/core/npc/Npc.java
Normal file
@ -0,0 +1,102 @@
|
||||
package mineplex.core.npc;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
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 NpcsRecord _databaseRecord;
|
||||
private final Location _location;
|
||||
private UUID _uuid;
|
||||
private int _failedAttempts = 0;
|
||||
private boolean _returning = false;
|
||||
|
||||
public Npc(NpcsRecord databaseRecord)
|
||||
{
|
||||
_databaseRecord = databaseRecord;
|
||||
|
||||
_location = new Location(Bukkit.getWorld(getDatabaseRecord().getWorld()), getDatabaseRecord().getX(), getDatabaseRecord().getY(), getDatabaseRecord().getZ());
|
||||
}
|
||||
|
||||
public void setEntity(LivingEntity entity)
|
||||
{
|
||||
if (entity == null)
|
||||
_uuid = null;
|
||||
else
|
||||
_uuid = entity.getUniqueId();
|
||||
}
|
||||
|
||||
public UUID getUuid()
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
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(Entity entity)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -1,26 +1,21 @@
|
||||
package mineplex.core.npc;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.EntityAgeable;
|
||||
import net.minecraft.server.v1_7_R4.EntityInsentient;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftAgeable;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
|
||||
import org.bukkit.entity.Ageable;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -33,522 +28,474 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import net.minecraft.server.v1_7_R4.EntityInsentient;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.creature.Creature;
|
||||
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
|
||||
import mineplex.core.npc.Commands.NpcCommand;
|
||||
import mineplex.core.database.DBPool;
|
||||
import mineplex.core.npc.command.NpcCommand;
|
||||
import mineplex.core.npc.event.NpcDamageByEntityEvent;
|
||||
import mineplex.core.npc.event.NpcInteractEntityEvent;
|
||||
import mineplex.database.Tables;
|
||||
import mineplex.database.tables.records.NpcsRecord;
|
||||
import org.jooq.Result;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
public class NpcManager extends MiniPlugin
|
||||
{
|
||||
private Creature _creature;
|
||||
protected NautHashMap<String, NpcEntry> _npcs;
|
||||
private NautHashMap<String, Integer> _failedAttempts;
|
||||
private static String itemStackToYaml(ItemStack stack)
|
||||
{
|
||||
if (stack == null || stack.getType() == Material.AIR)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
YamlConfiguration configuration = new YamlConfiguration();
|
||||
configuration.set("stack", stack);
|
||||
return configuration.saveToString();
|
||||
}
|
||||
}
|
||||
|
||||
private NautHashMap<String, NpcEntry> _addTempList;
|
||||
private HashSet<String> _delTempList;
|
||||
private static ItemStack yamlToItemStack(String yaml)
|
||||
{
|
||||
if (yaml == null)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
YamlConfiguration configuration = new YamlConfiguration();
|
||||
configuration.loadFromString(yaml);
|
||||
return configuration.getItemStack("stack");
|
||||
}
|
||||
catch (InvalidConfigurationException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final Creature _creature;
|
||||
private final Set<Npc> _npcs = new HashSet<>();
|
||||
private final Set<UUID> _npcDeletingPlayers = new HashSet<>();
|
||||
|
||||
|
||||
public NpcManager(JavaPlugin plugin, Creature creature)
|
||||
{
|
||||
super("NpcManager", plugin);
|
||||
|
||||
|
||||
_creature = creature;
|
||||
_npcs = new NautHashMap<String, NpcEntry>();
|
||||
_failedAttempts = new NautHashMap<String, Integer>();
|
||||
_addTempList = new NautHashMap<String, NpcEntry>();
|
||||
_delTempList = new HashSet<String>();
|
||||
|
||||
|
||||
_plugin.getServer().getScheduler().scheduleSyncRepeatingTask(_plugin, new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
UpdateNpcLocations();
|
||||
}
|
||||
}, 0L, 5L);
|
||||
|
||||
_plugin.getServer().getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
ReattachNpcs();
|
||||
}
|
||||
}, 100L);
|
||||
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
updateNpcLocations();
|
||||
}
|
||||
}, 0L, 5L);
|
||||
|
||||
_plugin.getServer().getPluginManager().registerEvents(this, _plugin);
|
||||
|
||||
LoadNpcs();
|
||||
|
||||
try
|
||||
{
|
||||
loadNpcs();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddCommands()
|
||||
{
|
||||
|
||||
public void AddCommands()
|
||||
{
|
||||
AddCommand(new NpcCommand(this));
|
||||
}
|
||||
|
||||
|
||||
public void Help(Player caller, String message)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main(_moduleName, "Commands List:"));
|
||||
UtilPlayer.message(caller, F.help("/npc add <radius> <name>", "Right click mob to attach npc.", Rank.OWNER));
|
||||
UtilPlayer.message(caller, F.help("/npc del ", "Right click npc to delete", Rank.OWNER));
|
||||
UtilPlayer.message(caller, F.help("/npc clear", "Removes all npcs", Rank.OWNER));
|
||||
UtilPlayer.message(caller, F.help("/npc home", " Teleport npcs to home locations.", Rank.OWNER));
|
||||
UtilPlayer.message(caller, F.help("/npc reattach", "Attempt to reattach npcs to entities.", Rank.OWNER));
|
||||
|
||||
UtilPlayer.message(caller, F.help("/npc add <type> [radius] [adult] [name]", "Create a new NPC.", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("/npc del ", "Right click NPC to delete.", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("/npc home", "Teleport NPCs to home locations.", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("/npc clear", "Deletes all NPCs.", Rank.DEVELOPER));
|
||||
|
||||
if (message != null)
|
||||
UtilPlayer.message(caller, F.main(_moduleName, ChatColor.RED + message));
|
||||
}
|
||||
|
||||
|
||||
public void Help(Player caller)
|
||||
{
|
||||
Help(caller, null);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void OnEntityDamage(EntityDamageEvent event)
|
||||
{
|
||||
if (_npcs.containsKey(event.getEntity().getUniqueId().toString()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void OnEntityDamage(EntityDamageByEntityEvent event)
|
||||
{
|
||||
if (_npcs.containsKey(event.getEntity().getUniqueId().toString()))
|
||||
{
|
||||
if (event.getDamager() instanceof LivingEntity)
|
||||
{
|
||||
NpcDamageByEntityEvent npcEvent = new NpcDamageByEntityEvent((LivingEntity)event.getEntity(), (LivingEntity)event.getDamager());
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(npcEvent);
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void OnCreatureKillEntities(CreatureKillEntitiesEvent event)
|
||||
{
|
||||
Iterator<Entity> entityIterator = event.GetEntities().iterator();
|
||||
|
||||
while (entityIterator.hasNext())
|
||||
{
|
||||
if (_npcs.containsKey(entityIterator.next().getUniqueId().toString()))
|
||||
{
|
||||
entityIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void OnEntityTarget(EntityTargetEvent event)
|
||||
{
|
||||
if (_npcs.containsKey(event.getEntity().getUniqueId().toString()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void OnEntityCombust(EntityCombustEvent event)
|
||||
{
|
||||
if (_npcs.containsKey(event.getEntity().getUniqueId().toString()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void OnChunkLoad(ChunkLoadEvent event)
|
||||
{
|
||||
for (Entity entity : event.getChunk().getEntities())
|
||||
{
|
||||
if (_npcs.containsKey(entity.getUniqueId().toString()))
|
||||
{
|
||||
_npcs.get(entity.getUniqueId().toString()).Name = ((LivingEntity)entity).getCustomName();
|
||||
_npcs.get(entity.getUniqueId().toString()).Entity = entity;
|
||||
UtilEnt.silence(entity, true);
|
||||
UtilEnt.ghost(entity, true, false);
|
||||
|
||||
if (_npcs.get(entity.getUniqueId().toString()).Radius == 0)
|
||||
{
|
||||
UtilEnt.Vegetate(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event)
|
||||
{
|
||||
if (event.getRightClicked() instanceof LivingEntity)
|
||||
public Npc getNpcByEntityUUID(UUID uuid)
|
||||
{
|
||||
if (uuid == null)
|
||||
return null;
|
||||
|
||||
for (Npc npc : _npcs)
|
||||
{
|
||||
if (_addTempList.containsKey(event.getPlayer().getName()))
|
||||
{
|
||||
if (event.getRightClicked().getType() == EntityType.PLAYER)
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Failed to add npc. Can't attach to player."));
|
||||
}
|
||||
else
|
||||
{
|
||||
LivingEntity npc = ((LivingEntity)event.getRightClicked());
|
||||
|
||||
if (_addTempList.get(event.getPlayer().getName()).Name != null)
|
||||
{
|
||||
npc.setCustomName(_addTempList.get(event.getPlayer().getName()).Name);
|
||||
npc.setCustomNameVisible(true);
|
||||
}
|
||||
|
||||
npc.getEquipment().setArmorContents(event.getPlayer().getInventory().getArmorContents());
|
||||
npc.getEquipment().setItemInHand(event.getPlayer().getItemInHand());
|
||||
npc.setCanPickupItems(false);
|
||||
((EntityInsentient)((CraftLivingEntity)npc).getHandle()).persistent = true;
|
||||
|
||||
if (npc instanceof Creature)
|
||||
{
|
||||
((org.bukkit.entity.Creature)npc).setTarget(null);
|
||||
}
|
||||
|
||||
AddNpc(npc, _addTempList.get(event.getPlayer().getName()), true);
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Added npc"));
|
||||
}
|
||||
|
||||
_addTempList.remove(event.getPlayer().getName());
|
||||
}
|
||||
else if (_delTempList.contains(event.getPlayer().getName()))
|
||||
{
|
||||
if (DeleteNpc(event.getRightClicked()))
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Deleted npc."));
|
||||
}
|
||||
else
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Failed to delete npc. That one isn't in the list."));
|
||||
}
|
||||
|
||||
_delTempList.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
if (_npcs.containsKey(event.getRightClicked().getUniqueId().toString()))
|
||||
{
|
||||
NpcInteractEntityEvent npcEvent = new NpcInteractEntityEvent((LivingEntity)event.getRightClicked(), event.getPlayer());
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(npcEvent);
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (npc.getUuid() != null && npc.getUuid().equals(uuid))
|
||||
return npc;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetNpcInfo(Player admin, int radius, String name, Location location)
|
||||
{
|
||||
_addTempList.put(admin.getName(), new NpcEntry(name, null, radius, location));
|
||||
}
|
||||
|
||||
public Entity AddNpc(EntityType entityType, int radius, String name, Location location)
|
||||
{
|
||||
LivingEntity entity = (LivingEntity) _creature.SpawnEntity(location, entityType);
|
||||
|
||||
entity.setCustomName(name);
|
||||
entity.setCustomNameVisible(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
public Npc getNpcByEntity(Entity entity)
|
||||
{
|
||||
if (entity == null)
|
||||
return null;
|
||||
|
||||
return getNpcByEntityUUID(entity.getUniqueId());
|
||||
}
|
||||
|
||||
public boolean isNpc(Entity entity)
|
||||
{
|
||||
return getNpcByEntity(entity) != null;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityDamage(EntityDamageEvent event)
|
||||
{
|
||||
if (isNpc(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDamage(EntityDamageByEntityEvent event)
|
||||
{
|
||||
if (isNpc(event.getEntity()))
|
||||
{
|
||||
if (event.getEntity() instanceof LivingEntity && event.getDamager() instanceof LivingEntity)
|
||||
{
|
||||
NpcDamageByEntityEvent npcEvent = new NpcDamageByEntityEvent((LivingEntity) event.getEntity(), (LivingEntity) event.getDamager());
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(npcEvent);
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onCreatureKillEntities(CreatureKillEntitiesEvent event)
|
||||
{
|
||||
for (Iterator<Entity> entityIterator = event.GetEntities().iterator(); entityIterator.hasNext(); )
|
||||
{
|
||||
if (isNpc(entityIterator.next()))
|
||||
entityIterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityTarget(EntityTargetEvent event)
|
||||
{
|
||||
if (isNpc(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityCombust(EntityCombustEvent event)
|
||||
{
|
||||
if (isNpc(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void OnChunkLoad(ChunkLoadEvent event)
|
||||
{
|
||||
for (Entity entity : event.getChunk().getEntities())
|
||||
{
|
||||
Npc npc = getNpcByEntity(entity);
|
||||
|
||||
if (npc != null)
|
||||
{
|
||||
UtilEnt.silence(entity, true);
|
||||
UtilEnt.ghost(entity, true, false);
|
||||
|
||||
if (npc.getDatabaseRecord().getRadius() == 0)
|
||||
UtilEnt.Vegetate(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event)
|
||||
{
|
||||
if (event.getRightClicked() instanceof LivingEntity)
|
||||
{
|
||||
if (_npcDeletingPlayers.remove(event.getPlayer().getUniqueId()))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (deleteNpc(event.getRightClicked()))
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Deleted npc."));
|
||||
else
|
||||
event.getPlayer().sendMessage(F.main(GetName(), "Failed to delete npc. That one isn't in the list."));
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else if (isNpc(event.getRightClicked()))
|
||||
{
|
||||
NpcInteractEntityEvent npcEvent = new NpcInteractEntityEvent((LivingEntity) event.getRightClicked(), event.getPlayer());
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(npcEvent);
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Entity addNpc(Player player, EntityType entityType, double radius, boolean adult, String name) throws SQLException
|
||||
{
|
||||
try (Connection connection = DBPool.getInstance().getConnection())
|
||||
{
|
||||
String helmet = itemStackToYaml(player.getInventory().getHelmet());
|
||||
String chestplate = itemStackToYaml(player.getInventory().getChestplate());
|
||||
String leggings = itemStackToYaml(player.getInventory().getLeggings());
|
||||
String boots = itemStackToYaml(player.getInventory().getBoots());
|
||||
String inHand = itemStackToYaml(player.getInventory().getItemInHand());
|
||||
|
||||
NpcsRecord npcsRecord = DSL.using(connection).newRecord(Tables.npcs);
|
||||
npcsRecord.setServer(GetPlugin().getClass().getSimpleName());
|
||||
npcsRecord.setName(name);
|
||||
npcsRecord.setWorld(player.getWorld().getName());
|
||||
npcsRecord.setX(player.getLocation().getX());
|
||||
npcsRecord.setY(player.getLocation().getY());
|
||||
npcsRecord.setZ(player.getLocation().getZ());
|
||||
npcsRecord.setRadius(radius);
|
||||
npcsRecord.setEntityType(entityType.name());
|
||||
npcsRecord.setAdult(adult);
|
||||
npcsRecord.setHelmet(helmet);
|
||||
npcsRecord.setChestplate(chestplate);
|
||||
npcsRecord.setLeggings(leggings);
|
||||
npcsRecord.setBoots(boots);
|
||||
npcsRecord.setInHand(inHand);
|
||||
|
||||
try
|
||||
{
|
||||
npcsRecord.insert();
|
||||
}
|
||||
finally
|
||||
{
|
||||
npcsRecord.detach();
|
||||
}
|
||||
|
||||
Npc npc = new Npc(npcsRecord);
|
||||
_npcs.add(npc);
|
||||
|
||||
return spawnNpc(npc);
|
||||
}
|
||||
}
|
||||
|
||||
public Entity spawnNpc(Npc npc)
|
||||
{
|
||||
LivingEntity entity = (LivingEntity) _creature.SpawnEntity(npc.getLocation(), EntityType.valueOf(npc.getDatabaseRecord().getEntityType()));
|
||||
|
||||
if (npc.getDatabaseRecord().getName() != null)
|
||||
{
|
||||
entity.setCustomName(npc.getDatabaseRecord().getName());
|
||||
entity.setCustomNameVisible(true);
|
||||
}
|
||||
|
||||
entity.setCanPickupItems(false);
|
||||
entity.setRemoveWhenFarAway(false);
|
||||
((EntityInsentient)((CraftLivingEntity)entity).getHandle()).persistent = true;
|
||||
|
||||
if (((CraftLivingEntity)entity).getHandle() instanceof EntityAgeable)
|
||||
((EntityInsentient) ((CraftLivingEntity) entity).getHandle()).persistent = true;
|
||||
|
||||
if (entity instanceof Ageable)
|
||||
{
|
||||
((CraftAgeable)entity).getHandle().ageLocked = true;
|
||||
if (npc.getDatabaseRecord().getAdult())
|
||||
((Ageable) entity).setAdult();
|
||||
else
|
||||
((Ageable) entity).setBaby();
|
||||
|
||||
((Ageable) entity).setAgeLock(true);
|
||||
}
|
||||
|
||||
if (entity instanceof Creature)
|
||||
{
|
||||
((org.bukkit.entity.Creature)entity).setTarget(null);
|
||||
}
|
||||
|
||||
return AddNpc(entity, new NpcEntry(name, null, radius, location), true);
|
||||
}
|
||||
|
||||
public Entity AddNpc(LivingEntity entity, NpcEntry entry, boolean save)
|
||||
{
|
||||
entry.Entity = entity;
|
||||
_npcs.put(entity.getUniqueId().toString(), entry);
|
||||
|
||||
if (entry.Radius == 0)
|
||||
{
|
||||
UtilEnt.Vegetate(entry.Entity);
|
||||
UtilEnt.silence(entry.Entity, true);
|
||||
}
|
||||
|
||||
if (save)
|
||||
SaveNpcs();
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public boolean DeleteNpc(Entity entity)
|
||||
{
|
||||
if (entity instanceof LivingEntity)
|
||||
{
|
||||
if (_npcs.containsKey(entity.getUniqueId().toString()))
|
||||
{
|
||||
entity.remove();
|
||||
_npcs.remove(entity.getUniqueId().toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
if (entity instanceof org.bukkit.entity.Creature)
|
||||
((org.bukkit.entity.Creature) entity).setTarget(null);
|
||||
|
||||
public void PrepDeleteNpc(Player admin)
|
||||
{
|
||||
_delTempList.add(admin.getName());
|
||||
if (npc.getDatabaseRecord().getRadius() == 0)
|
||||
{
|
||||
UtilEnt.Vegetate(entity);
|
||||
UtilEnt.silence(entity, true);
|
||||
}
|
||||
|
||||
if (npc.getDatabaseRecord().getHelmet() != null)
|
||||
entity.getEquipment().setHelmet(yamlToItemStack(npc.getDatabaseRecord().getHelmet()));
|
||||
if (npc.getDatabaseRecord().getChestplate() != null)
|
||||
entity.getEquipment().setChestplate(yamlToItemStack(npc.getDatabaseRecord().getChestplate()));
|
||||
if (npc.getDatabaseRecord().getLeggings() != null)
|
||||
entity.getEquipment().setLeggings(yamlToItemStack(npc.getDatabaseRecord().getLeggings()));
|
||||
if (npc.getDatabaseRecord().getBoots() != null)
|
||||
entity.getEquipment().setBoots(yamlToItemStack(npc.getDatabaseRecord().getBoots()));
|
||||
if (npc.getDatabaseRecord().getInHand() != null)
|
||||
entity.getEquipment().setItemInHand(yamlToItemStack(npc.getDatabaseRecord().getInHand()));
|
||||
|
||||
npc.setEntity(entity);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void ClearNpcs()
|
||||
public boolean deleteNpc(Entity entity) throws SQLException
|
||||
{
|
||||
Iterator<String> npcIterator = _npcs.keySet().iterator();
|
||||
|
||||
while (npcIterator.hasNext())
|
||||
Npc npc = getNpcByEntity(entity);
|
||||
|
||||
if (npc != null)
|
||||
{
|
||||
String id = npcIterator.next();
|
||||
|
||||
if (_npcs.get(id).Entity != null)
|
||||
_npcs.get(id).Entity.remove();
|
||||
|
||||
npcIterator.remove();
|
||||
try (Connection connection = DBPool.getInstance().getConnection())
|
||||
{
|
||||
npc.getDatabaseRecord().attach(DSL.using(connection).configuration());
|
||||
npc.getDatabaseRecord().delete();
|
||||
|
||||
entity.remove();
|
||||
_npcs.remove(npc);
|
||||
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
npc.getDatabaseRecord().detach();
|
||||
}
|
||||
}
|
||||
|
||||
SaveNpcs();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void UpdateNpcLocations()
|
||||
|
||||
public void prepDeleteNpc(Player admin)
|
||||
{
|
||||
for (NpcEntry npc : _npcs.values())
|
||||
_npcDeletingPlayers.add(admin.getUniqueId());
|
||||
}
|
||||
|
||||
private void updateNpcLocations()
|
||||
{
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
if (npc.Entity == null)
|
||||
for (LivingEntity entity : world.getEntitiesByClass(LivingEntity.class))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
npc.Entity.setTicksLived(1);
|
||||
((EntityInsentient)((CraftLivingEntity)npc.Entity).getHandle()).persistent = true;
|
||||
UtilEnt.silence(npc.Entity, true);
|
||||
|
||||
if (!IsNpcChunkLoaded(npc.Entity) || !(npc.Entity instanceof CraftCreature))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!npc.Entity.isDead() && npc.Entity.isValid())
|
||||
{
|
||||
String uuid = npc.Entity.getUniqueId().toString();
|
||||
|
||||
((LivingEntity)npc.Entity).getEquipment().getArmorContents()[0].setDurability((short)0);
|
||||
((LivingEntity)npc.Entity).getEquipment().getArmorContents()[1].setDurability((short)0);
|
||||
((LivingEntity)npc.Entity).getEquipment().getArmorContents()[2].setDurability((short)0);
|
||||
((LivingEntity)npc.Entity).getEquipment().getArmorContents()[3].setDurability((short)0);
|
||||
|
||||
if (!_failedAttempts.containsKey(uuid))
|
||||
_failedAttempts.put(uuid, 0);
|
||||
|
||||
if (_failedAttempts.get(uuid) >= 10)
|
||||
{
|
||||
npc.Entity.teleport(npc.Location);
|
||||
_failedAttempts.put(uuid, 0);
|
||||
}
|
||||
else if (!npc.IsInRadius())
|
||||
Npc npc = getNpcByEntity(entity);
|
||||
if (npc == null)
|
||||
continue;
|
||||
|
||||
entity.setTicksLived(1);
|
||||
((EntityInsentient) ((CraftLivingEntity) entity).getHandle()).persistent = true;
|
||||
UtilEnt.silence(entity, true);
|
||||
|
||||
if (!isNpcChunkLoaded(entity) || !(entity instanceof CraftCreature))
|
||||
continue;
|
||||
|
||||
if (!entity.isDead() && entity.isValid())
|
||||
{
|
||||
npc.ReturnToPost();
|
||||
_failedAttempts.put(uuid, _failedAttempts.get(uuid) + 1);
|
||||
for (ItemStack armor : entity.getEquipment().getArmorContents())
|
||||
{
|
||||
if (armor != null && armor.getType() != Material.AIR)
|
||||
armor.setDurability((short) 0);
|
||||
}
|
||||
|
||||
if (npc.getFailedAttempts() >= 10)
|
||||
{
|
||||
entity.teleport(npc.getLocation());
|
||||
npc.setFailedAttempts(0);
|
||||
}
|
||||
else if (!npc.isInRadius(entity.getLocation()))
|
||||
{
|
||||
npc.returnToPost(entity);
|
||||
npc.incrementFailedAttempts();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.isReturning())
|
||||
npc.clearGoals(entity);
|
||||
|
||||
npc.setFailedAttempts(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.Returning())
|
||||
{
|
||||
npc.ClearGoals();
|
||||
}
|
||||
|
||||
_failedAttempts.put(uuid, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TeleportNpcsHome()
|
||||
|
||||
public void teleportNpcsHome()
|
||||
{
|
||||
for (NpcEntry npc : _npcs.values())
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
if (npc.Entity == null)
|
||||
for (LivingEntity entity : world.getEntitiesByClass(LivingEntity.class))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IsNpcChunkLoaded(npc.Entity))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!npc.Entity.isDead() && npc.Entity.isValid())
|
||||
{
|
||||
npc.Entity.teleport(npc.Location);
|
||||
_failedAttempts.put(npc.Entity.getUniqueId().toString(), 0);
|
||||
Npc npc = getNpcByEntity(entity);
|
||||
if (npc == null)
|
||||
continue;
|
||||
|
||||
if (!isNpcChunkLoaded(entity))
|
||||
continue;
|
||||
|
||||
if (!entity.isDead() && entity.isValid())
|
||||
{
|
||||
entity.teleport(npc.getLocation());
|
||||
|
||||
npc.setFailedAttempts(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ReattachNpcs()
|
||||
{
|
||||
for (Entity entity : UtilWorld.getWorldType(Environment.NORMAL).getEntities())
|
||||
{
|
||||
if (_npcs.containsKey(entity.getUniqueId().toString()))
|
||||
{
|
||||
_npcs.get(entity.getUniqueId().toString()).Name = ((LivingEntity)entity).getCustomName();
|
||||
_npcs.get(entity.getUniqueId().toString()).Entity = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean IsNpcChunkLoaded(Entity entity)
|
||||
|
||||
public boolean isNpcChunkLoaded(Entity entity)
|
||||
{
|
||||
return entity.getWorld().isChunkLoaded(entity.getLocation().getBlockX() >> 4, entity.getLocation().getBlockZ() >> 4);
|
||||
}
|
||||
|
||||
public void LoadNpcs()
|
||||
public void loadNpcs() throws SQLException
|
||||
{
|
||||
FileInputStream fstream = null;
|
||||
BufferedReader br = null;
|
||||
|
||||
try
|
||||
{
|
||||
File npcFile = new File("npcs.dat");
|
||||
String serverType = _plugin.getClass().getSimpleName();
|
||||
|
||||
if (npcFile.exists())
|
||||
{
|
||||
fstream = new FileInputStream(npcFile);
|
||||
br = new BufferedReader(new InputStreamReader(fstream));
|
||||
|
||||
String line = br.readLine();
|
||||
|
||||
while (line != null)
|
||||
{
|
||||
UUID uuid = UUID.fromString(line.split(" ")[0]);
|
||||
String location = line.split(" ")[1];
|
||||
Integer radius = Integer.parseInt(line.split(" ")[2]);
|
||||
|
||||
_npcs.put(uuid.toString(), new NpcEntry(null, null, radius, UtilWorld.strToLoc(location)));
|
||||
|
||||
line = br.readLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
try (Connection connection = DBPool.getInstance().getConnection())
|
||||
{
|
||||
System.out.println(F.main(GetName(), "Error parsing npc file."));
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (br != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
br.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (fstream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fstream.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveNpcs()
|
||||
{
|
||||
FileWriter fstream = null;
|
||||
BufferedWriter out = null;
|
||||
|
||||
try
|
||||
{
|
||||
fstream = new FileWriter("npcs.dat");
|
||||
out = new BufferedWriter(fstream);
|
||||
|
||||
for (String key : _npcs.keySet())
|
||||
{
|
||||
out.write(key + " " + UtilWorld.locToStr(_npcs.get(key).Location) + " " + _npcs.get(key).Radius);
|
||||
out.newLine();
|
||||
}
|
||||
Result<NpcsRecord> result = DSL.using(connection)
|
||||
.selectFrom(Tables.npcs)
|
||||
.where(Tables.npcs.server.eq(serverType))
|
||||
.fetch();
|
||||
|
||||
out.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("Npc Save Error: " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (out != null)
|
||||
for (NpcsRecord record : result)
|
||||
{
|
||||
try
|
||||
{
|
||||
out.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (fstream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fstream.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
record.detach();
|
||||
|
||||
Npc npc = new Npc(record);
|
||||
spawnNpc(npc);
|
||||
_npcs.add(npc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public NpcEntry GetNpcByUUID(UUID uniqueId)
|
||||
public void clearNpcs() throws SQLException
|
||||
{
|
||||
return _npcs.get(uniqueId.toString());
|
||||
}
|
||||
String serverType = _plugin.getClass().getSimpleName();
|
||||
|
||||
public boolean isNpc(LivingEntity entity)
|
||||
{
|
||||
return _npcs.containsKey(entity.getUniqueId().toString());
|
||||
try (Connection connection = DBPool.getInstance().getConnection())
|
||||
{
|
||||
DSL.using(connection)
|
||||
.delete(Tables.npcs)
|
||||
.where(Tables.npcs.server.eq(serverType))
|
||||
.execute();
|
||||
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
for (LivingEntity entity : world.getEntitiesByClass(LivingEntity.class))
|
||||
{
|
||||
if (isNpc(entity))
|
||||
entity.remove();
|
||||
}
|
||||
}
|
||||
|
||||
_npcs.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,72 @@
|
||||
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 = ChatColor.translateAlternateColorCodes('&', args[3]);
|
||||
|
||||
try
|
||||
{
|
||||
Plugin.addNpc(caller, type, radius, adult, name);
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
Plugin.Help(caller, "Database error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
else
|
||||
{
|
||||
Plugin.ClearNpcs();
|
||||
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Cleared npcs."));
|
||||
try
|
||||
{
|
||||
Plugin.clearNpcs();
|
||||
|
||||
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Cleared NPCs."));
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
Plugin.Help(caller, "Database error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
else
|
||||
{
|
||||
Plugin.PrepDeleteNpc(caller);
|
||||
Plugin.prepDeleteNpc(caller);
|
||||
|
||||
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Now right click npc."));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
else
|
||||
{
|
||||
Plugin.TeleportNpcsHome();
|
||||
Plugin.teleportNpcsHome();
|
||||
|
||||
UtilPlayer.message(caller, F.main(Plugin.GetName(), "Npcs teleported to home locations."));
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.npc.Commands;
|
||||
package mineplex.core.npc.command;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -10,13 +10,12 @@ 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));
|
||||
}
|
||||
|
||||
@Override
|
@ -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 = -1621358205;
|
||||
|
||||
/**
|
||||
* The singleton instance of <code>Account</code>
|
||||
@ -40,6 +40,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
|
||||
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,
|
||||
|
@ -24,6 +24,7 @@ public class Keys {
|
||||
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;
|
||||
@ -51,6 +52,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;
|
||||
@ -78,6 +80,7 @@ public class Keys {
|
||||
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;
|
||||
@ -95,6 +98,7 @@ public class Keys {
|
||||
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);
|
||||
@ -120,6 +124,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);
|
||||
@ -145,6 +150,7 @@ public class Keys {
|
||||
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);
|
||||
|
@ -43,6 +43,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
|
||||
*/
|
||||
|
@ -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 = 203359538;
|
||||
|
||||
/**
|
||||
* The singleton instance of <code>Account.accountPreferences</code>
|
||||
@ -81,6 +81,16 @@ 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, "");
|
||||
|
||||
/**
|
||||
* Create a <code>Account.accountPreferences</code> table reference
|
||||
*/
|
||||
|
@ -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 = -555476915;
|
||||
|
||||
/**
|
||||
* The singleton instance of <code>Account.accounts</code>
|
||||
@ -46,10 +46,15 @@ public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.r
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> gems = createField("gems", org.jooq.impl.SQLDataType.INTEGER, 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>.
|
||||
@ -64,7 +69,7 @@ public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.r
|
||||
/**
|
||||
* 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>.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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 = -1308334886;
|
||||
|
||||
/**
|
||||
* 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,7 +64,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.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>.
|
||||
|
@ -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.Record13<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> {
|
||||
|
||||
private static final long serialVersionUID = -1987641641;
|
||||
private static final long serialVersionUID = 865577358;
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accountPreferences.id</code>.
|
||||
@ -167,6 +167,34 @@ 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);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
@ -180,23 +208,23 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record11 type implementation
|
||||
// Record13 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.Row13<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> fieldsRow() {
|
||||
return (org.jooq.Row13) 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.Row13<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> valuesRow() {
|
||||
return (org.jooq.Row13) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -287,6 +315,22 @@ 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}
|
||||
*/
|
||||
@ -375,6 +419,22 @@ 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}
|
||||
*/
|
||||
@ -478,7 +538,25 @@ 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 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) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -496,7 +574,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) {
|
||||
super(mineplex.database.tables.AccountPreferences.accountPreferences);
|
||||
|
||||
setValue(0, id);
|
||||
@ -510,5 +588,7 @@ public class AccountPreferencesRecord extends org.jooq.impl.UpdatableRecordImpl<
|
||||
setValue(8, showChat);
|
||||
setValue(9, partyRequests);
|
||||
setValue(10, forcefield);
|
||||
setValue(11, showMacReports);
|
||||
setValue(12, ignoreVelocity);
|
||||
}
|
||||
}
|
||||
|
@ -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.Record10<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> {
|
||||
|
||||
private static final long serialVersionUID = 902357087;
|
||||
private static final long serialVersionUID = 1437085324;
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.id</code>.
|
||||
@ -69,74 +69,88 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
return (java.lang.Integer) getValue(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.donorRank</code>.
|
||||
*/
|
||||
public void setDonorRank(java.lang.String value) {
|
||||
setValue(4, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accounts.donorRank</code>.
|
||||
*/
|
||||
public java.lang.String getDonorRank() {
|
||||
return (java.lang.String) getValue(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.rank</code>.
|
||||
*/
|
||||
public void setRank(java.lang.String value) {
|
||||
setValue(4, value);
|
||||
setValue(5, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accounts.rank</code>.
|
||||
*/
|
||||
public java.lang.String getRank() {
|
||||
return (java.lang.String) getValue(4);
|
||||
return (java.lang.String) getValue(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.rankPerm</code>.
|
||||
*/
|
||||
public void setRankPerm(java.lang.Byte value) {
|
||||
setValue(5, value);
|
||||
setValue(6, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accounts.rankPerm</code>.
|
||||
*/
|
||||
public java.lang.Byte getRankPerm() {
|
||||
return (java.lang.Byte) getValue(5);
|
||||
return (java.lang.Byte) getValue(6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.rankExpire</code>.
|
||||
*/
|
||||
public void setRankExpire(java.lang.String value) {
|
||||
setValue(6, value);
|
||||
setValue(7, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accounts.rankExpire</code>.
|
||||
*/
|
||||
public java.lang.String getRankExpire() {
|
||||
return (java.lang.String) getValue(6);
|
||||
return (java.lang.String) getValue(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(8, 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(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.accounts.totalPlayTime</code>.
|
||||
*/
|
||||
public void setTotalPlayTime(java.lang.String value) {
|
||||
setValue(8, value);
|
||||
setValue(9, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accounts.totalPlayTime</code>.
|
||||
*/
|
||||
public java.lang.String getTotalPlayTime() {
|
||||
return (java.lang.String) getValue(8);
|
||||
return (java.lang.String) getValue(9);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -152,23 +166,23 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record9 type implementation
|
||||
// Record10 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.Row10<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> fieldsRow() {
|
||||
return (org.jooq.Row10) 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.Row10<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> valuesRow() {
|
||||
return (org.jooq.Row10) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,6 +222,14 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field5() {
|
||||
return mineplex.database.tables.Accounts.accounts.donorRank;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field6() {
|
||||
return mineplex.database.tables.Accounts.accounts.rank;
|
||||
}
|
||||
|
||||
@ -215,7 +237,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Byte> field6() {
|
||||
public org.jooq.Field<java.lang.Byte> field7() {
|
||||
return mineplex.database.tables.Accounts.accounts.rankPerm;
|
||||
}
|
||||
|
||||
@ -223,7 +245,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field7() {
|
||||
public org.jooq.Field<java.lang.String> field8() {
|
||||
return mineplex.database.tables.Accounts.accounts.rankExpire;
|
||||
}
|
||||
|
||||
@ -231,7 +253,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> field9() {
|
||||
return mineplex.database.tables.Accounts.accounts.lastLogin;
|
||||
}
|
||||
|
||||
@ -239,7 +261,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> field10() {
|
||||
return mineplex.database.tables.Accounts.accounts.totalPlayTime;
|
||||
}
|
||||
|
||||
@ -280,6 +302,14 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value5() {
|
||||
return getDonorRank();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value6() {
|
||||
return getRank();
|
||||
}
|
||||
|
||||
@ -287,7 +317,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Byte value6() {
|
||||
public java.lang.Byte value7() {
|
||||
return getRankPerm();
|
||||
}
|
||||
|
||||
@ -295,7 +325,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value7() {
|
||||
public java.lang.String value8() {
|
||||
return getRankExpire();
|
||||
}
|
||||
|
||||
@ -303,7 +333,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value8() {
|
||||
public java.sql.Timestamp value9() {
|
||||
return getLastLogin();
|
||||
}
|
||||
|
||||
@ -311,7 +341,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value9() {
|
||||
public java.lang.String value10() {
|
||||
return getTotalPlayTime();
|
||||
}
|
||||
|
||||
@ -356,6 +386,15 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value5(java.lang.String value) {
|
||||
setDonorRank(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value6(java.lang.String value) {
|
||||
setRank(value);
|
||||
return this;
|
||||
}
|
||||
@ -364,7 +403,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value6(java.lang.Byte value) {
|
||||
public AccountsRecord value7(java.lang.Byte value) {
|
||||
setRankPerm(value);
|
||||
return this;
|
||||
}
|
||||
@ -373,7 +412,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value7(java.lang.String value) {
|
||||
public AccountsRecord value8(java.lang.String value) {
|
||||
setRankExpire(value);
|
||||
return this;
|
||||
}
|
||||
@ -382,7 +421,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value8(java.lang.String value) {
|
||||
public AccountsRecord value9(java.sql.Timestamp value) {
|
||||
setLastLogin(value);
|
||||
return this;
|
||||
}
|
||||
@ -391,7 +430,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountsRecord value9(java.lang.String value) {
|
||||
public AccountsRecord value10(java.lang.String value) {
|
||||
setTotalPlayTime(value);
|
||||
return this;
|
||||
}
|
||||
@ -400,7 +439,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.String value5, java.lang.String value6, java.lang.Byte value7, java.lang.String value8, java.sql.Timestamp value9, java.lang.String value10) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -418,17 +457,18 @@ 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.String donorRank, java.lang.String rank, java.lang.Byte rankPerm, java.lang.String 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, donorRank);
|
||||
setValue(5, rank);
|
||||
setValue(6, rankPerm);
|
||||
setValue(7, rankExpire);
|
||||
setValue(8, lastLogin);
|
||||
setValue(9, totalPlayTime);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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.Record15<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.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 = -202208690;
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.id</code>.
|
||||
@ -41,200 +41,186 @@ 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(9);
|
||||
return (java.lang.String) getValue(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.adult</code>.
|
||||
*/
|
||||
public void setAdult(java.lang.Boolean value) {
|
||||
setValue(10, value);
|
||||
setValue(9, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.adult</code>.
|
||||
*/
|
||||
public java.lang.Boolean getAdult() {
|
||||
return (java.lang.Boolean) getValue(10);
|
||||
return (java.lang.Boolean) getValue(9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.helmet</code>.
|
||||
*/
|
||||
public void setHelmet(java.lang.String value) {
|
||||
setValue(11, value);
|
||||
setValue(10, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.helmet</code>.
|
||||
*/
|
||||
public java.lang.String getHelmet() {
|
||||
return (java.lang.String) getValue(11);
|
||||
return (java.lang.String) getValue(10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.chestplate</code>.
|
||||
*/
|
||||
public void setChestplate(java.lang.String value) {
|
||||
setValue(12, value);
|
||||
setValue(11, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.chestplate</code>.
|
||||
*/
|
||||
public java.lang.String getChestplate() {
|
||||
return (java.lang.String) getValue(12);
|
||||
return (java.lang.String) getValue(11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.leggings</code>.
|
||||
*/
|
||||
public void setLeggings(java.lang.String value) {
|
||||
setValue(13, value);
|
||||
setValue(12, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.leggings</code>.
|
||||
*/
|
||||
public java.lang.String getLeggings() {
|
||||
return (java.lang.String) getValue(13);
|
||||
return (java.lang.String) getValue(12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.boots</code>.
|
||||
*/
|
||||
public void setBoots(java.lang.String value) {
|
||||
setValue(14, value);
|
||||
setValue(13, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.boots</code>.
|
||||
*/
|
||||
public java.lang.String getBoots() {
|
||||
return (java.lang.String) getValue(14);
|
||||
return (java.lang.String) getValue(13);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.npcs.inHand</code>.
|
||||
*/
|
||||
public void setInHand(java.lang.String value) {
|
||||
setValue(15, value);
|
||||
setValue(14, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.npcs.inHand</code>.
|
||||
*/
|
||||
public java.lang.String getInHand() {
|
||||
return (java.lang.String) getValue(15);
|
||||
return (java.lang.String) getValue(14);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -250,23 +236,23 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record16 type implementation
|
||||
// Record15 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@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() {
|
||||
return (org.jooq.Row16) super.fieldsRow();
|
||||
public org.jooq.Row15<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.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
|
||||
return (org.jooq.Row15) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@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() {
|
||||
return (org.jooq.Row16) super.valuesRow();
|
||||
public org.jooq.Row15<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.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
|
||||
return (org.jooq.Row15) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,14 +276,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 +283,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 +291,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 +299,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 +307,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 +315,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,7 +323,7 @@ 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;
|
||||
}
|
||||
|
||||
@ -353,7 +331,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Boolean> field11() {
|
||||
public org.jooq.Field<java.lang.Boolean> field10() {
|
||||
return mineplex.database.tables.Npcs.npcs.adult;
|
||||
}
|
||||
|
||||
@ -361,7 +339,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field12() {
|
||||
public org.jooq.Field<java.lang.String> field11() {
|
||||
return mineplex.database.tables.Npcs.npcs.helmet;
|
||||
}
|
||||
|
||||
@ -369,7 +347,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field13() {
|
||||
public org.jooq.Field<java.lang.String> field12() {
|
||||
return mineplex.database.tables.Npcs.npcs.chestplate;
|
||||
}
|
||||
|
||||
@ -377,7 +355,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field14() {
|
||||
public org.jooq.Field<java.lang.String> field13() {
|
||||
return mineplex.database.tables.Npcs.npcs.leggings;
|
||||
}
|
||||
|
||||
@ -385,7 +363,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field15() {
|
||||
public org.jooq.Field<java.lang.String> field14() {
|
||||
return mineplex.database.tables.Npcs.npcs.boots;
|
||||
}
|
||||
|
||||
@ -393,7 +371,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field16() {
|
||||
public org.jooq.Field<java.lang.String> field15() {
|
||||
return mineplex.database.tables.Npcs.npcs.inHand;
|
||||
}
|
||||
|
||||
@ -418,14 +396,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 +403,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 +411,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 +419,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 +427,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 +435,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,7 +443,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value10() {
|
||||
public java.lang.String value9() {
|
||||
return getEntityType();
|
||||
}
|
||||
|
||||
@ -481,7 +451,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Boolean value11() {
|
||||
public java.lang.Boolean value10() {
|
||||
return getAdult();
|
||||
}
|
||||
|
||||
@ -489,7 +459,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value12() {
|
||||
public java.lang.String value11() {
|
||||
return getHelmet();
|
||||
}
|
||||
|
||||
@ -497,7 +467,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value13() {
|
||||
public java.lang.String value12() {
|
||||
return getChestplate();
|
||||
}
|
||||
|
||||
@ -505,7 +475,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value14() {
|
||||
public java.lang.String value13() {
|
||||
return getLeggings();
|
||||
}
|
||||
|
||||
@ -513,7 +483,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value15() {
|
||||
public java.lang.String value14() {
|
||||
return getBoots();
|
||||
}
|
||||
|
||||
@ -521,7 +491,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value16() {
|
||||
public java.lang.String value15() {
|
||||
return getInHand();
|
||||
}
|
||||
|
||||
@ -548,15 +518,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 +526,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 +535,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 +544,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 +553,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 +562,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,7 +571,7 @@ 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;
|
||||
}
|
||||
@ -619,7 +580,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value11(java.lang.Boolean value) {
|
||||
public NpcsRecord value10(java.lang.Boolean value) {
|
||||
setAdult(value);
|
||||
return this;
|
||||
}
|
||||
@ -628,7 +589,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value12(java.lang.String value) {
|
||||
public NpcsRecord value11(java.lang.String value) {
|
||||
setHelmet(value);
|
||||
return this;
|
||||
}
|
||||
@ -637,7 +598,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value13(java.lang.String value) {
|
||||
public NpcsRecord value12(java.lang.String value) {
|
||||
setChestplate(value);
|
||||
return this;
|
||||
}
|
||||
@ -646,7 +607,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value14(java.lang.String value) {
|
||||
public NpcsRecord value13(java.lang.String value) {
|
||||
setLeggings(value);
|
||||
return this;
|
||||
}
|
||||
@ -655,7 +616,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value15(java.lang.String value) {
|
||||
public NpcsRecord value14(java.lang.String value) {
|
||||
setBoots(value);
|
||||
return this;
|
||||
}
|
||||
@ -664,7 +625,7 @@ public class NpcsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.datab
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public NpcsRecord value16(java.lang.String value) {
|
||||
public NpcsRecord value15(java.lang.String value) {
|
||||
setInHand(value);
|
||||
return this;
|
||||
}
|
||||
@ -673,7 +634,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.Boolean value10, java.lang.String value11, java.lang.String value12, java.lang.String value13, java.lang.String value14, java.lang.String value15) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -691,24 +652,23 @@ 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.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(10, adult);
|
||||
setValue(11, helmet);
|
||||
setValue(12, chestplate);
|
||||
setValue(13, leggings);
|
||||
setValue(14, boots);
|
||||
setValue(15, inHand);
|
||||
setValue(2, name);
|
||||
setValue(3, world);
|
||||
setValue(4, x);
|
||||
setValue(5, y);
|
||||
setValue(6, z);
|
||||
setValue(7, radius);
|
||||
setValue(8, entityType);
|
||||
setValue(9, adult);
|
||||
setValue(10, helmet);
|
||||
setValue(11, chestplate);
|
||||
setValue(12, leggings);
|
||||
setValue(13, boots);
|
||||
setValue(14, inHand);
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,7 @@ public class NpcProtectListener implements Listener
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void CustomDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamageeEntity() != null && _npcManager.GetNpcByUUID(event.GetDamageeEntity().getUniqueId()) != null)
|
||||
{
|
||||
if (event.GetDamageeEntity() != null && _npcManager.getNpcByEntityUUID(event.GetDamageeEntity().getUniqueId()) != null)
|
||||
event.SetCancelled("NPC");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user