mcMMO now requires the latest MC version (currently 1.17.1)

Fixed a few bugs from API breaks
This commit is contained in:
nossr50 2021-11-08 18:38:50 -08:00
parent 4bf2ad46ea
commit 8eee39b88b
5 changed files with 50 additions and 31 deletions

View File

@ -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)

26
pom.xml
View File

@ -256,27 +256,27 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@ -291,7 +291,7 @@
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.4</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
@ -302,7 +302,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -332,36 +332,36 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.0-M1</version>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.11.2</version>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.11.2</version>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>10.0.5</version>
<version>10.0.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
<version>22.0.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
<version>31.0.1-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -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<ItemStack> results, int fuelLevel) {
super(brewer, contents, results, fuelLevel);
}
}

View File

@ -114,7 +114,7 @@ public final class AlchemyPotionBrewer {
}
List<AlchemyPotion> inputList = new ArrayList<>();
ItemStack[] outputList = new ItemStack[3];
var outputList = new ArrayList<ItemStack>();
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));
}
}

View File

@ -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;
}
}