mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Set the minimum Java version to 16; drop Bedrock 1.17.0 (#2477)
This commit is contained in:
parent
93f5298ee3
commit
bc0cfde8f9
93 changed files with 668 additions and 10637 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()];
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue