From dcb23664a35c15f16ae4230747beb13d92228868 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 8 Jun 2022 15:36:56 +0200 Subject: [PATCH] More more more more more more more more more more more patches --- ...eEvent-and-CollarColorable-interface.patch | 0 .../server/Add-PlayerStopUsingItemEvent.patch | 0 .../Add-TameableDeathMessageEvent.patch | 11 ++-- ...valid-GameProfiles-on-skull-blocks-i.patch | 0 ...king-amount-to-PlayerItemDamageEvent.patch | 0 .../Add-support-for-Proxy-Protocol.patch | 0 ...hange-the-podium-for-the-EnderDragon.patch | 0 .../server/Buffer-OOB-setBlock-calls.patch | 0 ...t-selector-resolving-in-books-by-def.patch | 37 ------------ ...o-not-accept-invalid-client-settings.patch | 0 ...cle-movement-from-players-while-tele.patch | 0 .../server/Don-t-tick-markers.patch | 0 ...assenger-world-matches-ridden-entity.patch | 0 .../Expose-furnace-minecart-push-values.patch | 0 .../FallingBlock-auto-expire-setting.patch | 0 ...-CauldronLevelChange-on-initial-fill.patch | 20 +++---- ...ntory-for-smokers-and-blast-furnaces.patch | 0 ...verriding-a-block-entity-during-worl.patch | 0 ...x-NPE-for-BlockDataMeta-getBlockData.patch | 0 ...ix-OfflinePlayer-getBedSpawnLocation.patch | 0 ...reGrowEvent-species-for-RED_MUSHROOM.patch | 2 +- ...rojectileHitEvent-for-piercing-arrow.patch | 0 ...ta-for-EntityChangeBlockEvent-when-s.patch | 0 .../Fix-save-problems-on-shutdown.patch | 0 .../server/Fix-saving-in-unloadWorld.patch | 0 ...rs-not-spawning-outside-slime-chunks.patch | 2 +- ...ard-against-invalid-entity-positions.patch | 4 +- .../Implement-enchantWithLevels-API.patch | 0 .../Implement-getComputedBiome-API.patch | 0 .../server/Make-some-itemstacks-nonnull.patch | 0 .../server/More-Projectile-API.patch | 0 ...s-ServerLevel-for-gamerule-callbacks.patch | 0 ...entity-loading-causing-async-lookups.patch | 0 ...nt-tile-entity-copies-loading-chunks.patch | 0 .../Sanitize-Sent-BlockEntity-NBT.patch | 0 .../server/Sign-cleanup-filtering.patch | 0 ...n-on-world-create-while-being-ticked.patch | 0 ..._destroyed-trigger-in-the-correct-pl.patch | 0 ...tead-of-display-name-in-PlayerList-g.patch | 0 .../server/WorldCreator-keepSpawnLoaded.patch | 0 .../server/cache-resource-keys.patch | 0 ...ables-running-when-mob-loot-gamerule.patch | 2 +- ...-snow-cauldrons-not-turning-to-water.patch | 0 ...ix-swamp-hut-cat-generation-deadlock.patch | 56 ------------------- 44 files changed, 21 insertions(+), 113 deletions(-) rename patches/{unapplied => }/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch (100%) rename patches/{unapplied => }/server/Add-PlayerStopUsingItemEvent.patch (100%) rename patches/{unapplied => }/server/Add-TameableDeathMessageEvent.patch (77%) rename patches/{unapplied => }/server/Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch (100%) rename patches/{unapplied => }/server/Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch (100%) rename patches/{unapplied => }/server/Add-support-for-Proxy-Protocol.patch (100%) rename patches/{unapplied => }/server/Allow-to-change-the-podium-for-the-EnderDragon.patch (100%) rename patches/{unapplied => }/server/Buffer-OOB-setBlock-calls.patch (100%) rename patches/{unapplied => }/server/Disable-component-selector-resolving-in-books-by-def.patch (52%) rename patches/{unapplied => }/server/Do-not-accept-invalid-client-settings.patch (100%) rename patches/{unapplied => }/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch (100%) rename patches/{unapplied => }/server/Don-t-tick-markers.patch (100%) rename patches/{unapplied => }/server/Ensure-entity-passenger-world-matches-ridden-entity.patch (100%) rename patches/{unapplied => }/server/Expose-furnace-minecart-push-values.patch (100%) rename patches/{unapplied => }/server/FallingBlock-auto-expire-setting.patch (100%) rename patches/{unapplied => }/server/Fire-CauldronLevelChange-on-initial-fill.patch (80%) rename patches/{unapplied => }/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch (100%) rename patches/{unapplied => }/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch (100%) rename patches/{unapplied => }/server/Fix-NPE-for-BlockDataMeta-getBlockData.patch (100%) rename patches/{unapplied => }/server/Fix-OfflinePlayer-getBedSpawnLocation.patch (100%) rename patches/{unapplied => }/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch (96%) rename patches/{unapplied => }/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch (100%) rename patches/{unapplied => }/server/Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch (100%) rename patches/{unapplied => }/server/Fix-save-problems-on-shutdown.patch (100%) rename patches/{unapplied => }/server/Fix-saving-in-unloadWorld.patch (100%) rename patches/{unapplied => }/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch (98%) rename patches/{unapplied => }/server/Guard-against-invalid-entity-positions.patch (93%) rename patches/{unapplied => }/server/Implement-enchantWithLevels-API.patch (100%) rename patches/{unapplied => }/server/Implement-getComputedBiome-API.patch (100%) rename patches/{unapplied => }/server/Make-some-itemstacks-nonnull.patch (100%) rename patches/{unapplied => }/server/More-Projectile-API.patch (100%) rename patches/{unapplied => }/server/Pass-ServerLevel-for-gamerule-callbacks.patch (100%) rename patches/{unapplied => }/server/Prevent-entity-loading-causing-async-lookups.patch (100%) rename patches/{unapplied => }/server/Prevent-tile-entity-copies-loading-chunks.patch (100%) rename patches/{unapplied => }/server/Sanitize-Sent-BlockEntity-NBT.patch (100%) rename patches/{unapplied => }/server/Sign-cleanup-filtering.patch (100%) rename patches/{unapplied => }/server/Throw-exception-on-world-create-while-being-ticked.patch (100%) rename patches/{unapplied => }/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch (100%) rename patches/{unapplied => }/server/Use-username-instead-of-display-name-in-PlayerList-g.patch (100%) rename patches/{unapplied => }/server/WorldCreator-keepSpawnLoaded.patch (100%) rename patches/{unapplied => }/server/cache-resource-keys.patch (100%) rename patches/{unapplied => }/server/fix-player-loottables-running-when-mob-loot-gamerule.patch (94%) rename patches/{unapplied => }/server/fix-powder-snow-cauldrons-not-turning-to-water.patch (100%) delete mode 100644 patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 100% rename from patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch b/patches/server/Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch rename to patches/server/Add-PlayerStopUsingItemEvent.patch diff --git a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch b/patches/server/Add-TameableDeathMessageEvent.patch similarity index 77% rename from patches/unapplied/server/Add-TameableDeathMessageEvent.patch rename to patches/server/Add-TameableDeathMessageEvent.patch index e7d276fb08..d351c6fe1e 100644 --- a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch +++ b/patches/server/Add-TameableDeathMessageEvent.patch @@ -10,14 +10,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java @@ -0,0 +0,0 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @Override - public void die(DamageSource source) { + public void die(DamageSource damageSource) { if (!this.level.isClientSide && this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { -- this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), Util.NIL_UUID); +- this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage()); + // Paper start - TameableDeathMessageEvent + io.papermc.paper.event.entity.TameableDeathMessageEvent event = new io.papermc.paper.event.entity.TameableDeathMessageEvent((org.bukkit.entity.Tameable) getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getCombatTracker().getDeathMessage())); + if (event.callEvent()) { -+ this.getOwner().sendMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()), Util.NIL_UUID); -+ } // Paper end - TameableDeathMessageEvent ++ this.getOwner().sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage())); ++ } ++ // Paper end - TameableDeathMessageEvent } - super.die(source); + super.die(damageSource); diff --git a/patches/unapplied/server/Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch b/patches/server/Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch similarity index 100% rename from patches/unapplied/server/Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch rename to patches/server/Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch diff --git a/patches/unapplied/server/Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch b/patches/server/Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch similarity index 100% rename from patches/unapplied/server/Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch rename to patches/server/Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch diff --git a/patches/unapplied/server/Add-support-for-Proxy-Protocol.patch b/patches/server/Add-support-for-Proxy-Protocol.patch similarity index 100% rename from patches/unapplied/server/Add-support-for-Proxy-Protocol.patch rename to patches/server/Add-support-for-Proxy-Protocol.patch diff --git a/patches/unapplied/server/Allow-to-change-the-podium-for-the-EnderDragon.patch b/patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch similarity index 100% rename from patches/unapplied/server/Allow-to-change-the-podium-for-the-EnderDragon.patch rename to patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch diff --git a/patches/unapplied/server/Buffer-OOB-setBlock-calls.patch b/patches/server/Buffer-OOB-setBlock-calls.patch similarity index 100% rename from patches/unapplied/server/Buffer-OOB-setBlock-calls.patch rename to patches/server/Buffer-OOB-setBlock-calls.patch diff --git a/patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/Disable-component-selector-resolving-in-books-by-def.patch similarity index 52% rename from patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch rename to patches/server/Disable-component-selector-resolving-in-books-by-def.patch index 2341e5aed7..e32f322fb9 100644 --- a/patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch +++ b/patches/server/Disable-component-selector-resolving-in-books-by-def.patch @@ -31,40 +31,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compoundTag.putBoolean("resolved", true); if (!makeSureTagIsValid(compoundTag)) { return false; - } else { - ListTag listTag = compoundTag.getList("pages", 8); -+ // Paper start - backport length limit -+ ListTag newPages = new ListTag(); - - for(int i = 0; i < listTag.size(); ++i) { -- listTag.set(i, (Tag)StringTag.valueOf(resolvePage(commandSource, player, listTag.getString(i)))); -+ String resolvedPage = resolvePage(commandSource, player, listTag.getString(i)); -+ if (resolvedPage.length() > 32767) { -+ return false; -+ } -+ -+ newPages.add(i, StringTag.valueOf(resolvedPage)); - } - - if (compoundTag.contains("filtered_pages", 10)) { - CompoundTag compoundTag2 = compoundTag.getCompound("filtered_pages"); -+ CompoundTag newFilteredPages = new CompoundTag(); - - for(String string : compoundTag2.getAllKeys()) { -- compoundTag2.putString(string, resolvePage(commandSource, player, compoundTag2.getString(string))); -+ String resolvedPage = resolvePage(commandSource, player, compoundTag2.getString(string)); -+ if (resolvedPage.length() > 32767) { -+ return false; -+ } -+ -+ newFilteredPages.putString(string, resolvedPage); - } -+ -+ compoundTag.put("filtered_pages", newFilteredPages); - } - -+ compoundTag.put("pages", newPages); -+ // Paper end - return true; - } - } else { diff --git a/patches/unapplied/server/Do-not-accept-invalid-client-settings.patch b/patches/server/Do-not-accept-invalid-client-settings.patch similarity index 100% rename from patches/unapplied/server/Do-not-accept-invalid-client-settings.patch rename to patches/server/Do-not-accept-invalid-client-settings.patch diff --git a/patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch similarity index 100% rename from patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch rename to patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch diff --git a/patches/unapplied/server/Don-t-tick-markers.patch b/patches/server/Don-t-tick-markers.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-markers.patch rename to patches/server/Don-t-tick-markers.patch diff --git a/patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch similarity index 100% rename from patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch rename to patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch diff --git a/patches/unapplied/server/Expose-furnace-minecart-push-values.patch b/patches/server/Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/unapplied/server/Expose-furnace-minecart-push-values.patch rename to patches/server/Expose-furnace-minecart-push-values.patch diff --git a/patches/unapplied/server/FallingBlock-auto-expire-setting.patch b/patches/server/FallingBlock-auto-expire-setting.patch similarity index 100% rename from patches/unapplied/server/FallingBlock-auto-expire-setting.patch rename to patches/server/FallingBlock-auto-expire-setting.patch diff --git a/patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/Fire-CauldronLevelChange-on-initial-fill.patch similarity index 80% rename from patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch rename to patches/server/Fire-CauldronLevelChange-on-initial-fill.patch index 72028dbb8f..d654e93456 100644 --- a/patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch +++ b/patches/server/Fire-CauldronLevelChange-on-initial-fill.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } + // Paper end - world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos); + world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos); } else if (precipitation == Biome.Precipitation.SNOW) { - world.setBlockAndUpdate(pos, Blocks.POWDER_SNOW_CAULDRON.defaultBlockState()); + // Paper start - call event for initial fill @@ -28,31 +28,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } + // Paper end - world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos); + world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos); } @@ -0,0 +0,0 @@ public class CauldronBlock extends AbstractCauldronBlock { - @Override - protected void receiveStalactiteDrip(BlockState state, Level world, BlockPos pos, Fluid fluid) { + if (fluid == Fluids.WATER) { -- LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit + iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState(); +- LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit + // Paper start - don't send level event or game event if cancelled -+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit ++ if (!LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit + return; + } + // Paper end world.levelEvent(1047, pos, 0); - world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos); } else if (fluid == Fluids.LAVA) { -- LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit + iblockdata1 = Blocks.LAVA_CAULDRON.defaultBlockState(); +- LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit + // Paper start - don't send level event or game event if cancelled -+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit ++ if (!LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit + return; + } + // Paper end world.levelEvent(1046, pos, 0); - world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos); } + diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java diff --git a/patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch similarity index 100% rename from patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch rename to patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/unapplied/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch similarity index 100% rename from patches/unapplied/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch rename to patches/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch diff --git a/patches/unapplied/server/Fix-NPE-for-BlockDataMeta-getBlockData.patch b/patches/server/Fix-NPE-for-BlockDataMeta-getBlockData.patch similarity index 100% rename from patches/unapplied/server/Fix-NPE-for-BlockDataMeta-getBlockData.patch rename to patches/server/Fix-NPE-for-BlockDataMeta-getBlockData.patch diff --git a/patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/unapplied/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch b/patches/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch similarity index 96% rename from patches/unapplied/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch rename to patches/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch index f026163813..c5646c0720 100644 --- a/patches/unapplied/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch +++ b/patches/server/Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java @@ -0,0 +0,0 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock { - public boolean growMushroom(ServerLevel world, BlockPos pos, BlockState state, Random random) { + public boolean growMushroom(ServerLevel world, BlockPos pos, BlockState state, RandomSource random) { world.removeBlock(pos, false); - SaplingBlock.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit + SaplingBlock.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.RED_MUSHROOM; // CraftBukkit // Paper diff --git a/patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch similarity index 100% rename from patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch rename to patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch diff --git a/patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch b/patches/server/Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch similarity index 100% rename from patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch rename to patches/server/Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch diff --git a/patches/unapplied/server/Fix-save-problems-on-shutdown.patch b/patches/server/Fix-save-problems-on-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-save-problems-on-shutdown.patch rename to patches/server/Fix-save-problems-on-shutdown.patch diff --git a/patches/unapplied/server/Fix-saving-in-unloadWorld.patch b/patches/server/Fix-saving-in-unloadWorld.patch similarity index 100% rename from patches/unapplied/server/Fix-saving-in-unloadWorld.patch rename to patches/server/Fix-saving-in-unloadWorld.patch diff --git a/patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch b/patches/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch similarity index 98% rename from patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch rename to patches/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch index faebd2215a..f6510f05c0 100644 --- a/patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch +++ b/patches/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java @@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { - public static boolean checkSlimeSpawnRules(EntityType type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { + public static boolean checkSlimeSpawnRules(EntityType type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) { if (world.getDifficulty() != Difficulty.PEACEFUL) { + // Paper start - fix slime spawners; Fixes MC-50647 + if (spawnReason == MobSpawnType.SPAWNER) { diff --git a/patches/unapplied/server/Guard-against-invalid-entity-positions.patch b/patches/server/Guard-against-invalid-entity-positions.patch similarity index 93% rename from patches/unapplied/server/Guard-against-invalid-entity-positions.patch rename to patches/server/Guard-against-invalid-entity-positions.patch index b4c9556cbb..05084a5ca6 100644 --- a/patches/unapplied/server/Guard-against-invalid-entity-positions.patch +++ b/patches/server/Guard-against-invalid-entity-positions.patch @@ -41,5 +41,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - block invalid positions // Paper end - // Paper start - fix MC-4 - if (this instanceof ItemEntity) { + if (this.position.x != x || this.position.y != y || this.position.z != z) { + synchronized (this.posLock) { // Paper diff --git a/patches/unapplied/server/Implement-enchantWithLevels-API.patch b/patches/server/Implement-enchantWithLevels-API.patch similarity index 100% rename from patches/unapplied/server/Implement-enchantWithLevels-API.patch rename to patches/server/Implement-enchantWithLevels-API.patch diff --git a/patches/unapplied/server/Implement-getComputedBiome-API.patch b/patches/server/Implement-getComputedBiome-API.patch similarity index 100% rename from patches/unapplied/server/Implement-getComputedBiome-API.patch rename to patches/server/Implement-getComputedBiome-API.patch diff --git a/patches/unapplied/server/Make-some-itemstacks-nonnull.patch b/patches/server/Make-some-itemstacks-nonnull.patch similarity index 100% rename from patches/unapplied/server/Make-some-itemstacks-nonnull.patch rename to patches/server/Make-some-itemstacks-nonnull.patch diff --git a/patches/unapplied/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch similarity index 100% rename from patches/unapplied/server/More-Projectile-API.patch rename to patches/server/More-Projectile-API.patch diff --git a/patches/unapplied/server/Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch similarity index 100% rename from patches/unapplied/server/Pass-ServerLevel-for-gamerule-callbacks.patch rename to patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch diff --git a/patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch b/patches/server/Prevent-entity-loading-causing-async-lookups.patch similarity index 100% rename from patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch rename to patches/server/Prevent-entity-loading-causing-async-lookups.patch diff --git a/patches/unapplied/server/Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/Prevent-tile-entity-copies-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-tile-entity-copies-loading-chunks.patch rename to patches/server/Prevent-tile-entity-copies-loading-chunks.patch diff --git a/patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch b/patches/server/Sanitize-Sent-BlockEntity-NBT.patch similarity index 100% rename from patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch rename to patches/server/Sanitize-Sent-BlockEntity-NBT.patch diff --git a/patches/unapplied/server/Sign-cleanup-filtering.patch b/patches/server/Sign-cleanup-filtering.patch similarity index 100% rename from patches/unapplied/server/Sign-cleanup-filtering.patch rename to patches/server/Sign-cleanup-filtering.patch diff --git a/patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch similarity index 100% rename from patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch rename to patches/server/Throw-exception-on-world-create-while-being-ticked.patch diff --git a/patches/unapplied/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch similarity index 100% rename from patches/unapplied/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch rename to patches/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch diff --git a/patches/unapplied/server/Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/Use-username-instead-of-display-name-in-PlayerList-g.patch similarity index 100% rename from patches/unapplied/server/Use-username-instead-of-display-name-in-PlayerList-g.patch rename to patches/server/Use-username-instead-of-display-name-in-PlayerList-g.patch diff --git a/patches/unapplied/server/WorldCreator-keepSpawnLoaded.patch b/patches/server/WorldCreator-keepSpawnLoaded.patch similarity index 100% rename from patches/unapplied/server/WorldCreator-keepSpawnLoaded.patch rename to patches/server/WorldCreator-keepSpawnLoaded.patch diff --git a/patches/unapplied/server/cache-resource-keys.patch b/patches/server/cache-resource-keys.patch similarity index 100% rename from patches/unapplied/server/cache-resource-keys.patch rename to patches/server/cache-resource-keys.patch diff --git a/patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch similarity index 94% rename from patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch rename to patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch index 4e1280a79b..38bbe7430d 100644 --- a/patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { // Paper - preserve this check from vanilla // SPIGOT-5071: manually add player loot tables (SPIGOT-5195 - ignores keepInventory rule) - this.dropFromLootTable(source, this.lastHurtByPlayerTime > 0); + this.dropFromLootTable(damageSource, this.lastHurtByPlayerTime > 0); for (org.bukkit.inventory.ItemStack item : this.drops) { loot.add(item); } diff --git a/patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch similarity index 100% rename from patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch rename to patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch diff --git a/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch b/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch deleted file mode 100644 index d1f2ee8104..0000000000 --- a/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Sat, 12 Mar 2022 06:31:13 -0800 -Subject: [PATCH] Fix swamp hut cat generation deadlock - -The worldgen thread will attempt to get structure references -via the world's getChunkAt method, which is fine if the gen is -not cancelled - but if the chunk was unloaded, the call will block -indefinitely. Instead of using the world state, we use the already -supplied generatoraccess which will always have the chunk available. - -diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/Cat.java -+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -0,0 +0,0 @@ public class Cat extends TamableAnimal { - Registry> iregistry = worldserver1.registryAccess().registryOrThrow(Registry.CONFIGURED_STRUCTURE_FEATURE_REGISTRY); - - if (ChunkGenerator.allConfigurations(iregistry, StructureFeature.SWAMP_HUT).anyMatch((structurefeature) -> { -- return worldserver1.structureFeatureManager().getStructureWithPieceAt(this.blockPosition(), structurefeature).isValid(); -+ return worldserver1.structureFeatureManager().getStructureWithPieceAt(this.blockPosition(), structurefeature, world).isValid(); // Paper - fix deadlock - })) { - this.setCatType(10); - this.setPersistenceRequired(); -diff --git a/src/main/java/net/minecraft/world/level/StructureFeatureManager.java b/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -+++ b/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -@@ -0,0 +0,0 @@ public class StructureFeatureManager { - } - - public List startsForFeature(SectionPos sectionPos, ConfiguredStructureFeature configuredStructureFeature) { -- LongSet longSet = this.level.getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES).getReferencesForFeature(configuredStructureFeature); -+ // Paper start - add world option -+ return this.startsForFeature(sectionPos, configuredStructureFeature, (ServerLevelAccessor)null); -+ } -+ public List startsForFeature(SectionPos sectionPos, ConfiguredStructureFeature configuredStructureFeature, ServerLevelAccessor world) { -+ LongSet longSet = (world == null ? this.level : world).getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES).getReferencesForFeature(configuredStructureFeature); -+ // Paper end - add world option - ImmutableList.Builder builder = ImmutableList.builder(); - this.fillStartsForFeature(configuredStructureFeature, longSet, builder::add); - return builder.build(); -@@ -0,0 +0,0 @@ public class StructureFeatureManager { - } - - public StructureStart getStructureWithPieceAt(BlockPos pos, ConfiguredStructureFeature configuredStructureFeature) { -- for(StructureStart structureStart : this.startsForFeature(SectionPos.of(pos), configuredStructureFeature)) { -+ // Paper start - add world option -+ return this.getStructureWithPieceAt(pos, configuredStructureFeature, (ServerLevelAccessor)null); -+ } -+ public StructureStart getStructureWithPieceAt(BlockPos pos, ConfiguredStructureFeature configuredStructureFeature, ServerLevelAccessor world) { -+ // Paper end - add world option -+ for(StructureStart structureStart : this.startsForFeature(SectionPos.of(pos), configuredStructureFeature, world)) { // Paper - add world option - if (this.structureHasPieceAt(pos, structureStart)) { - return structureStart; - }