diff --git a/Changelog.txt b/Changelog.txt index 87338abb9..f74b8e20d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,19 @@ +Version 2.1.203 + mcMMO now requires Java 16 + mcMMO now requires the newest version of Minecraft (currently 1.17.1) + Fixed several API breaks (mostly affected Alchemy) + + NOTES: + If you want to play mcMMO on older versions, simply use 2.1.202 instead + Keeping mcMMO backwards compatible with older versions is getting messy, and I'd rather be able to focus my attention at newer features than having to make an elaborate build process (or alternatively hacky code) to support older versions of the game + Furthermore, it seems most people are playing 1.17.1 by a wide margin + You may have trouble compiling the source code if your maven is not setup to run JDK16, if you get any errors when compiling this is likely the reason + + The data from bstats went into making this decision (shoutout to Qixils for typing this up too) + 71.9% of servers are running 1.17.X + 97.9% of servers are running ≥1.16 + 99.3% of servers are running ≥1.15 + Version 2.1.202 Fixed a bug where mcMMO didn't reward XP for Kelp Fixed a bug where mcMMO marked bonemealed Azalea trees as unnatural (and thus did not give XP or get affected by Tree Feller) diff --git a/pom.xml b/pom.xml index 340f4ca5d..b1736004d 100755 --- a/pom.xml +++ b/pom.xml @@ -256,27 +256,27 @@ net.kyori adventure-text-serializer-gson - 4.9.1 + 4.9.3 net.kyori adventure-api - 4.9.1 + 4.9.3 net.kyori adventure-nbt - 4.9.1 + 4.9.3 net.kyori adventure-key - 4.9.1 + 4.9.3 net.kyori adventure-text-serializer-gson-legacy-impl - 4.9.1 + 4.9.3 net.kyori @@ -291,7 +291,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 1.9.4 + 1.12.0 org.bstats @@ -302,7 +302,7 @@ org.spigotmc spigot-api - 1.16.5-R0.1-SNAPSHOT + 1.17.1-R0.1-SNAPSHOT provided @@ -332,36 +332,36 @@ org.junit.jupiter junit-jupiter - 5.8.0-M1 + 5.8.1 test org.mockito mockito-core - 3.11.2 + 4.0.0 test org.mockito mockito-inline - 3.11.2 + 4.0.0 test org.apache.tomcat tomcat-jdbc - 10.0.5 + 10.0.12 compile org.jetbrains annotations - 20.1.0 + 22.0.0 com.google.guava guava - 29.0-jre + 31.0.1-jre compile diff --git a/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java b/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java index d564ed0d0..ea44f355a 100644 --- a/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java +++ b/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java @@ -3,9 +3,12 @@ package com.gmail.nossr50.events.fake; import org.bukkit.block.Block; import org.bukkit.event.inventory.BrewEvent; import org.bukkit.inventory.BrewerInventory; +import org.bukkit.inventory.ItemStack; + +import java.util.List; public class FakeBrewEvent extends BrewEvent implements FakeEvent { - public FakeBrewEvent(Block brewer, BrewerInventory contents, int fuelLevel) { - super(brewer, contents, fuelLevel); + public FakeBrewEvent(Block brewer, BrewerInventory contents, List results, int fuelLevel) { + super(brewer, contents, results, fuelLevel); } } diff --git a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java index 8b9f9ae36..0fa16aa7b 100644 --- a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java +++ b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java @@ -114,7 +114,7 @@ public final class AlchemyPotionBrewer { } List inputList = new ArrayList<>(); - ItemStack[] outputList = new ItemStack[3]; + var outputList = new ArrayList(); for (int i = 0; i < 3; i++) { ItemStack item = inventory.getItem(i); @@ -129,11 +129,11 @@ public final class AlchemyPotionBrewer { inputList.add(input); if (output != null) { - outputList[i] = output.toItemStack(item.getAmount()).clone(); + outputList.set(i, output.toItemStack(item.getAmount()).clone()); } } - FakeBrewEvent event = new FakeBrewEvent(brewingStand.getBlock(), inventory, ((BrewingStand) brewingStand).getFuelLevel()); + FakeBrewEvent event = new FakeBrewEvent(brewingStand.getBlock(), inventory, outputList, ((BrewingStand) brewingStand).getFuelLevel()); mcMMO.p.getServer().getPluginManager().callEvent(event); if (event.isCancelled() || inputList.isEmpty()) { @@ -141,8 +141,8 @@ public final class AlchemyPotionBrewer { } for (int i = 0; i < 3; i++) { - if(outputList[i] != null) { - inventory.setItem(i, outputList[i]); + if(outputList.get(i) != null) { + inventory.setItem(i, outputList.get(i)); } } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java index 60166dcdf..00c05d20e 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java @@ -8,8 +8,8 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for + * * @return true if the ability was successful, false otherwise */ protected static boolean convertGreenTerraBlocks(BlockState blockState) { @@ -22,16 +22,16 @@ public class Herbalism { blockState.setType(Material.MOSSY_STONE_BRICKS); return true; - case DIRT : - case GRASS_PATH : + case DIRT: + case DIRT_PATH: blockState.setType(Material.GRASS_BLOCK); return true; - case COBBLESTONE : + case COBBLESTONE: blockState.setType(Material.MOSSY_COBBLESTONE); return true; - default : + default: return false; } } @@ -39,19 +39,19 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for + * * @return true if the ability was successful, false otherwise */ protected static boolean convertShroomThumb(BlockState blockState) { switch (blockState.getType()) { - case DIRT : + case DIRT: case GRASS_BLOCK: - case GRASS_PATH : + case DIRT_PATH: blockState.setType(Material.MYCELIUM); return true; - default : + default: return false; } }