Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ spigot = "1.13-R0.1-SNAPSHOT"
placeholderapi = "2.12.2"
headdatabase-api = "1.3.2"
bstats = "3.1.0"
item-nbt-api = "2.15.5"
xseries = "13.6.0"
item-nbt-api = "2.15.7"
xseries = "13.6.0+26.1"
lombok = "1.18.44"
annotations = "26.1.0"
# Test
Expand All @@ -20,7 +20,7 @@ placeholderapi = { module = "me.clip:placeholderapi", version.ref = "placeholder
headdatabase-api = { module = "com.arcaniax:HeadDatabase-API", version.ref = "headdatabase-api" }
bstats-bukkit = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" }
item-nbt-api = { module = "de.tr7zw:item-nbt-api", version.ref = "item-nbt-api" }
xseries = { module = "com.github.cryptomorin:XSeries", version.ref = "xseries" }
xseries = { module = "io.github.almighty-satan:XSeries", version.ref = "xseries" }
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }
# Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ EntityPacketsBuilder withRemoveEntity(int entityId) {
}

private void sendPacket(Player player, Packet<?> packet) {
((CraftPlayer) player).getHandle().connection.sendPacket(packet);
// #sendPacket also exists, but Paper doesn't have that method
((CraftPlayer) player).getHandle().connection.send(packet);
}

private net.minecraft.world.item.ItemStack itemStackToNms(ItemStack itemStack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ static net.minecraft.world.entity.EntityType<?> findEntityTypes(EntityType entit
private static NamespacedKey getNamespacedKey(EntityType entityType) {
try {
// Using the deprecated #getKey method because #getKeyOrThrow and #getKeyOrNull don't exist on Paper.
return entityType.getKeyOrThrow();
} catch (IllegalStateException e) {
return entityType.getKey();
} catch (IllegalStateException _) {
throw new DecentHologramsNmsException("Couldn't get key for entity type: " + entityType);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public enum Version {
paper_v1_21_R6(21, Platform.PAPER, "1.21.9", "1.21.10"),
v1_21_R7(21, Platform.SPIGOT, "1.21.11"),
paper_v1_21_R7(21, Platform.PAPER, "1.21.11"),
v26_1(26, Platform.SPIGOT, "26.1"),
v26_1(26, Platform.ALL, "26.1", "26.1.1", "26.1.2"),
;

/*
Expand All @@ -72,7 +72,13 @@ private static Platform getServerPlatform() {

private static String getCurrentMinecraftVersion() {
// Bukkit version (e.g., 1.20.6-R0.1-SNAPSHOT)
String bukkitVersion = Bukkit.getServer().getBukkitVersion();
String bukkitVersion;
if (CURRENT_SERVER_PLATFORM == Platform.PAPER) {
// Since 26.1, Paper returns the version in a wrong format from #getBukkitVersion() (e.g.: "26.1.2.build.52-beta")
bukkitVersion = Bukkit.getServer().getVersion();
} else {
bukkitVersion = Bukkit.getServer().getBukkitVersion();
}
// Minecraft version (e.g., 1.20.6)
return bukkitVersion.split("-", 2)[0];
}
Expand Down
Loading