From db15ffad72093f223cc98158f3dd2e263f1f0983 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sun, 2 Aug 2015 05:17:51 -0500 Subject: [PATCH] Bonus changes + Update jooq --- Plugins/.idea/compiler.xml | 2 - .../src/mineplex/database/Account.java | 3 +- .../src/mineplex/database/Keys.java | 4 + .../src/mineplex/database/Routines.java | 13 + .../src/mineplex/database/Tables.java | 5 + .../database/routines/Check_vote.java | 93 +++++ .../mineplex/database/tables/AccountStat.java | 4 +- .../src/mineplex/database/tables/Bonus.java | 32 +- .../mineplex/database/tables/Chatsnap.java | 129 +++++++ .../tables/records/AccountStatRecord.java | 24 +- .../database/tables/records/BonusRecord.java | 258 ++++++++++++- .../tables/records/ChatsnapRecord.java | 359 ++++++++++++++++++ .../src/mineplex/hub/bonuses/BonusAmount.java | 9 +- .../mineplex/hub/bonuses/BonusRepository.java | 4 +- .../bonuses/gui/buttons/RankBonusButton.java | 22 +- 15 files changed, 922 insertions(+), 39 deletions(-) create mode 100644 Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java create mode 100644 Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java create mode 100644 Plugins/Mineplex.Database/src/mineplex/database/tables/records/ChatsnapRecord.java diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index 0a635917b..2e4d3e99b 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -5,8 +5,6 @@ - - diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Account.java b/Plugins/Mineplex.Database/src/mineplex/database/Account.java index 9e66bafa8..745edad55 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/Account.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/Account.java @@ -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 = 625106486; + private static final long serialVersionUID = 2034846771; /** * The reference instance of Account @@ -54,6 +54,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.Bonus.bonus, + mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanMember.clanMember, diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Keys.java b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java index 4eb24c54d..58b66870c 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/Keys.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java @@ -34,6 +34,7 @@ public class Keys { public static final org.jooq.Identity IDENTITY_accountTasks = Identities0.IDENTITY_accountTasks; public static final org.jooq.Identity IDENTITY_accountTransactions = Identities0.IDENTITY_accountTransactions; public static final org.jooq.Identity IDENTITY_bonus = Identities0.IDENTITY_bonus; + public static final org.jooq.Identity IDENTITY_chatsnap = Identities0.IDENTITY_chatsnap; public static final org.jooq.Identity IDENTITY_clanAlliances = Identities0.IDENTITY_clanAlliances; public static final org.jooq.Identity IDENTITY_clanEnemies = Identities0.IDENTITY_clanEnemies; public static final org.jooq.Identity IDENTITY_clans = Identities0.IDENTITY_clans; @@ -83,6 +84,7 @@ public class Keys { public static final org.jooq.UniqueKey KEY_accountTransactions_PRIMARY = UniqueKeys0.KEY_accountTransactions_PRIMARY; public static final org.jooq.UniqueKey KEY_activeTournaments_PRIMARY = UniqueKeys0.KEY_activeTournaments_PRIMARY; public static final org.jooq.UniqueKey KEY_bonus_PRIMARY = UniqueKeys0.KEY_bonus_PRIMARY; + public static final org.jooq.UniqueKey KEY_chatsnap_PRIMARY = UniqueKeys0.KEY_chatsnap_PRIMARY; public static final org.jooq.UniqueKey KEY_clanAlliances_PRIMARY = UniqueKeys0.KEY_clanAlliances_PRIMARY; public static final org.jooq.UniqueKey KEY_clanEnemies_PRIMARY = UniqueKeys0.KEY_clanEnemies_PRIMARY; public static final org.jooq.UniqueKey KEY_clanEnemies_unique_clanId = UniqueKeys0.KEY_clanEnemies_unique_clanId; @@ -175,6 +177,7 @@ public class Keys { public static org.jooq.Identity IDENTITY_accountTasks = createIdentity(mineplex.database.tables.AccountTasks.accountTasks, mineplex.database.tables.AccountTasks.accountTasks.id); public static org.jooq.Identity IDENTITY_accountTransactions = createIdentity(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id); public static org.jooq.Identity IDENTITY_bonus = createIdentity(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId); + public static org.jooq.Identity IDENTITY_chatsnap = createIdentity(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id); public static org.jooq.Identity IDENTITY_clanAlliances = createIdentity(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id); public static org.jooq.Identity IDENTITY_clanEnemies = createIdentity(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id); public static org.jooq.Identity IDENTITY_clans = createIdentity(mineplex.database.tables.Clans.clans, mineplex.database.tables.Clans.clans.id); @@ -222,6 +225,7 @@ public class Keys { public static final org.jooq.UniqueKey KEY_accountTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id); public static final org.jooq.UniqueKey KEY_activeTournaments_PRIMARY = createUniqueKey(mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.ActiveTournaments.activeTournaments.name); public static final org.jooq.UniqueKey KEY_bonus_PRIMARY = createUniqueKey(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId); + public static final org.jooq.UniqueKey KEY_chatsnap_PRIMARY = createUniqueKey(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id); public static final org.jooq.UniqueKey KEY_clanAlliances_PRIMARY = createUniqueKey(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id); public static final org.jooq.UniqueKey KEY_clanEnemies_PRIMARY = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id); public static final org.jooq.UniqueKey KEY_clanEnemies_unique_clanId = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.clanId); diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Routines.java b/Plugins/Mineplex.Database/src/mineplex/database/Routines.java index 21ae7415e..9a5c0f4de 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/Routines.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/Routines.java @@ -54,6 +54,19 @@ public class Routines { return p; } + /** + * Call Account.check_vote + */ + public static mineplex.database.routines.Check_vote callCheckVote(org.jooq.Configuration configuration, java.lang.Integer accountId_in, java.lang.Integer coinsChange, java.lang.Integer gemsChange) { + mineplex.database.routines.Check_vote p = new mineplex.database.routines.Check_vote(); + p.setAccountId_in(accountId_in); + p.setCoinsChange(coinsChange); + p.setGemsChange(gemsChange); + + p.execute(configuration); + return p; + } + /** * Call Account.createLeaderboard */ diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Tables.java b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java index 36f9b2e67..6036ed719 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/Tables.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java @@ -91,6 +91,11 @@ public class Tables { */ public static final mineplex.database.tables.Bonus bonus = mineplex.database.tables.Bonus.bonus; + /** + * The table Account.chatsnap + */ + public static final mineplex.database.tables.Chatsnap chatsnap = mineplex.database.tables.Chatsnap.chatsnap; + /** * The table Account.clanAlliances */ diff --git a/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java b/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java new file mode 100644 index 000000000..847580a4c --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java @@ -0,0 +1,93 @@ +/** + * 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 Check_vote extends org.jooq.impl.AbstractRoutine implements java.io.Serializable, java.lang.Cloneable { + + private static final long serialVersionUID = 2035299030; + + /** + * The parameter Account.check_vote.accountId_in. + */ + public static final org.jooq.Parameter accountId_in = createParameter("accountId_in", org.jooq.impl.SQLDataType.INTEGER, false); + + /** + * The parameter Account.check_vote.coinsChange. + */ + public static final org.jooq.Parameter coinsChange = createParameter("coinsChange", org.jooq.impl.SQLDataType.INTEGER, false); + + /** + * The parameter Account.check_vote.gemsChange. + */ + public static final org.jooq.Parameter gemsChange = createParameter("gemsChange", org.jooq.impl.SQLDataType.INTEGER, false); + + /** + * The parameter Account.check_vote.pass. + */ + public static final org.jooq.Parameter pass = createParameter("pass", org.jooq.impl.SQLDataType.TINYINT, false); + + /** + * The parameter Account.check_vote.outTime. + */ + public static final org.jooq.Parameter outTime = createParameter("outTime", org.jooq.impl.SQLDataType.DATE, false); + + /** + * Create a new routine call instance + */ + public Check_vote() { + super("check_vote", mineplex.database.Account.Account); + + addInParameter(accountId_in); + addInParameter(coinsChange); + addInParameter(gemsChange); + addOutParameter(pass); + addOutParameter(outTime); + } + + /** + * Set the accountId_in parameter IN value to the routine + */ + public void setAccountId_in(java.lang.Integer value) { + setValue(mineplex.database.routines.Check_vote.accountId_in, value); + } + + /** + * Set the coinsChange parameter IN value to the routine + */ + public void setCoinsChange(java.lang.Integer value) { + setValue(mineplex.database.routines.Check_vote.coinsChange, value); + } + + /** + * Set the gemsChange parameter IN value to the routine + */ + public void setGemsChange(java.lang.Integer value) { + setValue(mineplex.database.routines.Check_vote.gemsChange, value); + } + + /** + * Get the pass parameter OUT value from the routine + */ + public java.lang.Byte getPass() { + return getValue(pass); + } + + /** + * Get the outTime parameter OUT value from the routine + */ + public java.sql.Date getOutTime() { + return getValue(outTime); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java index fead0616c..a73aa75b4 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java @@ -16,7 +16,7 @@ package mineplex.database.tables; @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class AccountStat extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { - private static final long serialVersionUID = 956897097; + private static final long serialVersionUID = 34581219; /** * The reference instance of Account.accountStat @@ -44,7 +44,7 @@ public class AccountStat extends org.jooq.impl.TableImplAccount.accountStat.value. */ - public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.BIGINT.defaulted(true), this, ""); + public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.BIGINTUNSIGNED.defaulted(true), this, ""); /** * Create a Account.accountStat table reference diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java index a2acbbbb5..93914d875 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java @@ -16,7 +16,7 @@ package mineplex.database.tables; @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Bonus extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { - private static final long serialVersionUID = -70389593; + private static final long serialVersionUID = -524321170; /** * The reference instance of Account.bonus @@ -46,6 +46,36 @@ public class Bonus extends org.jooq.impl.TableImpl ranktime = createField("ranktime", org.jooq.impl.SQLDataType.DATE, this, ""); + /** + * The column Account.bonus.votetime. + */ + public final org.jooq.TableField votetime = createField("votetime", org.jooq.impl.SQLDataType.DATE, this, ""); + + /** + * The column Account.bonus.dailyStreak. + */ + public final org.jooq.TableField dailyStreak = createField("dailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.bonus.maxDailyStreak. + */ + public final org.jooq.TableField maxDailyStreak = createField("maxDailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.bonus.voteStreak. + */ + public final org.jooq.TableField voteStreak = createField("voteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.bonus.maxVoteStreak. + */ + public final org.jooq.TableField maxVoteStreak = createField("maxVoteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.bonus.tickets. + */ + public final org.jooq.TableField tickets = createField("tickets", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** * Create a Account.bonus table reference */ diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java new file mode 100644 index 000000000..044ee5e36 --- /dev/null +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java @@ -0,0 +1,129 @@ +/** + * This class is generated by jOOQ + */ +package mineplex.database.tables; + +/** + * This class is generated by jOOQ. + */ +@javax.annotation.Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.5.2" + }, + comments = "This class is generated by jOOQ" +) +@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Chatsnap extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable { + + private static final long serialVersionUID = -176946707; + + /** + * The reference instance of Account.chatsnap + */ + public static final mineplex.database.tables.Chatsnap chatsnap = new mineplex.database.tables.Chatsnap(); + + /** + * The class holding records for this type + */ + @Override + public java.lang.Class getRecordType() { + return mineplex.database.tables.records.ChatsnapRecord.class; + } + + /** + * The column Account.chatsnap.id. + */ + public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.chatsnap.reporterId. + */ + public final org.jooq.TableField reporterId = createField("reporterId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.chatsnap.reporteeId. + */ + public final org.jooq.TableField reporteeId = createField("reporteeId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column Account.chatsnap.time. + */ + public final org.jooq.TableField time = createField("time", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, ""); + + /** + * The column Account.chatsnap.status. + */ + public final org.jooq.TableField status = createField("status", org.jooq.impl.SQLDataType.VARCHAR.length(10).nullable(false).defaulted(true), this, ""); + + /** + * The column Account.chatsnap.reason. + */ + public final org.jooq.TableField reason = createField("reason", org.jooq.impl.SQLDataType.CLOB.length(65535).nullable(false), this, ""); + + /** + * The column Account.chatsnap.data. + */ + public final org.jooq.TableField data = createField("data", org.jooq.impl.SQLDataType.CLOB.length(16777215).nullable(false), this, ""); + + /** + * Create a Account.chatsnap table reference + */ + public Chatsnap() { + this("chatsnap", null); + } + + /** + * Create an aliased Account.chatsnap table reference + */ + public Chatsnap(java.lang.String alias) { + this(alias, mineplex.database.tables.Chatsnap.chatsnap); + } + + private Chatsnap(java.lang.String alias, org.jooq.Table aliased) { + this(alias, aliased, null); + } + + private Chatsnap(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field[] parameters) { + super(alias, mineplex.database.Account.Account, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Identity getIdentity() { + return mineplex.database.Keys.IDENTITY_chatsnap; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.UniqueKey getPrimaryKey() { + return mineplex.database.Keys.KEY_chatsnap_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public java.util.List> getKeys() { + return java.util.Arrays.>asList(mineplex.database.Keys.KEY_chatsnap_PRIMARY); + } + + /** + * {@inheritDoc} + */ + @Override + public mineplex.database.tables.Chatsnap as(java.lang.String alias) { + return new mineplex.database.tables.Chatsnap(alias, this); + } + + /** + * Rename this table + */ + public mineplex.database.tables.Chatsnap rename(java.lang.String name) { + return new mineplex.database.tables.Chatsnap(name, null); + } +} diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java index 83dc0a684..df8d59c6e 100644 --- a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java +++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java @@ -14,9 +14,9 @@ package mineplex.database.tables.records; comments = "This class is generated by jOOQ" ) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 { +public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 { - private static final long serialVersionUID = 1109290129; + private static final long serialVersionUID = -516667486; /** * Setter for Account.accountStat.accountId. @@ -49,15 +49,15 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImplAccount.accountStat.value. */ - public void setValue(java.lang.Long value) { + public void setValue(org.jooq.types.ULong value) { setValue(2, value); } /** * Getter for Account.accountStat.value. */ - public java.lang.Long getValue() { - return (java.lang.Long) getValue(2); + public org.jooq.types.ULong getValue() { + return (org.jooq.types.ULong) getValue(2); } // ------------------------------------------------------------------------- @@ -80,7 +80,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl fieldsRow() { + public org.jooq.Row3 fieldsRow() { return (org.jooq.Row3) super.fieldsRow(); } @@ -88,7 +88,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl valuesRow() { + public org.jooq.Row3 valuesRow() { return (org.jooq.Row3) super.valuesRow(); } @@ -112,7 +112,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl field3() { + public org.jooq.Field field3() { return mineplex.database.tables.AccountStat.accountStat.value; } @@ -136,7 +136,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 { +public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9 { - private static final long serialVersionUID = -64019858; + private static final long serialVersionUID = -785434679; /** * Setter for Account.bonus.accountId. @@ -60,6 +60,90 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImplAccount.bonus.votetime. + */ + public void setVotetime(java.sql.Date value) { + setValue(3, value); + } + + /** + * Getter for Account.bonus.votetime. + */ + public java.sql.Date getVotetime() { + return (java.sql.Date) getValue(3); + } + + /** + * Setter for Account.bonus.dailyStreak. + */ + public void setDailyStreak(java.lang.Integer value) { + setValue(4, value); + } + + /** + * Getter for Account.bonus.dailyStreak. + */ + public java.lang.Integer getDailyStreak() { + return (java.lang.Integer) getValue(4); + } + + /** + * Setter for Account.bonus.maxDailyStreak. + */ + public void setMaxDailyStreak(java.lang.Integer value) { + setValue(5, value); + } + + /** + * Getter for Account.bonus.maxDailyStreak. + */ + public java.lang.Integer getMaxDailyStreak() { + return (java.lang.Integer) getValue(5); + } + + /** + * Setter for Account.bonus.voteStreak. + */ + public void setVoteStreak(java.lang.Integer value) { + setValue(6, value); + } + + /** + * Getter for Account.bonus.voteStreak. + */ + public java.lang.Integer getVoteStreak() { + return (java.lang.Integer) getValue(6); + } + + /** + * Setter for Account.bonus.maxVoteStreak. + */ + public void setMaxVoteStreak(java.lang.Integer value) { + setValue(7, value); + } + + /** + * Getter for Account.bonus.maxVoteStreak. + */ + public java.lang.Integer getMaxVoteStreak() { + return (java.lang.Integer) getValue(7); + } + + /** + * Setter for Account.bonus.tickets. + */ + public void setTickets(java.lang.Integer value) { + setValue(8, value); + } + + /** + * Getter for Account.bonus.tickets. + */ + public java.lang.Integer getTickets() { + return (java.lang.Integer) getValue(8); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -73,23 +157,23 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl fieldsRow() { - return (org.jooq.Row3) super.fieldsRow(); + public org.jooq.Row9 fieldsRow() { + return (org.jooq.Row9) super.fieldsRow(); } /** * {@inheritDoc} */ @Override - public org.jooq.Row3 valuesRow() { - return (org.jooq.Row3) super.valuesRow(); + public org.jooq.Row9 valuesRow() { + return (org.jooq.Row9) super.valuesRow(); } /** @@ -116,6 +200,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl field4() { + return mineplex.database.tables.Bonus.bonus.votetime; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.Bonus.bonus.dailyStreak; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.Bonus.bonus.maxDailyStreak; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.Bonus.bonus.voteStreak; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field8() { + return mineplex.database.tables.Bonus.bonus.maxVoteStreak; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field9() { + return mineplex.database.tables.Bonus.bonus.tickets; + } + /** * {@inheritDoc} */ @@ -140,6 +272,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record7 { + + private static final long serialVersionUID = 2087133341; + + /** + * Setter for Account.chatsnap.id. + */ + public void setId(java.lang.Integer value) { + setValue(0, value); + } + + /** + * Getter for Account.chatsnap.id. + */ + public java.lang.Integer getId() { + return (java.lang.Integer) getValue(0); + } + + /** + * Setter for Account.chatsnap.reporterId. + */ + public void setReporterId(java.lang.Integer value) { + setValue(1, value); + } + + /** + * Getter for Account.chatsnap.reporterId. + */ + public java.lang.Integer getReporterId() { + return (java.lang.Integer) getValue(1); + } + + /** + * Setter for Account.chatsnap.reporteeId. + */ + public void setReporteeId(java.lang.Integer value) { + setValue(2, value); + } + + /** + * Getter for Account.chatsnap.reporteeId. + */ + public java.lang.Integer getReporteeId() { + return (java.lang.Integer) getValue(2); + } + + /** + * Setter for Account.chatsnap.time. + */ + public void setTime(java.sql.Timestamp value) { + setValue(3, value); + } + + /** + * Getter for Account.chatsnap.time. + */ + public java.sql.Timestamp getTime() { + return (java.sql.Timestamp) getValue(3); + } + + /** + * Setter for Account.chatsnap.status. + */ + public void setStatus(java.lang.String value) { + setValue(4, value); + } + + /** + * Getter for Account.chatsnap.status. + */ + public java.lang.String getStatus() { + return (java.lang.String) getValue(4); + } + + /** + * Setter for Account.chatsnap.reason. + */ + public void setReason(java.lang.String value) { + setValue(5, value); + } + + /** + * Getter for Account.chatsnap.reason. + */ + public java.lang.String getReason() { + return (java.lang.String) getValue(5); + } + + /** + * Setter for Account.chatsnap.data. + */ + public void setData(java.lang.String value) { + setValue(6, value); + } + + /** + * Getter for Account.chatsnap.data. + */ + public java.lang.String getData() { + return (java.lang.String) getValue(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Record1 key() { + return (org.jooq.Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row7 fieldsRow() { + return (org.jooq.Row7) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Row7 valuesRow() { + return (org.jooq.Row7) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field1() { + return mineplex.database.tables.Chatsnap.chatsnap.id; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field2() { + return mineplex.database.tables.Chatsnap.chatsnap.reporterId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field3() { + return mineplex.database.tables.Chatsnap.chatsnap.reporteeId; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field4() { + return mineplex.database.tables.Chatsnap.chatsnap.time; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field5() { + return mineplex.database.tables.Chatsnap.chatsnap.status; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field6() { + return mineplex.database.tables.Chatsnap.chatsnap.reason; + } + + /** + * {@inheritDoc} + */ + @Override + public org.jooq.Field field7() { + return mineplex.database.tables.Chatsnap.chatsnap.data; + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value2() { + return getReporterId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.Integer value3() { + return getReporteeId(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.sql.Timestamp value4() { + return getTime(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value5() { + return getStatus(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value6() { + return getReason(); + } + + /** + * {@inheritDoc} + */ + @Override + public java.lang.String value7() { + return getData(); + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value1(java.lang.Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value2(java.lang.Integer value) { + setReporterId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value3(java.lang.Integer value) { + setReporteeId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value4(java.sql.Timestamp value) { + setTime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value5(java.lang.String value) { + setStatus(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value6(java.lang.String value) { + setReason(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord value7(java.lang.String value) { + setData(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ChatsnapRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.sql.Timestamp value4, java.lang.String value5, java.lang.String value6, java.lang.String value7) { + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ChatsnapRecord + */ + public ChatsnapRecord() { + super(mineplex.database.tables.Chatsnap.chatsnap); + } + + /** + * Create a detached, initialised ChatsnapRecord + */ + public ChatsnapRecord(java.lang.Integer id, java.lang.Integer reporterId, java.lang.Integer reporteeId, java.sql.Timestamp time, java.lang.String status, java.lang.String reason, java.lang.String data) { + super(mineplex.database.tables.Chatsnap.chatsnap); + + setValue(0, id); + setValue(1, reporterId); + setValue(2, reporteeId); + setValue(3, time); + setValue(4, status); + setValue(5, reason); + setValue(6, data); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusAmount.java b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusAmount.java index 2cbe8403a..f3ad6025a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusAmount.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusAmount.java @@ -93,6 +93,11 @@ public class BonusAmount return getGems() + getBonusGems(); } + public boolean isGreaterThanZero() + { + return _bonusCoins > 0 || _coins > 0 || _bonusGems > 0 || _gems > 0 || _gold > 0 || _bonusGold > 0; + } + public void addLore(List lore) { addLore(lore, getCoins(), getBonusCoins(), "Coins"); @@ -104,9 +109,9 @@ public class BonusAmount { if (amount > 0) { - lore.add(C.cYellow + "Reward " + C.cWhite + amount + " " + suffix); + lore.add(C.cYellow + "Reward: " + C.cWhite + amount + " " + suffix); if (bonus > 0) - lore.add(C.cYellow + "Streak Bonus " + C.cWhite + bonus + " " + suffix); + lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + bonus + " " + suffix); lore.add(" "); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusRepository.java b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusRepository.java index 61db50951..f789c3c4c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusRepository.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/BonusRepository.java @@ -142,7 +142,7 @@ public class BonusRepository extends RepositoryBase { return; } final int accountId = _manager.getClientManager().Get(player).getAccountId(); - final int coins = _manager.getRankBonusAmount(player); + final int coins = _manager.getRankBonusAmount(player).getCoins(); final int gems = 0; @@ -228,7 +228,7 @@ public class BonusRepository extends RepositoryBase { return; } final int accountId = _manager.getClientManager().Get(player).getAccountId(); - final int coins = _manager.getRankBonusAmount(player); + final int coins = _manager.getRankBonusAmount(player).getCoins(); final int gems = 0; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/gui/buttons/RankBonusButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/gui/buttons/RankBonusButton.java index 1178b594f..547df3f4a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/gui/buttons/RankBonusButton.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/bonuses/gui/buttons/RankBonusButton.java @@ -58,7 +58,7 @@ public class RankBonusButton implements GuiItem, Listener { @Override public void setup() { - if (_bonusManager.getRankBonusAmount(getPlayer()) > 0) + if (_bonusManager.getRankBonusAmount(getPlayer()).isGreaterThanZero()) { this.hasRank = true; this.bonusTime = _bonusManager.nextRankBonus(getPlayer()); @@ -143,7 +143,7 @@ public class RankBonusButton implements GuiItem, Listener { public void setItem() { - ArrayList lore = new ArrayList; + ArrayList lore = new ArrayList(); Material material; String itemName; byte data = 0; @@ -163,12 +163,18 @@ public class RankBonusButton implements GuiItem, Listener { if (isAvailable()) { material = Material.ENDER_CHEST; - itemName = C.cGreen + C.Bold + "Click to Claim!"; + itemName = C.cGreen + C.Bold + "Rank Bonus"; + + lore.add(" "); + lore.add(ChatColor.RESET + "Click to Claim!"); } else { material = Material.REDSTONE_BLOCK; - itemName = C.cRed + C.Bold + "Next reward in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!"; + itemName = C.cRed + C.Bold + "Rank Bonus"; + + lore.add(" "); + lore.add(ChatColor.RESET + "Next reward in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!"); } lore.add(" "); @@ -178,11 +184,11 @@ public class RankBonusButton implements GuiItem, Listener { BonusAmount bonusAmount = _bonusManager.getRankBonusAmount(_player); bonusAmount.addLore(lore); - lore.add(C.cYellow + "Current Streak " + C.cWhite + client.getRankStreak()); - lore.add(C.cYellow + "Highest Streak " + C.cWhite + client.getMaxRankStreak()); + lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getRankStreak()); + lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxRankStreak()); lore.add(" "); - lore.add(C.cYellow + "Record Holder " + C.cWhite + "Phinary"); - lore.add(C.cYellow + "Streak " + C.cWhite + "420"); + lore.add(C.cYellow + "Record Holder: " + C.cWhite + "Phinary"); + lore.add(C.cYellow + "Streak: " + C.cWhite + "420"); _item = ItemStackFactory.Instance.CreateStack(Material.ENDER_CHEST, (byte) 0, 1, ChatColor.GREEN + "Click to collect rank bonus!"); }