Skip to content

Commit

Permalink
5.1.2.5 1.20.2 Support (#406)
Browse files Browse the repository at this point in the history
* Using varchar(128) for world name in database

* Replace Rollbar token

* Fix event append issue for custom item display

* Add 1.20.2 Support

* Fix typo for limit comment

* Bump to 5.1.2.5

* Improve real display item message

* Bump de.tr7zw:item-nbt-api-plugin from 2.11.3 to 2.12.0 (#403)

Bumps de.tr7zw:item-nbt-api-plugin from 2.11.3 to 2.12.0.

---
updated-dependencies:
- dependency-name: de.tr7zw:item-nbt-api-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump me.clip:placeholderapi from 2.11.2 to 2.11.4 (#404)

Bumps me.clip:placeholderapi from 2.11.2 to 2.11.4.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.spigotmc:spigot-api (#405)

Bumps org.spigotmc:spigot-api from 1.20.1-R0.1-SNAPSHOT to 1.20.2-R0.1-SNAPSHOT.

---
updated-dependencies:
- dependency-name: org.spigotmc:spigot-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
sandtechnology authored Oct 3, 2023
1 parent dc77f81 commit 63291ca
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<artifactId>QuickShop</artifactId>

<properties>
<pluginver>5.1.2.4</pluginver>
<pluginver>5.1.2.5</pluginver>
<package>org.maxgamer.quickshop</package>
<developer>Ghost-chu</developer>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -565,7 +565,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.2</version>
<version>2.11.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -627,7 +627,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -886,7 +886,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.11.3</version>
<version>2.12.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/maxgamer/quickshop/QuickShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
@Nullable
private AbstractEconomy economy;
/**
* Whether or not to limit players shop amounts
* Whether to limit players shop amounts
*/
private boolean limit = false;
@Nullable
Expand Down Expand Up @@ -500,7 +500,7 @@ private void load3rdParty() {
}
}
if (AbstractDisplayItem.getNowUsing() == DisplayType.REALITEM) {
getLogger().warning("You're using Real Display system and that may cause your server lagg, switch to Virtual Display system if you can!");
getLogger().warning("You're using Real Display system and that may cause your server lagg, switch to Virtual Display system if you can! (Checkout display-type option in config.yml)");
Plugin clearLagPlugin = Bukkit.getPluginManager().getPlugin("ClearLag");
if (clearLagPlugin != null && Util.verifyClassLoader(clearLagPlugin)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,13 @@ private ComponentBuilder append(BaseComponent component, ComponentBuilder.Format
if (component.isReset() && retention == ComponentBuilder.FormatRetention.ALL) {
retention = ComponentBuilder.FormatRetention.EVENTS;
}

//Hacky method to replace dummy components
if (previous == null && builder.getCursor() == -1) {
previous = new TextComponent("");
builder.append(previous);
}

if (previous != null && (!component.isReset() || retention == ComponentBuilder.FormatRetention.EVENTS)) {
component.copyFormatting(previous, retention, false);
parts.add(component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ private void init() throws SQLException {
*/

private void createShopsTable() {
String sqlString = "CREATE TABLE " + manager.getDatabase().getTablePrefix() + "shops (owner VARCHAR(255) NOT NULL, price double(32, 2) NOT NULL, itemConfig TEXT CHARSET utf8 NOT NULL, x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(32) NOT NULL, unlimited boolean, type boolean, PRIMARY KEY (x, y, z, world) );";
String sqlString = "CREATE TABLE " + manager.getDatabase().getTablePrefix() + "shops (owner VARCHAR(255) NOT NULL, price double(32, 2) NOT NULL, itemConfig TEXT CHARSET utf8 NOT NULL, x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(128) NOT NULL, unlimited boolean, type boolean, PRIMARY KEY (x, y, z, world) );";
if (manager.getDatabase() instanceof MySQLCore) {
sqlString = "CREATE TABLE " + manager.getDatabase().getTablePrefix() + "shops (owner VARCHAR(255) NOT NULL, price double(32, 2) NOT NULL, itemConfig TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(32) NOT NULL, unlimited boolean, type boolean, PRIMARY KEY (x, y, z, world) );";
sqlString = "CREATE TABLE " + manager.getDatabase().getTablePrefix() + "shops (owner VARCHAR(255) NOT NULL, price double(32, 2) NOT NULL, itemConfig TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(128) NOT NULL, unlimited boolean, type boolean, PRIMARY KEY (x, y, z, world) );";
}
manager.runInstantTask(new DatabaseTask(sqlString));
}
Expand Down Expand Up @@ -111,7 +111,7 @@ private void createLogsTable() {

private void createExternalCacheTable() {
String createTable = "CREATE TABLE " + manager.getDatabase().getTablePrefix()
+ "external_cache (x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(32) NOT NULL, PRIMARY KEY (x, y, z, world));";
+ "external_cache (x INTEGER(32) NOT NULL, y INTEGER(32) NOT NULL, z INTEGER(32) NOT NULL, world VARCHAR(128) NOT NULL, PRIMARY KEY (x, y, z, world));";
manager.runInstantTask(new DatabaseTask(createTable));
createColumn("external_cache", "space", new DataType(DataTypeMapping.INT, null));
createColumn("external_cache", "stock", new DataType(DataTypeMapping.INT, null));
Expand Down Expand Up @@ -151,6 +151,9 @@ public void onFailed(SQLException e) {
manager.runInstantTask(new DatabaseTask("ALTER TABLE " + manager.getDatabase().getTablePrefix() + "shops TO CHARACTER SET uft8mb4 COLLATE utf8mb4_general_ci", checkTask));
manager.runInstantTask(new DatabaseTask("ALTER TABLE " + manager.getDatabase().getTablePrefix() + "messages TO CHARACTER SET uft8mb4 COLLATE utf8mb4_general_ci", checkTask));
manager.runInstantTask(new DatabaseTask("ALTER TABLE " + manager.getDatabase().getTablePrefix() + "history TO CHARACTER SET uft8mb4 COLLATE utf8mb4_general_ci", checkTask));
//Using varchar 128 for world name
manager.runInstantTask(new DatabaseTask("ALTER TABLE " + manager.getDatabase().getTablePrefix() + "shops MODIFY COLUMN world VARCHAR(128)", checkTask));
manager.runInstantTask(new DatabaseTask("ALTER TABLE " + manager.getDatabase().getTablePrefix() + "external_cache MODIFY COLUMN world VARCHAR(128)", checkTask));
}
plugin.getLogger().info("Finished!");
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/maxgamer/quickshop/util/GameVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public enum GameVersion {
v1_19_R2(true, false, true, true, true, true),
v1_19_R3(true, false, true, true, true, true),
v1_20_R1(true, false, true, true, true, true),
v1_20_R2(true, false, true, true, true, true),

UNKNOWN(true, false, false, true, true, true);
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class RollbarErrorReporter implements IErrorReporter {

public RollbarErrorReporter(@NotNull QuickShop plugin) {
this.plugin = plugin;
Config config = ConfigBuilder.withAccessToken("164c5246fa464ae4a6a0867a856d4062")
Config config = ConfigBuilder.withAccessToken("c386df69d08440d9a3d982cf98b53ed6")
.environment(Util.isDevEdition() ? "development" : "production")
.platform(plugin.getServer().getVersion())
.codeVersion(QuickShop.getVersion())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static class IndexMetaHandler extends DefaultHandler {
@Override
public void endElement(String uri, String localName, String qName) {
switch (qName) {
case "latest":
case "release":
latestRelease = tempStr;
break;
case "lastUpdated":
Expand Down

0 comments on commit 63291ca

Please sign in to comment.