Skip to content

Commit bc0cfde

Browse files
authored
Set the minimum Java version to 16; drop Bedrock 1.17.0 (GeyserMC#2477)
1 parent 93f5298 commit bc0cfde

File tree

93 files changed

+668
-10637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+668
-10637
lines changed

.github/workflows/pullrequest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
1616
restore-keys: |
1717
${{ runner.os }}-maven-
18-
- name: Set up JDK 1.8
18+
- name: Set up JDK 16
1919
uses: actions/setup-java@v1
2020
with:
21-
java-version: 1.8
21+
java-version: 16
2222
- name: submodules-init
2323
uses: snickerbockers/submodules-init@v4
2424
- name: Build with Maven

ap/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>geyser-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>ap</artifactId>
13-
<version>1.4.2-SNAPSHOT</version>
13+
<version>1.4.3-SNAPSHOT</version>
1414
</project>

bootstrap/bungeecord/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>bootstrap-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-bungeecord</artifactId>
1212

1313
<dependencies>
1414
<dependency>
1515
<groupId>org.geysermc</groupId>
1616
<artifactId>connector</artifactId>
17-
<version>1.4.2-SNAPSHOT</version>
17+
<version>1.4.3-SNAPSHOT</version>
1818
<scope>compile</scope>
1919
</dependency>
2020
<!-- Used for better working with internals without reflection -->
@@ -49,7 +49,7 @@
4949
<plugin>
5050
<groupId>org.apache.maven.plugins</groupId>
5151
<artifactId>maven-shade-plugin</artifactId>
52-
<version>3.2.1</version>
52+
<version>3.3.0-SNAPSHOT</version>
5353
<executions>
5454
<execution>
5555
<phase>package</phase>

bootstrap/bungeecord/src/main/java/org/geysermc/platform/bungeecord/command/BungeeCommandSender.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public boolean isConsole() {
5757

5858
@Override
5959
public String getLocale() {
60-
if (handle instanceof ProxiedPlayer) {
61-
ProxiedPlayer player = (ProxiedPlayer) handle;
60+
if (handle instanceof ProxiedPlayer player) {
6261
String locale = player.getLocale().getLanguage() + "_" + player.getLocale().getCountry();
6362
return LanguageUtils.formatLocale(locale);
6463
}

bootstrap/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>geyser-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-parent</artifactId>
1212
<packaging>pom</packaging>
@@ -34,7 +34,7 @@
3434
<dependency>
3535
<groupId>org.geysermc</groupId>
3636
<artifactId>ap</artifactId>
37-
<version>1.4.2-SNAPSHOT</version>
37+
<version>1.4.3-SNAPSHOT</version>
3838
<scope>provided</scope>
3939
</dependency>
4040
</dependencies>

bootstrap/spigot/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>bootstrap-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-spigot</artifactId>
1212

@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>org.geysermc</groupId>
2323
<artifactId>connector</artifactId>
24-
<version>1.4.2-SNAPSHOT</version>
24+
<version>1.4.3-SNAPSHOT</version>
2525
<scope>compile</scope>
2626
</dependency>
2727
<dependency>
@@ -66,7 +66,7 @@
6666
<plugin>
6767
<groupId>org.apache.maven.plugins</groupId>
6868
<artifactId>maven-shade-plugin</artifactId>
69-
<version>3.2.1</version>
69+
<version>3.3.0-SNAPSHOT</version>
7070
<executions>
7171
<execution>
7272
<phase>package</phase>

bootstrap/spigot/src/main/java/org/geysermc/platform/spigot/command/SpigotCommandSender.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ public static void setUseLegacyLocaleMethod(boolean useLegacyMethod) {
9797
* @return the locale of the Spigot player
9898
*/
9999
private String getSpigotLocale() {
100-
if (handle instanceof Player) {
101-
Player player = (Player) handle;
100+
if (handle instanceof Player player) {
102101
if (USE_LEGACY_METHOD) {
103102
try {
104103
// sigh

bootstrap/spigot/src/main/java/org/geysermc/platform/spigot/world/GeyserSpigot1_11CraftingListener.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public void sendServerRecipes(GeyserSession session) {
109109
if (output == null || output.getId() == 0) continue; // If items make air we don't want that
110110

111111
boolean isNotAllAir = false; // Check for all-air recipes
112-
if (recipe instanceof ShapedRecipe) {
113-
ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
112+
if (recipe instanceof ShapedRecipe shapedRecipe) {
114113
int size = shapedRecipe.getShape().length * shapedRecipe.getShape()[0].length();
115114
Ingredient[] ingredients = new Ingredient[size];
116115
ItemData[] input = new ItemData[size];
@@ -134,8 +133,7 @@ public void sendServerRecipes(GeyserSession session) {
134133
craftingDataPacket.getCraftingData().add(CraftingData.fromShaped(uuid.toString(),
135134
shapedRecipe.getShape()[0].length(), shapedRecipe.getShape().length, Arrays.asList(input),
136135
Collections.singletonList(output), uuid, "crafting_table", 0, netId++));
137-
} else if (recipe instanceof ShapelessRecipe) {
138-
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
136+
} else if (recipe instanceof ShapelessRecipe shapelessRecipe) {
139137
Ingredient[] ingredients = new Ingredient[shapelessRecipe.getIngredientList().size()];
140138
ItemData[] input = new ItemData[shapelessRecipe.getIngredientList().size()];
141139

bootstrap/spigot/src/main/java/org/geysermc/platform/spigot/world/manager/GeyserSpigotWorldManager.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,13 @@ public NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boole
9999
}
100100

101101
Block block = bukkitPlayer.getWorld().getBlockAt(x, y, z);
102-
if (!(block.getState() instanceof Lectern)) {
102+
if (!(block.getState() instanceof Lectern lectern)) {
103103
session.getConnector().getLogger().error("Lectern expected at: " + Vector3i.from(x, y, z).toString() + " but was not! " + block.toString());
104104
return;
105105
}
106106

107-
Lectern lectern = (Lectern) block.getState();
108107
ItemStack itemStack = lectern.getInventory().getItem(0);
109-
if (itemStack == null || !(itemStack.getItemMeta() instanceof BookMeta)) {
108+
if (itemStack == null || !(itemStack.getItemMeta() instanceof BookMeta bookMeta)) {
110109
if (!isChunkLoad) {
111110
// We need to update the lectern since it's not going to be updated otherwise
112111
BlockEntityUtils.updateBlockEntity(session, LecternInventoryTranslator.getBaseLecternTag(x, y, z, 0).build(), Vector3i.from(x, y, z));
@@ -115,7 +114,6 @@ public NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boole
115114
return;
116115
}
117116

118-
BookMeta bookMeta = (BookMeta) itemStack.getItemMeta();
119117
// 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
120118
boolean hasBookPages = bookMeta.getPageCount() > 0;
121119
NbtMapBuilder lecternTag = LecternInventoryTranslator.getBaseLecternTag(x, y, z, hasBookPages ? bookMeta.getPageCount() : 1);

bootstrap/sponge/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>bootstrap-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-sponge</artifactId>
1212

1313
<dependencies>
1414
<dependency>
1515
<groupId>org.geysermc</groupId>
1616
<artifactId>connector</artifactId>
17-
<version>1.4.2-SNAPSHOT</version>
17+
<version>1.4.3-SNAPSHOT</version>
1818
<scope>compile</scope>
1919
</dependency>
2020
<dependency>
@@ -48,7 +48,7 @@
4848
<plugin>
4949
<groupId>org.apache.maven.plugins</groupId>
5050
<artifactId>maven-shade-plugin</artifactId>
51-
<version>3.2.1</version>
51+
<version>3.3.0-SNAPSHOT</version>
5252
<executions>
5353
<execution>
5454
<phase>package</phase>

bootstrap/standalone/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>bootstrap-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-standalone</artifactId>
1212

1313
<dependencies>
1414
<dependency>
1515
<groupId>org.geysermc</groupId>
1616
<artifactId>connector</artifactId>
17-
<version>1.4.2-SNAPSHOT</version>
17+
<version>1.4.3-SNAPSHOT</version>
1818
<scope>compile</scope>
1919
</dependency>
2020
<dependency>
@@ -89,7 +89,7 @@
8989
<plugin>
9090
<groupId>org.apache.maven.plugins</groupId>
9191
<artifactId>maven-shade-plugin</artifactId>
92-
<version>3.2.1</version>
92+
<version>3.3.0-SNAPSHOT</version>
9393
<dependencies>
9494
<dependency>
9595
<groupId>com.github.edwgiz</groupId>

bootstrap/standalone/src/main/java/org/geysermc/platform/standalone/GeyserStandaloneBootstrap.java

+10-16
Original file line numberDiff line numberDiff line change
@@ -98,32 +98,26 @@ public static void main(String[] args) {
9898
// Allows gui and nogui without options, for backwards compatibility
9999
String arg = args[i];
100100
switch (arg) {
101-
case "--gui":
102-
case "gui":
103-
useGuiOpts = true;
104-
break;
105-
case "--nogui":
106-
case "nogui":
107-
useGuiOpts = false;
108-
break;
109-
case "--config":
110-
case "-c":
101+
case "--gui", "gui" -> useGuiOpts = true;
102+
case "--nogui", "nogui" -> useGuiOpts = false;
103+
case "--config", "-c" -> {
111104
if (i >= args.length - 1) {
112105
System.err.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_not_specified"), "-c"));
113106
return;
114107
}
115-
configFilenameOpt = args[i+1]; i++;
108+
configFilenameOpt = args[i + 1];
109+
i++;
116110
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_specified"), configFilenameOpt));
117-
break;
118-
case "--help":
119-
case "-h":
111+
}
112+
case "--help", "-h" -> {
120113
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
121114
System.out.println(" " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.options"));
122115
System.out.println(" -c, --config [file] " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config"));
123116
System.out.println(" -h, --help " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.help"));
124117
System.out.println(" --gui, --nogui " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.gui"));
125118
return;
126-
default:
119+
}
120+
default -> {
127121
// We have likely added a config option argument
128122
if (arg.startsWith("--")) {
129123
// Split the argument by an =
@@ -159,9 +153,9 @@ public static void main(String[] args) {
159153
}
160154
}
161155
}
162-
163156
System.err.println(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.unrecognised", arg));
164157
return;
158+
}
165159
}
166160
}
167161
bootstrap.onEnable(useGuiOpts, configFilenameOpt);

bootstrap/standalone/src/main/java/org/geysermc/platform/standalone/gui/GraphPanel.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ public void addValues(Collection<Integer> newValues) {
6868
@Override
6969
protected void paintComponent(Graphics graphics) {
7070
super.paintComponent(graphics);
71-
if (!(graphics instanceof Graphics2D)) {
71+
if (!(graphics instanceof final Graphics2D g)) {
7272
graphics.drawString("Graphics is not Graphics2D, unable to render", 0, 0);
7373
return;
7474
}
75-
final Graphics2D g = (Graphics2D) graphics;
7675
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
7776

7877
final int length = values.size();

bootstrap/velocity/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>bootstrap-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>bootstrap-velocity</artifactId>
1212

1313
<dependencies>
1414
<dependency>
1515
<groupId>org.geysermc</groupId>
1616
<artifactId>connector</artifactId>
17-
<version>1.4.2-SNAPSHOT</version>
17+
<version>1.4.3-SNAPSHOT</version>
1818
<scope>compile</scope>
1919
</dependency>
2020
<dependency>
@@ -48,7 +48,7 @@
4848
<plugin>
4949
<groupId>org.apache.maven.plugins</groupId>
5050
<artifactId>maven-shade-plugin</artifactId>
51-
<version>3.2.1</version>
51+
<version>3.3.0-SNAPSHOT</version>
5252
<executions>
5353
<execution>
5454
<phase>package</phase>

common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>geyser-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>common</artifactId>
1212

connector/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.geysermc</groupId>
88
<artifactId>geyser-parent</artifactId>
9-
<version>1.4.2-SNAPSHOT</version>
9+
<version>1.4.3-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>connector</artifactId>
1212

@@ -21,13 +21,13 @@
2121
<dependency>
2222
<groupId>org.geysermc</groupId>
2323
<artifactId>ap</artifactId>
24-
<version>1.4.2-SNAPSHOT</version>
24+
<version>1.4.3-SNAPSHOT</version>
2525
<scope>provided</scope>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.geysermc</groupId>
2929
<artifactId>common</artifactId>
30-
<version>1.4.2-SNAPSHOT</version>
30+
<version>1.4.3-SNAPSHOT</version>
3131
<scope>compile</scope>
3232
</dependency>
3333
<!-- Jackson JSON and YAML serialization -->

connector/src/main/java/org/geysermc/connector/GeyserConnector.java

-31
Original file line numberDiff line numberDiff line change
@@ -384,40 +384,9 @@ private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
384384
logger.warning(LanguageUtils.getLocaleStringLog("geyser.core.movement_warn"));
385385
}
386386

387-
checkForOutdatedJava();
388-
389387
newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED);
390388
}
391389

392-
private void checkForOutdatedJava() {
393-
final int supportedJavaVersion = 16;
394-
// Taken from Paper
395-
String javaVersion = System.getProperty("java.version");
396-
Matcher matcher = Pattern.compile("(?:1\\.)?(\\d+)").matcher(javaVersion);
397-
if (!matcher.find()) {
398-
getLogger().debug("Could not parse Java version string " + javaVersion);
399-
return;
400-
}
401-
402-
String version = matcher.group(1);
403-
int majorVersion;
404-
try {
405-
majorVersion = Integer.parseInt(version);
406-
} catch (NumberFormatException e) {
407-
getLogger().debug("Could not format as an int: " + version);
408-
return;
409-
}
410-
411-
if (majorVersion < supportedJavaVersion) {
412-
getLogger().warning("*********************************************");
413-
getLogger().warning("");
414-
getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_java.header"));
415-
getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_java.message", supportedJavaVersion, javaVersion));
416-
getLogger().warning("");
417-
getLogger().warning("*********************************************");
418-
}
419-
}
420-
421390
public void shutdown() {
422391
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown"));
423392
shuttingDown = true;

0 commit comments

Comments
 (0)