Merge branch 'clans-beta' of ssh://184.154.0.242:7999/min/Mineplex into clans-beta
This commit is contained in:
commit
917839af0e
@ -7,6 +7,14 @@
|
||||
<option name="STATIC_FIELD_NAME_PREFIX" value="_" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="20" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="10" />
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value>
|
||||
<package name="java.awt" withSubpackages="false" static="false" />
|
||||
<package name="org.jooq.impl.DSL" withSubpackages="false" static="true" />
|
||||
<package name="mineplex.database.Tables" withSubpackages="false" static="true" />
|
||||
<package name="javax.swing" withSubpackages="false" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="javax" withSubpackages="true" static="false" />
|
||||
@ -38,6 +46,5 @@
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Mineplex" />
|
||||
</component>
|
||||
</project>
|
@ -70,22 +70,24 @@ public class C
|
||||
public static String chat = "" + ChatColor.WHITE;
|
||||
|
||||
public static String xBorderlands = "" + ChatColor.GOLD;
|
||||
public static String xWilderness = "" + ChatColor.YELLOW;
|
||||
public static String xWilderness = "" + ChatColor.GRAY;
|
||||
public static String xMid = "" + ChatColor.WHITE;
|
||||
public static String xNone = "" + ChatColor.GRAY;
|
||||
public static ChatColor xNone = ChatColor.YELLOW;
|
||||
|
||||
public static ChatColor xAdmin = ChatColor.WHITE;
|
||||
public static ChatColor xSafe = ChatColor.AQUA;
|
||||
|
||||
public static ChatColor xNeutral = ChatColor.YELLOW;
|
||||
public static ChatColor xSelf = ChatColor.AQUA;
|
||||
public static ChatColor xAlly = ChatColor.GREEN;
|
||||
public static ChatColor xEnemy = ChatColor.YELLOW;
|
||||
public static ChatColor xEnemy = ChatColor.RED;
|
||||
public static ChatColor xWar = ChatColor.RED;
|
||||
public static ChatColor xPillage = ChatColor.LIGHT_PURPLE;
|
||||
|
||||
|
||||
public static ChatColor xdNeutral = ChatColor.GOLD;
|
||||
public static ChatColor xdSelf = ChatColor.DARK_AQUA;
|
||||
public static ChatColor xdAlly = ChatColor.DARK_GREEN;
|
||||
public static ChatColor xdEnemy = ChatColor.GOLD;
|
||||
public static ChatColor xdEnemy = ChatColor.DARK_RED;
|
||||
public static ChatColor xdWar = ChatColor.DARK_RED;
|
||||
public static ChatColor xdPillage = ChatColor.DARK_PURPLE;
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.database.column.Column;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -43,7 +46,7 @@ public abstract class RepositoryBase implements Listener
|
||||
public void run()
|
||||
{
|
||||
initialize();
|
||||
update();
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
||||
@ -80,6 +83,11 @@ public abstract class RepositoryBase implements Listener
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected DSLContext jooq()
|
||||
{
|
||||
return DSL.using(_dataSource, SQLDialect.MYSQL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a query against the repository.
|
||||
|
@ -16,7 +16,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 = -478529995;
|
||||
private static final long serialVersionUID = 1150881021;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>Account</code>
|
||||
@ -67,9 +67,11 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
|
||||
mineplex.database.tables.ItemCategories.itemCategories,
|
||||
mineplex.database.tables.Items.items,
|
||||
mineplex.database.tables.Mail.mail,
|
||||
mineplex.database.tables.Mailbox.mailbox,
|
||||
mineplex.database.tables.Npcs.npcs,
|
||||
mineplex.database.tables.PlayerMap.playerMap,
|
||||
mineplex.database.tables.Polls.polls,
|
||||
mineplex.database.tables.RankBenefits.rankBenefits,
|
||||
mineplex.database.tables.ServerPassword.serverPassword,
|
||||
mineplex.database.tables.Spawns.spawns,
|
||||
mineplex.database.tables.StatEvents.statEvents,
|
||||
|
@ -47,9 +47,11 @@ public class Keys {
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.ItemCategoriesRecord, java.lang.Integer> IDENTITY_itemCategories = Identities0.IDENTITY_itemCategories;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.ItemsRecord, java.lang.Integer> IDENTITY_items = Identities0.IDENTITY_items;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.MailRecord, java.lang.Integer> IDENTITY_mail = Identities0.IDENTITY_mail;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.MailboxRecord, java.lang.Integer> IDENTITY_mailbox = Identities0.IDENTITY_mailbox;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> IDENTITY_npcs = Identities0.IDENTITY_npcs;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.PlayerMapRecord, java.lang.Integer> IDENTITY_playerMap = Identities0.IDENTITY_playerMap;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.PollsRecord, java.lang.Integer> IDENTITY_polls = Identities0.IDENTITY_polls;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> IDENTITY_rankBenefits = Identities0.IDENTITY_rankBenefits;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.ServerPasswordRecord, java.lang.Integer> IDENTITY_serverPassword = Identities0.IDENTITY_serverPassword;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.SpawnsRecord, java.lang.Integer> IDENTITY_spawns = Identities0.IDENTITY_spawns;
|
||||
public static final org.jooq.Identity<mineplex.database.tables.records.StatEventsRecord, org.jooq.types.UInteger> IDENTITY_statEvents = Identities0.IDENTITY_statEvents;
|
||||
@ -101,10 +103,12 @@ public class Keys {
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemsRecord> KEY_items_PRIMARY = UniqueKeys0.KEY_items_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemsRecord> KEY_items_uniqueNameCategoryIndex = UniqueKeys0.KEY_items_uniqueNameCategoryIndex;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.MailRecord> KEY_mail_PRIMARY = UniqueKeys0.KEY_mail_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.MailboxRecord> KEY_mailbox_PRIMARY = UniqueKeys0.KEY_mailbox_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.NpcsRecord> KEY_npcs_PRIMARY = UniqueKeys0.KEY_npcs_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_PRIMARY = UniqueKeys0.KEY_playerMap_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_playerIndex = UniqueKeys0.KEY_playerMap_playerIndex;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PollsRecord> KEY_polls_PRIMARY = UniqueKeys0.KEY_polls_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord> KEY_rankBenefits_PRIMARY = UniqueKeys0.KEY_rankBenefits_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ServerPasswordRecord> KEY_serverPassword_PRIMARY = UniqueKeys0.KEY_serverPassword_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.SpawnsRecord> KEY_spawns_PRIMARY = UniqueKeys0.KEY_spawns_PRIMARY;
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatEventsRecord> KEY_statEvents_PRIMARY = UniqueKeys0.KEY_statEvents_PRIMARY;
|
||||
@ -147,6 +151,8 @@ public class Keys {
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ClanTerritoryRecord, mineplex.database.tables.records.ClanServerRecord> clanTerritory_ibfk_2 = ForeignKeys0.clanTerritory_ibfk_2;
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ItemsRecord, mineplex.database.tables.records.ItemCategoriesRecord> items_ibfk_1 = ForeignKeys0.items_ibfk_1;
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.MailRecord, mineplex.database.tables.records.AccountsRecord> mail_ibfk_1 = ForeignKeys0.mail_ibfk_1;
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.MailboxRecord, mineplex.database.tables.records.AccountsRecord> mailbox_ibfk_1 = ForeignKeys0.mailbox_ibfk_1;
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.RankBenefitsRecord, mineplex.database.tables.records.AccountsRecord> rankBenefits_ibfk_1 = ForeignKeys0.rankBenefits_ibfk_1;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// [#1459] distribute members to avoid static initialisers > 64kb
|
||||
@ -179,9 +185,11 @@ public class Keys {
|
||||
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);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.ItemsRecord, java.lang.Integer> IDENTITY_items = createIdentity(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.MailRecord, java.lang.Integer> IDENTITY_mail = createIdentity(mineplex.database.tables.Mail.mail, mineplex.database.tables.Mail.mail.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.MailboxRecord, java.lang.Integer> IDENTITY_mailbox = createIdentity(mineplex.database.tables.Mailbox.mailbox, mineplex.database.tables.Mailbox.mailbox.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.NpcsRecord, java.lang.Integer> IDENTITY_npcs = createIdentity(mineplex.database.tables.Npcs.npcs, mineplex.database.tables.Npcs.npcs.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.PlayerMapRecord, java.lang.Integer> IDENTITY_playerMap = createIdentity(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.PollsRecord, java.lang.Integer> IDENTITY_polls = createIdentity(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> IDENTITY_rankBenefits = createIdentity(mineplex.database.tables.RankBenefits.rankBenefits, mineplex.database.tables.RankBenefits.rankBenefits.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.ServerPasswordRecord, java.lang.Integer> IDENTITY_serverPassword = createIdentity(mineplex.database.tables.ServerPassword.serverPassword, mineplex.database.tables.ServerPassword.serverPassword.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.SpawnsRecord, java.lang.Integer> IDENTITY_spawns = createIdentity(mineplex.database.tables.Spawns.spawns, mineplex.database.tables.Spawns.spawns.id);
|
||||
public static org.jooq.Identity<mineplex.database.tables.records.StatEventsRecord, org.jooq.types.UInteger> IDENTITY_statEvents = createIdentity(mineplex.database.tables.StatEvents.statEvents, mineplex.database.tables.StatEvents.statEvents.eventId);
|
||||
@ -231,10 +239,12 @@ public class Keys {
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemsRecord> KEY_items_PRIMARY = createUniqueKey(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemsRecord> KEY_items_uniqueNameCategoryIndex = createUniqueKey(mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.name, mineplex.database.tables.Items.items.categoryId);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.MailRecord> KEY_mail_PRIMARY = createUniqueKey(mineplex.database.tables.Mail.mail, mineplex.database.tables.Mail.mail.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.MailboxRecord> KEY_mailbox_PRIMARY = createUniqueKey(mineplex.database.tables.Mailbox.mailbox, mineplex.database.tables.Mailbox.mailbox.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.NpcsRecord> KEY_npcs_PRIMARY = createUniqueKey(mineplex.database.tables.Npcs.npcs, mineplex.database.tables.Npcs.npcs.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_PRIMARY = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PlayerMapRecord> KEY_playerMap_playerIndex = createUniqueKey(mineplex.database.tables.PlayerMap.playerMap, mineplex.database.tables.PlayerMap.playerMap.playerName);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.PollsRecord> KEY_polls_PRIMARY = createUniqueKey(mineplex.database.tables.Polls.polls, mineplex.database.tables.Polls.polls.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord> KEY_rankBenefits_PRIMARY = createUniqueKey(mineplex.database.tables.RankBenefits.rankBenefits, mineplex.database.tables.RankBenefits.rankBenefits.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ServerPasswordRecord> KEY_serverPassword_PRIMARY = createUniqueKey(mineplex.database.tables.ServerPassword.serverPassword, mineplex.database.tables.ServerPassword.serverPassword.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.SpawnsRecord> KEY_spawns_PRIMARY = createUniqueKey(mineplex.database.tables.Spawns.spawns, mineplex.database.tables.Spawns.spawns.id);
|
||||
public static final org.jooq.UniqueKey<mineplex.database.tables.records.StatEventsRecord> KEY_statEvents_PRIMARY = createUniqueKey(mineplex.database.tables.StatEvents.statEvents, mineplex.database.tables.StatEvents.statEvents.eventId);
|
||||
@ -275,5 +285,7 @@ public class Keys {
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ClanTerritoryRecord, mineplex.database.tables.records.ClanServerRecord> clanTerritory_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_clanServer_PRIMARY, mineplex.database.tables.ClanTerritory.clanTerritory, mineplex.database.tables.ClanTerritory.clanTerritory.serverId);
|
||||
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);
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.MailRecord, mineplex.database.tables.records.AccountsRecord> mail_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.Mail.mail, mineplex.database.tables.Mail.mail.accountId);
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.MailboxRecord, mineplex.database.tables.records.AccountsRecord> mailbox_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.Mailbox.mailbox, mineplex.database.tables.Mailbox.mailbox.accountId);
|
||||
public static final org.jooq.ForeignKey<mineplex.database.tables.records.RankBenefitsRecord, mineplex.database.tables.records.AccountsRecord> rankBenefits_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.RankBenefits.rankBenefits, mineplex.database.tables.RankBenefits.rankBenefits.accountId);
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,18 @@ package mineplex.database;
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Routines {
|
||||
|
||||
/**
|
||||
* Call <code>Account.accountGoldChange</code>
|
||||
*/
|
||||
public static java.lang.Byte callAccountgoldchange(org.jooq.Configuration configuration, java.lang.Integer accountId, java.lang.Integer goldChange) {
|
||||
mineplex.database.routines.AccountGoldChange p = new mineplex.database.routines.AccountGoldChange();
|
||||
p.setAccountId(accountId);
|
||||
p.setGoldChange(goldChange);
|
||||
|
||||
p.execute(configuration);
|
||||
return p.getSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call <code>Account.check_daily</code>
|
||||
*/
|
||||
|
@ -156,6 +156,11 @@ public class Tables {
|
||||
*/
|
||||
public static final mineplex.database.tables.Mail mail = mineplex.database.tables.Mail.mail;
|
||||
|
||||
/**
|
||||
* The table Account.mailbox
|
||||
*/
|
||||
public static final mineplex.database.tables.Mailbox mailbox = mineplex.database.tables.Mailbox.mailbox;
|
||||
|
||||
/**
|
||||
* The table Account.npcs
|
||||
*/
|
||||
@ -171,6 +176,11 @@ public class Tables {
|
||||
*/
|
||||
public static final mineplex.database.tables.Polls polls = mineplex.database.tables.Polls.polls;
|
||||
|
||||
/**
|
||||
* The table Account.rankBenefits
|
||||
*/
|
||||
public static final mineplex.database.tables.RankBenefits rankBenefits = mineplex.database.tables.RankBenefits.rankBenefits;
|
||||
|
||||
/**
|
||||
* The table Account.serverPassword
|
||||
*/
|
||||
|
@ -0,0 +1,67 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package mineplex.database.routines;
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.5.2"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class AccountGoldChange extends org.jooq.impl.AbstractRoutine<java.lang.Void> implements java.io.Serializable, java.lang.Cloneable {
|
||||
|
||||
private static final long serialVersionUID = 360483639;
|
||||
|
||||
/**
|
||||
* The parameter <code>Account.accountGoldChange.accountId</code>.
|
||||
*/
|
||||
public static final org.jooq.Parameter<java.lang.Integer> accountId = createParameter("accountId", org.jooq.impl.SQLDataType.INTEGER, false);
|
||||
|
||||
/**
|
||||
* The parameter <code>Account.accountGoldChange.goldChange</code>.
|
||||
*/
|
||||
public static final org.jooq.Parameter<java.lang.Integer> goldChange = createParameter("goldChange", org.jooq.impl.SQLDataType.INTEGER, false);
|
||||
|
||||
/**
|
||||
* The parameter <code>Account.accountGoldChange.success</code>.
|
||||
*/
|
||||
public static final org.jooq.Parameter<java.lang.Byte> success = createParameter("success", org.jooq.impl.SQLDataType.TINYINT, false);
|
||||
|
||||
/**
|
||||
* Create a new routine call instance
|
||||
*/
|
||||
public AccountGoldChange() {
|
||||
super("accountGoldChange", mineplex.database.Account.Account);
|
||||
|
||||
addInParameter(accountId);
|
||||
addInParameter(goldChange);
|
||||
addOutParameter(success);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the <code>accountId</code> parameter IN value to the routine
|
||||
*/
|
||||
public void setAccountId(java.lang.Integer value) {
|
||||
setValue(mineplex.database.routines.AccountGoldChange.accountId, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the <code>goldChange</code> parameter IN value to the routine
|
||||
*/
|
||||
public void setGoldChange(java.lang.Integer value) {
|
||||
setValue(mineplex.database.routines.AccountGoldChange.goldChange, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <code>success</code> parameter OUT value from the routine
|
||||
*/
|
||||
public java.lang.Byte getSuccess() {
|
||||
return getValue(success);
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package mineplex.database.tables;
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.5.2"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Mailbox extends org.jooq.impl.TableImpl<mineplex.database.tables.records.MailboxRecord> implements java.io.Serializable, java.lang.Cloneable {
|
||||
|
||||
private static final long serialVersionUID = 581316209;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>Account.mailbox</code>
|
||||
*/
|
||||
public static final mineplex.database.tables.Mailbox mailbox = new mineplex.database.tables.Mailbox();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Class<mineplex.database.tables.records.MailboxRecord> getRecordType() {
|
||||
return mineplex.database.tables.records.MailboxRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.id</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.accountId</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.Integer> accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER, this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.sender</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.String> sender = createField("sender", org.jooq.impl.SQLDataType.VARCHAR.length(64), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.message</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.String> message = createField("message", org.jooq.impl.SQLDataType.VARCHAR.length(1024), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.archived</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.Byte> archived = createField("archived", org.jooq.impl.SQLDataType.TINYINT, this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.deleted</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.lang.Byte> deleted = createField("deleted", org.jooq.impl.SQLDataType.TINYINT, this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.mailbox.timeSent</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.MailboxRecord, java.sql.Timestamp> timeSent = createField("timeSent", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>Account.mailbox</code> table reference
|
||||
*/
|
||||
public Mailbox() {
|
||||
this("mailbox", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>Account.mailbox</code> table reference
|
||||
*/
|
||||
public Mailbox(java.lang.String alias) {
|
||||
this(alias, mineplex.database.tables.Mailbox.mailbox);
|
||||
}
|
||||
|
||||
private Mailbox(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.MailboxRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Mailbox(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.MailboxRecord> aliased, org.jooq.Field<?>[] parameters) {
|
||||
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Identity<mineplex.database.tables.records.MailboxRecord, java.lang.Integer> getIdentity() {
|
||||
return mineplex.database.Keys.IDENTITY_mailbox;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.UniqueKey<mineplex.database.tables.records.MailboxRecord> getPrimaryKey() {
|
||||
return mineplex.database.Keys.KEY_mailbox_PRIMARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.MailboxRecord>> getKeys() {
|
||||
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.MailboxRecord>>asList(mineplex.database.Keys.KEY_mailbox_PRIMARY);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.MailboxRecord, ?>> getReferences() {
|
||||
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.MailboxRecord, ?>>asList(mineplex.database.Keys.mailbox_ibfk_1);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public mineplex.database.tables.Mailbox as(java.lang.String alias) {
|
||||
return new mineplex.database.tables.Mailbox(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
public mineplex.database.tables.Mailbox rename(java.lang.String name) {
|
||||
return new mineplex.database.tables.Mailbox(name, null);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package mineplex.database.tables;
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.5.2"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class RankBenefits extends org.jooq.impl.TableImpl<mineplex.database.tables.records.RankBenefitsRecord> implements java.io.Serializable, java.lang.Cloneable {
|
||||
|
||||
private static final long serialVersionUID = 1274456623;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>Account.rankBenefits</code>
|
||||
*/
|
||||
public static final mineplex.database.tables.RankBenefits rankBenefits = new mineplex.database.tables.RankBenefits();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Class<mineplex.database.tables.records.RankBenefitsRecord> getRecordType() {
|
||||
return mineplex.database.tables.records.RankBenefitsRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>Account.rankBenefits.id</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.rankBenefits.accountId</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER, this, "");
|
||||
|
||||
/**
|
||||
* The column <code>Account.rankBenefits.benefit</code>.
|
||||
*/
|
||||
public final org.jooq.TableField<mineplex.database.tables.records.RankBenefitsRecord, java.lang.String> benefit = createField("benefit", org.jooq.impl.SQLDataType.VARCHAR.length(100), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>Account.rankBenefits</code> table reference
|
||||
*/
|
||||
public RankBenefits() {
|
||||
this("rankBenefits", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>Account.rankBenefits</code> table reference
|
||||
*/
|
||||
public RankBenefits(java.lang.String alias) {
|
||||
this(alias, mineplex.database.tables.RankBenefits.rankBenefits);
|
||||
}
|
||||
|
||||
private RankBenefits(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.RankBenefitsRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private RankBenefits(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.RankBenefitsRecord> aliased, org.jooq.Field<?>[] parameters) {
|
||||
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Identity<mineplex.database.tables.records.RankBenefitsRecord, java.lang.Integer> getIdentity() {
|
||||
return mineplex.database.Keys.IDENTITY_rankBenefits;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord> getPrimaryKey() {
|
||||
return mineplex.database.Keys.KEY_rankBenefits_PRIMARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord>> getKeys() {
|
||||
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.RankBenefitsRecord>>asList(mineplex.database.Keys.KEY_rankBenefits_PRIMARY);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.RankBenefitsRecord, ?>> getReferences() {
|
||||
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.RankBenefitsRecord, ?>>asList(mineplex.database.Keys.rankBenefits_ibfk_1);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public mineplex.database.tables.RankBenefits as(java.lang.String alias) {
|
||||
return new mineplex.database.tables.RankBenefits(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
public mineplex.database.tables.RankBenefits rename(java.lang.String name) {
|
||||
return new mineplex.database.tables.RankBenefits(name, null);
|
||||
}
|
||||
}
|
@ -0,0 +1,359 @@
|
||||
/**
|
||||
* 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",
|
||||
"jOOQ version:3.5.2"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class MailboxRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.MailboxRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record7<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.Byte, java.sql.Timestamp> {
|
||||
|
||||
private static final long serialVersionUID = 763437590;
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.id</code>.
|
||||
*/
|
||||
public void setId(java.lang.Integer value) {
|
||||
setValue(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.id</code>.
|
||||
*/
|
||||
public java.lang.Integer getId() {
|
||||
return (java.lang.Integer) getValue(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.accountId</code>.
|
||||
*/
|
||||
public void setAccountId(java.lang.Integer value) {
|
||||
setValue(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.accountId</code>.
|
||||
*/
|
||||
public java.lang.Integer getAccountId() {
|
||||
return (java.lang.Integer) getValue(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.sender</code>.
|
||||
*/
|
||||
public void setSender(java.lang.String value) {
|
||||
setValue(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.sender</code>.
|
||||
*/
|
||||
public java.lang.String getSender() {
|
||||
return (java.lang.String) getValue(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.message</code>.
|
||||
*/
|
||||
public void setMessage(java.lang.String value) {
|
||||
setValue(3, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.message</code>.
|
||||
*/
|
||||
public java.lang.String getMessage() {
|
||||
return (java.lang.String) getValue(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.archived</code>.
|
||||
*/
|
||||
public void setArchived(java.lang.Byte value) {
|
||||
setValue(4, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.archived</code>.
|
||||
*/
|
||||
public java.lang.Byte getArchived() {
|
||||
return (java.lang.Byte) getValue(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.deleted</code>.
|
||||
*/
|
||||
public void setDeleted(java.lang.Byte value) {
|
||||
setValue(5, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.deleted</code>.
|
||||
*/
|
||||
public java.lang.Byte getDeleted() {
|
||||
return (java.lang.Byte) getValue(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.mailbox.timeSent</code>.
|
||||
*/
|
||||
public void setTimeSent(java.sql.Timestamp value) {
|
||||
setValue(6, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.mailbox.timeSent</code>.
|
||||
*/
|
||||
public java.sql.Timestamp getTimeSent() {
|
||||
return (java.sql.Timestamp) getValue(6);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Record1<java.lang.Integer> key() {
|
||||
return (org.jooq.Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record7 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row7<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.Byte, java.sql.Timestamp> fieldsRow() {
|
||||
return (org.jooq.Row7) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row7<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Byte, java.lang.Byte, java.sql.Timestamp> valuesRow() {
|
||||
return (org.jooq.Row7) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Integer> field1() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Integer> field2() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.accountId;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field3() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field4() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.message;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Byte> field5() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.archived;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Byte> field6() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.sql.Timestamp> field7() {
|
||||
return mineplex.database.tables.Mailbox.mailbox.timeSent;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Integer value1() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Integer value2() {
|
||||
return getAccountId();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value3() {
|
||||
return getSender();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value4() {
|
||||
return getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Byte value5() {
|
||||
return getArchived();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Byte value6() {
|
||||
return getDeleted();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.sql.Timestamp value7() {
|
||||
return getTimeSent();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value1(java.lang.Integer value) {
|
||||
setId(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value2(java.lang.Integer value) {
|
||||
setAccountId(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value3(java.lang.String value) {
|
||||
setSender(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value4(java.lang.String value) {
|
||||
setMessage(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value5(java.lang.Byte value) {
|
||||
setArchived(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value6(java.lang.Byte value) {
|
||||
setDeleted(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord value7(java.sql.Timestamp value) {
|
||||
setTimeSent(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MailboxRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.String value3, java.lang.String value4, java.lang.Byte value5, java.lang.Byte value6, java.sql.Timestamp value7) {
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached MailboxRecord
|
||||
*/
|
||||
public MailboxRecord() {
|
||||
super(mineplex.database.tables.Mailbox.mailbox);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised MailboxRecord
|
||||
*/
|
||||
public MailboxRecord(java.lang.Integer id, java.lang.Integer accountId, java.lang.String sender, java.lang.String message, java.lang.Byte archived, java.lang.Byte deleted, java.sql.Timestamp timeSent) {
|
||||
super(mineplex.database.tables.Mailbox.mailbox);
|
||||
|
||||
setValue(0, id);
|
||||
setValue(1, accountId);
|
||||
setValue(2, sender);
|
||||
setValue(3, message);
|
||||
setValue(4, archived);
|
||||
setValue(5, deleted);
|
||||
setValue(6, timeSent);
|
||||
}
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
/**
|
||||
* 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",
|
||||
"jOOQ version:3.5.2"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class RankBenefitsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.RankBenefitsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3<java.lang.Integer, java.lang.Integer, java.lang.String> {
|
||||
|
||||
private static final long serialVersionUID = 1205523956;
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.rankBenefits.id</code>.
|
||||
*/
|
||||
public void setId(java.lang.Integer value) {
|
||||
setValue(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.rankBenefits.id</code>.
|
||||
*/
|
||||
public java.lang.Integer getId() {
|
||||
return (java.lang.Integer) getValue(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.rankBenefits.accountId</code>.
|
||||
*/
|
||||
public void setAccountId(java.lang.Integer value) {
|
||||
setValue(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.rankBenefits.accountId</code>.
|
||||
*/
|
||||
public java.lang.Integer getAccountId() {
|
||||
return (java.lang.Integer) getValue(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>Account.rankBenefits.benefit</code>.
|
||||
*/
|
||||
public void setBenefit(java.lang.String value) {
|
||||
setValue(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.rankBenefits.benefit</code>.
|
||||
*/
|
||||
public java.lang.String getBenefit() {
|
||||
return (java.lang.String) getValue(2);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Record1<java.lang.Integer> key() {
|
||||
return (org.jooq.Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record3 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row3<java.lang.Integer, java.lang.Integer, java.lang.String> fieldsRow() {
|
||||
return (org.jooq.Row3) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row3<java.lang.Integer, java.lang.Integer, java.lang.String> valuesRow() {
|
||||
return (org.jooq.Row3) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Integer> field1() {
|
||||
return mineplex.database.tables.RankBenefits.rankBenefits.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.Integer> field2() {
|
||||
return mineplex.database.tables.RankBenefits.rankBenefits.accountId;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Field<java.lang.String> field3() {
|
||||
return mineplex.database.tables.RankBenefits.rankBenefits.benefit;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Integer value1() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Integer value2() {
|
||||
return getAccountId();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.String value3() {
|
||||
return getBenefit();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public RankBenefitsRecord value1(java.lang.Integer value) {
|
||||
setId(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public RankBenefitsRecord value2(java.lang.Integer value) {
|
||||
setAccountId(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public RankBenefitsRecord value3(java.lang.String value) {
|
||||
setBenefit(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public RankBenefitsRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.String value3) {
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached RankBenefitsRecord
|
||||
*/
|
||||
public RankBenefitsRecord() {
|
||||
super(mineplex.database.tables.RankBenefits.rankBenefits);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised RankBenefitsRecord
|
||||
*/
|
||||
public RankBenefitsRecord(java.lang.Integer id, java.lang.Integer accountId, java.lang.String benefit) {
|
||||
super(mineplex.database.tables.RankBenefits.rankBenefits);
|
||||
|
||||
setValue(0, id);
|
||||
setValue(1, accountId);
|
||||
setValue(2, benefit);
|
||||
}
|
||||
}
|
@ -214,17 +214,28 @@ public class ClansAdmin
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "Clan name cannot be a Player name."));
|
||||
else
|
||||
{
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans Admin", caller.getName() + " formed " + F.elem("Admin Clan " + args[2]) + "."));
|
||||
Clans.getClanDataAccess().create(caller.getName(), args[2], true, new Callback<ClanInfo>()
|
||||
{
|
||||
@Override
|
||||
public void run(ClanInfo data)
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans Admin", caller.getName() + " formed " + F.elem("Admin Clan " + args[2]) + "."));
|
||||
|
||||
// Create and Join
|
||||
Clans.getClanDataAccess().create(caller.getName(), args[2], true);
|
||||
// Set Mimic
|
||||
Clans.Get(caller).setMimic(args[2]);
|
||||
|
||||
// Set Mimic
|
||||
Clans.Get(caller).setMimic(args[2]);
|
||||
|
||||
// Inform
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "You are mimicing Clan " + args[2] + "."));
|
||||
// Inform
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "You are mimicing Clan " + args[2] + "."));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "There was an error creating a clan! Try again later"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -232,18 +243,30 @@ public class ClansAdmin
|
||||
}, args[2]);
|
||||
}
|
||||
|
||||
public void delete(Player caller, String[] args)
|
||||
public void delete(final Player caller, String[] args)
|
||||
{
|
||||
ClanInfo clan = getMimic(caller, true);
|
||||
final ClanInfo clan = getMimic(caller, true);
|
||||
|
||||
if (clan == null)
|
||||
return;
|
||||
|
||||
//Task
|
||||
Clans.getClanDataAccess().delete(clan);
|
||||
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans Admin", caller.getName() + " disbanded " + F.elem("Clan " + clan.getName()) + "."));
|
||||
Clans.getClanDataAccess().delete(clan, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans Admin", caller.getName() + " disbanded " + F.elem("Clan " + clan.getName()) + "."));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "There was an error disbanding your clan! Try again later"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void invite(Player caller, String[] args)
|
||||
@ -371,9 +394,9 @@ public class ClansAdmin
|
||||
clan.inform(F.main("Clans Admin", caller.getName() + " demoted " + target + " to " + newRank + "."), null);
|
||||
}
|
||||
|
||||
public void kick(Player caller, String[] args)
|
||||
public void kick(final Player caller, String[] args)
|
||||
{
|
||||
ClanInfo clan = getMimic(caller, true);
|
||||
final ClanInfo clan = getMimic(caller, true);
|
||||
|
||||
if (clan == null)
|
||||
return;
|
||||
@ -384,18 +407,35 @@ public class ClansAdmin
|
||||
return;
|
||||
}
|
||||
|
||||
String targetName = UtilPlayer.searchCollection(caller, args[2], clan.getMembers().keySet(), "Clan Member", true);
|
||||
final String targetName = UtilPlayer.searchCollection(caller, args[2], clan.getMembers().keySet(), "Clan Member", true);
|
||||
|
||||
if (targetName == null)
|
||||
return;
|
||||
|
||||
//Task
|
||||
Clans.getClanDataAccess().leave(clan, targetName);
|
||||
final Player player = UtilPlayer.searchOnline(null, targetName, false);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(UtilPlayer.searchOnline(null, targetName, false), F.main("Clans Admin", caller.getName() + " kicked you from " + F.elem("Clan " + clan.getName()) + "."));
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "You kicked " + targetName + " from your Clan."));
|
||||
clan.inform(F.main("Clans Admin", caller.getName() + " kicked " + targetName + " from your Clan."), caller.getName());
|
||||
Callback<Boolean> callback = new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
//Inform
|
||||
if (player != null)
|
||||
UtilPlayer.message(player, F.main("Clans Admin", caller.getName() + " kicked you from " + F.elem("Clan " + clan.getName()) + "."));
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "You kicked " + targetName + " from your Clan."));
|
||||
clan.inform(F.main("Clans Admin", caller.getName() + " kicked " + targetName + " from your Clan."), caller.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "There was an error processing your request"));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (player != null) Clans.getClanDataAccess().leave(clan, player, callback);
|
||||
else Clans.getClanDataAccess().leave(clan, targetName, callback);
|
||||
}
|
||||
|
||||
public void ally(Player caller, String[] args)
|
||||
|
@ -8,6 +8,8 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.game.clans.clans.repository.ClanRepository;
|
||||
@ -29,63 +31,161 @@ public class ClansDataAccessLayer
|
||||
_repository = new ClanRepository(clans.getPlugin(), clans.getServerName());
|
||||
}
|
||||
|
||||
public void delete(ClanInfo clan)
|
||||
public void delete(final ClanInfo clan, final Callback<Boolean> callback)
|
||||
{
|
||||
//Territory Unclaim
|
||||
for (String cur : clan.getClaimSet())
|
||||
_manager.getClaimMap().remove(cur);
|
||||
|
||||
_manager.getClanMap().remove(clan.getName());
|
||||
|
||||
for (String cur : clan.getMembers().keySet())
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
_manager.getClanMemberMap().remove(cur);
|
||||
}
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
boolean out = _repository.deleteClan(clan.getId());
|
||||
|
||||
//Clean from Others
|
||||
for (ClanInfo cur : _manager.getClanMap().values())
|
||||
{
|
||||
cur.getAllyMap().remove(clan.getName());
|
||||
cur.getRequestMap().remove(clan.getName());
|
||||
}
|
||||
if (out)
|
||||
{
|
||||
//Territory Unclaim
|
||||
for (String cur : clan.getClaimSet())
|
||||
_manager.getClaimMap().remove(cur);
|
||||
|
||||
//Save
|
||||
_repository.deleteClan(clan.getId());
|
||||
_manager.getClanMap().remove(clan.getName());
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(clan);
|
||||
for (String cur : clan.getMembers().keySet())
|
||||
{
|
||||
_manager.getClanMemberMap().remove(cur);
|
||||
}
|
||||
|
||||
//Log
|
||||
_manager.log("Deleted [" + clan.getName() + "].");
|
||||
//Clean from Others
|
||||
for (ClanInfo cur : _manager.getClanMap().values())
|
||||
{
|
||||
cur.getAllyMap().remove(clan.getName());
|
||||
cur.getRequestMap().remove(clan.getName());
|
||||
}
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(clan);
|
||||
|
||||
//Log
|
||||
_manager.log("Deleted [" + clan.getName() + "].");
|
||||
}
|
||||
|
||||
if (callback != null) callback.run(out);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ClanInfo create(String creator, String name, boolean admin)
|
||||
public void createAndJoin(final Player player, final String name, final Callback<ClanInfo> callback)
|
||||
{
|
||||
ClanToken token = new ClanToken();
|
||||
create(player.getName(), name, false, new Callback<ClanInfo>()
|
||||
{
|
||||
@Override
|
||||
public void run(final ClanInfo clan)
|
||||
{
|
||||
if (clan != null)
|
||||
{
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final ClanRole role = ClanRole.LEADER;
|
||||
_repository.addMember(clan.getId(), player.getUniqueId(), role.toString());
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
updateJoinCache(clan, player, role);
|
||||
|
||||
//Log
|
||||
_manager.log("Added [" + player + "] to [" + clan.getName() + "].");
|
||||
|
||||
if (callback != null) callback.run(clan);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (callback != null) callback.run(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void create(final String creator, final String name, final boolean admin, final Callback<ClanInfo> callback)
|
||||
{
|
||||
final ClanToken token = new ClanToken();
|
||||
token.Name = name;
|
||||
token.Description = "No Description";
|
||||
token.Home = "";
|
||||
token.Admin = admin;
|
||||
token.Energy = 1440;
|
||||
|
||||
//Create Clan
|
||||
ClanInfo clan = new ClanInfo(_manager, token);
|
||||
_manager.getClanMap().put(name, clan);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final int clanId = _repository.addClan(token);
|
||||
final boolean response = clanId != -1;
|
||||
|
||||
//Save
|
||||
_repository.addClan(clan, token);
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
ClanInfo clanInfo = null;
|
||||
|
||||
//Log
|
||||
_manager.log("[" + clan.getName() + "] with Admin [" + admin + "] created by [" + creator + "].");
|
||||
if (response)
|
||||
{
|
||||
token.Id = clanId;
|
||||
clanInfo = new ClanInfo(_manager, token);
|
||||
_manager.getClanMap().put(name, clanInfo);
|
||||
_manager.log("[" + clanInfo.getName() + "] with Admin [" + admin + "] created by [" + creator + "].");
|
||||
}
|
||||
|
||||
return clan;
|
||||
if (callback != null) callback.run(clanInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void join(ClanInfo clan, Player player, ClanRole role)
|
||||
public void join(final ClanInfo clan, final Player player, final ClanRole role, final Callback<Boolean> callback)
|
||||
{
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final boolean success = _repository.addMember(clan.getId(), player.getUniqueId(), role.toString());
|
||||
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
updateJoinCache(clan, player, role);
|
||||
|
||||
//Log
|
||||
_manager.log("Added [" + player + "] to [" + clan.getName() + "].");
|
||||
}
|
||||
|
||||
if (callback != null) callback.run(success);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateJoinCache(ClanInfo clan, Player player, ClanRole role)
|
||||
{
|
||||
String playerName = player.getName();
|
||||
if (_manager.getClanMemberMap().containsKey(playerName))
|
||||
leave(_manager.getClanUtility().getClanByPlayer(player), player);
|
||||
leave(_manager.getClanUtility().getClanByPlayer(player), player, null);
|
||||
|
||||
//Update Clan
|
||||
clan.getMembers().put(playerName, role);
|
||||
@ -94,46 +194,64 @@ public class ClansDataAccessLayer
|
||||
clan.getInviterMap().remove(playerName);
|
||||
clan.playerOnline(player);
|
||||
|
||||
//Save
|
||||
_repository.addMember(clan.getId(), playerName, role.toString());
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(player);
|
||||
|
||||
//Log
|
||||
_manager.log("Added [" + player + "] to [" + clan.getName() + "].");
|
||||
}
|
||||
|
||||
public void leave(ClanInfo clan, Player player)
|
||||
public void leave(ClanInfo clan, Player player, Callback<Boolean> callback)
|
||||
{
|
||||
leave(clan, player.getName());
|
||||
leave(clan, player.getName(), callback);
|
||||
_scoreboard.refresh(player);
|
||||
}
|
||||
|
||||
public void leave(ClanInfo clan, String player)
|
||||
public void leave(final ClanInfo clan, final String player, final Callback<Boolean> callback)
|
||||
{
|
||||
if (clan == null)
|
||||
return;
|
||||
|
||||
//Update Clan
|
||||
clan.getMembers().remove(player);
|
||||
_manager.getClanMemberMap().remove(player);
|
||||
clan.playerOffline(player);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final boolean success = _repository.removeMember(clan.getId(), player);
|
||||
|
||||
//Save
|
||||
_repository.removeMember(clan.getId(), player);
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
//Update Clan
|
||||
clan.getMembers().remove(player);
|
||||
_manager.getClanMemberMap().remove(player);
|
||||
clan.playerOffline(player);
|
||||
//Log
|
||||
_manager.log("Removed [" + player + "] from [" + clan.getName() + "].");
|
||||
}
|
||||
|
||||
//Log
|
||||
_manager.log("Removed [" + player + "] from [" + clan.getName() + "].");
|
||||
if (callback != null) callback.run(success);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void role(ClanInfo clan, String player, ClanRole role)
|
||||
public void role(final ClanInfo clan, final String player, final ClanRole role)
|
||||
{
|
||||
//Update Clan
|
||||
clan.getMembers().put(player, role);
|
||||
|
||||
//Save
|
||||
_repository.updateMember(clan.getId(), player, role.toString());
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.updateMember(clan.getId(), player, role.toString());
|
||||
}
|
||||
});
|
||||
|
||||
//Log
|
||||
_manager.log("Removed [" + player + "] from [" + clan.getName() + "].");
|
||||
@ -156,7 +274,7 @@ public class ClansDataAccessLayer
|
||||
_manager.log("Alliance Request to [" + target.getName() + "] from [" + clan.getName() + "] by [" + player + "].");
|
||||
}
|
||||
|
||||
public void ally(ClanInfo cA, ClanInfo cB, String player)
|
||||
public void ally(final ClanInfo cA, final ClanInfo cB, String player)
|
||||
{
|
||||
//Remove Requests
|
||||
cA.getRequestMap().remove(cB.getName());
|
||||
@ -167,8 +285,15 @@ public class ClansDataAccessLayer
|
||||
cB.getAllyMap().put(cA.getName(), false);
|
||||
|
||||
//Save
|
||||
_repository.addClanRelationship(cA.getId(), cB.getId(), false);
|
||||
_repository.addClanRelationship(cB.getId(), cA.getId(), false);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.addClanRelationship(cA.getId(), cB.getId(), false);
|
||||
_repository.addClanRelationship(cB.getId(), cA.getId(), false);
|
||||
}
|
||||
});
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(cA);
|
||||
@ -177,9 +302,18 @@ public class ClansDataAccessLayer
|
||||
_manager.log("Added Ally for [" + cB.getName() + "] and [" + cA.getName() + "] by [" + player + "].");
|
||||
}
|
||||
|
||||
public void enemy(ClanInfo clan, ClanInfo otherClan, String player)
|
||||
public void enemy(final ClanInfo clan, final ClanInfo otherClan, String player)
|
||||
{
|
||||
_repository.addEnemy(clan.getId(), otherClan.getId());
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.addEnemy(clan.getId(), otherClan.getId());
|
||||
}
|
||||
});
|
||||
|
||||
// Memory
|
||||
Timestamp currDate = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
ClanEnemyToken clanEnemyToken = new ClanEnemyToken();
|
||||
@ -200,18 +334,25 @@ public class ClansDataAccessLayer
|
||||
_manager.log("Added Enemy for [" + clan.getName() + "] and [" + otherClan.getName() + "] by [" + player + "].");
|
||||
}
|
||||
|
||||
public boolean trust(ClanInfo ownerClan, ClanInfo otherClan, String player)
|
||||
public boolean trust(final ClanInfo ownerClan, final ClanInfo otherClan, String player)
|
||||
{
|
||||
if (!ownerClan.getAllyMap().containsKey(otherClan.getName()))
|
||||
return false;
|
||||
|
||||
boolean trust = !ownerClan.getAllyMap().get(otherClan.getName());
|
||||
final boolean trust = !ownerClan.getAllyMap().get(otherClan.getName());
|
||||
|
||||
//Memory
|
||||
ownerClan.getAllyMap().put(otherClan.getName(), trust);
|
||||
|
||||
//Save
|
||||
_repository.updateClanRelationship(ownerClan.getId(), otherClan.getId(), trust);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.updateClanRelationship(ownerClan.getId(), otherClan.getId(), trust);
|
||||
}
|
||||
});
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(ownerClan);
|
||||
@ -222,15 +363,22 @@ public class ClansDataAccessLayer
|
||||
return trust;
|
||||
}
|
||||
|
||||
public void neutral(ClanInfo cA, ClanInfo cB, String player, boolean bothClansManager)
|
||||
public void neutral(final ClanInfo cA, final ClanInfo cB, String player, boolean bothClansManager)
|
||||
{
|
||||
//Update ClansManager
|
||||
cA.getAllyMap().remove(cB.getName());
|
||||
cB.getAllyMap().remove(cA.getName());
|
||||
|
||||
//Save
|
||||
_repository.removeClanRelationship(cA.getId(), cB.getId());
|
||||
_repository.removeClanRelationship(cB.getId(), cA.getId());
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.removeClanRelationship(cA.getId(), cB.getId());
|
||||
_repository.removeClanRelationship(cB.getId(), cA.getId());
|
||||
}
|
||||
});
|
||||
|
||||
//Scoreboard
|
||||
_scoreboard.refresh(cA);
|
||||
@ -240,12 +388,12 @@ public class ClansDataAccessLayer
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean claim(String name, String chunk, String player, boolean safe)
|
||||
public boolean claim(String name, final String chunk, String player, final boolean safe)
|
||||
{
|
||||
if (!_manager.getClanMap().containsKey(name))
|
||||
return false;
|
||||
|
||||
ClanInfo clan = _manager.getClanMap().get(name);
|
||||
final ClanInfo clan = _manager.getClanMap().get(name);
|
||||
|
||||
//Unclaim
|
||||
if (_manager.getClaimMap().containsKey(chunk))
|
||||
@ -259,7 +407,14 @@ public class ClansDataAccessLayer
|
||||
_manager.getClaimMap().put(chunk, claim);
|
||||
|
||||
//Save
|
||||
_repository.addTerritoryClaim(clan.getId(), chunk, safe);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.addTerritoryClaim(clan.getId(), chunk, safe);
|
||||
}
|
||||
});
|
||||
|
||||
//Visual
|
||||
Chunk c = UtilWorld.strToChunk(chunk);
|
||||
@ -281,7 +436,7 @@ public class ClansDataAccessLayer
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean unclaim(String chunk, String player, boolean sql)
|
||||
public boolean unclaim(final String chunk, String player, boolean sql)
|
||||
{
|
||||
ClanTerritory claim = _manager.getClaimMap().remove(chunk);
|
||||
|
||||
@ -291,7 +446,7 @@ public class ClansDataAccessLayer
|
||||
return false;
|
||||
}
|
||||
|
||||
ClanInfo clan = _manager.getClanMap().get(claim.Owner);
|
||||
final ClanInfo clan = _manager.getClanMap().get(claim.Owner);
|
||||
|
||||
if (clan == null)
|
||||
{
|
||||
@ -300,7 +455,14 @@ public class ClansDataAccessLayer
|
||||
}
|
||||
|
||||
//Memory
|
||||
clan.getClaimSet().remove(chunk);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
clan.getClaimSet().remove(chunk);
|
||||
}
|
||||
});
|
||||
|
||||
//Save
|
||||
_repository.removeTerritoryClaim(clan.getId(), chunk);
|
||||
@ -320,13 +482,20 @@ public class ClansDataAccessLayer
|
||||
return unclaim(chunk, null, sql);
|
||||
}
|
||||
|
||||
public void home(ClanInfo clan, Location loc, String player)
|
||||
public void home(final ClanInfo clan, Location loc, String player)
|
||||
{
|
||||
//Memory
|
||||
clan.setHome(loc);
|
||||
|
||||
//Save
|
||||
_repository.updateClan(clan.getId(), clan.getName(), clan.getDesc(), UtilWorld.locToStr(clan.getHome()), clan.isAdmin(), clan.getEnergy(), clan.getLastOnline());
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.updateClan(clan.getId(), clan.getName(), clan.getDesc(), UtilWorld.locToStr(clan.getHome()), clan.isAdmin(), clan.getEnergy(), clan.getLastOnline());
|
||||
}
|
||||
});
|
||||
|
||||
//Log
|
||||
_manager.log("Set Home for [" + clan.getName() + "] to " + UtilWorld.locToStrClean(loc) + " by [" + player + "].");
|
||||
@ -372,4 +541,14 @@ public class ClansDataAccessLayer
|
||||
{
|
||||
return _repository;
|
||||
}
|
||||
|
||||
private void runAsync(Runnable runnable)
|
||||
{
|
||||
_manager.runAsync(runnable);
|
||||
}
|
||||
|
||||
private void runSync(Runnable runnable)
|
||||
{
|
||||
_manager.runSync(runnable);
|
||||
}
|
||||
}
|
||||
|
@ -613,10 +613,10 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
|
||||
public void onJoin(PlayerLoginEvent event)
|
||||
{
|
||||
Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
|
||||
if (!rank.Has(Rank.HELPER) && !event.getPlayer().isWhitelisted())
|
||||
if (!rank.Has(Rank.MAPDEV) && !event.getPlayer().isWhitelisted())
|
||||
{
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
event.setKickMessage("Only Trainee+ can join this server");
|
||||
event.setKickMessage("Only Builder+ can join this server");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,23 +30,30 @@ public class ClansUtility
|
||||
|
||||
public enum ClanRelation
|
||||
{
|
||||
SELF(C.xSelf.toString()),
|
||||
ALLY(C.xAlly.toString()),
|
||||
ALLY_TRUST(C.xAlly.toString()),
|
||||
NEUTRAL(C.xNone.toString()),
|
||||
ADMIN(C.xAdmin.toString()),
|
||||
SAFE(C.xSafe.toString());
|
||||
SELF(C.xSelf, C.xdSelf),
|
||||
ALLY(C.xAlly, C.xdAlly),
|
||||
ALLY_TRUST(C.xAlly, C.xdAlly),
|
||||
NEUTRAL(C.xNeutral, C.xdNeutral),
|
||||
ADMIN(C.xAdmin, C.xAdmin),
|
||||
SAFE(C.xSafe, C.xSafe);
|
||||
|
||||
private String _prefix;
|
||||
private ChatColor _light;
|
||||
private ChatColor _dark;
|
||||
|
||||
ClanRelation(String prefix)
|
||||
ClanRelation(ChatColor light, ChatColor dark)
|
||||
{
|
||||
_prefix = prefix;
|
||||
_light = light;
|
||||
_dark = dark;
|
||||
}
|
||||
|
||||
public String getPrefix()
|
||||
{
|
||||
return _prefix;
|
||||
return _light.toString();
|
||||
}
|
||||
|
||||
public ChatColor getColor(boolean dark)
|
||||
{
|
||||
return dark ? _dark : _light;
|
||||
}
|
||||
}
|
||||
|
||||
@ -465,21 +472,7 @@ public class ClansUtility
|
||||
|
||||
public ChatColor relChatColor(ClanRelation relation, boolean dark)
|
||||
{
|
||||
if (relation == ClanRelation.SAFE) return C.xAdmin;
|
||||
if (relation == ClanRelation.ADMIN) return C.xAdmin;
|
||||
|
||||
if (!dark)
|
||||
{
|
||||
if (relation == ClanRelation.SELF) return C.xSelf;
|
||||
if (relation == ClanRelation.ALLY_TRUST) return C.xdAlly;
|
||||
if (relation == ClanRelation.ALLY) return C.xAlly;
|
||||
return C.xEnemy;
|
||||
}
|
||||
|
||||
if (relation == ClanRelation.SELF) return C.xdSelf;
|
||||
if (relation == ClanRelation.ALLY_TRUST) return C.xAlly;
|
||||
if (relation == ClanRelation.ALLY) return C.xdAlly;
|
||||
return C.xdEnemy;
|
||||
return relation.getColor(dark);
|
||||
}
|
||||
|
||||
public String relColor(ClanRelation relation, boolean dark)
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.util.Vector;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilInput;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -47,30 +48,43 @@ public class ClanManagementCommand extends CommandBase<ClansManager>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
public void Execute(final Player caller, String[] args)
|
||||
{
|
||||
if (args == null || args.length == 0)
|
||||
{
|
||||
notify(caller, "Incorrect number of arguments!");
|
||||
message(caller, "Incorrect number of arguments!");
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("delete") && args.length > 1)
|
||||
{
|
||||
String clanName = args[1];
|
||||
ClanInfo clan = Plugin.getClanUtility().searchClan(caller, args[1], false);
|
||||
final String clanName = args[1];
|
||||
final ClanInfo clan = Plugin.getClanUtility().searchClan(caller, args[1], false);
|
||||
|
||||
if (clan != null)
|
||||
{
|
||||
_clansManager.getClanDataAccess().delete(clan);
|
||||
notify(caller, String.format("Deleted the clan %s!", clanName));
|
||||
_clansManager.getClanDataAccess().delete(clan, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
message(caller, String.format("Deleted the clan %s!", clanName));
|
||||
}
|
||||
else
|
||||
{
|
||||
message(caller, "There was a database error while trying to delete " + clanName);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
notify(caller, String.format("Unable to locate clan %s!", clanName));
|
||||
message(caller, String.format("Unable to locate clan %s!", clanName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void notify(Player player, String message)
|
||||
public static void message(Player player, String message)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Clans", message));
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilInput;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -219,8 +220,10 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
UtilPlayer.message(caller, F.help("/c <clan>", "View Clan Information", Rank.ALL));
|
||||
}
|
||||
|
||||
public void create(Player caller, String[] args)
|
||||
public void create(final Player caller, final String[] args)
|
||||
{
|
||||
System.out.println("CREATE COMMAND");
|
||||
|
||||
ClientClan client = Plugin.Get(caller);
|
||||
|
||||
if (Plugin.getClanMemberMap().containsKey(caller.getName()))
|
||||
@ -282,23 +285,33 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
{
|
||||
if (cur.equalsIgnoreCase(args[1]))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "Clan name is already used by another Clan."));
|
||||
UtilPlayer.message(caller, F.main("Clans", "Clan name is already uased by another Clan."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans", F.name(caller.getName()) + " formed " + F.elem("Clan " + args[1]) + "."));
|
||||
|
||||
|
||||
ClanInfo clan = Plugin.getClanDataAccess().create(caller.getName(), args[1], false);
|
||||
|
||||
Plugin.getClanDataAccess().join(clan, caller, ClanRole.LEADER);
|
||||
Plugin.getClanDataAccess().createAndJoin(caller, args[1], new Callback<ClanInfo>()
|
||||
{
|
||||
@Override
|
||||
public void run(ClanInfo data)
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans", F.name(caller.getName()) + " formed " + F.elem("Clan " + args[1]) + "."));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hopefully shouldn't happen!
|
||||
UtilPlayer.message(caller, F.main("Clans", "There was an error creating the clan. Please try again"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(Player caller, String[] args)
|
||||
public void delete(final Player caller, String[] args)
|
||||
{
|
||||
ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
final ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
|
||||
if (clan == null)
|
||||
{
|
||||
@ -313,10 +326,22 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
}
|
||||
|
||||
//Task
|
||||
Plugin.getClanDataAccess().delete(clan);
|
||||
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans", F.name(caller.getName()) + " disbanded " + F.elem("Clan " + clan.getName()) + "."));
|
||||
Plugin.getClanDataAccess().delete(clan, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
//Inform
|
||||
UtilServer.broadcast(F.main("Clans", F.name(caller.getName()) + " disbanded " + F.elem("Clan " + clan.getName()) + "."));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "There was an error processing your request. Try again later"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void invite(Player caller, String[] args)
|
||||
@ -362,7 +387,7 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
Plugin.getClanDataAccess().invite(clan, target.getName(), caller.getName());
|
||||
}
|
||||
|
||||
public void join(Player caller, String[] args)
|
||||
public void join(final Player caller, String[] args)
|
||||
{
|
||||
if (Plugin.getClanMemberMap().containsKey(caller.getName()))
|
||||
{
|
||||
@ -390,7 +415,7 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
return;
|
||||
}
|
||||
|
||||
ClanInfo clan = Plugin.getClanUtility().searchClanPlayer(caller, args[1], true);
|
||||
final ClanInfo clan = Plugin.getClanUtility().searchClanPlayer(caller, args[1], true);
|
||||
if (clan == null)
|
||||
return;
|
||||
|
||||
@ -401,16 +426,30 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
}
|
||||
|
||||
//Task
|
||||
Plugin.getClanDataAccess().join(clan, caller, ClanRole.RECRUIT);
|
||||
Plugin.getClanDataAccess().join(clan, caller, ClanRole.RECRUIT, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
//Inform
|
||||
UtilPlayer.message(caller, F.main("Clans", "You joined " + F.elem("Clan " + clan.getName()) + "."));
|
||||
clan.inform(F.name(caller.getName()) + " has joined your Clan.", caller.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "There was an error processing your request"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(caller, F.main("Clans", "You joined " + F.elem("Clan " + clan.getName()) + "."));
|
||||
clan.inform(F.name(caller.getName()) + " has joined your Clan.", caller.getName());
|
||||
}
|
||||
|
||||
public void leave(Player caller, String[] args)
|
||||
public void leave(final Player caller, String[] args)
|
||||
{
|
||||
ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
final ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
|
||||
if (clan == null)
|
||||
{
|
||||
@ -427,14 +466,17 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
//Leave or Delete
|
||||
if (clan.getMembers().size() > 1)
|
||||
{
|
||||
//Inform
|
||||
UtilPlayer.message(caller, F.main("Clans", "You left " + F.elem("Clan " + clan.getName()) + "."));
|
||||
|
||||
//Task
|
||||
Plugin.getClanDataAccess().leave(clan, caller);
|
||||
|
||||
//Inform
|
||||
clan.inform(F.name(caller.getName()) + " has left your Clan.", null);
|
||||
Plugin.getClanDataAccess().leave(clan, caller, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
//Inform
|
||||
UtilPlayer.message(caller, F.main("Clans", "You left " + F.elem("Clan " + clan.getName()) + "."));
|
||||
clan.inform(F.name(caller.getName()) + " has left your Clan.", null);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -442,9 +484,9 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
}
|
||||
}
|
||||
|
||||
public void kick(Player caller, String[] args)
|
||||
public void kick(final Player caller, String[] args)
|
||||
{
|
||||
ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
final ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
|
||||
|
||||
if (clan == null)
|
||||
{
|
||||
@ -458,7 +500,7 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
return;
|
||||
}
|
||||
|
||||
String target = UtilPlayer.searchCollection(caller, args[1], clan.getMembers().keySet(), "Clan Member", true);
|
||||
final String target = UtilPlayer.searchCollection(caller, args[1], clan.getMembers().keySet(), "Clan Member", true);
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
@ -477,14 +519,24 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
return;
|
||||
}
|
||||
|
||||
final Player player = UtilPlayer.searchOnline(null, target, false);
|
||||
|
||||
Callback<Boolean> callback = new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
//Inform
|
||||
if (player != null)
|
||||
UtilPlayer.message(player, F.main("Clans", F.name(caller.getName()) + " kicked you from " + F.elem("Clan " + clan.getName()) + "."));
|
||||
UtilPlayer.message(caller, F.main("Clans", "You kicked " + F.name(target) + " from your Clan."));
|
||||
clan.inform(F.main("Clans", F.name(caller.getName()) + " kicked " + F.name(target) + " from your Clan."), caller.getName());
|
||||
}
|
||||
};
|
||||
|
||||
//Task
|
||||
Plugin.getClanDataAccess().leave(clan, target);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(UtilPlayer.searchOnline(null, target, false), F.main("Clans", F.name(caller.getName()) + " kicked you from " + F.elem("Clan " + clan.getName()) + "."));
|
||||
UtilPlayer.message(caller, F.main("Clans", "You kicked " + F.name(target) + " from your Clan."));
|
||||
clan.inform(F.main("Clans", F.name(caller.getName()) + " kicked " + F.name(target) + " from your Clan."), caller.getName());
|
||||
if (player != null) Plugin.getClanDataAccess().leave(clan, player, callback);
|
||||
else Plugin.getClanDataAccess().leave(clan, target, callback);
|
||||
}
|
||||
|
||||
public void promote(Player caller, String[] args)
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.packethandler.PacketPlayOutWorldBorder;
|
||||
@ -70,18 +71,32 @@ public class ClansRegions extends MiniPlugin
|
||||
* @param claimOffset - the initial offset in claim (creating a 'hole' with chunk offset radius)
|
||||
* @param safe - whether the chunk claimed is considered a 'safe' (pvp-free) region.
|
||||
*/
|
||||
private void claimArea(String clanName, int chunkRadius, int claimOffset, boolean safe, Location... locations)
|
||||
private void claimArea(final String clanName, final int chunkRadius, final int claimOffset, final boolean safe, final Location... locations)
|
||||
{
|
||||
ClanInfo clan = _manager.getClan(clanName);
|
||||
final ClanInfo clan = _manager.getClan(clanName);
|
||||
|
||||
if (clan == null)
|
||||
{
|
||||
clan = _manager.getClanDataAccess().create("ClansRegions", clanName, true);
|
||||
for (Location location : locations)
|
||||
_manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback<ClanInfo>()
|
||||
{
|
||||
claimArea(clan, location, chunkRadius, claimOffset, safe);
|
||||
log(String.format("Initialized %s faction territory and creation!", clanName));
|
||||
}
|
||||
@Override
|
||||
public void run(ClanInfo data)
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
for (Location location : locations)
|
||||
{
|
||||
claimArea(data, location, chunkRadius, claimOffset, safe);
|
||||
log(String.format("Initialized %s faction territory and creation!", clanName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Clans Regions error!");
|
||||
System.out.println("Seek out help!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,16 @@ import mineplex.core.database.column.ColumnBoolean;
|
||||
import mineplex.core.database.column.ColumnInt;
|
||||
import mineplex.core.database.column.ColumnTimestamp;
|
||||
import mineplex.core.database.column.ColumnVarChar;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.database.tables.records.ClansRecord;
|
||||
import mineplex.game.clans.clans.repository.tokens.ClanAllianceToken;
|
||||
import mineplex.game.clans.clans.repository.tokens.ClanEnemyToken;
|
||||
import mineplex.game.clans.clans.repository.tokens.ClanMemberToken;
|
||||
import mineplex.game.clans.clans.repository.tokens.ClanTerritoryToken;
|
||||
import mineplex.game.clans.clans.repository.tokens.ClanToken;
|
||||
import org.jooq.DSLContext;
|
||||
|
||||
import static mineplex.database.Tables.*;
|
||||
import static org.jooq.impl.DSL.*;
|
||||
|
||||
public class ClanRepository extends RepositoryBase
|
||||
{
|
||||
@ -251,36 +255,56 @@ public class ClanRepository extends RepositoryBase
|
||||
{
|
||||
}
|
||||
|
||||
public void deleteClan(int clanId)
|
||||
public boolean deleteClan(int clanId)
|
||||
{
|
||||
executeUpdate(DELETE_CLAN, new ColumnInt("clanid", clanId));
|
||||
return jooq().delete(clans).where(clans.id.equal(clanId)).execute() == 1;
|
||||
}
|
||||
|
||||
public void addClan(final ClanInfo clan, final ClanToken token)
|
||||
public int addClan(ClanToken token)
|
||||
{
|
||||
executeInsert(ADD_CLAN, new ResultSetCallable()
|
||||
ClansRecord record = jooq().newRecord(clans);
|
||||
record.setServerId(_serverId);
|
||||
record.setName(token.Name);
|
||||
record.setDescription(token.Description);
|
||||
record.setHome(token.Home);
|
||||
record.setAdmin(token.Admin);
|
||||
record.setEnergy(token.Energy);
|
||||
|
||||
if (record.store() == 1)
|
||||
{
|
||||
@Override
|
||||
public void processResultSet(ResultSet resultSet) throws SQLException
|
||||
{
|
||||
while (resultSet.next())
|
||||
{
|
||||
clan.setId(resultSet.getInt(1));
|
||||
}
|
||||
}
|
||||
|
||||
}, new ColumnInt("serverId", _serverId), new ColumnVarChar("name", 100, token.Name), new ColumnVarChar("description", 100, token.Description), new ColumnVarChar("home", 100, token.Home), new ColumnBoolean("admin", token.Admin), new ColumnInt("energy", token.Energy));
|
||||
|
||||
return record.getId();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void addMember(int clanId, String playerName, String role)
|
||||
@Deprecated
|
||||
public boolean addMember(int clanId, String playerName, String role)
|
||||
{
|
||||
executeUpdate(ADD_CLAN_MEMBER, new ColumnInt("clanid", clanId), new ColumnVarChar("clanRole", 100, role), new ColumnVarChar("name", 100, playerName));
|
||||
DSLContext create = jooq();
|
||||
int out = create.insertInto(accountClan)
|
||||
.set(accountClan.accountId, select(accounts.id).from(accounts).where(accounts.name.eq(playerName)))
|
||||
.set(accountClan.clanId, clanId)
|
||||
.set(accountClan.clanRole, role).execute();
|
||||
|
||||
return out == 1;
|
||||
}
|
||||
|
||||
public void removeMember(int clanId, String playerName)
|
||||
public boolean addMember(int clanId, UUID playerUUID, String role)
|
||||
{
|
||||
executeUpdate(DELETE_CLAN_MEMBER, new ColumnInt("clanid", clanId), new ColumnVarChar("name", 100, playerName));
|
||||
int out = jooq().insertInto(accountClan)
|
||||
.set(accountClan.accountId, select(accounts.id).from(accounts).where(accounts.uuid.eq(playerUUID.toString())))
|
||||
.set(accountClan.clanId, clanId)
|
||||
.set(accountClan.clanRole, role).execute();
|
||||
|
||||
return out == 1;
|
||||
}
|
||||
|
||||
public boolean removeMember(int clanId, String playerName)
|
||||
{
|
||||
return executeUpdate(DELETE_CLAN_MEMBER, new ColumnInt("clanid", clanId), new ColumnVarChar("name", 100, playerName)) == 1;
|
||||
}
|
||||
|
||||
public void updateMember(int clanId, String playerName, String role)
|
||||
@ -303,9 +327,9 @@ public class ClanRepository extends RepositoryBase
|
||||
executeUpdate(DELETE_CLAN_ALLIANCE, new ColumnInt("clanid", clanId), new ColumnInt("otherClanId", otherClanId));
|
||||
}
|
||||
|
||||
public void addTerritoryClaim(int clanId, String chunk, boolean safe)
|
||||
public boolean addTerritoryClaim(int clanId, String chunk, boolean safe)
|
||||
{
|
||||
executeUpdate(ADD_CLAN_TERRITORY, new ColumnInt("clanId", clanId), new ColumnInt("serverId", _serverId), new ColumnVarChar("chunk", 100, chunk), new ColumnBoolean("safe", safe));
|
||||
return executeUpdate(ADD_CLAN_TERRITORY, new ColumnInt("clanId", clanId), new ColumnInt("serverId", _serverId), new ColumnVarChar("chunk", 100, chunk), new ColumnBoolean("safe", safe)) == 1;
|
||||
}
|
||||
|
||||
public void addEnemy(int clanId, int otherClanId)
|
||||
|
@ -2,9 +2,14 @@ package mineplex.game.clans.clans.scoreboard;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.ScoreboardTeam;
|
||||
|
||||
import mineplex.core.scoreboard.PlayerScoreboard;
|
||||
import mineplex.core.scoreboard.ScoreboardManager;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ClansUtility.ClanRelation;
|
||||
|
||||
@ -21,11 +26,6 @@ public class ClansPlayerScoreboard extends PlayerScoreboard
|
||||
@Override
|
||||
protected void addTeams(Player player)
|
||||
{
|
||||
for (ClanRelation relation : ClanRelation.values())
|
||||
{
|
||||
getScoreboard().registerNewTeam(relation.name()).setPrefix(relation.getPrefix());
|
||||
}
|
||||
|
||||
refreshTeams(player);
|
||||
}
|
||||
|
||||
@ -36,12 +36,34 @@ public class ClansPlayerScoreboard extends PlayerScoreboard
|
||||
if (otherPlayer.equals(player))
|
||||
continue;
|
||||
|
||||
ClanRelation relation = _clansManager.getRelation(player.getName(), otherPlayer.getName());
|
||||
ClanInfo clan = _clansManager.getClan(player);
|
||||
ClanInfo otherClan = _clansManager.getClan(otherPlayer);
|
||||
ClanRelation rel = _clansManager.getClanUtility().rel(clan, otherClan);
|
||||
|
||||
// Add Other to Self
|
||||
getScoreboard().getTeam(relation.name()).addPlayer(otherPlayer);
|
||||
add(getScoreboard(), otherPlayer, otherClan, rel);
|
||||
// Add Self to Other
|
||||
otherPlayer.getScoreboard().getTeam(relation.name()).addPlayer(player);
|
||||
add(otherPlayer.getScoreboard(), player, clan, rel);
|
||||
}
|
||||
}
|
||||
|
||||
public void add(Scoreboard scoreboard, Player otherPlayer, ClanInfo clanInfo, ClanRelation relation)
|
||||
{
|
||||
String teamName = getTeamName(clanInfo, relation);
|
||||
Team team = scoreboard.getTeam(teamName);
|
||||
if (team == null)
|
||||
{
|
||||
team = scoreboard.registerNewTeam(teamName);
|
||||
if (clanInfo != null)
|
||||
team.setPrefix(relation.getColor(true) + clanInfo.getName() + relation.getColor(false) + " ");
|
||||
else
|
||||
team.setPrefix(relation.getColor(false).toString());
|
||||
}
|
||||
team.addPlayer(otherPlayer);
|
||||
}
|
||||
|
||||
public String getTeamName(ClanInfo clanInfo, ClanRelation relation)
|
||||
{
|
||||
return (clanInfo == null ? "" : clanInfo.getName()) + relation.ordinal();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user