diff --git a/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch index 777483a52b..0f70a2c9f8 100644 --- a/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -7,7 +7,7 @@ Bamboo - Both the minimum fully-grown heights and the maximum are configurable - Machine_Maker diff --git a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java -index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e7438380f9a7a8 100644 +index bd72deadb59289ae90afc379ee61e8198ddaf4ed..b54c76ce5c9433765495a5dd0f2166c17ebd304d 100644 --- a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java @@ -137,7 +137,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { @@ -15,7 +15,7 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 int i = this.getHeightBelowUpToMax(world, pos) + 1; - if (i < 16) { -+ if (i < world.paperConfig().maxGrowthHeight.bamboo.max) { // Paper ++ if (i < world.paperConfig().maxGrowthHeight.bamboo.max) { // Paper - Configurable cactus/bamboo/reed growth heights this.growBamboo(state, world, pos, random, i); } } @@ -24,7 +24,7 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 int j = this.getHeightBelowUpToMax(world, pos); - return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; -+ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper ++ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper - Configurable cactus/bamboo/reed growth heights } @Override @@ -33,7 +33,7 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 BlockState iblockdata1 = world.getBlockState(blockposition1); - if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here -+ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights ++ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus/bamboo/reed growth heights return; } @@ -42,7 +42,7 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 int j = (Integer) state.getValue(BambooStalkBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; - int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1; -+ int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper ++ int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper - Configurable cactus/bamboo/reed growth heights // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooStalkBlock.AGE, j)).setValue(BambooStalkBlock.LEAVES, blockpropertybamboosize)).setValue(BambooStalkBlock.STAGE, k), 3)) { @@ -51,7 +51,7 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 int i; - for (i = 0; i < 16 && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper ++ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth heights ; } @@ -60,12 +60,12 @@ index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e74383 int i; - for (i = 0; i < 16 && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper ++ for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper - Configurable cactus/bamboo/reed growth heights ; } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index fcd5b593c79aab42928cb1ddd0e6c1b03b7bafaf..3c7bbfcb3a88f23056cd0db3da2a281a81dc8c85 100644 +index fcd5b593c79aab42928cb1ddd0e6c1b03b7bafaf..43ecbeaced4d50910a59b24934908ff40d894770 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java @@ -61,7 +61,7 @@ public class CactusBlock extends Block { @@ -73,12 +73,12 @@ index fcd5b593c79aab42928cb1ddd0e6c1b03b7bafaf..3c7bbfcb3a88f23056cd0db3da2a281a } - if (i < 3) { -+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable growth height ++ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth heightst int j = (Integer) state.getValue(CactusBlock.AGE); int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java -index 47d4fc5bcf2657078abc7a2637b6337fc0ea0977..ceaec1776067b7635c3952025f00f13f4ea86c88 100644 +index 47d4fc5bcf2657078abc7a2637b6337fc0ea0977..e4a9ddf77d36f2d6df55c666c16677adb2e4fbe7 100644 --- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java @@ -59,7 +59,7 @@ public class SugarCaneBlock extends Block { @@ -86,7 +86,7 @@ index 47d4fc5bcf2657078abc7a2637b6337fc0ea0977..ceaec1776067b7635c3952025f00f13f } - if (i < 3) { -+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable growth height ++ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable cactus/bamboo/reed growth heights int j = (Integer) state.getValue(SugarCaneBlock.AGE); int modifier = world.spigotConfig.caneModifier; // Spigot - SPIGOT-7159: Better modifier resolution diff --git a/patches/server/0021-Configurable-baby-zombie-movement-speed.patch b/patches/server/0021-Configurable-baby-zombie-movement-speed.patch index 5575078963..5037cff218 100644 --- a/patches/server/0021-Configurable-baby-zombie-movement-speed.patch +++ b/patches/server/0021-Configurable-baby-zombie-movement-speed.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable baby zombie movement speed diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 190a02bce0026b2c6df796a5f14e639b5a84ccf1..38403a5bb8569f105056d61ca444d6b3a19becd2 100644 +index 190a02bce0026b2c6df796a5f14e639b5a84ccf1..a779d32f87b59f347408974e402fad22fdc47f09 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -78,6 +78,7 @@ public class Zombie extends Monster { @@ -21,10 +21,10 @@ index 190a02bce0026b2c6df796a5f14e639b5a84ccf1..38403a5bb8569f105056d61ca444d6b3 AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY.getId()); -+ attributemodifiable.removeModifier(this.babyModifier.getId()); // Paper ++ attributemodifiable.removeModifier(this.babyModifier.getId()); // Paper - Make baby speed configurable if (baby) { - attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY); -+ attributemodifiable.addTransientModifier(this.babyModifier); // Paper ++ attributemodifiable.addTransientModifier(this.babyModifier); // Paper - Make baby speed configurable } } diff --git a/patches/server/0022-Configurable-fishing-time-ranges.patch b/patches/server/0022-Configurable-fishing-time-ranges.patch index f47bc6f9c7..1ac9a0454c 100644 --- a/patches/server/0022-Configurable-fishing-time-ranges.patch +++ b/patches/server/0022-Configurable-fishing-time-ranges.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Configurable fishing time ranges diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index e5d9902331e3c4e461e855290a95980b41f5efe2..af6829c25fcd186adc3575d50cab6d46db9a2fac 100644 +index e5d9902331e3c4e461e855290a95980b41f5efe2..8b27b5118cbeeb0b25fb6a23056e51899be32035 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -92,6 +92,10 @@ public class FishingHook extends Projectile { this.noCulling = true; this.luck = Math.max(0, luckOfTheSeaLevel); this.lureSpeed = Math.max(0, lureLevel); -+ // Paper start ++ // Paper start - Configurable fishing time ranges + minWaitTime = world.paperConfig().fishingTimeRange.minimum; + maxWaitTime = world.paperConfig().fishingTimeRange.maximum; -+ // Paper end ++ // Paper end - Configurable fishing time ranges } public FishingHook(EntityType type, Level world) { diff --git a/patches/server/0023-Allow-nerfed-mobs-to-jump.patch b/patches/server/0023-Allow-nerfed-mobs-to-jump.patch index 927d436277..6cd56c73a4 100644 --- a/patches/server/0023-Allow-nerfed-mobs-to-jump.patch +++ b/patches/server/0023-Allow-nerfed-mobs-to-jump.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Allow nerfed mobs to jump diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 01761d37c9e4be4e498b62c7612885648b2968a6..183866636eb67f632728a01c8e5e11b514d89f84 100644 +index 01761d37c9e4be4e498b62c7612885648b2968a6..093c60df0948fd1a46aef86223ecc63bc9e8b440 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -112,6 +112,7 @@ public abstract class Mob extends LivingEntity implements Targeting { private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; -+ @Nullable public net.minecraft.world.entity.ai.goal.FloatGoal goalFloat; // Paper ++ @Nullable public net.minecraft.world.entity.ai.goal.FloatGoal goalFloat; // Paper - Allow nerfed mobs to jump and float public GoalSelector targetSelector; @Nullable private LivingEntity target; @@ -29,19 +29,19 @@ index 01761d37c9e4be4e498b62c7612885648b2968a6..183866636eb67f632728a01c8e5e11b5 + } + return; + } -+ // Paper end ++ // Paper end - Allow nerfed mobs to jump and float this.level().getProfiler().push("sensing"); this.sensing.tick(); this.level().getProfiler().pop(); diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java -index 01950951ea06e43bedeeede489a112e577617829..7093c62be53fe99ed9880fc8ddaa07440fe4f715 100644 +index 01950951ea06e43bedeeede489a112e577617829..60a62781fcfe4c598c308a7ce2b0dcf72c0895ae 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java @@ -9,6 +9,7 @@ public class FloatGoal extends Goal { public FloatGoal(Mob mob) { this.mob = mob; -+ if (mob.getCommandSenderWorld().paperConfig().entities.behavior.spawnerNerfedMobsShouldJump) mob.goalFloat = this; // Paper ++ if (mob.getCommandSenderWorld().paperConfig().entities.behavior.spawnerNerfedMobsShouldJump) mob.goalFloat = this; // Paper - Allow nerfed mobs to jump and float this.setFlags(EnumSet.of(Goal.Flag.JUMP)); mob.getNavigation().setCanFloat(true); } diff --git a/patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/0024-Add-configurable-entity-despawn-distances.patch similarity index 84% rename from patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/0024-Add-configurable-entity-despawn-distances.patch index 587bb29c19..600e13736c 100644 --- a/patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/0024-Add-configurable-entity-despawn-distances.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Suddenly Date: Tue, 1 Mar 2016 13:51:54 -0600 -Subject: [PATCH] Add configurable despawn distances for living entities +Subject: [PATCH] Add configurable entity despawn distances diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 183866636eb67f632728a01c8e5e11b514d89f84..007a5c9a6dc70ca6a215fdeb3fe77f8a8ee46818 100644 +index 093c60df0948fd1a46aef86223ecc63bc9e8b440..7cbb74f4bc7b63af86b7b2c52783fb20c7739258 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -853,14 +853,14 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -13,7 +13,7 @@ index 183866636eb67f632728a01c8e5e11b514d89f84..007a5c9a6dc70ca6a215fdeb3fe77f8a if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); - int i = this.getType().getCategory().getDespawnDistance(); -+ int i = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard(); // Paper - custom despawn distances ++ int i = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard(); // Paper - Configurable despawn distances int j = i * i; if (d0 > (double) j && this.removeWhenFarAway(d0)) { @@ -21,7 +21,7 @@ index 183866636eb67f632728a01c8e5e11b514d89f84..007a5c9a6dc70ca6a215fdeb3fe77f8a } - int k = this.getType().getCategory().getNoDespawnDistance(); -+ int k = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - custom despawn distances ++ int k = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - Configurable despawn distances int l = k * k; if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) { diff --git a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch index a9e11b490f..e18525c452 100644 --- a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 2922b90241e81245dbd56c53ab2eb661314c04fd..9369e0346a6b511a332d54577c781c3d2c2b5c86 100644 +index d3a7de8d3fd92d36d3df257cae5686fc7f61d3c3..0d3ce1ad077128585bb8960d2d6d38b567bbe5d3 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -264,6 +264,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings -+ this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper ++ this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); } diff --git a/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch index 5d0ae749e1..21eaaaa49e 100644 --- a/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index d344b13e3726f0fe8a57c098769d1beea9705cdd..5d09790876c3c50d126678565001645f6aece16f 100644 +index d344b13e3726f0fe8a57c098769d1beea9705cdd..67088152004caeecf4a678618be19419862e7ff1 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -142,6 +142,16 @@ public class FallingBlockEntity extends Entity { } this.move(MoverType.SELF, this.getDeltaMovement()); -+ // Paper start - Configurable EntityFallingBlock height nerf ++ // Paper start - Configurable falling blocks height nerf + if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) { + if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { + this.spawnAtLocation(block); @@ -22,41 +22,41 @@ index d344b13e3726f0fe8a57c098769d1beea9705cdd..5d09790876c3c50d126678565001645f + this.discard(); + return; + } -+ // Paper end ++ // Paper end - Configurable falling blocks height nerf if (!this.level().isClientSide) { BlockPos blockposition = this.blockPosition(); boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index 36d93ee421406302c05945db17d46b04b485e4c0..f08c021f867c00611139a17db48352944eb2aa99 100644 +index 36d93ee421406302c05945db17d46b04b485e4c0..19e2f2005bd1fb4d199debd34e92a0794a3d3fe4 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -77,6 +77,12 @@ public class PrimedTnt extends Entity implements TraceableEntity { } this.move(MoverType.SELF, this.getDeltaMovement()); -+ // Paper start - Configurable TNT entity height nerf ++ // Paper start - Configurable TNT height nerf + if (this.level().paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) { + this.discard(); + return; + } -+ // Paper end ++ // Paper end - Configurable TNT height nerf this.setDeltaMovement(this.getDeltaMovement().scale(0.98D)); if (this.onGround()) { this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D)); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -index 0fc58f38bbd855414ad36b682e60b069d7b68cb1..9ec8821cf6571c5cc6b32212fe6f33bc4f6b949f 100644 +index 0fc58f38bbd855414ad36b682e60b069d7b68cb1..48f531da21fa0305ab1e8d5b50276e61e3155a38 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java @@ -53,6 +53,12 @@ public class MinecartTNT extends AbstractMinecart { public void tick() { super.tick(); if (this.fuse > 0) { -+ // Paper start - Configurable TNT entity height nerf ++ // Paper start - Configurable TNT height nerf + if (this.level().paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) { + this.discard(); + return; + } -+ // Paper end ++ // Paper end - Configurable TNT height nerf --this.fuse; this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D); } else if (this.fuse == 0) { diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 4b0e79f2b2..b38ef455b6 100644 --- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cfab6bdf3c3eaf456b60653377df05fcf74c53e3..0c3a23502ab6cb9e1f027b1050dd6849ceb181d9 100644 +index 75b39c8a8471bc37add3a012453c74217357535a..44715334bc69cc9b12f53cecb64381b8aef6fae3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1546,7 +1546,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // CraftBukkit - cb > vanilla! -+ return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Paper"; // Paper } public SystemReport fillSystemReport(SystemReport details) { @@ -32,7 +32,7 @@ index c41e0fe3421a9066a4a32e74fcc3a414d7006bbd..452fcc1106e25db87c1dd29fb839c45c private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 3436351140383f53404d37b8f974181724d13627..bf6ee9f7613e76daba9db4089d13a1f189d093b4 100644 +index c312c450055965d63db0ccdee8aa8e34e7051d0b..9f4c5a6f22719ae30d88ca02a1db4a3f39957943 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -241,12 +241,25 @@ public class Main { @@ -57,7 +57,7 @@ index 3436351140383f53404d37b8f974181724d13627..bf6ee9f7613e76daba9db4089d13a1f1 + } else { + System.out.println("Unable to read system info"); + } -+ // Paper end ++ // Paper end - Log Java and OS versioning to help with debugging plugin issues + System.out.println("Loading libraries, please wait..."); net.minecraft.server.Main.main(options); diff --git a/patches/server/0030-Player-affects-spawning-API.patch b/patches/server/0030-Player-affects-spawning-API.patch index 9501f491a1..cadd2053d6 100644 --- a/patches/server/0030-Player-affects-spawning-API.patch +++ b/patches/server/0030-Player-affects-spawning-API.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index 3126e8cab3c40e3af47f4c8925e1c6a9523309ba..170fbb1d80947b9b21c2106497baae5c37bcdc0c 100644 +index 3126e8cab3c40e3af47f4c8925e1c6a9523309ba..3207166061bf9c4d7bf3f38e5a9f7aff23ccd5c1 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -30,6 +30,11 @@ public final class EntitySelector { public static final Predicate CAN_BE_COLLIDED_WITH = EntitySelector.NO_SPECTATORS.and(Entity::canBeCollidedWith); private EntitySelector() {} -+ // Paper start ++ // Paper start - Affects Spawning API + public static final Predicate PLAYER_AFFECTS_SPAWNING = (entity) -> { + return !entity.isSpectator() && entity.isAlive() && entity instanceof Player player && player.affectsSpawning; + }; -+ // Paper end ++ // Paper end - Affects Spawning API public static Predicate withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 007a5c9a6dc70ca6a215fdeb3fe77f8a8ee46818..3d054cfa5050f4b75eab4a18035655c1bfd9290b 100644 +index 7cbb74f4bc7b63af86b7b2c52783fb20c7739258..3fcd93f6d5a7553b032b44e7e919838ad2120dc9 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -849,7 +849,7 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -29,7 +29,7 @@ index 007a5c9a6dc70ca6a215fdeb3fe77f8a8ee46818..3d054cfa5050f4b75eab4a18035655c1 this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { - Player entityhuman = this.level().getNearestPlayer(this, -1.0D); -+ Player entityhuman = this.level().findNearbyPlayer(this, -1.0D, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper ++ Player entityhuman = this.level().findNearbyPlayer(this, -1.0D, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper - Affects Spawning API if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); @@ -60,7 +60,7 @@ index 96181e8925aef7f3d0a2010305caf1f6d9bcfcc9..6f452605e9dc9ebd9980eae9fdeea344 return false; } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 38403a5bb8569f105056d61ca444d6b3a19becd2..2aec8e2f45fe6ba56d84e5a51a6e30d36505df42 100644 +index a779d32f87b59f347408974e402fad22fdc47f09..15ccde8ee8bac1f70c6047464595aff6db073646 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -326,7 +326,7 @@ public class Zombie extends Monster { @@ -73,16 +73,14 @@ index 38403a5bb8569f105056d61ca444d6b3a19becd2..2aec8e2f45fe6ba56d84e5a51a6e30d3 entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null, (CompoundTag) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index eed6481bc88ed15a5e3fe7056b545ab44ed81983..86d187cadb73dbe0757f9417c4549e358ff303ca 100644 +index eed6481bc88ed15a5e3fe7056b545ab44ed81983..f8d3e195c094ff200c0a7bd8cd4829ef36d328da 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -179,6 +179,9 @@ public abstract class Player extends LivingEntity { +@@ -179,6 +179,7 @@ public abstract class Player extends LivingEntity { @Nullable public FishingHook fishing; protected float hurtDir; -+ // Paper start -+ public boolean affectsSpawning = true; -+ // Paper end ++ public boolean affectsSpawning = true; // Paper - Affects Spawning API // CraftBukkit start public boolean fauxSleeping; @@ -100,18 +98,18 @@ index d156f7e3430685947d2b4c30aa867e8002ca70ad..e888cf862662ae6baa6d0de8188aa74a public void clientTick(Level world, BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e6463cdce 100644 +index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..1872de0804862be1986b4eb2e6cfe28f952fdde6 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -82,6 +82,11 @@ public interface EntityGetter { } } -+ // Paper start ++ // Paper start - Affects Spawning API + default @Nullable Player findNearbyPlayer(Entity entity, double maxDistance, @Nullable Predicate predicate) { + return this.getNearestPlayer(entity.getX(), entity.getY(), entity.getZ(), maxDistance, predicate); + } -+ // Paper end ++ // Paper end - Affects Spawning API @Nullable default Player getNearestPlayer(double x, double y, double z, double maxDistance, @Nullable Predicate targetPredicate) { double d = -1.0D; @@ -119,7 +117,7 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e return this.getNearestPlayer(x, y, z, maxDistance, predicate); } -+ // Paper start ++ // Paper start - Affects Spawning API + default boolean hasNearbyAlivePlayerThatAffectsSpawning(double x, double y, double z, double range) { + for (Player player : this.players()) { + if (EntitySelector.PLAYER_AFFECTS_SPAWNING.test(player)) { // combines NO_SPECTATORS and LIVING_ENTITY_STILL_ALIVE with an "affects spawning" check @@ -131,7 +129,7 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e + } + return false; + } -+ // Paper end ++ // Paper end - Affects Spawning API + default boolean hasNearbyAlivePlayer(double x, double y, double z, double range) { for(Player player : this.players()) { diff --git a/patches/server/0032-Only-refresh-abilities-if-needed.patch b/patches/server/0031-Only-refresh-abilities-if-needed.patch similarity index 92% rename from patches/server/0032-Only-refresh-abilities-if-needed.patch rename to patches/server/0031-Only-refresh-abilities-if-needed.patch index 0dceae5133..cc292acbab 100644 --- a/patches/server/0032-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0031-Only-refresh-abilities-if-needed.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c6c4a50bc9d8dbba4c8e5980417e93e190f25d42..9f1ab39b333ef51ed41a80d5d513a7c1d30d92f9 100644 +index e1647bc92cc3a7e887cacb8d204ffb120114ff05..7aa9787b96862e427cfd0011bccc0895b0c8f4cd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1984,12 +1984,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0991-fix-ItemMeta-removing-CustomModelData.patch b/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch similarity index 86% rename from patches/server/0991-fix-ItemMeta-removing-CustomModelData.patch rename to patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch index 6df545066e..e76034d354 100644 --- a/patches/server/0991-fix-ItemMeta-removing-CustomModelData.patch +++ b/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix ItemMeta removing CustomModelData diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index b2f9a670c5224fb63081466fa594b2b4b3e8bddb..95c75aadea68e9b60caa935a88f2829e36948ae5 100644 +index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..814c4cf3f3b0fee53cbad9855525fb18e6631748 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -381,7 +381,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -353,7 +353,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } diff --git a/patches/server/0033-Entity-Origin-API.patch b/patches/server/0033-Entity-Origin-API.patch index 123d44ed16..b3c68af9ba 100644 --- a/patches/server/0033-Entity-Origin-API.patch +++ b/patches/server/0033-Entity-Origin-API.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ded164bbc983a058c944ebf43d2f46f3deeb59da..9c6e9d628765fe8aaf0a275a57cede21d40fad23 100644 +index ded164bbc983a058c944ebf43d2f46f3deeb59da..ef26da06b13254b2b745e7e62540f78615c81252 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2403,6 +2403,15 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit -+ // Paper start - Set origin location when the entity is being added to the world ++ // Paper start - Entity origin API + if (entity.getOriginVector() == null) { + entity.setOrigin(entity.getBukkitEntity().getLocation()); + } @@ -20,29 +20,29 @@ index ded164bbc983a058c944ebf43d2f46f3deeb59da..9c6e9d628765fe8aaf0a275a57cede21 + if (entity.getOriginWorld() == null) { + entity.setOrigin(entity.getOriginVector().toLocation(getWorld())); + } -+ // Paper end ++ // Paper end - Entity origin API } public void onTrackingEnd(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6ef314ccc9 100644 +index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..3afb2a7b02e10976eca5bcd9cf9f29223326a1cd 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -319,7 +319,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public long activatedTick = Integer.MIN_VALUE; public void inactiveTick() { } // Spigot end -+ // Paper start ++ // Paper start - Entity origin API + @javax.annotation.Nullable + private org.bukkit.util.Vector origin; + @javax.annotation.Nullable + private UUID originWorld; -+ + + public void setOrigin(@javax.annotation.Nonnull Location location) { + this.origin = location.toVector(); + this.originWorld = location.getWorld().getUID(); + } - ++ + @javax.annotation.Nullable + public org.bukkit.util.Vector getOriginVector() { + return this.origin != null ? this.origin.clone() : null; @@ -52,7 +52,7 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6e + public UUID getOriginWorld() { + return this.originWorld; + } -+ // Paper end ++ // Paper end - Entity origin API public float getBukkitYaw() { return this.yRot; } @@ -60,7 +60,7 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6e this.bukkitEntity.storeBukkitValues(nbttagcompound); } // CraftBukkit end -+ // Paper start - Save the entity's origin location ++ // Paper start + if (this.origin != null) { + UUID originWorld = this.originWorld != null ? this.originWorld : this.level != null ? this.level.getWorld().getUID() : null; + if (originWorld != null) { @@ -76,7 +76,7 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6e } // CraftBukkit end -+ // Paper start - Restore the entity's origin location ++ // Paper start + ListTag originTag = nbt.getList("Paper.Origin", net.minecraft.nbt.Tag.TAG_DOUBLE); + if (!originTag.isEmpty()) { + UUID originWorld = null; @@ -93,44 +93,6 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6e } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded"); -diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 5d09790876c3c50d126678565001645f6aece16f..6c4224e4752b655710c5b992d9acf9563b183483 100644 ---- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -343,6 +343,14 @@ public class FallingBlockEntity extends Entity { - this.blockState = Blocks.SAND.defaultBlockState(); - } - -+ // Paper start - Try and load origin location from the old NBT tags for backwards compatibility -+ if (nbt.contains("SourceLoc_x")) { -+ int srcX = nbt.getInt("SourceLoc_x"); -+ int srcY = nbt.getInt("SourceLoc_y"); -+ int srcZ = nbt.getInt("SourceLoc_z"); -+ this.setOrigin(new org.bukkit.Location(this.level().getWorld(), srcX, srcY, srcZ)); -+ } -+ // Paper end - } - - public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) { -diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index f08c021f867c00611139a17db48352944eb2aa99..5c3b86e2301079e775971aa4da6a8f2dc6a40d1f 100644 ---- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -132,6 +132,14 @@ public class PrimedTnt extends Entity implements TraceableEntity { - this.setBlockState(NbtUtils.readBlockState(this.level().holderLookup(Registries.BLOCK), nbt.getCompound("block_state"))); - } - -+ // Paper start - Try and load origin location from the old NBT tags for backwards compatibility -+ if (nbt.contains("SourceLoc_x")) { -+ int srcX = nbt.getInt("SourceLoc_x"); -+ int srcY = nbt.getInt("SourceLoc_y"); -+ int srcZ = nbt.getInt("SourceLoc_z"); -+ this.setOrigin(new org.bukkit.Location(this.level().getWorld(), srcX, srcY, srcZ)); -+ } -+ // Paper end - } - - @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index e269812e6193492afc3f25612edafa1a58325fa3..49294a8d580d891f21d8d4cbae14ae477c01ff8d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch similarity index 82% rename from patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch rename to patches/server/0034-Prevent-block-entity-and-entity-crashes.patch index 746e45c7bc..19eb8dc502 100644 --- a/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch +++ b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 Mar 2016 23:52:34 -0600 -Subject: [PATCH] Prevent tile entity and entity crashes +Subject: [PATCH] Prevent block entity and entity crashes diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6818173e3f798b4d89a17c6934020cc929ec5e4e..5315def7ff7ba0be6c09be86453284f3aed29576 100644 +index 0d3ce1ad077128585bb8960d2d6d38b567bbe5d3..99133791afe8a8b5edfbe45eadfa3e0f4e4484a7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -739,11 +739,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -17,16 +17,16 @@ index 6818173e3f798b4d89a17c6934020cc929ec5e4e..5315def7ff7ba0be6c09be86453284f3 - - entity.fillCrashReportCategory(crashreportsystemdetails); - throw new ReportedException(crashreport); -+ // Paper start - Prevent tile entity and entity crashes ++ // Paper start - Prevent block entity and entity crashes + final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); + MinecraftServer.LOGGER.error(msg, throwable); + entity.discard(); -+ // Paper end ++ // Paper end - Prevent block entity and entity crashes } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index b300d12e9e00519028b53aca9c3fb01f589eaa91..63acd109a79ed752a05df3d4f1b99309297c2055 100644 +index b300d12e9e00519028b53aca9c3fb01f589eaa91..66757716b401d4f5b690c895effbbaa46f169238 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -213,7 +213,12 @@ public abstract class BlockEntity { @@ -34,17 +34,17 @@ index b300d12e9e00519028b53aca9c3fb01f589eaa91..63acd109a79ed752a05df3d4f1b99309 }); if (this.level != null) { - CrashReportCategory.populateBlockDetails(crashReportSection, this.level, this.worldPosition, this.getBlockState()); -+ // Paper start - Prevent TileEntity and Entity crashes ++ // Paper start - Prevent block entity and entity crashes + BlockState block = this.getBlockState(); + if (block != null) { + CrashReportCategory.populateBlockDetails(crashReportSection, this.level, this.worldPosition, block); + } -+ // Paper end ++ // Paper end - Prevent block entity and entity crashes CrashReportCategory.populateBlockDetails(crashReportSection, this.level, this.worldPosition, this.level.getBlockState(this.worldPosition)); } } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index a664126bbcd29026e9d6770e362aa04c2c0b3fc8..92ae6e100cd70772dfc781bb630f41e94f0cdd06 100644 +index a664126bbcd29026e9d6770e362aa04c2c0b3fc8..ae62ef9bad1774cc6aecb686660ef19244bd1365 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1159,11 +1159,11 @@ public class LevelChunk extends ChunkAccess { @@ -56,11 +56,11 @@ index a664126bbcd29026e9d6770e362aa04c2c0b3fc8..92ae6e100cd70772dfc781bb630f41e9 - - this.blockEntity.fillCrashReportCategory(crashreportsystemdetails); - throw new ReportedException(crashreport); -+ // Paper start - Prevent tile entity and entity crashes ++ // Paper start - Prevent block entity and entity crashes + final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); + net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); + LevelChunk.this.removeBlockEntity(this.getPos()); -+ // Paper end ++ // Paper end - Prevent block entity and entity crashes // Spigot start } finally { this.blockEntity.tickTimer.stopTiming(); diff --git a/patches/server/0035-Configurable-top-of-nether-void-damage.patch b/patches/server/0035-Configurable-top-of-nether-void-damage.patch index 604c2aa416..29e69553ea 100644 --- a/patches/server/0035-Configurable-top-of-nether-void-damage.patch +++ b/patches/server/0035-Configurable-top-of-nether-void-damage.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Configurable top of nether void damage Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 37eab94ce7e4ba01c2c8a5fb15ef1f6ef314ccc9..16fa26878fc7bcf5d22d779ce7b37a59582ba033 100644 +index 3afb2a7b02e10976eca5bcd9cf9f29223326a1cd..47dc48fcf1e0d3a717479ce2738bfb79961bbed3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -722,7 +722,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -18,12 +18,12 @@ index 37eab94ce7e4ba01c2c8a5fb15ef1f6ef314ccc9..16fa26878fc7bcf5d22d779ce7b37a59 + if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER + && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) + && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { -+ // Paper end ++ // Paper end - Configurable nether ceiling damage this.onBelowWorld(); } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index 02e3322ec41108fe9275510e2daa833d180353dc..0762bb248b3bd43a06e89aa1893a6189f0e13866 100644 +index 02e3322ec41108fe9275510e2daa833d180353dc..550b7bc694d861c084769265f6c49c4d44033296 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -55,7 +55,7 @@ public class PortalForcer { @@ -31,7 +31,7 @@ index 02e3322ec41108fe9275510e2daa833d180353dc..0762bb248b3bd43a06e89aa1893a6189 return holder.is(PoiTypes.NETHER_PORTAL); }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> { - return worldborder.isWithinBounds(villageplacerecord.getPos()); -+ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - don't teleport into void damage ++ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - Configurable nether ceiling damage }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error return villageplacerecord.getPos().distSqr(blockposition); }).thenComparingInt((villageplacerecord) -> { @@ -39,11 +39,11 @@ index 02e3322ec41108fe9275510e2daa833d180353dc..0762bb248b3bd43a06e89aa1893a6189 BlockPos blockposition2 = null; WorldBorder worldborder = this.level.getWorldBorder(); int i = Math.min(this.level.getMaxBuildHeight(), this.level.getMinBuildHeight() + this.level.getLogicalHeight()) - 1; -+ // Paper start - if ceiling void damage is enabled, make sure the max height doesn't exceed the void damage height ++ // Paper start - Configurable nether ceiling damage; make sure the max height doesn't exceed the void damage height + if (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.enabled()) { + i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1); + } -+ // Paper end ++ // Paper end - Configurable nether ceiling damage BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable(); Iterator iterator = BlockPos.spiralAround(blockposition, createRadius, Direction.EAST, Direction.SOUTH).iterator(); // CraftBukkit diff --git a/patches/server/0038-Configurable-end-credits.patch b/patches/server/0038-Configurable-end-credits.patch index 762d732bb9..f21417dc70 100644 --- a/patches/server/0038-Configurable-end-credits.patch +++ b/patches/server/0038-Configurable-end-credits.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Configurable end credits diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b6939932a4b8800c8751125a4a6d4dcea39110c1..bf89ea0f7506434848cb9c1cbfb3fe6dd2eb3212 100644 +index 682388297375ea43515388bbdf9f7d2b949a7a62..11d2a3fd4e7baa00276f358c9b97752dbc6a76fd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1074,6 +1074,7 @@ public class ServerPlayer extends Player { this.unRide(); this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.wonGame) { -+ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Toggle to always disable end credits ++ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Option to disable end credits this.wonGame = true; this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F)); this.seenCredits = true; diff --git a/patches/server/0040-Optimize-explosions.patch b/patches/server/0040-Optimize-explosions.patch index bfe5d90649..229a5f849d 100644 --- a/patches/server/0040-Optimize-explosions.patch +++ b/patches/server/0040-Optimize-explosions.patch @@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 21fc0ce46567d7bd7f24759779f8586efe72fc9f..8072eedb5bc699aa5b04fbca39f4db30534cde4b 100644 +index 44715334bc69cc9b12f53cecb64381b8aef6fae3..bb66ed2fa4bbf4e8836022b210ca754b821adf95 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1479,6 +1479,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot -+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder ++ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { diff --git a/patches/server/0043-Disable-ice-and-snow.patch b/patches/server/0043-Disable-ice-and-snow.patch index 99dfc676d7..15a411e5eb 100644 --- a/patches/server/0043-Disable-ice-and-snow.patch +++ b/patches/server/0043-Disable-ice-and-snow.patch @@ -5,20 +5,20 @@ Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 11a829cc28e01f083c4669a8a28e377b96c3db0a..f1b34765b436461f09e8b9122cb981e319684838 100644 +index 6a3caf6107430e210ee1e689af2cd6d44d9c3713..a09299befdab37bfd3ceb42f9608e285eae5fde6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -876,11 +876,13 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.popPush("iceandsnow"); -+ if (!this.paperConfig().environment.disableIceAndSnow) { // Paper ++ if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int l = 0; l < randomTickSpeed; ++l) { if (this.random.nextInt(48) == 0) { this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15)); } } -+ } // Paper ++ } // Paper - Option to disable ice and snow gameprofilerfiller.popPush("tickBlocks"); timings.chunkTicksBlocks.startTiming(); // Paper diff --git a/patches/server/0044-Configurable-mob-spawner-tick-rate.patch b/patches/server/0044-Configurable-mob-spawner-tick-rate.patch index d9eb9b45d2..a34fa86ce5 100644 --- a/patches/server/0044-Configurable-mob-spawner-tick-rate.patch +++ b/patches/server/0044-Configurable-mob-spawner-tick-rate.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Configurable mob spawner tick rate diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index e888cf862662ae6baa6d0de8188aa74a9c6a8e00..bd48f49d50709354abc5bcff155b5abb9ab20191 100644 +index e888cf862662ae6baa6d0de8188aa74a9c6a8e00..a46293dafeb73f9206b92a2850df18a6a5f688b4 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -47,6 +47,7 @@ public abstract class BaseSpawner { public int maxNearbyEntities = 6; public int requiredPlayerRange = 16; public int spawnRange = 4; -+ private int tickDelay = 0; // Paper ++ private int tickDelay = 0; // Paper - Configurable mob spawner tick rate public BaseSpawner() {} @@ -24,16 +24,16 @@ index e888cf862662ae6baa6d0de8188aa74a9c6a8e00..bd48f49d50709354abc5bcff155b5abb + if (spawnDelay > 0 && --tickDelay > 0) return; + tickDelay = world.paperConfig().tickRates.mobSpawner; + if (tickDelay == -1) { return; } // If disabled -+ // Paper end ++ // Paper end - Configurable mob spawner tick rate if (this.isNearPlayer(world, pos)) { - if (this.spawnDelay == -1) { -+ if (this.spawnDelay < -tickDelay) { ++ if (this.spawnDelay < -tickDelay) { // Paper - Configurable mob spawner tick rate this.delay(world, pos); } if (this.spawnDelay > 0) { - --this.spawnDelay; -+ this.spawnDelay -= tickDelay; // Paper ++ this.spawnDelay -= tickDelay; // Paper - Configurable mob spawner tick rate } else { boolean flag = false; RandomSource randomsource = world.getRandom(); diff --git a/patches/server/0046-Add-BeaconEffectEvent.patch b/patches/server/0046-Add-BeaconEffectEvent.patch index 55ce19b8a7..fa44d8e1d5 100644 --- a/patches/server/0046-Add-BeaconEffectEvent.patch +++ b/patches/server/0046-Add-BeaconEffectEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 9fb27f93a7ccbf64f9babf19f626d1f45b1c7103..18349957bd6d1a4bc21aff781a791f912dddff1d 100644 +index 9fb27f93a7ccbf64f9babf19f626d1f45b1c7103..f4e1dc338dd240371694dd7a3455c79d5cea251a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -43,6 +43,10 @@ import net.minecraft.world.phys.AABB; @@ -33,7 +33,7 @@ index 9fb27f93a7ccbf64f9babf19f626d1f45b1c7103..18349957bd6d1a4bc21aff781a791f91 + // Paper start - BeaconEffectEvent + org.bukkit.block.Block block = ((Player) list.get(0)).level().getWorld().getBlockAt(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ()); + PotionEffect effect = CraftPotionUtil.toBukkit(new MobEffectInstance(effects, i, b0, true, true)); -+ // Paper end ++ // Paper end - BeaconEffectEvent while (iterator.hasNext()) { - entityhuman = (Player) iterator.next(); @@ -43,7 +43,7 @@ index 9fb27f93a7ccbf64f9babf19f626d1f45b1c7103..18349957bd6d1a4bc21aff781a791f91 + BeaconEffectEvent event = new BeaconEffectEvent(block, effect, (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), isPrimary); + if (CraftEventFactory.callEvent(event).isCancelled()) continue; + entityhuman.addEffect(new MobEffectInstance(CraftPotionUtil.fromBukkit(event.getEffect())), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.BEACON); -+ // Paper end ++ // Paper end - BeaconEffectEvent } } } diff --git a/patches/server/0047-Configurable-container-update-tick-rate.patch b/patches/server/0047-Configurable-container-update-tick-rate.patch index 031d9d4278..7bcb87ec73 100644 --- a/patches/server/0047-Configurable-container-update-tick-rate.patch +++ b/patches/server/0047-Configurable-container-update-tick-rate.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Configurable container update tick rate diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 686b42a9b4475fe3d530a9b950c1cc8f04717a65..d986c09392182335112040d4b6feae6a1a740d84 100644 +index 94571a63353b014f7aa30d8d0453332265c1d53f..ca511ec40965eb33f1e0e5c257ed9ae4e3d26d62 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -247,6 +247,7 @@ public class ServerPlayer extends Player { private RemoteChatSession chatSession; private int containerCounter; public boolean wonGame; -+ private int containerUpdateDelay; // Paper ++ private int containerUpdateDelay; // Paper - Configurable container update tick rate // CraftBukkit start public String displayName; @@ -26,7 +26,7 @@ index 686b42a9b4475fe3d530a9b950c1cc8f04717a65..d986c09392182335112040d4b6feae6a + this.containerMenu.broadcastChanges(); + containerUpdateDelay = this.level().paperConfig().tickRates.containerUpdate; + } -+ // Paper end ++ // Paper end - Configurable container update tick rate if (!this.level().isClientSide && !this.containerMenu.stillValid(this)) { this.closeContainer(); this.containerMenu = this.inventoryMenu; diff --git a/patches/server/0060-Add-exception-reporting-event.patch b/patches/server/0060-Add-exception-reporting-event.patch index 8d89dd05f7..0f11c822c3 100644 --- a/patches/server/0060-Add-exception-reporting-event.patch +++ b/patches/server/0060-Add-exception-reporting-event.patch @@ -88,7 +88,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..2b5b2869589991be37a4f128faabbff5 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index f7407f5204a2cbfcc46987d5e0a34770b2e5abbf..813a79866794bad9d0da105345641a6e9136ddf8 100644 +index 19f1be39c5e245c7e999ade36e53bff8d011dedb..0023f4f4572261e38136d3629cc35679454294f5 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1,5 +1,10 @@ @@ -103,12 +103,12 @@ index f7407f5204a2cbfcc46987d5e0a34770b2e5abbf..813a79866794bad9d0da105345641a6e import com.mojang.serialization.Codec; import java.io.IOException; @@ -741,6 +746,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - // Paper start - Prevent tile entity and entity crashes + // Paper start - Prevent block entity and entity crashes final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); + getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent entity.discard(); - // Paper end + // Paper end - Prevent block entity and entity crashes } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java index 5d65baba605dd83e5f74d526aeda36d8ede8c014..604766a286d00bb4b40c20482376fe80651beabe 100644 @@ -131,7 +131,7 @@ index 5d65baba605dd83e5f74d526aeda36d8ede8c014..604766a286d00bb4b40c20482376fe80 } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 92ae6e100cd70772dfc781bb630f41e94f0cdd06..40a829fa6b6410c2736af96ef1a46cf589056641 100644 +index ae62ef9bad1774cc6aecb686660ef19244bd1365..54aed742984809601d64f22ccf5db2d68b3831a2 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ @@ -164,12 +164,12 @@ index 92ae6e100cd70772dfc781bb630f41e94f0cdd06..40a829fa6b6410c2736af96ef1a46cf5 } } @@ -1162,6 +1169,7 @@ public class LevelChunk extends ChunkAccess { - // Paper start - Prevent tile entity and entity crashes + // Paper start - Prevent block entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); + net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent LevelChunk.this.removeBlockEntity(this.getPos()); - // Paper end + // Paper end - Prevent block entity and entity crashes // Spigot start diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java index 5103081e8469dd5a393595eae00c6f6c9d0a5028..9623a7bac79af37016ba5a5b37d4ef0b3dcb7312 100644 diff --git a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch index ba1e9aaad7..1a9455734f 100644 --- a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c893e7ed3d5db0de6a248f924a4f6f747fc71f00..b88ad110166915173d32fd00dd6bf8b22009b601 100644 +index 41422f3a54e5ee749b7389bfe761b4430e24f274..f03bacff1963650327bc94664b1ac00eb12d362d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2720,5 +2720,23 @@ public final class CraftServer implements Server { +@@ -2709,5 +2709,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 5db9abac5a..655b355b57 100644 --- a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1c0238932eec690d369dc9d55069f8b6aa15ada3..53a135f9f61a29ddfff5aa7eb20b96a2f0fc1fdf 100644 +index bb66ed2fa4bbf4e8836022b210ca754b821adf95..b7854ac5fc753302cf1ab171c561e073cc2fb3e3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1447,6 +1447,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 817e0ddc8821dd112fc5aa72bbbe11fdd1b56488..181a4e0e44cd05528c66ce87b653c33d6bd2fd03 100644 +index 6283b7ef17a7c128efb24206fe4f7201fcc48a3e..b389c99d6c19f4d63a3bf220aa165052ea28bf7d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -30,7 +30,7 @@ index 817e0ddc8821dd112fc5aa72bbbe11fdd1b56488..181a4e0e44cd05528c66ce87b653c33d public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e8b2e1f45ecd13ac4bfc2c3eb09f2d397b997b78..f711a4ef9168e05c7d795a1a831c608b19cc989c 100644 +index feaa6e1eaaa8f99f9d68b2da98be63b583e09b68..4f7d59c32db29ac95f237124c19d5a29272c8d42 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -506,7 +506,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch index ea98fc81c5..68b738f152 100644 --- a/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 181a4e0e44cd05528c66ce87b653c33d6bd2fd03..449f2ebc77a1850fc948bffc66e605f7bdc8efdd 100644 +index b389c99d6c19f4d63a3bf220aa165052ea28bf7d..31439413aa5ed26b7983ac22fe9ac44786fe0e33 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2415,6 +2415,7 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.setOrigin(entity.getOriginVector().toLocation(getWorld())); } - // Paper end + // Paper end - Entity origin API + new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity(), ServerLevel.this.getWorld()).callEvent(); // Paper - fire while valid } diff --git a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch index b6715be13c..7746d0d0a5 100644 --- a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch +++ b/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9697e189cf79994ed7d231c7801761791c128310..da845f0e07e1541514c60252192d49a85163b1a8 100644 +index e7e892234d4ff95f628e1c368161345f47fa1efc..b27c991d4b7615d0305d01155c908cfcaa8cd4ab 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -190,6 +190,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -25,7 +25,7 @@ index 9697e189cf79994ed7d231c7801761791c128310..da845f0e07e1541514c60252192d49a8 this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.profiler = this.metricsRecorder.getProfiler(); this.onMetricsRecordingStopped = (methodprofilerresults) -> { -@@ -2420,9 +2422,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { diff --git a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch index e9ab16c05f..b932c92135 100644 --- a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c41876842886e85f44e2cc64a2e6a48cf66c3609..5189806a847f27e125cab3a5395e30c9d076aa4e 100644 +index 914e551d7b2bc383c7247f1f584c6ea4f541887f..e5c3ee4c53dd1c09e35f1d1a47f4467a6a06ae71 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2765,5 +2765,10 @@ public final class CraftServer implements Server { +@@ -2754,5 +2754,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch index 02e920ba78..55cfa13cf6 100644 --- a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -250,7 +250,7 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5ab790ed036215d8b09f63f4f13a32a4af07e1c6..fae34d85f6c3a81f29fa625c78090895d3af31cc 100644 +index 1aed25e485a45c6bf77f0baebc1a7745f441af5b..1e1c6f8b22da3e51d001db11392f3ea8d3d3573d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -155,7 +155,7 @@ import org.slf4j.Logger; @@ -262,16 +262,15 @@ index 5ab790ed036215d8b09f63f4f13a32a4af07e1c6..fae34d85f6c3a81f29fa625c78090895 import joptsimple.OptionSet; import net.minecraft.nbt.NbtException; import net.minecraft.nbt.ReportedNbtException; -@@ -284,7 +284,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -370,7 +370,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); } diff --git a/patches/server/0173-Toggleable-player-crits.patch b/patches/server/0173-Toggleable-player-crits.patch index 03a7103dee..e7199ef60c 100644 --- a/patches/server/0173-Toggleable-player-crits.patch +++ b/patches/server/0173-Toggleable-player-crits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Toggleable player crits diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 5680bc0c9c71f915f66eecae401e8f51dc4225fe..4bba558b77d857ebc422c0313ba7b914df4dc2a8 100644 +index 5fa0e0c5293eda8a368c1801a9b5255807bf078c..04d02c456d2e3562dcd122cb1951f8de3d808f7f 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1234,6 +1234,7 @@ public abstract class Player extends LivingEntity { +@@ -1232,6 +1232,7 @@ public abstract class Player extends LivingEntity { boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; diff --git a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch index 0f625038b5..a6f11ff3e2 100644 --- a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch @@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fae34d85f6c3a81f29fa625c78090895d3af31cc..34189700b682377426bb70c9684f56115a6ab112 100644 +index 1e1c6f8b22da3e51d001db11392f3ea8d3d3573d..3d066e2a985ed46bc73d9856490d4aa692de26f3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,6 +3,9 @@ package net.minecraft.server; @@ -194,7 +194,7 @@ index fae34d85f6c3a81f29fa625c78090895d3af31cc..34189700b682377426bb70c9684f5611 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1424,7 +1427,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 42f8c39fa5f9f31c03d4e7af9fb6b7a842f29aae..d6437a6b6b90ceb6fe7d2375ab2fc9e28b469c9b 100644 +index 23f233adc1a3910237bb065a41e5d3d074d5bfd0..fad0460ac5d6792384fa46ff9741fee1887e792c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1909,8 +1909,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -83,7 +83,7 @@ index fa1c7d1781a2e2269359fa1860de79e918de7635..854177cb491d602c1f33e3496e01ba8a } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 374a91e712c2a6a8ad87d1047bb07d44eaa9908a..70820b8d95c71ea6df8a5cae16784ed764440a45 100644 +index 15ad425b9c091ee27965fe166f9021509199aa18..4ae0f36276592e37aeb5f881b713efa76d086f8e 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1646,7 +1646,7 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -161,10 +161,10 @@ index 81003ce3f05c6be6f52a92b86a4721235f4ce12a..cae7e3e85c3b911f50f8a06badf695c3 } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index bfc33822ab5ca58d77e11d3cbd140ba6c0374a6e..871adf673c536912604ea18f8146e7eead01bde5 100644 +index f28e9f06596cea6904b407fa87835f21d07817fa..5f59c7436756645a74ea730b026deb25d1571c9c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1277,9 +1277,9 @@ public abstract class Player extends LivingEntity { +@@ -1275,9 +1275,9 @@ public abstract class Player extends LivingEntity { if (flag5) { if (i > 0) { if (target instanceof LivingEntity) { @@ -176,7 +176,7 @@ index bfc33822ab5ca58d77e11d3cbd140ba6c0374a6e..871adf673c536912604ea18f8146e7ee } this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); -@@ -1301,7 +1301,7 @@ public abstract class Player extends LivingEntity { +@@ -1299,7 +1299,7 @@ public abstract class Player extends LivingEntity { if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) { diff --git a/patches/server/0209-InventoryCloseEvent-Reason-API.patch b/patches/server/0209-InventoryCloseEvent-Reason-API.patch index 4d25cf13f1..0f69229863 100644 --- a/patches/server/0209-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0209-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6c6ccdf7fb1cab27af720b2c8ef9d68b4521a20d..d993f6421e17a24bd6c371298ae78c2bc2f8a7ac 100644 +index e85390265dca2a55d0bb6f8dd4682d5a8a6cf478..518a900888b0ab51646f12e6b43a3cc12de55564 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1474,7 +1474,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -29,12 +29,12 @@ index 6c6ccdf7fb1cab27af720b2c8ef9d68b4521a20d..d993f6421e17a24bd6c371298ae78c2b } // Spigot End diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 708d1033306da34844827854edaf8a68ed67a936..0bdb75f733896335b87a19eb4d29024186e2d4d0 100644 +index eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153ed06e9707 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -692,7 +692,7 @@ public class ServerPlayer extends Player { } - // Paper end + // Paper end - Configurable container update tick rate if (!this.level().isClientSide && !this.containerMenu.stillValid(this)) { - this.closeContainer(); + this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason @@ -117,10 +117,10 @@ index 99ba7c82f8a8db9d5841cce18ed5f39439b512b0..5517f873e709b6f3b9206f0ad0212a95 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 871adf673c536912604ea18f8146e7eead01bde5..f9d7ef3b689ce1411b922649f9ee64dca34d3c74 100644 +index 5f59c7436756645a74ea730b026deb25d1571c9c..fb4cc32f2840098a13981ec4328e7eb6fe4f714b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -265,7 +265,7 @@ public abstract class Player extends LivingEntity { +@@ -263,7 +263,7 @@ public abstract class Player extends LivingEntity { this.updateIsUnderwater(); super.tick(); if (!this.level().isClientSide && this.containerMenu != null && !this.containerMenu.stillValid(this)) { @@ -129,7 +129,7 @@ index 871adf673c536912604ea18f8146e7eead01bde5..f9d7ef3b689ce1411b922649f9ee64dc this.containerMenu = this.inventoryMenu; } -@@ -497,6 +497,13 @@ public abstract class Player extends LivingEntity { +@@ -495,6 +495,13 @@ public abstract class Player extends LivingEntity { } diff --git a/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index be8a38cbae..c622fec25e 100644 --- a/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -17,11 +17,11 @@ index d04d0b9cbf91beb57da7e37e72f8e7c98cf6cf4c..e6e3a7ae08f7346ccbce02b9d3623948 Iterator iterator = list.iterator(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 9d2cf866cf4f0c93dea028e3673d9a51615059af..232dfdb70e31485969a972bfad53762edacf8549 100644 +index 0ce0bdf8de679998a32cf8c6e07be2ed56f10edb..18b6094ecd36ac50fc616e24f6d197352ae78e91 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -777,6 +777,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - // Paper end + // Paper end - Prevent block entity and entity crashes } } + // Paper start - Option to prevent armor stands from doing entity lookups diff --git a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch index 9d4b04066a..2df0c53f19 100644 --- a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,16 +9,16 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 34189700b682377426bb70c9684f56115a6ab112..feac302358f627c682c3294fca1ae21c8e57b84b 100644 +index 3d066e2a985ed46bc73d9856490d4aa692de26f3..46311cff83a7219508f74d862623b3c27eb8abea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1075,6 +1075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); }); diff --git a/patches/server/0269-Optimize-World-Time-Updates.patch b/patches/server/0269-Optimize-World-Time-Updates.patch index ac4e84b7e8..88845bfe55 100644 --- a/patches/server/0269-Optimize-World-Time-Updates.patch +++ b/patches/server/0269-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f43459256120b1d9bdc0f0e5f4e299c51bfaa504..df04c80feb1f427737e53080b592e39153da18ad 100644 +index 2a41f670c5298fc7cf901af21d8ad280435d7909..738c2a2acecc35dbd65d922044ab3763dd9644b4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1469,12 +1469,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 8a7032d909452cec6c4b3e99b02fb00df5cea324..5f384b764aa361d9cd575b9910afea789cb054bc 100644 +index bc4bac5607abc5146648a79419b28eb8ba1be0b2..faf704d805a1af037d0e8d4dd60a942a43e5b054 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2478,7 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -41,7 +41,7 @@ index 8a7032d909452cec6c4b3e99b02fb00df5cea324..5f384b764aa361d9cd575b9910afea78 entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit -+ ServerLevel.this.getChunkSource().addEntity(entity); - // Paper start - Set origin location when the entity is being added to the world ++ ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server + // Paper start - Entity origin API if (entity.getOriginVector() == null) { entity.setOrigin(entity.getBukkitEntity().getLocation()); diff --git a/patches/server/0346-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0346-Dead-Player-s-shouldn-t-be-able-to-move.patch index 71eab615ff..2bebf672b4 100644 --- a/patches/server/0346-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/patches/server/0346-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index fc9eed382c8de51b298102cdcf584bf7e19ea968..808a784a312438433fba0e65cbfd1afbad19fe86 100644 +index 80fba3abe6f971da951cf5b613ac54364d641a81..bae09577905084f3e3d845b9cd3eaea9f46899d1 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1153,7 +1153,7 @@ public abstract class Player extends LivingEntity { +@@ -1151,7 +1151,7 @@ public abstract class Player extends LivingEntity { @Override protected boolean isImmobile() { diff --git a/patches/server/0351-Prevent-opening-inventories-when-frozen.patch b/patches/server/0351-Prevent-opening-inventories-when-frozen.patch index 2b8439c66f..b26bd0f347 100644 --- a/patches/server/0351-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0351-Prevent-opening-inventories-when-frozen.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 538fe865ad27796371d11123ce03602719a9be68..2d8642f9a3dfa1a8a014fe773bbee93b86602677 100644 +index cdce839f310da5f7323b7d27120e7a7a81a52ee9..c58fb0d2937cc5534c4e81210f69cd5b09fa8bd5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -697,7 +697,7 @@ public class ServerPlayer extends Player { containerUpdateDelay = this.level().paperConfig().tickRates.containerUpdate; } - // Paper end + // Paper end - Configurable container update tick rate - if (!this.level().isClientSide && !this.containerMenu.stillValid(this)) { + if (!this.level().isClientSide && this.containerMenu != this.inventoryMenu && (this.isImmobile() || !this.containerMenu.stillValid(this))) { // Paper - Prevent opening inventories when frozen this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason diff --git a/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch index 7b2f30c00f..0e3b6dc935 100644 --- a/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch +++ b/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -87,10 +87,10 @@ index 4be466a21fb1fb936e1eaa6351e30a53c7b5cbb4..5657999a85b9b9dfb48a51170d5fa3d9 } // Paper end - Entity#getEntitySpawnReason diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b40eed864faf11962efc1e0df417074eb8737c6b..71b499843b25f78491ab2f7dad97523b9facd77c 100644 +index 4d0f9ee714ddcd93a5e6c53a81dacbe698507e6e..7332ef95cd4a9465c55de29de04412a9e2e197d4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2324,27 +2324,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2321,27 +2321,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // CraftBukkit end diff --git a/patches/server/0359-Add-phantom-creative-and-insomniac-controls.patch b/patches/server/0359-Add-phantom-creative-and-insomniac-controls.patch index 48cfa06f73..83892b75c4 100644 --- a/patches/server/0359-Add-phantom-creative-and-insomniac-controls.patch +++ b/patches/server/0359-Add-phantom-creative-and-insomniac-controls.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add phantom creative and insomniac controls diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index 170fbb1d80947b9b21c2106497baae5c37bcdc0c..c9c7833755af3c7bef1d40f2ca425cbec59efa68 100644 +index 3207166061bf9c4d7bf3f38e5a9f7aff23ccd5c1..ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -28,6 +28,7 @@ public final class EntitySelector { @@ -15,7 +15,7 @@ index 170fbb1d80947b9b21c2106497baae5c37bcdc0c..c9c7833755af3c7bef1d40f2ca425cbe + public static Predicate IS_INSOMNIAC = (player) -> net.minecraft.util.Mth.clamp(((net.minecraft.server.level.ServerPlayer) player).getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper - Add phantom creative and insomniac controls private EntitySelector() {} - // Paper start + // Paper start - Affects Spawning API diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java index 658393f451e46a93c5665fe3c580aa395ace68d1..ea980c2fdf01988ba25bffc7f8963d775101bee1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java diff --git a/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch b/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch index 13b35c9903..4f29a8c25d 100644 --- a/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch +++ b/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch @@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 71b499843b25f78491ab2f7dad97523b9facd77c..d2526510202c17006f22b148e4a1305714a4effd 100644 +index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba8781e8ea826 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2454,11 +2454,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2451,11 +2451,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { // CraftBukkit start - Capture drops for death event if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { @@ -34,7 +34,7 @@ index 71b499843b25f78491ab2f7dad97523b9facd77c..d2526510202c17006f22b148e4a13057 entityitem.setDefaultPickUpDelay(); // CraftBukkit start -@@ -3258,6 +3259,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3255,6 +3256,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Nullable public Entity teleportTo(ServerLevel worldserver, Vec3 location) { // CraftBukkit end @@ -47,7 +47,7 @@ index 71b499843b25f78491ab2f7dad97523b9facd77c..d2526510202c17006f22b148e4a13057 if (this.level() instanceof ServerLevel && !this.isRemoved()) { this.level().getProfiler().push("changeDimension"); // CraftBukkit start -@@ -3284,6 +3291,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3281,6 +3288,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit end this.level().getProfiler().popPush("reloading"); @@ -59,7 +59,7 @@ index 71b499843b25f78491ab2f7dad97523b9facd77c..d2526510202c17006f22b148e4a13057 Entity entity = this.getType().create(worldserver); if (entity != null) { -@@ -3301,10 +3313,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3298,10 +3310,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit start - Forward the CraftEntity to the new entity this.getBukkitEntity().setHandle(entity); entity.bukkitEntity = this.getBukkitEntity(); @@ -70,7 +70,7 @@ index 71b499843b25f78491ab2f7dad97523b9facd77c..d2526510202c17006f22b148e4a13057 // CraftBukkit end } -@@ -3423,7 +3431,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3420,7 +3428,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean canChangeDimensions() { diff --git a/patches/server/0365-misc-debugging-dumps.patch b/patches/server/0365-misc-debugging-dumps.patch index 127daea30c..70571b0360 100644 --- a/patches/server/0365-misc-debugging-dumps.patch +++ b/patches/server/0365-misc-debugging-dumps.patch @@ -42,10 +42,10 @@ index 40ff3090fb17fb0f01a9b52639fb783ea57ce6b6..d39743d9626eb01c942194387dafb110 StackTraceElement[] astacktraceelement = exception.getStackTrace(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a8115ac8e938631448d331b6d12d43a1e9646d68..480f4946658c3cc9c3c5acc1168a182297eb2bd7 100644 +index fe5041d05f93900a22049a2176cb59d226c263bf..ae7bddabc445dc42394235a3f87b2a3a5c27800a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -914,6 +914,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop this.getY() > v)) { if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { diff --git a/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch b/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch index c1ab7d31b2..1d2fd6c636 100644 --- a/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch +++ b/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ensure Entity position and AABB are never invalid Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d2526510202c17006f22b148e4a1305714a4effd..a6fc2a67027b749b9f87110aa15b339bdc58a72b 100644 +index b0eba706279b26b68d3bc3fce85ba8781e8ea826..11198bc084400d613545f511600810f02e4f3ffb 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -691,8 +691,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -20,7 +20,7 @@ index d2526510202c17006f22b148e4a1305714a4effd..a6fc2a67027b749b9f87110aa15b339b } protected AABB makeBoundingBox() { -@@ -4195,7 +4195,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4192,7 +4192,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale); } @@ -50,7 +50,7 @@ index d2526510202c17006f22b148e4a1305714a4effd..a6fc2a67027b749b9f87110aa15b339b // Paper start - rewrite chunk system if (this.updatingSectionStatus) { LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable()); -@@ -4219,6 +4241,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4216,6 +4238,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.levelCallback.onMove(); } diff --git a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 03be76b17b..9f9cf2f7e0 100644 --- a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead of restoring the server.properties every single load. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b9dbedd118a9287f659d2e785c3a582e817e4e36..e824ac0c487ab42c68cbf1a6f7c24d4b689809c3 100644 +index 71a47dd29bb950a9209fd5fe2fb23c96b88eb113..0e3e68ec5cd568c9fc89555597c167acb6563cee 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -825,7 +825,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop public - // Paper start - public boolean affectsSpawning = true; - // Paper end + public boolean affectsSpawning = true; // Paper - Affects Spawning API + + // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 93644aefd2e6c97eca2735812b2b7b4bd039cfb5..40f848d117c1a4f4fc2f11861c5f142071d56977 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/patches/server/0474-MC-4-Fix-item-position-desync.patch b/patches/server/0474-MC-4-Fix-item-position-desync.patch index e1d5b5d4e8..56b0f80efc 100644 --- a/patches/server/0474-MC-4-Fix-item-position-desync.patch +++ b/patches/server/0474-MC-4-Fix-item-position-desync.patch @@ -28,10 +28,10 @@ index 05ac41e136da43284fb24a6b698ebd36318278fb..3c4ac79c094dc2fff7de94150a34b7bf public Vec3 decode(long x, long y, long z) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a1cf6f17313f4f861f3c5c6ebcaafc85d9102b55..3877544229bc8a4e6e475060c4edca17c64ff739 100644 +index b9c919c466d6591492ede8a53df673114c50c1d9..18438f5c92840bd07e7ef0c2203d4ec943cb3161 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4238,6 +4238,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4235,6 +4235,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return; } // Paper end - rewrite chunk system diff --git a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch index d18bedb2dc..07d0008923 100644 --- a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch +++ b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 589feabf9ad471462aa7fb46f179b5de9455ff65..1aa73c3934c754fb9a4e09e8ac9c7f96d608ceb5 100644 +index e60e5f94cd05d71b29414f2a911ac4ce9d8f7412..5429906d0d793a45d7cedc2c14cae9d3e0ebb5e2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2039,7 +2039,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2072,6 +2078,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent @@ -17,7 +17,7 @@ index 1aa73c3934c754fb9a4e09e8ac9c7f96d608ceb5..849161e11d547445d9bd10ac54bcd994 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5020d671c7bbaf4277c300f3688c770b6a565129..f69fae303770b3ccace8e7d421b762504a7cb5dc 100644 +index e6216892f5bbc22dfde1eebfea33709e2eea841c..a24c782dfdf47868fdd8d494f0af1024fdc6ebe5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch index a307882c30..0b21df32eb 100644 --- a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 849161e11d547445d9bd10ac54bcd994a62aab06..22ffae1e5b0ea77b9c9330f521e31af77fe0d276 100644 +index 7857a385aef33fa3bc9bfe01223016c0eb879112..d4c1b31eb016bb6f39d3a399fb07f3cee40d6391 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2170,7 +2170,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); -@@ -2833,6 +2863,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2830,6 +2860,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.processPortalCooldown(); diff --git a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch index fd228bc63c..e614329b11 100644 --- a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d1d7f4c3963986031ea26562549ee15c8232a5a9..64b31447847d3b40ba00c4e6708d68113f2ef2bd 100644 +index 0a7589ef5e9ac21e0d3cb077f19cd8b99fb8e00f..3f0c5ccc53663ae006ad09b4eba7f372e9caf357 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2387,7 +2387,7 @@ public class ServerPlayer extends Player { @@ -18,10 +18,10 @@ index d1d7f4c3963986031ea26562549ee15c8232a5a9..64b31447847d3b40ba00c4e6708d6811 this.awardStat(Stats.DROP); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index d6960cfe647f7ad8c2279b30d8af8a0e11be829f..7899b55fd6f4099241d23be750669f7a9863cf0c 100644 +index caa71993f3ee344151a3e053ba527b868c13251b..b113c886b81d9ac77f16aa5acf7e1d9e61854b9f 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -725,6 +725,11 @@ public abstract class Player extends LivingEntity { +@@ -723,6 +723,11 @@ public abstract class Player extends LivingEntity { } double d0 = this.getEyeY() - 0.30000001192092896D; diff --git a/patches/server/0610-Optimize-indirect-passenger-iteration.patch b/patches/server/0610-Optimize-indirect-passenger-iteration.patch index b9595fffe4..58246604f3 100644 --- a/patches/server/0610-Optimize-indirect-passenger-iteration.patch +++ b/patches/server/0610-Optimize-indirect-passenger-iteration.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 002979f629798a8d39013c3a905f9b356abd115c..22620662491547c2d689e5a703d80bfd723eaa77 100644 +index 5f8144b847e0fb62bd8db48c035b33c0fa9ed5d8..bf9499f076e4eabc69d45d95705964daa56a570c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3878,20 +3878,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3875,20 +3875,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } private Stream getIndirectPassengersStream() { @@ -43,7 +43,7 @@ index 002979f629798a8d39013c3a905f9b356abd115c..22620662491547c2d689e5a703d80bfd return () -> { return this.getIndirectPassengersStream().iterator(); }; -@@ -3914,6 +3928,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3911,6 +3925,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Paper end - rewrite chunk system public boolean hasExactlyOnePlayerPassenger() { diff --git a/patches/server/0618-Add-back-EntityPortalExitEvent.patch b/patches/server/0618-Add-back-EntityPortalExitEvent.patch index 562783378c..6837ae902e 100644 --- a/patches/server/0618-Add-back-EntityPortalExitEvent.patch +++ b/patches/server/0618-Add-back-EntityPortalExitEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 22620662491547c2d689e5a703d80bfd723eaa77..e5f265d71fe10fe1c9cb1ec95958f0c42063e51c 100644 +index bf9499f076e4eabc69d45d95705964daa56a570c..5755c836024de4c8c25b026baa47c193a2df2a0b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3327,6 +3327,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3324,6 +3324,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { // CraftBukkit start worldserver = shapedetectorshape.world; @@ -37,7 +37,7 @@ index 22620662491547c2d689e5a703d80bfd723eaa77..e5f265d71fe10fe1c9cb1ec95958f0c4 if (worldserver == this.level) { // SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot); -@@ -3346,8 +3368,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3343,8 +3365,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (entity != null) { entity.restoreFrom(this); diff --git a/patches/server/0624-Add-critical-damage-API.patch b/patches/server/0624-Add-critical-damage-API.patch index 5669c3dbdd..8c81a77eea 100644 --- a/patches/server/0624-Add-critical-damage-API.patch +++ b/patches/server/0624-Add-critical-damage-API.patch @@ -28,10 +28,10 @@ index df8c88bfa749e02f633350446101dcce05db7ac1..ed1277fad60992344b94f8a939febaca + // Paper end - add critical damage API } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 7899b55fd6f4099241d23be750669f7a9863cf0c..11cc72f764913de577ecd6293e5316ae8c2c679c 100644 +index b113c886b81d9ac77f16aa5acf7e1d9e61854b9f..2c15a39d19d392e8aa2f5d70bf1bab9816fc186a 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1255,7 +1255,7 @@ public abstract class Player extends LivingEntity { +@@ -1253,7 +1253,7 @@ public abstract class Player extends LivingEntity { flag1 = true; } @@ -40,7 +40,7 @@ index 7899b55fd6f4099241d23be750669f7a9863cf0c..11cc72f764913de577ecd6293e5316ae flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits flag2 = flag2 && !this.isSprinting(); -@@ -1295,7 +1295,7 @@ public abstract class Player extends LivingEntity { +@@ -1293,7 +1293,7 @@ public abstract class Player extends LivingEntity { } Vec3 vec3d = target.getDeltaMovement(); @@ -49,7 +49,7 @@ index 7899b55fd6f4099241d23be750669f7a9863cf0c..11cc72f764913de577ecd6293e5316ae if (flag5) { if (i > 0) { -@@ -1323,7 +1323,7 @@ public abstract class Player extends LivingEntity { +@@ -1321,7 +1321,7 @@ public abstract class Player extends LivingEntity { if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits diff --git a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index 1a394dadf1..d39176ce97 100644 --- a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -9,7 +9,7 @@ chunk through it. This should also be OK from a leak prevention/ state desync POV because the TE is getting unloaded anyways. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 669c9e43ee76ce2502ed49965aae2703b922f3b5..e6a3f377762db8f2f58cb6851b8f713ce591b29f 100644 +index 43f190d5e3805f7260128b1e32c904d5aa67fd64..487b5620361acd54fd36b8996235fc5be053bd09 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1540,9 +1540,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -28,7 +28,7 @@ index 669c9e43ee76ce2502ed49965aae2703b922f3b5..e6a3f377762db8f2f58cb6851b8f713c } // Spigot End diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 770f99014f3cccbbc666f0aa8530dfb545ced7b6..bb313280236fb5c7dd2713a21edd3694e01a4fd1 100644 +index 475ae48f553c902a6635b56faea60d81dba1b0f4..ef51bcd19c2e0a4ba89a26df4b4a21094213937a 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1626,6 +1626,18 @@ public class ServerPlayer extends Player { @@ -51,10 +51,10 @@ index 770f99014f3cccbbc666f0aa8530dfb545ced7b6..bb313280236fb5c7dd2713a21edd3694 @Override public void doCloseContainer() { diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 11cc72f764913de577ecd6293e5316ae8c2c679c..712249fa1c1ce9af0dd07e8705bf944ac57842b5 100644 +index 2c15a39d19d392e8aa2f5d70bf1bab9816fc186a..c6a4252979da274ec5c3c6d95548c18e12977c3b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -508,6 +508,11 @@ public abstract class Player extends LivingEntity { +@@ -506,6 +506,11 @@ public abstract class Player extends LivingEntity { this.containerMenu = this.inventoryMenu; } // Paper end - Inventory close reason diff --git a/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch index d3b762e841..1b4de40b51 100644 --- a/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1b9b3e8b2a85c6e921ec665c95061f2d3e3f678d..d07e8305939e9bcf19578de8e7996f98af2a89ba 100644 +index ef4c3c7329f9d1172118ead69c959f788500906b..463887d7db1c43a24cea7ec8cc48a260be0f33f8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3299,6 +3299,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3296,6 +3296,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void restoreFrom(Entity original) { @@ -22,7 +22,7 @@ index 1b9b3e8b2a85c6e921ec665c95061f2d3e3f678d..d07e8305939e9bcf19578de8e7996f98 CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); nbttagcompound.remove("Dimension"); -@@ -3389,10 +3396,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3386,10 +3393,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } // CraftBukkit end diff --git a/patches/server/0688-Validate-usernames.patch b/patches/server/0688-Validate-usernames.patch index eda992b6b2..5f46c391be 100644 --- a/patches/server/0688-Validate-usernames.patch +++ b/patches/server/0688-Validate-usernames.patch @@ -39,10 +39,10 @@ index a4d2ddbb9cee1682fc5d91e90d2fd0b74a47aa3c..e67bcde933d8d64ca1d9d18b938f1189 } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 712249fa1c1ce9af0dd07e8705bf944ac57842b5..ff070dbb6c9fa525b484e4eb9ef58caad9f0f016 100644 +index c6a4252979da274ec5c3c6d95548c18e12977c3b..2b68edde9fa03aa04793d3a44dd6edbdbeaf6722 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -2332,9 +2332,23 @@ public abstract class Player extends LivingEntity { +@@ -2330,9 +2330,23 @@ public abstract class Player extends LivingEntity { } public static boolean isValidUsername(String name) { diff --git a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index 7357944555..f9ec2b868f 100644 --- a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6f7a55bc2379f28e17b7e3500959972bbff9830d..a6c515e5bba6f359da5d7547947033546c1e853f 100644 +index 0fd9e6f740ce4224144f80027b7aa611bafc0827..30b017e730b48f395642231a8a60abd73ee46fc3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -593,7 +593,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); @@ -18,7 +18,7 @@ index 6f7a55bc2379f28e17b7e3500959972bbff9830d..a6c515e5bba6f359da5d754794703354 biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 492867fb2bf9a94f8fd5fac7d02f7d1538edcf21..aa4b4504c95826ed7b0dd6dae8388e2280bd1a23 100644 +index 4517d82ea55e919f8a5ce16fde2d401053892fac..3356ebe129757b073c82de59cf67743a96526794 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1258,7 +1258,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0699-Freeze-Tick-Lock-API.patch b/patches/server/0699-Freeze-Tick-Lock-API.patch index f862f6c9f2..d6371e1fcf 100644 --- a/patches/server/0699-Freeze-Tick-Lock-API.patch +++ b/patches/server/0699-Freeze-Tick-Lock-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Freeze Tick Lock API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d07e8305939e9bcf19578de8e7996f98af2a89ba..db8d83dee46d325c0c07c5320a20302e431c5fcc 100644 +index 463887d7db1c43a24cea7ec8cc48a260be0f33f8..9080d797463dee45587ac9b812da16b931d1e410 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -404,6 +404,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -25,7 +25,7 @@ index d07e8305939e9bcf19578de8e7996f98af2a89ba..db8d83dee46d325c0c07c5320a20302e this.setTicksFrozen(0); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); } -@@ -2281,6 +2282,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2278,6 +2279,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (fromNetherPortal) { nbttagcompound.putBoolean("Paper.FromNetherPortal", true); } @@ -35,7 +35,7 @@ index d07e8305939e9bcf19578de8e7996f98af2a89ba..db8d83dee46d325c0c07c5320a20302e // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2425,6 +2429,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2422,6 +2426,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (spawnReason == null) { spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; } diff --git a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index 45f593e703..4f5bb791b0 100644 --- a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a6c515e5bba6f359da5d7547947033546c1e853f..846f5e341bc5bc3d286b1511dd87f54499b202d0 100644 +index 30b017e730b48f395642231a8a60abd73ee46fc3..ab108b28393b38ab666e6ada5663306fc8053402 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1290,6 +1290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index bfd8304f4fc2aded1681c7a59cf9d81192e5a3b2..a75e48f27cd8fbf6165c96c5df09671494eb9dd8 100644 +index 2452c7f0a3ed1faf9b90351bea3389382c677d05..9daf8aa557d9f4fdbcc138a47892ea5a061dd877 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -66,6 +66,7 @@ public class FallingBlockEntity extends Entity { @@ -24,7 +24,7 @@ index bfd8304f4fc2aded1681c7a59cf9d81192e5a3b2..a75e48f27cd8fbf6165c96c5df096714 public FallingBlockEntity(EntityType type, Level world) { super(type, world); -@@ -180,7 +181,7 @@ public class FallingBlockEntity extends Entity { +@@ -178,7 +179,7 @@ public class FallingBlockEntity extends Entity { } if (!this.onGround() && !flag1) { @@ -33,7 +33,7 @@ index bfd8304f4fc2aded1681c7a59cf9d81192e5a3b2..a75e48f27cd8fbf6165c96c5df096714 if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { this.spawnAtLocation((ItemLike) block); } -@@ -328,6 +329,7 @@ public class FallingBlockEntity extends Entity { +@@ -326,6 +327,7 @@ public class FallingBlockEntity extends Entity { } nbt.putBoolean("CancelDrop", this.cancelDrop); @@ -41,10 +41,10 @@ index bfd8304f4fc2aded1681c7a59cf9d81192e5a3b2..a75e48f27cd8fbf6165c96c5df096714 } @Override -@@ -363,6 +365,11 @@ public class FallingBlockEntity extends Entity { - this.setOrigin(new org.bukkit.Location(this.level().getWorld(), srcX, srcY, srcZ)); +@@ -353,6 +355,11 @@ public class FallingBlockEntity extends Entity { + this.blockState = Blocks.SAND.defaultBlockState(); } - // Paper end + + // Paper start - Expand FallingBlock API + if (nbt.contains("Paper.AutoExpire")) { + this.autoExpire = nbt.getBoolean("Paper.AutoExpire"); diff --git a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch index 1cf3de0781..ff4b988423 100644 --- a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,10 +7,10 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 35053ad6cdb071d3f256a23d532d1abb77f14858..fb86e510dc3197cf47b999d80a34a60c37f1d3c8 100644 +index 2968e4253bb4eed39b28db3f3c87d31e4834540b..773c817bfae580ff6151d33ac7a24274ab335fae 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -307,6 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1507,7 +1508,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent -@@ -1577,6 +1580,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= i) { // CraftBukkit this.level().getProfiler().push("portal"); this.portalTime = i; @@ -22,7 +22,7 @@ index 5c6111c224eb92de071ff9e588e97c4fee64432b..9ec4143c8f9c257d12233b9ae92147f6 this.setPortalCooldown(); // CraftBukkit start if (this instanceof ServerPlayer) { -@@ -2874,6 +2881,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2871,6 +2878,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { this.changeDimension(worldserver1); } diff --git a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch index dfdc415fba..1bee3971b8 100644 --- a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fb86e510dc3197cf47b999d80a34a60c37f1d3c8..14393bd35c3c77ee8d7bad0c71e880f6dd9c1be5 100644 +index 773c817bfae580ff6151d33ac7a24274ab335fae..34b17c9ced5ac2b6ad8ef35eb774724a6c78c28e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1212,6 +1212,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop public - // Paper start - public boolean affectsSpawning = true; + public boolean affectsSpawning = true; // Paper - Affects Spawning API + public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage - // Paper end // CraftBukkit start -@@ -1671,7 +1672,7 @@ public abstract class Player extends LivingEntity { + public boolean fauxSleeping; +@@ -1669,7 +1670,7 @@ public abstract class Player extends LivingEntity { @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { diff --git a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch index 9631961352..fd8d41d360 100644 --- a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 14393bd35c3c77ee8d7bad0c71e880f6dd9c1be5..b703a21df8f27a987f74f99ceff476ec75f647d0 100644 +index 34b17c9ced5ac2b6ad8ef35eb774724a6c78c28e..f1551b0c6a3a466cb755c8061fe7fcbc0b1e34df 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1503,6 +1503,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index b703a21df8f27a987f74f99ceff476ec75f647d0..e2e37b75475c7c243245ca3ff78d29c5 // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -309,6 +309,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -928,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop optional = villageplace.getInSquare((holder) -> { - return holder.is(PoiTypes.NETHER_PORTAL); - }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> { -- return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - don't teleport into void damage +- return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - Configurable nether ceiling damage - }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error - return villageplacerecord.getPos().distSqr(blockposition); - }).thenComparingInt((villageplacerecord) -> { @@ -1028,7 +1028,7 @@ index 48984809d2df318b42309b7e9a1cac513c89ca42..cffb04fc0aa90b9b99fd754b11e65d00 + // why would we generate the chunk? + return false; + } -+ if (!worldborder.isWithinBounds(pos) || (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))) { // Paper - don't teleport into void damage ++ if (!worldborder.isWithinBounds(pos) || (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))) { // Paper - Configurable nether ceiling damage + return false; + } + return lowest.getBlockState(pos).hasProperty(BlockStateProperties.HORIZONTAL_AXIS); diff --git a/patches/server/1021-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch similarity index 100% rename from patches/server/1021-Custom-table-implementation-for-blockstate-state-loo.patch rename to patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/server/1022-Execute-chunk-tasks-mid-tick.patch b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch similarity index 95% rename from patches/server/1022-Execute-chunk-tasks-mid-tick.patch rename to patches/server/1021-Execute-chunk-tasks-mid-tick.patch index 0f02de9736..5eb7d636c5 100644 --- a/patches/server/1022-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch @@ -19,10 +19,10 @@ index 7a4234abf620b8394307fa01913bc00215a64e23..4b467f1af93452d13829f756d55dee18 private MinecraftTimings() {} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e2e37b75475c7c243245ca3ff78d29c51ff0ad39..399cb6d50b5a49ab873fab9b5f86c986364d49c3 100644 +index 153c8994b2f3325c7772b763737ad694ba2b6ce6..2f89c5efa0decf792fd2cd079c1d269257edc7b9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1353,8 +1353,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder + if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder - BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); + blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper if (this.isRainingAt(blockposition)) { DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); @@ -897,7 +903,10 @@ public class ServerLevel extends Level implements WorldGenLevel { - if (!this.paperConfig().environment.disableIceAndSnow) { // Paper + if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int l = 0; l < randomTickSpeed; ++l) { if (this.random.nextInt(48) == 0) { - this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15)); @@ -127,7 +127,7 @@ index ac5c505a9d280fb128bbc59526bb8bbe7aaaf307..6ced436bda5beaa107ad333d35f39efe + // Paper end } } - } // Paper + } // Paper - Option to disable ice and snow @@ -905,36 +914,37 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.popPush("tickBlocks"); timings.chunkTicksBlocks.startTiming(); // Paper @@ -324,7 +324,7 @@ index 1a2a4dcb3cfa2690f2aa936a6c176319d807bd74..f97bdfbd07db000845d3b791de64056c public BlockPos getHomePos() { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6b47b8fe38080a2b99bbdc8596f2b607ff0ff4c9..8286d2b5e696828a0c06b93537bc19aafe82e235 100644 +index 7070457a13974f0b578dba014d90540896e0c227..e6cd2a60a8ef1f312c243572e635883cacb089e7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1400,10 +1400,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1024-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch similarity index 100% rename from patches/server/1024-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch rename to patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch diff --git a/patches/server/1025-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch similarity index 100% rename from patches/server/1025-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch diff --git a/patches/server/1026-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch similarity index 97% rename from patches/server/1026-Detail-more-information-in-watchdog-dumps.patch rename to patches/server/1025-Detail-more-information-in-watchdog-dumps.patch index 5ef4c4d855..df963d6ee9 100644 --- a/patches/server/1026-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch @@ -76,7 +76,7 @@ index 454d0187ff8370a0d99cca051ee0a8c50b39cfb7..3e2d5dcd62775b6ed7c0ce0ba51a71b6 }); throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6ced436bda5beaa107ad333d35f39efe366f0595..38c57ad6f028db325bb78fd849e9150af2d6d2ca 100644 +index bac2e7c8178696859ff2d38f1e095d86557fc306..5eaf8585df1f885f4a08fdd06ff4bb730961e400 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1239,7 +1239,26 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -122,7 +122,7 @@ index 6ced436bda5beaa107ad333d35f39efe366f0595..38c57ad6f028db325bb78fd849e9150a private void tickPassenger(Entity vehicle, Entity passenger) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9af161903792ebaa0209acd7212bb525ed6e5263..10b0e37ddab7c664cd50c39ca3586f5aebfc5706 100644 +index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751849b924b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1051,8 +1051,43 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -183,7 +183,7 @@ index 9af161903792ebaa0209acd7212bb525ed6e5263..10b0e37ddab7c664cd50c39ca3586f5a } private boolean isStateClimbable(BlockState state) { -@@ -4366,7 +4408,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4363,7 +4405,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void setDeltaMovement(Vec3 velocity) { @@ -193,7 +193,7 @@ index 9af161903792ebaa0209acd7212bb525ed6e5263..10b0e37ddab7c664cd50c39ca3586f5a } public void addDeltaMovement(Vec3 velocity) { -@@ -4469,7 +4513,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4466,7 +4510,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end - Fix MC-4 if (this.position.x != x || this.position.y != y || this.position.z != z) { diff --git a/patches/server/1027-Collision-optimisations.patch b/patches/server/1026-Collision-optimisations.patch similarity index 99% rename from patches/server/1027-Collision-optimisations.patch rename to patches/server/1026-Collision-optimisations.patch index ce4af686fb..a5a2a44b57 100644 --- a/patches/server/1027-Collision-optimisations.patch +++ b/patches/server/1026-Collision-optimisations.patch @@ -2179,7 +2179,7 @@ index 073c717bb676b9e99aada00c349fb7eee91df1e7..2a9fc1f1dfc0c5894c1e74dad5a79ae9 private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) { this.data3d = id; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index bd1a53e2ce2644681c23f8cf678afa2a99166d9b..4ef7cc68bdcad9eaa157325a195aa74e62b478e5 100644 +index 803ed79940af00b49aec4b1414ddfacb57ff4f3f..569dbd5a1479b41b2604aacd351bf6d33054de29 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -496,7 +496,7 @@ public class ServerPlayer extends Player { @@ -2214,7 +2214,7 @@ index 0ce7ce1899ac4115051353fc3eb0c622846d6748..0dd44f3625ca9383f22e4862ad3e9245 entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 10b0e37ddab7c664cd50c39ca3586f5aebfc5706..7ceb4ec480d8799d0bdbd645e5760d2c952b679b 100644 +index 7e51a93ac779a6119a09b5b5f0428751849b924b..66bc002b7e12b73badfe5707674b946c65f9b5d9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1238,9 +1238,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2364,7 +2364,7 @@ index 10b0e37ddab7c664cd50c39ca3586f5aebfc5706..7ceb4ec480d8799d0bdbd645e5760d2c } public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List collisions) { -@@ -2690,11 +2775,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2687,11 +2772,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S float f = this.dimensions.width * 0.8F; AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f); @@ -2511,7 +2511,7 @@ index c476e37df8a75d77f5093b2a449e04f25ef2c2dd..5d66aadae51db1ae760812849bfc8740 return this.noCollision((Entity)null, box); } diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index 8c436d16914e160be8e3074badc1293af2ae6b31..a3d15f30eaab29d85cb6b3d693df9980a880f686 100644 +index cc888bbcd6a50124fa553bc4a8ffd1e8885d3856..f42dd9602805e9d538506ee4e3eac7e2811a3da6 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -45,17 +45,36 @@ public interface EntityGetter { @@ -2611,9 +2611,9 @@ index 8c436d16914e160be8e3074badc1293af2ae6b31..a3d15f30eaab29d85cb6b3d693df9980 + // Paper end - optimise collisions } - // Paper start + // Paper start - Affects Spawning API diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 8286d2b5e696828a0c06b93537bc19aafe82e235..3c70eabf3ef1a0b7916ba795eeb9396f7cea3ff7 100644 +index e6cd2a60a8ef1f312c243572e635883cacb089e7..da4e2c9572d602bb622cbe0dc46b842fd62d0a0b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -299,6 +299,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1028-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch similarity index 100% rename from patches/server/1028-Optimise-collision-checking-in-player-move-packet-ha.patch rename to patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch diff --git a/patches/server/1029-Fix-tripwire-state-inconsistency.patch b/patches/server/1028-Fix-tripwire-state-inconsistency.patch similarity index 100% rename from patches/server/1029-Fix-tripwire-state-inconsistency.patch rename to patches/server/1028-Fix-tripwire-state-inconsistency.patch diff --git a/patches/server/1030-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 100% rename from patches/server/1030-Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/server/1031-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch similarity index 99% rename from patches/server/1031-Add-Alternate-Current-redstone-implementation.patch rename to patches/server/1030-Add-Alternate-Current-redstone-implementation.patch index 0cfa2ed745..60448b2f46 100644 --- a/patches/server/1031-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch @@ -2008,7 +2008,7 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 38c57ad6f028db325bb78fd849e9150af2d6d2ca..c8ed96a458ab05f20c5904d4e449f08f68522184 100644 +index 5eaf8585df1f885f4a08fdd06ff4bb730961e400..ab2e84f85da7931e133ad5f0d2686cd1738f6ea1 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -223,6 +223,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2034,7 +2034,7 @@ index 38c57ad6f028db325bb78fd849e9150af2d6d2ca..c8ed96a458ab05f20c5904d4e449f08f EntityCallbacks() {} diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 3c70eabf3ef1a0b7916ba795eeb9396f7cea3ff7..9fd2fcf8437c866e4fe7a44108cde338e1a9f9a2 100644 +index da4e2c9572d602bb622cbe0dc46b842fd62d0a0b..504b22fe308611c60520d4f1fda18c5656b544d6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1897,4 +1897,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1032-optimize-dirt-and-snow-spreading.patch b/patches/server/1031-optimize-dirt-and-snow-spreading.patch similarity index 100% rename from patches/server/1032-optimize-dirt-and-snow-spreading.patch rename to patches/server/1031-optimize-dirt-and-snow-spreading.patch diff --git a/patches/server/1033-Properly-resend-entities.patch b/patches/server/1032-Properly-resend-entities.patch similarity index 99% rename from patches/server/1033-Properly-resend-entities.patch rename to patches/server/1032-Properly-resend-entities.patch index 519272b513..e84590518b 100644 --- a/patches/server/1033-Properly-resend-entities.patch +++ b/patches/server/1032-Properly-resend-entities.patch @@ -137,7 +137,7 @@ index b760e51f6d1682fe8185c62389f33e0bb4ce884f..42b433d9461d0912b395422636843233 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ea36111733a3ffa271768f6b2c7729f2cd6bb06d..b7bf28b62e3aac022f6dfd7ccead47533fd0e4d7 100644 +index 0dd44f3625ca9383f22e4862ad3e92452e26befd..e0ee45036b9bf14a6e2013fe291cde0402b85b1f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -390,7 +390,7 @@ public abstract class PlayerList { diff --git a/patches/server/1034-Optimize-Hoppers.patch b/patches/server/1033-Optimize-Hoppers.patch similarity index 99% rename from patches/server/1034-Optimize-Hoppers.patch rename to patches/server/1033-Optimize-Hoppers.patch index 6c47acb431..e06fa5cda9 100644 --- a/patches/server/1034-Optimize-Hoppers.patch +++ b/patches/server/1033-Optimize-Hoppers.patch @@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 399cb6d50b5a49ab873fab9b5f86c986364d49c3..a18d9569627ba39ad2898be61d40e147d601f84e 100644 +index 2f89c5efa0decf792fd2cd079c1d269257edc7b9..a966a0fe4fd9d882e81c5e2786e16ff687c892b3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1687,6 +1687,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent @@ -85,7 +85,7 @@ index 2470acc82292bedd930be404a2e1d1f8fad700e1..ed27a963223bfe18310ad5adabf461b5 itemstack.setPopTime(this.getPopTime()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 0fdf74317a20a250b474978c9e50a6c533abfbe6..4ce7a7947fa727e64556148f923508ce76c128c4 100644 +index 20201430ee8f28245aa845acb172d0f5d80458ff..9ea74d37cd951e0dc76d20ed8234b5871035566c 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -26,6 +26,7 @@ import co.aikar.timings.MinecraftTimings; // Paper diff --git a/patches/server/1035-Improve-performance-of-mass-crafts.patch b/patches/server/1034-Improve-performance-of-mass-crafts.patch similarity index 100% rename from patches/server/1035-Improve-performance-of-mass-crafts.patch rename to patches/server/1034-Improve-performance-of-mass-crafts.patch diff --git a/patches/server/1036-Actually-optimise-explosions.patch b/patches/server/1035-Actually-optimise-explosions.patch similarity index 99% rename from patches/server/1036-Actually-optimise-explosions.patch rename to patches/server/1035-Actually-optimise-explosions.patch index 349e2e5f06..da42c9e195 100644 --- a/patches/server/1036-Actually-optimise-explosions.patch +++ b/patches/server/1035-Actually-optimise-explosions.patch @@ -34,7 +34,7 @@ The results indicate that this logic is 5 times faster than Vanilla and 2.3 times faster than Lithium. diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 4d51baab29b1a913c3efef2cb4ab0cac6c8cf38a..1fa02130dcb65b3109fde0cb612b538b1c4cd4cb 100644 +index f54219d2b973136ad00a0f03cbd99f6b82ecee65..28ef910885dbd48965fba6f08cec412697b1b7f0 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -111,6 +111,271 @@ public class Explosion { diff --git a/patches/server/1037-Optimise-chunk-tick-iteration.patch b/patches/server/1036-Optimise-chunk-tick-iteration.patch similarity index 99% rename from patches/server/1037-Optimise-chunk-tick-iteration.patch rename to patches/server/1036-Optimise-chunk-tick-iteration.patch index 8315778f52..6120a7359b 100644 --- a/patches/server/1037-Optimise-chunk-tick-iteration.patch +++ b/patches/server/1036-Optimise-chunk-tick-iteration.patch @@ -365,7 +365,7 @@ index c2973fcfde402b5432db37468e4a40a1a119cca1..77a2458b8acb21c64676934cd8d6b05e gameprofilerfiller.pop(); } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4ef7cc68bdcad9eaa157325a195aa74e62b478e5..4a0df97430cf025d1e830f681ef791ecec985102 100644 +index 569dbd5a1479b41b2604aacd351bf6d33054de29..0dba30c41affafe7b1d585b515925043b37712fa 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -325,6 +325,9 @@ public class ServerPlayer extends Player { diff --git a/patches/server/1038-Lag-compensation-ticks.patch b/patches/server/1037-Lag-compensation-ticks.patch similarity index 96% rename from patches/server/1038-Lag-compensation-ticks.patch rename to patches/server/1037-Lag-compensation-ticks.patch index 0b26f7c25a..17c4a518a7 100644 --- a/patches/server/1038-Lag-compensation-ticks.patch +++ b/patches/server/1037-Lag-compensation-ticks.patch @@ -8,10 +8,10 @@ Areas affected by lag comepnsation: - Eating food items diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a18d9569627ba39ad2898be61d40e147d601f84e..559e159a0cfdefb5a0d69224409d91c4ad67371a 100644 +index a966a0fe4fd9d882e81c5e2786e16ff687c892b3..58da8abd1603359bb9f2772a6420b55108e22ceb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1686,6 +1687,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - Add EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c8ed96a458ab05f20c5904d4e449f08f68522184..f32a28474b7f604df871a9bf3e1fb2e4077c8bc1 100644 +index ab2e84f85da7931e133ad5f0d2686cd1738f6ea1..5bbfb1af24e13a9e6a02ad8c36bb504a17f06398 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -565,6 +565,17 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/1039-Optimise-nearby-player-retrieval.patch b/patches/server/1038-Optimise-nearby-player-retrieval.patch similarity index 98% rename from patches/server/1039-Optimise-nearby-player-retrieval.patch rename to patches/server/1038-Optimise-nearby-player-retrieval.patch index f7af520328..c6ab594786 100644 --- a/patches/server/1039-Optimise-nearby-player-retrieval.patch +++ b/patches/server/1038-Optimise-nearby-player-retrieval.patch @@ -8,7 +8,7 @@ we can instead use the nearby player tracking system to reduce the number of tests per search. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f32a28474b7f604df871a9bf3e1fb2e4077c8bc1..8e9936c3725194775cf9b342bd44275a0e2a0088 100644 +index 5bbfb1af24e13a9e6a02ad8c36bb504a17f06398..6934e9dac0d69c043b73b7c46d59f2d39b37c67f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -576,6 +576,115 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -208,7 +208,7 @@ index fae0dbfb6ac09a0c152c0f74a72583f44316def7..c8a80c1b2fedff22e8a877d466062375 private boolean testInvisible = true; @Nullable diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index a3d15f30eaab29d85cb6b3d693df9980a880f686..ff0b7b9e4ae3aa0c170d05bc51fd7ff26e7531ee 100644 +index f42dd9602805e9d538506ee4e3eac7e2811a3da6..ed84c87a3f76bc0254c1abb189e6b8b808823465 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -230,9 +230,13 @@ public interface EntityGetter { diff --git a/patches/server/1040-Handle-Oversized-Tile-Entities-in-chunks.patch b/patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch similarity index 98% rename from patches/server/1040-Handle-Oversized-Tile-Entities-in-chunks.patch rename to patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch index 73a6a26e4c..1bdb933b52 100644 --- a/patches/server/1040-Handle-Oversized-Tile-Entities-in-chunks.patch +++ b/patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 6 May 2020 05:00:57 -0400 -Subject: [PATCH] Handle Oversized Tile Entities in chunks +Subject: [PATCH] Handle Oversized block entities in chunks Splits out Extra Packets if too many TE's are encountered to prevent creating too large of a packet to sed. diff --git a/patches/server/0031-Further-improve-server-tick-loop.patch b/patches/server/1040-Further-improve-server-tick-loop.patch similarity index 93% rename from patches/server/0031-Further-improve-server-tick-loop.patch rename to patches/server/1040-Further-improve-server-tick-loop.patch index a7c572586e..c7ae92070e 100644 --- a/patches/server/0031-Further-improve-server-tick-loop.patch +++ b/patches/server/1040-Further-improve-server-tick-loop.patch @@ -12,19 +12,19 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0c3a23502ab6cb9e1f027b1050dd6849ceb181d9..6bc92eb33bc066c477d86d317cb445dd7f7884f5 100644 +index 58da8abd1603359bb9f2772a6420b55108e22ceb..4e1011dca1081a5246981fabb93f142442dcc92c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop