diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 0d1b1d5c94..a249b6d84e 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + testImplementation("junit:junit:4.13.1") + testImplementation("org.hamcrest:hamcrest-library:1.3") -+ testImplementation("org.ow2.asm:asm-tree:9.1") ++ testImplementation("org.ow2.asm:asm-tree:9.2") +} + +configure { @@ -212,7 +212,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.ow2.asm - asm-tree -- 9.1 +- 9.2 - test - - diff --git a/patches/api/More-World-API.patch b/patches/api/More-World-API.patch index 25cb73a096..e2cc9b5e87 100644 --- a/patches/api/More-World-API.patch +++ b/patches/api/More-World-API.patch @@ -47,21 +47,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * + * @return true if ultrawarm, false if not ++ * @deprecated use {@link #isUltraWarm()} + */ ++ @Deprecated + boolean isUltrawarm(); + + /** -+ * Checks if the world is natural. -+ *

-+ * If {@code false}, compasses will spin randomly in the world. -+ * If {@code true}, nether portals will spawn zombified piglins. -+ *

-+ * -+ * @return true or false -+ */ -+ boolean isNatural(); -+ -+ /** + * Gets the coordinate scaling of this world. + * + * @return the coordinate scale @@ -72,45 +63,39 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Checks if the world has skylight access + * + * @return whether there is skylight ++ * @deprecated use {@link #hasSkyLight()} + */ ++ @Deprecated + boolean hasSkylight(); + + /** + * Checks if the world has a bedrock ceiling + * + * @return whether the world has a bedrock ceiling ++ * @deprecated use {@link #hasCeiling()} + */ ++ @Deprecated + boolean hasBedrockCeiling(); + + /** -+ * Checks if piglins will turn into Zombified Piglins in this world -+ * -+ * @return whether Piglins will not transform -+ */ -+ boolean isPiglinSafe(); -+ -+ /** + * Checks if beds work + * + * @return whether beds work ++ * @deprecated use {@link #isBedWorks()} + */ ++ @Deprecated + boolean doesBedWork(); + + /** + * Checks if respawn anchors work + * + * @return whether respawn anchors work ++ * @deprecated use {@link #isRespawnAnchorWorks()} + */ ++ @Deprecated + boolean doesRespawnAnchorWork(); + + /** -+ * Checks if this world supports raids -+ * -+ * @return whether this world supports raids -+ */ -+ boolean hasRaids(); -+ -+ /** + * Checks if this world has a fixed time + * + * @return whether this world has fixed time diff --git a/patches/server/Add-EntityInsideBlockEvent.patch b/patches/server/Add-EntityInsideBlockEvent.patch index 0a4c58a87b..15a1c14b79 100644 --- a/patches/server/Add-EntityInsideBlockEvent.patch +++ b/patches/server/Add-EntityInsideBlockEvent.patch @@ -74,8 +74,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper if (!entity.fireImmune() && (Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) { + org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, pos); // CraftBukkit entity.hurt(DamageSource.IN_FIRE, (float) this.fireDamage); - } diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 9aac0451b6..5b5c041829 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1252,9 +1252,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - Component defaultMessage = this.getCombatTracker().getDeathMessage(); - -- String deathmessage = defaultMessage.getString(); + String deathmessage = defaultMessage.getString(); + this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel - org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory); + org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure @@ -2495,8 +2494,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage); + PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure event.setKeepInventory(keepInventory); + event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel org.bukkit.World world = entity.getWorld(); - Bukkit.getServer().getPluginManager().callEvent(event); @@ -0,0 +0,0 @@ public class CraftEventFactory { * Server methods */ diff --git a/patches/server/Allow-overriding-the-java-version-check.patch b/patches/server/Allow-overriding-the-java-version-check.patch index ef64daab09..82c1dd7747 100644 --- a/patches/server/Allow-overriding-the-java-version-check.patch +++ b/patches/server/Allow-overriding-the-java-version-check.patch @@ -11,8 +11,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { } - if (javaVersion > 60.0) { - System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 16 is supported."); + if (javaVersion > 61.0) { + System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 17 is supported."); - return; + if (!Boolean.getBoolean("Paper.IgnoreJavaVersion")) return; // Paper } diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 876d1c8881..f092f6ff24 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } + implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper + implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper - implementation("org.ow2.asm:asm:9.1") -+ implementation("org.ow2.asm:asm-commons:9.1") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm:9.2") ++ implementation("org.ow2.asm:asm-commons:9.2") // Paper - ASM event executor generation implementation("com.googlecode.json-simple:json-simple:1.1.1") { // This includes junit transitively for whatever reason isTransitive = false diff --git a/patches/server/Config-option-for-named-entity-death-logging.patch b/patches/server/Config-option-for-named-entity-death-logging.patch deleted file mode 100644 index c74a77862b..0000000000 --- a/patches/server/Config-option-for-named-entity-death-logging.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Malfrador -Date: Wed, 7 Jul 2021 12:48:50 +0200 -Subject: [PATCH] Config option for named entity death logging - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -0,0 +0,0 @@ public class PaperConfig { - deobfuscateStacktraces = getBoolean("settings.loggers.deobfuscate-stacktraces", deobfuscateStacktraces); - } - -+ public static boolean logNamedEntityDeaths = true; -+ private static void namedEntityDeaths() { -+ logNamedEntityDeaths = getBoolean("settings.log-named-entity-deaths", logNamedEntityDeaths); -+ } -+ - public static int itemValidationDisplayNameLength = 8192; - public static int itemValidationLocNameLength = 8192; - public static int itemValidationLoreLineLength = 8192; -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { - this.stopSleeping(); - } - -- if (!this.level.isClientSide && this.hasCustomName()) { -+ if (com.destroystokyo.paper.PaperConfig.logNamedEntityDeaths && !this.level.isClientSide && this.hasCustomName()) { // Paper - add setting for entity death logging - LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); - } - diff --git a/patches/server/Improve-death-events.patch b/patches/server/Improve-death-events.patch index ef45cfc4dd..0511458459 100644 --- a/patches/server/Improve-death-events.patch +++ b/patches/server/Improve-death-events.patch @@ -34,8 +34,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start public String displayName; @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - Component defaultMessage = this.getCombatTracker().getDeathMessage(); - + String deathmessage = defaultMessage.getString(); + this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure + // Paper start - cancellable death event + if (event.isCancelled()) { @@ -110,7 +110,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { if (!this.level.isClientSide && this.hasCustomName()) { - LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); + if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot } + */ // Paper - move down to make death event cancellable - this is the runKillTrigger below @@ -136,7 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + if (!this.level.isClientSide && this.hasCustomName()) { -+ LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); ++ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot + } + + this.getCombatTracker().recheckStatus(); @@ -318,9 +318,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { @@ -0,0 +0,0 @@ public class CraftEventFactory { - CraftPlayer entity = victim.getBukkitEntity(); PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure event.setKeepInventory(keepInventory); + event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel + populateFields(victim, event); // Paper - make cancellable org.bukkit.World world = entity.getWorld(); Bukkit.getServer().getPluginManager().callEvent(event); diff --git a/patches/server/More-World-API.patch b/patches/server/More-World-API.patch index db9e514674..850153777a 100644 --- a/patches/server/More-World-API.patch +++ b/patches/server/More-World-API.patch @@ -31,11 +31,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override -+ public boolean isNatural() { -+ return getHandle().dimensionType().natural(); -+ } -+ -+ @Override + public double getCoordinateScale() { + return getHandle().dimensionType().coordinateScale(); + } @@ -51,11 +46,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override -+ public boolean isPiglinSafe() { -+ return getHandle().dimensionType().piglinSafe(); -+ } -+ -+ @Override + public boolean doesBedWork() { + return getHandle().dimensionType().bedWorks(); + } @@ -66,11 +56,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override -+ public boolean hasRaids() { -+ return getHandle().dimensionType().hasRaids(); -+ } -+ -+ @Override + public boolean isFixedTime() { + return getHandle().dimensionType().hasFixedTime(); + } diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 1046941fe6..09ad85bcd7 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") { + exclude(group = "org.apache.logging.log4j", module = "log4j-api") + } -+ implementation("org.ow2.asm:asm:9.1") ++ implementation("org.ow2.asm:asm:9.2") + implementation("com.googlecode.json-simple:json-simple:1.1.1") { + // This includes junit transitively for whatever reason + isTransitive = false @@ -244,7 +244,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.ow2.asm - asm -- 9.1 +- 9.2 - compile - - diff --git a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch index ea4b1cb05e..a5d793598f 100644 --- a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper - implementation("org.ow2.asm:asm:9.1") + implementation("org.ow2.asm:asm:9.2") diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/call-EntityDamageByBlockEvent-for-campfires.patch b/patches/server/call-EntityDamageByBlockEvent-for-campfires.patch deleted file mode 100644 index 93940cff1f..0000000000 --- a/patches/server/call-EntityDamageByBlockEvent-for-campfires.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Wed, 21 Jul 2021 11:46:28 -0700 -Subject: [PATCH] call EntityDamageByBlockEvent for campfires - - -diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -@@ -0,0 +0,0 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB - public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { - if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - if (!entity.fireImmune() && (Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) { -+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); // Paper - entity.hurt(DamageSource.IN_FIRE, (float) this.fireDamage); -+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // Paper - } - - super.entityInside(state, world, pos, entity); -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -0,0 +0,0 @@ public class CraftEventFactory { - cause = DamageCause.HOT_FLOOR; - } else if (source == DamageSource.MAGIC) { - cause = DamageCause.MAGIC; -+ // Paper start -+ } else if (source == DamageSource.IN_FIRE) { -+ cause = DamageCause.FIRE; -+ // Paper end - } else { - throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.msgId)); - } diff --git a/work/Bukkit b/work/Bukkit index e0598aa29e..974452512a 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit e0598aa29ef8f0622378d929c0ed0542e698db60 +Subproject commit 974452512a4638f2692cc7baff5baf77401349ba diff --git a/work/CraftBukkit b/work/CraftBukkit index 2cdc6b1e4c..61e4ca7b9e 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 2cdc6b1e4cc28d67eeb6397b5650ecc1e13efdfa +Subproject commit 61e4ca7b9e7dbc0ee899140a7b194248edc3f493 diff --git a/work/Spigot b/work/Spigot index 18c71bf4fd..ff89b973e6 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 18c71bf4fd43113ac9b24c21afe6d88c16170f30 +Subproject commit ff89b973e62ca3b6085aeeb474f2568e45ac02be