mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-24 21:02:48 +02:00
Minecraft 1.17 support (#1781)
* Java 16 preliminary branch. This compiles, but junit tests fail all over because there is a lack of Java 16 support right now. * Use Java 16 * 1.17 WIP * Require 1.17 * Fixes tests. * WIP fixing tests * Exclude maven from shading * Try update snapshots to build action * Try repo on command line * Remove reference to shade plugin in dependencies
This commit is contained in:
parent
cc43dbfabe
commit
c2e832095a
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -13,10 +13,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 16
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 16
|
||||||
- name: Cache SonarCloud packages
|
- name: Cache SonarCloud packages
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@ -30,7 +30,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: ${{ runner.os }}-m2
|
restore-keys: ${{ runner.os }}-m2
|
||||||
- name: Build
|
- name: Build
|
||||||
run: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install
|
run: mvn --batch-mode clean org.jacoco:jacoco-maven-plugin:prepare-agent install
|
||||||
- run: mkdir staging && cp target/*.jar staging
|
- run: mkdir staging && cp target/*.jar staging
|
||||||
- name: Save artifacts
|
- name: Save artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
49
pom.xml
49
pom.xml
@ -63,21 +63,21 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>16</java.version>
|
||||||
<!-- Non-minecraft related dependencies -->
|
<!-- Non-minecraft related dependencies -->
|
||||||
<powermock.version>2.0.4</powermock.version>
|
<powermock.version>2.0.9</powermock.version>
|
||||||
<mongodb.version>3.8.0</mongodb.version>
|
<mongodb.version>3.12.8</mongodb.version>
|
||||||
<!-- More visible way to change dependency versions -->
|
<!-- More visible way to change dependency versions -->
|
||||||
<spigot.version>1.16.4-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
|
||||||
<!-- Might differ from the last Spigot release for short periods
|
<!-- Might differ from the last Spigot release for short periods
|
||||||
of time -->
|
of time -->
|
||||||
<paper.version>1.16.4-R0.1-SNAPSHOT</paper.version>
|
<paper.version>1.16.5-R0.1-SNAPSHOT</paper.version>
|
||||||
<bstats.version>2.1.0</bstats.version>
|
<bstats.version>2.2.1</bstats.version>
|
||||||
<vault.version>1.7</vault.version>
|
<vault.version>1.7</vault.version>
|
||||||
<placeholderapi.version>2.10.9</placeholderapi.version>
|
<placeholderapi.version>2.10.9</placeholderapi.version>
|
||||||
<githubapi.version>d5f5e0bbd8</githubapi.version>
|
<githubapi.version>d5f5e0bbd8</githubapi.version>
|
||||||
<dynmap.version>3.0-SNAPSHOT</dynmap.version>
|
<dynmap.version>3.0-SNAPSHOT</dynmap.version>
|
||||||
<worldedit.version>7.0.0</worldedit.version>
|
<worldedit.version>7.2.5</worldedit.version>
|
||||||
<!-- Revision variable removes warning about dynamic version -->
|
<!-- Revision variable removes warning about dynamic version -->
|
||||||
<revision>${build.version}-SNAPSHOT</revision>
|
<revision>${build.version}-SNAPSHOT</revision>
|
||||||
<!-- Do not change unless you want different name for local builds. -->
|
<!-- Do not change unless you want different name for local builds. -->
|
||||||
@ -154,6 +154,12 @@
|
|||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<!-- This is a temporary reference as the Maven Shade plugin
|
||||||
|
that supports Java 16 is not released yet -->
|
||||||
|
<id>maven-snapshots</id>
|
||||||
|
<url>https://repository.apache.org/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||||
@ -203,7 +209,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>${spigot.version}</version>
|
<version>1.17-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Metrics -->
|
<!-- Metrics -->
|
||||||
@ -216,7 +222,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.11.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -283,7 +289,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt</groupId>
|
<groupId>org.eclipse.jdt</groupId>
|
||||||
<artifactId>org.eclipse.jdt.annotation</artifactId>
|
<artifactId>org.eclipse.jdt.annotation</artifactId>
|
||||||
<version>2.2.200</version>
|
<version>2.2.600</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- PaperLib -->
|
<!-- PaperLib -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -296,7 +302,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.apachezy</groupId>
|
<groupId>com.github.apachezy</groupId>
|
||||||
<artifactId>LangUtils</artifactId>
|
<artifactId>LangUtils</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>3.2.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -333,21 +339,26 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.2.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${java.version}</source>
|
<release>16</release>
|
||||||
<target>${java.version}</target>
|
<!-- <source>${java.version}</source> <target>${java.version}</target> -->
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.22.2</version>
|
<version>3.0.0-M5</version>
|
||||||
|
<configuration>
|
||||||
|
<argLine>
|
||||||
|
--illegal-access=permit
|
||||||
|
</argLine>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -357,7 +368,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>8</source>
|
<source>8</source>
|
||||||
<show>private</show>
|
<show>private</show>
|
||||||
@ -393,7 +404,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.3.0-SNAPSHOT</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<minimizeJar>true</minimizeJar>
|
<minimizeJar>true</minimizeJar>
|
||||||
<relocations>
|
<relocations>
|
||||||
@ -412,6 +423,8 @@
|
|||||||
</relocations>
|
</relocations>
|
||||||
<artifactSet>
|
<artifactSet>
|
||||||
<excludes>
|
<excludes>
|
||||||
|
<exclude>org.apache.maven.shared:*</exclude>
|
||||||
|
<exclude>org.apache.maven:*</exclude>
|
||||||
<exclude>com.google.code.gson:*</exclude>
|
<exclude>com.google.code.gson:*</exclude>
|
||||||
<exclude>org.mongodb:*</exclude>
|
<exclude>org.mongodb:*</exclude>
|
||||||
<exclude>org.eclipse.jdt:*</exclude>
|
<exclude>org.eclipse.jdt:*</exclude>
|
||||||
@ -449,7 +462,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.8.4</version>
|
<version>0.8.7</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<append>true</append>
|
<append>true</append>
|
||||||
<excludes>
|
<excludes>
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
package world.bentobox.bentobox.nms;
|
package world.bentobox.bentobox.nms;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData;
|
|
||||||
|
|
||||||
import net.minecraft.server.v1_16_R3.IBlockData;
|
|
||||||
|
|
||||||
public interface NMSAbstraction {
|
public interface NMSAbstraction {
|
||||||
|
|
||||||
static final IBlockData AIR = ((CraftBlockData) Bukkit.createBlockData(Material.AIR)).getState();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the low-level chunk information for the given block to the new block ID and data. This
|
* Update the low-level chunk information for the given block to the new block ID and data. This
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
package world.bentobox.bentobox.nms.v1_16_R3;
|
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
|
|
||||||
import org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData;
|
|
||||||
|
|
||||||
import net.minecraft.server.v1_16_R3.BlockPosition;
|
|
||||||
import world.bentobox.bentobox.nms.NMSAbstraction;
|
|
||||||
|
|
||||||
public class NMSHandler implements NMSAbstraction {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setBlockInNativeChunk(Chunk chunk, int x, int y, int z, BlockData blockData, boolean applyPhysics) {
|
|
||||||
CraftBlockData craft = (CraftBlockData) blockData;
|
|
||||||
net.minecraft.server.v1_16_R3.World nmsWorld = ((CraftWorld) chunk.getWorld()).getHandle();
|
|
||||||
net.minecraft.server.v1_16_R3.Chunk nmsChunk = nmsWorld.getChunkAt(chunk.getX(), chunk.getZ());
|
|
||||||
BlockPosition bp = new BlockPosition((chunk.getX() << 4) + x, y, (chunk.getZ() << 4) + z);
|
|
||||||
// Setting the block to air before setting to another state prevents some console errors
|
|
||||||
nmsChunk.setType(bp, AIR, applyPhysics, true);
|
|
||||||
nmsChunk.setType(bp, craft.getState(), applyPhysics, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,31 @@
|
|||||||
|
package world.bentobox.bentobox.nms.v1_17_R1;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.data.BlockData;
|
||||||
|
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPosition;
|
||||||
|
import net.minecraft.world.level.World;
|
||||||
|
import net.minecraft.world.level.block.state.IBlockData;
|
||||||
|
import net.minecraft.world.level.chunk.Chunk;
|
||||||
|
import world.bentobox.bentobox.nms.NMSAbstraction;
|
||||||
|
|
||||||
|
|
||||||
|
public class NMSHandler implements NMSAbstraction {
|
||||||
|
|
||||||
|
private static final IBlockData AIR = ((CraftBlockData) Bukkit.createBlockData(Material.AIR)).getState();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBlockInNativeChunk(org.bukkit.Chunk chunk, int x, int y, int z, BlockData blockData, boolean applyPhysics) {
|
||||||
|
CraftBlockData craft = (CraftBlockData) blockData;
|
||||||
|
World nmsWorld = ((CraftWorld) chunk.getWorld()).getHandle();
|
||||||
|
Chunk nmsChunk = nmsWorld.getChunkAt(chunk.getX(), chunk.getZ());
|
||||||
|
BlockPosition bp = new BlockPosition((chunk.getX() << 4) + x, y, (chunk.getZ() << 4) + z);
|
||||||
|
// Setting the block to air before setting to another state prevents some console errors
|
||||||
|
nmsChunk.setType(bp, AIR, applyPhysics, true);
|
||||||
|
nmsChunk.setType(bp, craft.getState(), applyPhysics, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -160,25 +160,30 @@ public class ServerCompatibility {
|
|||||||
/**
|
/**
|
||||||
* @since 1.14.0
|
* @since 1.14.0
|
||||||
*/
|
*/
|
||||||
V1_16_1(Compatibility.NOT_SUPPORTED),
|
V1_16_1(Compatibility.INCOMPATIBLE),
|
||||||
/**
|
/**
|
||||||
* @since 1.15.0
|
* @since 1.15.0
|
||||||
*/
|
*/
|
||||||
V1_16_2(Compatibility.NOT_SUPPORTED),
|
V1_16_2(Compatibility.INCOMPATIBLE),
|
||||||
/**
|
/**
|
||||||
* @since 1.15.1
|
* @since 1.15.1
|
||||||
*/
|
*/
|
||||||
V1_16_3(Compatibility.NOT_SUPPORTED),
|
V1_16_3(Compatibility.INCOMPATIBLE),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.15.3
|
* @since 1.15.3
|
||||||
*/
|
*/
|
||||||
V1_16_4(Compatibility.COMPATIBLE),
|
V1_16_4(Compatibility.INCOMPATIBLE),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.16.0
|
* @since 1.16.0
|
||||||
*/
|
*/
|
||||||
V1_16_5(Compatibility.COMPATIBLE)
|
V1_16_5(Compatibility.INCOMPATIBLE),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.17.0
|
||||||
|
*/
|
||||||
|
V1_17(Compatibility.COMPATIBLE)
|
||||||
;
|
;
|
||||||
|
|
||||||
private Compatibility compatibility;
|
private Compatibility compatibility;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: BentoBox
|
name: BentoBox
|
||||||
main: world.bentobox.bentobox.BentoBox
|
main: world.bentobox.bentobox.BentoBox
|
||||||
version: ${project.version}${build.number}
|
version: ${project.version}${build.number}
|
||||||
api-version: "1.15"
|
api-version: "1.17"
|
||||||
|
|
||||||
authors: [tastybento, Poslovitch]
|
authors: [tastybento, Poslovitch]
|
||||||
contributors: ["The BentoBoxWorld Community"]
|
contributors: ["The BentoBoxWorld Community"]
|
||||||
|
@ -108,6 +108,7 @@ public class GeoMobLimitTabTest {
|
|||||||
assertEquals("BAT", list.get(0));
|
assertEquals("BAT", list.get(0));
|
||||||
// Click on BAT
|
// Click on BAT
|
||||||
tab.onClick(panel, user, ClickType.LEFT, 9);
|
tab.onClick(panel, user, ClickType.LEFT, 9);
|
||||||
|
list.forEach(System.out::println);
|
||||||
assertEquals(1, list.size());
|
assertEquals(1, list.size());
|
||||||
assertEquals("COW", list.get(0));
|
assertEquals("COW", list.get(0));
|
||||||
// Click on BAT again to have it added
|
// Click on BAT again to have it added
|
||||||
|
Loading…
Reference in New Issue
Block a user