Set the minimum Java version to 16; drop Bedrock 1.17.0 (#2477)

This commit is contained in:
Camotoy 2021-09-10 14:10:56 -04:00 committed by GitHub
parent 93f5298ee3
commit bc0cfde8f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 668 additions and 10637 deletions

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-bungeecord</artifactId>
@ -14,7 +14,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Used for better working with internals without reflection -->
@ -49,7 +49,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>

View file

@ -57,8 +57,7 @@ public class BungeeCommandSender implements CommandSender {
@Override
public String getLocale() {
if (handle instanceof ProxiedPlayer) {
ProxiedPlayer player = (ProxiedPlayer) handle;
if (handle instanceof ProxiedPlayer player) {
String locale = player.getLocale().getLanguage() + "_" + player.getLocale().getCountry();
return LanguageUtils.formatLocale(locale);
}

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-parent</artifactId>
<packaging>pom</packaging>
@ -34,7 +34,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>ap</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-spigot</artifactId>
@ -21,7 +21,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -66,7 +66,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>

View file

@ -97,8 +97,7 @@ public class SpigotCommandSender implements CommandSender {
* @return the locale of the Spigot player
*/
private String getSpigotLocale() {
if (handle instanceof Player) {
Player player = (Player) handle;
if (handle instanceof Player player) {
if (USE_LEGACY_METHOD) {
try {
// sigh

View file

@ -109,8 +109,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener {
if (output == null || output.getId() == 0) continue; // If items make air we don't want that
boolean isNotAllAir = false; // Check for all-air recipes
if (recipe instanceof ShapedRecipe) {
ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
if (recipe instanceof ShapedRecipe shapedRecipe) {
int size = shapedRecipe.getShape().length * shapedRecipe.getShape()[0].length();
Ingredient[] ingredients = new Ingredient[size];
ItemData[] input = new ItemData[size];
@ -134,8 +133,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener {
craftingDataPacket.getCraftingData().add(CraftingData.fromShaped(uuid.toString(),
shapedRecipe.getShape()[0].length(), shapedRecipe.getShape().length, Arrays.asList(input),
Collections.singletonList(output), uuid, "crafting_table", 0, netId++));
} else if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
} else if (recipe instanceof ShapelessRecipe shapelessRecipe) {
Ingredient[] ingredients = new Ingredient[shapelessRecipe.getIngredientList().size()];
ItemData[] input = new ItemData[shapelessRecipe.getIngredientList().size()];

View file

@ -99,14 +99,13 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
}
Block block = bukkitPlayer.getWorld().getBlockAt(x, y, z);
if (!(block.getState() instanceof Lectern)) {
if (!(block.getState() instanceof Lectern lectern)) {
session.getConnector().getLogger().error("Lectern expected at: " + Vector3i.from(x, y, z).toString() + " but was not! " + block.toString());
return;
}
Lectern lectern = (Lectern) block.getState();
ItemStack itemStack = lectern.getInventory().getItem(0);
if (itemStack == null || !(itemStack.getItemMeta() instanceof BookMeta)) {
if (itemStack == null || !(itemStack.getItemMeta() instanceof BookMeta bookMeta)) {
if (!isChunkLoad) {
// We need to update the lectern since it's not going to be updated otherwise
BlockEntityUtils.updateBlockEntity(session, LecternInventoryTranslator.getBaseLecternTag(x, y, z, 0).build(), Vector3i.from(x, y, z));
@ -115,7 +114,6 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
return;
}
BookMeta bookMeta = (BookMeta) itemStack.getItemMeta();
// On the count: allow the book to show/open even there are no pages. We know there is a book here, after all, and this matches Java behavior
boolean hasBookPages = bookMeta.getPageCount() > 0;
NbtMapBuilder lecternTag = LecternInventoryTranslator.getBaseLecternTag(x, y, z, hasBookPages ? bookMeta.getPageCount() : 1);

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-sponge</artifactId>
@ -14,7 +14,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -48,7 +48,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-standalone</artifactId>
@ -14,7 +14,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -89,7 +89,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.github.edwgiz</groupId>

View file

@ -98,32 +98,26 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
// Allows gui and nogui without options, for backwards compatibility
String arg = args[i];
switch (arg) {
case "--gui":
case "gui":
useGuiOpts = true;
break;
case "--nogui":
case "nogui":
useGuiOpts = false;
break;
case "--config":
case "-c":
case "--gui", "gui" -> useGuiOpts = true;
case "--nogui", "nogui" -> useGuiOpts = false;
case "--config", "-c" -> {
if (i >= args.length - 1) {
System.err.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_not_specified"), "-c"));
return;
}
configFilenameOpt = args[i+1]; i++;
configFilenameOpt = args[i + 1];
i++;
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_specified"), configFilenameOpt));
break;
case "--help":
case "-h":
}
case "--help", "-h" -> {
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
System.out.println(" " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.options"));
System.out.println(" -c, --config [file] " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config"));
System.out.println(" -h, --help " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.help"));
System.out.println(" --gui, --nogui " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.gui"));
return;
default:
}
default -> {
// We have likely added a config option argument
if (arg.startsWith("--")) {
// Split the argument by an =
@ -159,9 +153,9 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
}
}
}
System.err.println(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.unrecognised", arg));
return;
}
}
}
bootstrap.onEnable(useGuiOpts, configFilenameOpt);

View file

@ -68,11 +68,10 @@ public final class GraphPanel extends JPanel {
@Override
protected void paintComponent(Graphics graphics) {
super.paintComponent(graphics);
if (!(graphics instanceof Graphics2D)) {
if (!(graphics instanceof final Graphics2D g)) {
graphics.drawString("Graphics is not Graphics2D, unable to render", 0, 0);
return;
}
final Graphics2D g = (Graphics2D) graphics;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
final int length = values.size();

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-velocity</artifactId>
@ -14,7 +14,7 @@
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -48,7 +48,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>