Updated Upstream (CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
b5d7883a SPIGOT-6634: Override needed method
99561c21 SPIGOT-6624: Explosions do not destroy blocks out of vanilla heights in custom dimensions
This commit is contained in:
kennytv 2021-07-09 16:08:42 +02:00 committed by Nassim Jahnke
parent d770f71f41
commit 0aa0a1d973
10 changed files with 8 additions and 31 deletions

View file

@ -4252,12 +4252,12 @@ index 0000000000000000000000000000000000000000..49dc0c441b9dd7e7745cf15ced67f383
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index 9d14625528c14c9a4b48060dedabad2ac1adf541..a430506c31d9ce7a5c90d726a68f097498629545 100644
index f43fde089bf7bbe5c982a75ccbc4017b0422a32c..08634e060b35d653c5677b7c1012cfda266bf002 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -188,7 +188,23 @@ public class DummyGeneratorAccess implements LevelAccessor {
@@ -189,7 +189,23 @@ public class DummyGeneratorAccess implements LevelAccessor {
public FluidState getFluidState(BlockPos pos) {
throw new UnsupportedOperationException("Not supported yet.");
return Fluids.EMPTY.defaultFluidState(); // SPIGOT-6634
}
+ // Paper start - if loaded util
+ @javax.annotation.Nullable

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent headless pistons from being created
Prevent headless pistons from being created by explosions or tree/mushroom growth.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index fdbd8b89bb8bf3b61f60b812b90483c98a3d5ccb..faa1b775e45563b93ac1d5b904938b1f5ad8d80c 100644
index 3a3874dc04e9b0ea3c3f0fda96dce8b3fed3199f..2678e4517570cbeafca7a9a4e54d4518cba75e69 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -441,6 +441,12 @@ public class PaperConfig {
@ -23,7 +23,7 @@ index fdbd8b89bb8bf3b61f60b812b90483c98a3d5ccb..faa1b775e45563b93ac1d5b904938b1f
public static int maxPlayerAutoSavePerTick = 10;
private static void playerAutoSaveRate() {
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index a12af10e28f2d023ba6f916b5e7a53539416713f..d4785160c1477ed13343e30c913b08175011d048 100644
index 1575fb0bbad6e11f25fb9ce51fd1f15a1b11e0fe..132140e00865fcf84ebe03ffcbc2f30ac11a0b35 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -15,6 +15,7 @@ import java.util.Random;
@ -45,7 +45,7 @@ index a12af10e28f2d023ba6f916b5e7a53539416713f..d4785160c1477ed13343e30c913b0817
import net.minecraft.world.level.material.FluidState;
@@ -189,6 +192,15 @@ public class Explosion {
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) {
set.add(blockposition);
+ // Paper start - prevent headless pistons from forming
+ if (!com.destroystokyo.paper.PaperConfig.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {

View file

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 24 Jun 2021 01:42:35 +0100
Subject: [PATCH] Allow explosions under 0 height
Upstream forgot to update the check here which prevents explosions
occuring under 0 height, however, vanilla already checks that we
are in bounds of the world above this, so this call is entirely
redundant.
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index d4785160c1477ed13343e30c913b08175011d048..fb50ee3daba9f4fe8cc173c209521679a59f23d7 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -190,7 +190,7 @@ public class Explosion {
f -= ((Float) optional.get() + 0.3F) * 0.3F;
}
- if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions
+ if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)/* && blockposition.getY() < 256 && blockposition.getY() >= 0*/) { // CraftBukkit - don't wrap explosions // Paper - permit < 0
set.add(blockposition);
// Paper start - prevent headless pistons from forming
if (!com.destroystokyo.paper.PaperConfig.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {

View file

@ -21,7 +21,7 @@ index 98b71384508447adc80c2175f8e35e5d86b0c378..f101302892a7f95ffa0e6d63cb69d8a3
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 0c38298ce04b28bb41b3c10b44b026a9b54c612b..92fd98540e8d5ada4eaaf83bee8cdd276c4458a7 100644
index 442d0df276defbbea1b4282b99460ab463c2e5e0..027898e97667081840562547653d4adaeae01dda 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1634,7 +1634,7 @@ public abstract class LivingEntity extends Entity {

@ -1 +1 @@
Subproject commit fb556bfa1404661b38cc3abd1f0a7d02764f8f5b
Subproject commit b5d7883afc519c56031e6cd93462ba4601075aae