Skip to content

Commit 79fd92c

Browse files
committed
1.21.5 support
1 parent 428c2f9 commit 79fd92c

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

api/src/main/java/me/remigio07/chatplugin/api/common/util/Library.java

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ public enum Library {
4141
/**
4242
* Represents the <a href="https://docs.advntr.dev">Adventure API</a> library.
4343
*/
44-
ADVENTURE_API("Adventure API", "net.kyori.adventure.Adventure", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-api/4.18.0/adventure-api-4.18.0.jar", "adventure-api.jar"),
44+
ADVENTURE_API("Adventure API", "net.kyori.adventure.Adventure", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-api/4.20.0/adventure-api-4.20.0.jar", "adventure-api.jar"),
4545

4646
/**
4747
* Represents the <a href="https://docs.advntr.dev">Adventure Key</a> library.
4848
*/
49-
ADVENTURE_KEY("Adventure Key", "net.kyori.adventure.key.Key", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-key/4.18.0/adventure-key-4.18.0.jar", "adventure-key.jar"),
49+
ADVENTURE_KEY("Adventure Key", "net.kyori.adventure.key.Key", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-key/4.20.0/adventure-key-4.20.0.jar", "adventure-key.jar"),
5050

5151
/**
5252
* Represents the <a href="https://docs.advntr.dev">Adventure NBT</a> library.
5353
*/
54-
ADVENTURE_NBT("Adventure NBT", "net.kyori.adventure.nbt.BinaryTagLike", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-nbt/4.18.0/adventure-nbt-4.18.0.jar", "adventure-nbt.jar"),
54+
ADVENTURE_NBT("Adventure NBT", "net.kyori.adventure.nbt.BinaryTagLike", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-nbt/4.20.0/adventure-nbt-4.20.0.jar", "adventure-nbt.jar"),
5555

5656
/**
5757
* Represents the <a href="https://docs.advntr.dev">Adventure Platform API</a> library.
@@ -63,11 +63,6 @@ public enum Library {
6363
*/
6464
ADVENTURE_PLATFORM_BUKKIT("Adventure Platform Bukkit", "net.kyori.adventure.platform.bukkit.BukkitAudiences", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-platform-bukkit/4.3.4/adventure-platform-bukkit-4.3.4.jar", "adventure-platform-bukkit.jar"),
6565

66-
/**
67-
* Represents the <a href="https://docs.advntr.dev">Adventure Platform BungeeCord</a> library.
68-
*/
69-
ADVENTURE_PLATFORM_BUNGEECORD("Adventure Platform BungeeCord", "net.kyori.adventure.platform.bungeecord.BungeeAudiences", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-platform-bungeecord/4.3.4/adventure-platform-bungeecord-4.3.4.jar", "adventure-platform-bungeecord.jar"),
70-
7166
/**
7267
* Represents the <a href="https://docs.advntr.dev">Adventure Platform Facet</a> library.
7368
*/
@@ -78,35 +73,30 @@ public enum Library {
7873
*/
7974
ADVENTURE_PLATFORM_SPONGEAPI("Adventure Platform SpongeAPI", "net.kyori.adventure.platform.spongeapi.SpongeAudiences", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-platform-spongeapi/4.3.4/adventure-platform-spongeapi-4.3.4.jar", "adventure-platform-spongeapi.jar"),
8075

81-
/**
82-
* Represents the <a href="https://docs.advntr.dev">Adventure Platform Viaversion</a> library.
83-
*/
84-
ADVENTURE_PLATFORM_VIAVERSION("Adventure Platform Viaversion", "net.kyori.adventure.platform.viaversion.ViaFacet", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-platform-viaversion/4.3.4/adventure-platform-viaversion-4.3.4.jar", "adventure-platform-viaversion.jar"),
85-
8676
/**
8777
* Represents the <a href="https://docs.advntr.dev">Adventure Text Serializer Gson</a> library.
8878
*/
89-
ADVENTURE_TEXT_SERIALIZER_GSON("Adventure Text Serializer Gson", "net.kyori.adventure.text.serializer.gson.GsonComponentSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-gson/4.18.0/adventure-text-serializer-gson-4.18.0.jar", "adventure-text-serializer-gson.jar"),
79+
ADVENTURE_TEXT_SERIALIZER_GSON("Adventure Text Serializer Gson", "net.kyori.adventure.text.serializer.gson.GsonComponentSerializer", Relocation.KYORI_RELOCATION, "https://github.com/Remigio07/adventure/releases/download/v4.20.0/adventure-text-serializer-gson-4.20.0.jar", "adventure-text-serializer-gson.jar"),
9080

9181
/**
9282
* Represents the <a href="https://docs.advntr.dev">Adventure Text Serializer Gson Legacy Impl</a> library.
9383
*/
94-
ADVENTURE_TEXT_SERIALIZER_GSON_LEGACY_IMPL("Adventure Text Serializer Gson Legacy Impl", "net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-gson-legacy-impl/4.18.0/adventure-text-serializer-gson-legacy-impl-4.18.0.jar", "adventure-text-serializer-gson-legacy-impl.jar"),
84+
ADVENTURE_TEXT_SERIALIZER_GSON_LEGACY_IMPL("Adventure Text Serializer Gson Legacy Impl", "net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-gson-legacy-impl/4.20.0/adventure-text-serializer-gson-legacy-impl-4.20.0.jar", "adventure-text-serializer-gson-legacy-impl.jar"),
9585

9686
/**
9787
* Represents the <a href="https://docs.advntr.dev">Adventure Text Serializer JSON</a> library.
9888
*/
99-
ADVENTURE_TEXT_SERIALIZER_JSON("Adventure Text Serializer JSON", "net.kyori.adventure.text.serializer.json.JSONComponentSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-json/4.18.0/adventure-text-serializer-json-4.18.0.jar", "adventure-text-serializer-json.jar"),
89+
ADVENTURE_TEXT_SERIALIZER_JSON("Adventure Text Serializer JSON", "net.kyori.adventure.text.serializer.json.JSONComponentSerializer", Relocation.KYORI_RELOCATION, "https://github.com/Remigio07/adventure/releases/download/v4.20.0/adventure-text-serializer-json-4.20.0.jar", "adventure-text-serializer-json.jar"),
10090

10191
/**
10292
* Represents the <a href="https://docs.advntr.dev">Adventure Text Serializer JSON Legacy Impl</a> library.
10393
*/
104-
ADVENTURE_TEXT_SERIALIZER_JSON_LEGACY_IMPL("Adventure Text Serializer JSON Legacy Impl", "net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-json-legacy-impl/4.18.0/adventure-text-serializer-json-legacy-impl-4.18.0.jar", "adventure-text-serializer-json-legacy-impl.jar"),
94+
ADVENTURE_TEXT_SERIALIZER_JSON_LEGACY_IMPL("Adventure Text Serializer JSON Legacy Impl", "net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-json-legacy-impl/4.20.0/adventure-text-serializer-json-legacy-impl-4.20.0.jar", "adventure-text-serializer-json-legacy-impl.jar"),
10595

10696
/**
10797
* Represents the <a href="https://docs.advntr.dev">Adventure Text Serializer Legacy</a> library.
10898
*/
109-
ADVENTURE_TEXT_SERIALIZER_LEGACY("Adventure Text Serializer Legacy", "net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-legacy/4.18.0/adventure-text-serializer-legacy-4.18.0.jar", "adventure-text-serializer-legacy.jar"),
99+
ADVENTURE_TEXT_SERIALIZER_LEGACY("Adventure Text Serializer Legacy", "net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/adventure-text-serializer-legacy/4.20.0/adventure-text-serializer-legacy-4.20.0.jar", "adventure-text-serializer-legacy.jar"),
110100

111101
/**
112102
* Represents the <a href="https://commons.apache.org/proper/commons-codec/">Apache Commons Codec</a> library.
@@ -301,7 +291,7 @@ public enum Library {
301291
/**
302292
* Represents the <a href="https://github.com/KyoriPowered/option">Option</a> library.
303293
*/
304-
OPTION("Option", "net.kyori.option.Option", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/option/1.0.0/option-1.0.0.jar", "option.jar"),
294+
OPTION("Option", "net.kyori.option.Option", Relocation.KYORI_RELOCATION, "https://repo1.maven.org/maven2/net/kyori/option/1.1.0/option-1.1.0.jar", "option.jar"),
305295

306296
/**
307297
* Represents the <a href="https://www.slf4j.org/">SLF4J API</a> library.

api/src/main/java/me/remigio07/chatplugin/api/common/util/VersionUtils.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static boolean isFlameCord() {
198198
}
199199

200200
/**
201-
* Represents a Minecraft <em>release</em>.
201+
* Represents a Minecraft: Java Edition <em>release</em>.
202202
*/
203203
public enum Version { // dates are approximated to the release day's midnight time
204204

@@ -984,7 +984,15 @@ public enum Version { // dates are approximated to the release day's midnight ti
984984
* <p><strong>Protocol version number:</strong> 769
985985
* <br><strong>Release date:</strong> December 3, 2024</p>
986986
*/
987-
V1_21_4(769, 1733180400000L, "1.21.4");
987+
V1_21_4(769, 1733180400000L, "1.21.4"),
988+
989+
/**
990+
* Version <a href="https://minecraft.wiki/w/Java_Edition_1.21.5">1.21.5</a>.
991+
*
992+
* <p><strong>Protocol version number:</strong> 770
993+
* <br><strong>Release date:</strong> March 25, 2025</p>
994+
*/
995+
V1_21_5(770, 1742857200000L, "1.21.5");
988996

989997
private int protocol;
990998
private long releaseDate;

free/src/main/java/me/remigio07/chatplugin/common/util/LibrariesUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import me.remigio07.chatplugin.api.common.util.Library;
3030
import me.remigio07.chatplugin.api.common.util.Library.Relocation;
3131
import me.remigio07.chatplugin.api.common.util.MemoryUtils;
32+
import me.remigio07.chatplugin.api.common.util.VersionChange;
3233
import me.remigio07.chatplugin.api.common.util.manager.LogManager;
3334
import me.remigio07.chatplugin.bootstrap.IsolatedClassLoader;
3435
import me.remigio07.chatplugin.bootstrap.JARLibraryLoader;
@@ -53,7 +54,7 @@ public static void load(Library library) throws LibraryException {
5354
File file = getTarget(library);
5455

5556
if (file.exists()) {
56-
if (ConfigurationManager.getInstance().getLastVersionChange().isMinor())
57+
if (ConfigurationManager.getInstance().getLastVersionChange() != VersionChange.NULL)
5758
downloadFreshCopy("Updating {0} library (new plugin version detected)...", 0, library);
5859
else if (library.getMD5Hash() != null && !bytesToHexString(MessageDigest.getInstance("MD5").digest(Files.readAllBytes(getTarget(library).toPath()))).equals(library.getMD5Hash()))
5960
downloadFreshCopy("The {0} library's file is corrupted; downloading a fresh copy...", 1, library);

free/src/main/java/me/remigio07/chatplugin/common/util/Utils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ public static void initUtils() throws ChatPluginManagerException {
8080
if (!Environment.isProxy()) {
8181
for (Library library : ADVENTURE_LIBS)
8282
LibrariesUtils.load(library);
83-
if (Environment.isBukkit()) {
83+
if (Environment.isBukkit())
8484
LibrariesUtils.load(Library.ADVENTURE_PLATFORM_BUKKIT);
85-
LibrariesUtils.load(Library.ADVENTURE_PLATFORM_BUNGEECORD);
86-
LibrariesUtils.load(Library.ADVENTURE_PLATFORM_VIAVERSION);
87-
} else if (Environment.isSponge())
85+
else if (Environment.isSponge())
8886
LibrariesUtils.load(Library.ADVENTURE_PLATFORM_SPONGEAPI);
8987
} LibrariesUtils.load(Library.JSON_SIMPLE);
9088
} catch (LibraryException e) {

0 commit comments

Comments
 (0)