2.6.13 - Added Apache Commons Lang3 and Text. More 1.19 fixes.

This commit is contained in:
Fernando Pettinelli 2022-06-26 12:27:20 -04:00
parent b110a69285
commit 2929c628ed
30 changed files with 63 additions and 53 deletions

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,6 +1,6 @@
package com.songoda.core.compatibility; package com.songoda.core.compatibility;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
public enum ServerProject { public enum ServerProject {

View File

@ -1,6 +1,6 @@
package com.songoda.core.compatibility; package com.songoda.core.compatibility;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
public enum ServerVersion { public enum ServerVersion {

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -65,14 +65,6 @@
<shadedArtifactAttached>false</shadedArtifactAttached> <shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom> <createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>com.songoda:*</include>
<include>com.zaxxer:HikariCP</include>
<include>de.tr7zw:item-nbt-api</include>
</includes>
</artifactSet>
<relocations> <relocations>
<relocation> <relocation>
<pattern>com.zaxxer</pattern> <pattern>com.zaxxer</pattern>
@ -83,20 +75,22 @@
<pattern>de.tr7zw.changeme.nbtapi</pattern> <pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>com.songoda.core.third_party.de.tr7zw.nbtapi</shadedPattern> <shadedPattern>com.songoda.core.third_party.de.tr7zw.nbtapi</shadedPattern>
</relocation> </relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>com.songoda.core.third_party.org.apache.commons</shadedPattern>
</relocation>
</relocations> </relocations>
<filters> <artifactSet>
<filter>
<artifact>*:*</artifact>
<includes> <includes>
<include>com/</include> <include>com.songoda:*</include>
<include>de/tr7zw/</include> <include>com.zaxxer:HikariCP</include>
<include>META-INF/MANIFEST.MF</include> <include>org.apache.commons:commons-text</include>
<include>META-INF/maven/com.songoda/SongodaCore/</include> <include>org.apache.commons:commons-lang3</include>
<include>de.tr7zw:item-nbt-api</include>
</includes> </includes>
</filter> </artifactSet>
</filters>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
@ -122,7 +116,7 @@
<dependency> <dependency>
<groupId>de.tr7zw</groupId> <groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId> <artifactId>item-nbt-api</artifactId>
<version>2.9.2</version> <version>2.10.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -53,7 +53,7 @@ public class SongodaCore {
/** /**
* @since coreRevision 6 * @since coreRevision 6
*/ */
private final static String coreVersion = "2.6.13-DEV"; private final static String coreVersion = "2.6.13";
/** /**
* This is specific to the website api * This is specific to the website api

View File

@ -226,7 +226,9 @@ public class ChatMessage {
textList.addAll(this.textList); textList.addAll(this.textList);
Object packet; Object packet;
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_19)) {
packet = mc_PacketPlayOutChat_new.newInstance(mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)), 0);
}else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) {
packet = mc_PacketPlayOutChat_new.newInstance( packet = mc_PacketPlayOutChat_new.newInstance(
mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)), mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)),
mc_chatMessageType_Chat.get(null), mc_chatMessageType_Chat.get(null),
@ -272,9 +274,11 @@ public class ChatMessage {
mc_IChatBaseComponent = ClassMapping.I_CHAT_BASE_COMPONENT.getClazz(); mc_IChatBaseComponent = ClassMapping.I_CHAT_BASE_COMPONENT.getClazz();
mc_IChatBaseComponent_ChatSerializer = ClassMapping.I_CHAT_BASE_COMPONENT.getClazz("ChatSerializer"); mc_IChatBaseComponent_ChatSerializer = ClassMapping.I_CHAT_BASE_COMPONENT.getClazz("ChatSerializer");
mc_IChatBaseComponent_ChatSerializer_a = mc_IChatBaseComponent_ChatSerializer.getMethod("a", String.class); mc_IChatBaseComponent_ChatSerializer_a = mc_IChatBaseComponent_ChatSerializer.getMethod("a", String.class);
mc_PacketPlayOutChat = ClassMapping.PACKET_PLAY_OUT_CHAT.getClazz(); mc_PacketPlayOutChat = ServerVersion.isServerVersionAtLeast(ServerVersion.V1_19) ? ClassMapping.CLIENTBOUND_SYSTEM_CHAT.getClazz() : ClassMapping.PACKET_PLAY_OUT_CHAT.getClazz();
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_19)) {
mc_PacketPlayOutChat_new = mc_PacketPlayOutChat.getConstructor(mc_IChatBaseComponent, Integer.TYPE);
} else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) {
mc_ChatMessageType = ClassMapping.CHAT_MESSAGE_TYPE.getClazz(); mc_ChatMessageType = ClassMapping.CHAT_MESSAGE_TYPE.getClazz();
mc_chatMessageType_Chat = mc_ChatMessageType.getField(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_17) ? "a" : "CHAT"); mc_chatMessageType_Chat = mc_ChatMessageType.getField(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_17) ? "a" : "CHAT");
mc_PacketPlayOutChat_new = mc_PacketPlayOutChat.getConstructor(mc_IChatBaseComponent, mc_ChatMessageType, UUID.class); mc_PacketPlayOutChat_new = mc_PacketPlayOutChat.getConstructor(mc_IChatBaseComponent, mc_ChatMessageType, UUID.class);

View File

@ -1,7 +1,7 @@
package com.songoda.core.configuration; package com.songoda.core.configuration;
import com.songoda.core.utils.TextUtils; import com.songoda.core.utils.TextUtils;
import org.apache.commons.lang.Validate; import org.apache.commons.lang3.Validate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConstructor; import org.bukkit.configuration.file.YamlConstructor;

View File

@ -7,7 +7,7 @@ import com.songoda.core.compatibility.CompatibleHand;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.MethodMapping; import com.songoda.core.compatibility.MethodMapping;
import com.songoda.core.compatibility.ServerVersion; import com.songoda.core.compatibility.ServerVersion;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,7 +1,7 @@
package com.songoda.core.nms.world; package com.songoda.core.nms.world;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import org.apache.commons.lang.WordUtils; import org.apache.commons.text.WordUtils;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -19,7 +19,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -60,7 +60,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -60,7 +60,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

14
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId> <artifactId>SongodaCore-Modules</artifactId>
<version>2.6.13-DEV</version> <version>2.6.13</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z' to update version recursively --> <!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z' to update version recursively -->
@ -151,6 +151,18 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>