From 9b6d97d0d0d0385670e78b2d036bdffb1f7ddda5 Mon Sep 17 00:00:00 2001 From: "version-bump[github-action]" <41898282+version-bump[github-action]@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:41:07 +0000 Subject: [PATCH 1/3] Bump version from 5.0.10 to 5.0.10-SNAPSHOT0 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9f3d7ec6..75985216 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,7 @@ dependencies { } group = "plugily.projects" -version = "5.0.10" +version = "5.0.10-SNAPSHOT0" description = "BuildBattle" java { From 7e7a7181d8a72b9cfa9fb467a33ac047f77ac598 Mon Sep 17 00:00:00 2001 From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com> Date: Sat, 13 Jul 2024 01:44:26 +0200 Subject: [PATCH 2/3] Changed ServerVersion as 1.20.6+ removed package nms --- build.gradle.kts | 2 +- .../projects/buildbattle/arena/ArenaEvents.java | 4 ++-- .../projects/buildbattle/arena/ArenaRegistry.java | 2 +- .../buildbattle/arena/managers/plots/Plot.java | 6 +++--- .../handlers/menu/registry/banner/Banner.java | 2 +- .../handlers/menu/registry/banner/BannerMenu.java | 2 +- .../menu/registry/biomes/BiomeChangeOption.java | 2 +- .../buildbattle/handlers/misc/ChunkManager.java | 12 ++++++------ 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 75985216..08fb63f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,7 @@ repositories { } dependencies { - implementation("plugily.projects:MiniGamesBox-Classic:1.3.12") { isTransitive = false } + implementation("plugily.projects:MiniGamesBox-Classic:1.3.13") { isTransitive = false } compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") compileOnly("net.citizensnpcs:citizensapi:2.0.31-SNAPSHOT") diff --git a/src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java b/src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java index 9890735a..2815df82 100644 --- a/src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java +++ b/src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java @@ -189,7 +189,7 @@ public void onNPCClick(PlugilyPlayerInteractEntityEvent event) { if(playerPlot != null) { // Prevent "Legacy material support initialisation" - playerPlot.changeFloor(material, ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1) ? hand.getData().getData() : 0); + playerPlot.changeFloor(material, ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12) ? hand.getData().getData() : 0); new MessageBuilder("MENU_OPTION_CONTENT_FLOOR_CHANGED").asKey().player(event.getPlayer()).sendPlayer(); } } @@ -340,7 +340,7 @@ public void onCreatureSpawn(CreatureSpawnEvent event) { plot.addEntity(); event.setCancelled(false); - if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9_R1)) { + if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9)) { event.getEntity().setAI(false); } } diff --git a/src/main/java/plugily/projects/buildbattle/arena/ArenaRegistry.java b/src/main/java/plugily/projects/buildbattle/arena/ArenaRegistry.java index fddfcb36..1bb47778 100644 --- a/src/main/java/plugily/projects/buildbattle/arena/ArenaRegistry.java +++ b/src/main/java/plugily/projects/buildbattle/arena/ArenaRegistry.java @@ -119,7 +119,7 @@ public boolean additionalValidatorChecks(ConfigurationSection section, PluginAre World minWorld = minPoint.getWorld(); if(minWorld != null) { - Biome biome = ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15_R1) ? + Biome biome = ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15) ? minWorld.getBiome(minPoint.getBlockX(), minPoint.getBlockY(), minPoint.getBlockZ()) : minWorld.getBiome(minPoint.getBlockX(), minPoint.getBlockZ()); diff --git a/src/main/java/plugily/projects/buildbattle/arena/managers/plots/Plot.java b/src/main/java/plugily/projects/buildbattle/arena/managers/plots/Plot.java index 21144837..65c47f4d 100644 --- a/src/main/java/plugily/projects/buildbattle/arena/managers/plots/Plot.java +++ b/src/main/java/plugily/projects/buildbattle/arena/managers/plots/Plot.java @@ -220,7 +220,7 @@ public void resetPlot() { } for(Chunk chunk : cuboid.chunkList()) { - if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15_R1)) { + if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15)) { chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ()); continue; } @@ -235,7 +235,7 @@ public void resetPlot() { changeFloor(defaultFloor.parseMaterial()); if(centerWorld != null) { - if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15_R1)) { + if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15)) { Location min = cuboid.getMinPoint(); Location max = cuboid.getMaxPoint(); @@ -307,7 +307,7 @@ public void changeFloor(Material material, byte data) { Block block = maxWorld.getBlockAt(x, y, z); block.setType(material); - if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) { + if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) { try { Block.class.getMethod("setData", byte.class).invoke(block, data); } catch(Exception e) { diff --git a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/Banner.java b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/Banner.java index 14c720d9..fcd928bb 100644 --- a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/Banner.java +++ b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/Banner.java @@ -66,7 +66,7 @@ public ItemStack buildBanner() { ItemStack item = XMaterial.WHITE_BANNER.parseItem(); BannerMeta meta = (BannerMeta) item.getItemMeta(); - if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) { + if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) { meta.setBaseColor(color); } diff --git a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/BannerMenu.java b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/BannerMenu.java index 4415d021..2a74c8d3 100644 --- a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/BannerMenu.java +++ b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/BannerMenu.java @@ -69,7 +69,7 @@ private void prepareBaseStageGui() { for(DyeColor color : DyeColor.values()) { ItemStack item; - if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) { + if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) { item = XMaterial.WHITE_BANNER.parseItem(); BannerMeta meta = (BannerMeta) item.getItemMeta(); diff --git a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/biomes/BiomeChangeOption.java b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/biomes/BiomeChangeOption.java index 7f0187d4..30aaa1e0 100644 --- a/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/biomes/BiomeChangeOption.java +++ b/src/main/java/plugily/projects/buildbattle/handlers/menu/registry/biomes/BiomeChangeOption.java @@ -88,7 +88,7 @@ public void onClick(InventoryClickEvent event) { } for(Chunk chunk : plot.getCuboid().chunkList()) { - if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15_R1)) { + if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15)) { chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ()); continue; } diff --git a/src/main/java/plugily/projects/buildbattle/handlers/misc/ChunkManager.java b/src/main/java/plugily/projects/buildbattle/handlers/misc/ChunkManager.java index 68fc2909..b45e158c 100644 --- a/src/main/java/plugily/projects/buildbattle/handlers/misc/ChunkManager.java +++ b/src/main/java/plugily/projects/buildbattle/handlers/misc/ChunkManager.java @@ -39,11 +39,11 @@ public class ChunkManager { private static Constructor mapChunkConstructor; static { - if (ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_18_R1)) { + if (ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_18)) { packetPlayOutMapChunk = PacketUtils.classByName("net.minecraft.network.protocol.game", "PacketPlayOutMapChunk"); chunkClass = PacketUtils.classByName("net.minecraft.world.level.chunk", "Chunk"); - if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17_R1)) { + if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17)) { try { mapChunkConstructor = packetPlayOutMapChunk.getConstructor(PacketUtils.classByName("net.minecraft.world.level.chunk", "LevelChunk")); } catch (NoSuchMethodException e) { @@ -58,18 +58,18 @@ public class ChunkManager { } public static void sendMapChunk(Player player, Chunk chunk) { - if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_18_R1)) { + if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_18)) { return; // Should just use World#refreshChunk instead } try { Method chunkHandleMethod = chunk.getClass().getMethod("getHandle"); - if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17_R1)) { + if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17)) { PacketUtils.sendPacket(player, mapChunkConstructor.newInstance(chunkHandleMethod.invoke(chunk))); return; } - if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16_R1)) { + if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16)) { if (mapChunkConstructor == null) mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass, int.class, boolean.class); @@ -77,7 +77,7 @@ public static void sendMapChunk(Player player, Chunk chunk) { return; } - if (ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_10_R2)) { + if (ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_10)) { if (mapChunkConstructor == null) mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass, boolean.class, int.class); From 5052fc30aac2e4ee7f67a6430edfc472f49cb17b Mon Sep 17 00:00:00 2001 From: "version-bump[github-action]" <41898282+version-bump[github-action]@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:45:29 +0000 Subject: [PATCH 3/3] Bump version from 5.0.10-SNAPSHOT0 to 5.0.10-SNAPSHOT1 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 08fb63f8..3d874e7f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,7 @@ dependencies { } group = "plugily.projects" -version = "5.0.10-SNAPSHOT0" +version = "5.0.10-SNAPSHOT1" description = "BuildBattle" java {