diff --git a/patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch similarity index 100% rename from patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch rename to patches/server/API-for-creating-command-sender-which-forwards-feedb.patch diff --git a/patches/unapplied/server/Add-GameEvent-tags.patch b/patches/server/Add-GameEvent-tags.patch similarity index 100% rename from patches/unapplied/server/Add-GameEvent-tags.patch rename to patches/server/Add-GameEvent-tags.patch diff --git a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch b/patches/server/Add-TameableDeathMessageEvent.patch similarity index 100% rename from patches/unapplied/server/Add-TameableDeathMessageEvent.patch rename to patches/server/Add-TameableDeathMessageEvent.patch diff --git a/patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch similarity index 100% rename from patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch rename to patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch diff --git a/patches/server/Add-configurable-height-for-slime-spawn.patch b/patches/server/Add-configurable-height-for-slime-spawn.patch new file mode 100644 index 0000000000..2e6750addc --- /dev/null +++ b/patches/server/Add-configurable-height-for-slime-spawn.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Doc +Date: Mon, 2 Aug 2021 11:24:39 -0400 +Subject: [PATCH] Add configurable height for slime spawn + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java +@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { + return checkMobSpawnRules(type, world, spawnReason, pos, random); + } + +- if (world.getBiome(pos).is(BiomeTags.ALLOWS_SURFACE_SLIME_SPAWNS) && pos.getY() > 50 && pos.getY() < 70 && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) { ++ // Paper start - Replace rules for Height in Swamp Biome ++ final double maxHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.maximum; ++ final double minHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.minimum; ++ if (world.getBiome(pos).is(BiomeTags.ALLOWS_SURFACE_SLIME_SPAWNS) && pos.getY() > minHeightSwamp && pos.getY() < maxHeightSwamp && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) { ++ // Paper end + return checkMobSpawnRules(type, world, spawnReason, pos, random); + } + +@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { + ChunkPos chunkcoordintpair = new ChunkPos(pos); + boolean flag = world.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper + +- if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { ++ // Paper start - Replace rules for Height in Slime Chunks ++ final double maxHeightSlimeChunk = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum; ++ if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) { ++ // Paper end + return checkMobSpawnRules(type, world, spawnReason, pos, random); + } + } diff --git a/patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch similarity index 100% rename from patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch rename to patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch diff --git a/patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch b/patches/server/Add-missing-block-data-mins-and-maxes.patch similarity index 89% rename from patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch rename to patches/server/Add-missing-block-data-mins-and-maxes.patch index f728166dbd..3f2ee7cca3 100644 --- a/patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch +++ b/patches/server/Add-missing-block-data-mins-and-maxes.patch @@ -150,19 +150,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end } -diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java -@@ -0,0 +0,0 @@ public final class CraftPowderSnowCauldron extends org.bukkit.craftbukkit.block. - public int getMaximumLevel() { - return getMax(CraftPowderSnowCauldron.LEVEL); - } -+ -+ // Paper start -+ @Override -+ public int getMinimumLevel() { -+ return getMin(CraftPowderSnowCauldron.LEVEL); -+ } -+ // Paper end - } diff --git a/patches/unapplied/server/Add-missing-structure-set-seed-configs.patch b/patches/server/Add-missing-structure-set-seed-configs.patch similarity index 100% rename from patches/unapplied/server/Add-missing-structure-set-seed-configs.patch rename to patches/server/Add-missing-structure-set-seed-configs.patch diff --git a/patches/unapplied/server/Add-new-overload-to-PersistentDataContainer-has.patch b/patches/server/Add-new-overload-to-PersistentDataContainer-has.patch similarity index 100% rename from patches/unapplied/server/Add-new-overload-to-PersistentDataContainer-has.patch rename to patches/server/Add-new-overload-to-PersistentDataContainer-has.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/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/unapplied/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.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/Bucketable-API.patch b/patches/server/Bucketable-API.patch similarity index 100% rename from patches/unapplied/server/Bucketable-API.patch rename to patches/server/Bucketable-API.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/Configurable-max-block-light-for-monster-spawning.patch b/patches/server/Configurable-max-block-light-for-monster-spawning.patch similarity index 100% rename from patches/unapplied/server/Configurable-max-block-light-for-monster-spawning.patch rename to patches/server/Configurable-max-block-light-for-monster-spawning.patch diff --git a/patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch b/patches/server/Configurable-sculk-sensor-listener-range.patch similarity index 100% rename from patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch rename to patches/server/Configurable-sculk-sensor-listener-range.patch diff --git a/patches/unapplied/server/Custom-Potion-Mixes.patch b/patches/server/Custom-Potion-Mixes.patch similarity index 81% rename from patches/unapplied/server/Custom-Potion-Mixes.patch rename to patches/server/Custom-Potion-Mixes.patch index e65eda9622..c9cf5f8122 100644 --- a/patches/unapplied/server/Custom-Potion-Mixes.patch +++ b/patches/server/Custom-Potion-Mixes.patch @@ -31,18 +31,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return CraftRecipe.toIngredient(choice, true); + } +} -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.6D) { - // CraftBukkit start -- if (!CraftEventFactory.callEntityChangeBlockEvent(projectile, blockposition, Blocks.AIR.defaultBlockState())) { -+ if (!CraftEventFactory.callEntityChangeBlockEvent(projectile, blockposition, state.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state - return; - } - // CraftBukkit end + if (projectile.mayInteract(world, blockposition) && projectile.mayBreak(world) && projectile instanceof ThrownTrident && projectile.getDeltaMovement().length() > 0.6D) { + // CraftBukkit start +- if (!CraftEventFactory.callEntityChangeBlockEvent(projectile, blockposition, Blocks.AIR.defaultBlockState())) { ++ if (!CraftEventFactory.callEntityChangeBlockEvent(projectile, blockposition, state.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state + return; + } + // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/TntBlock.java b/src/main/java/net/minecraft/world/level/block/TntBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/TntBlock.java 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-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch similarity index 100% rename from patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch rename to patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch diff --git a/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch similarity index 100% rename from patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch rename to patches/server/Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch b/patches/server/Fix-xp-reward-for-baby-zombies.patch similarity index 100% rename from patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch rename to patches/server/Fix-xp-reward-for-baby-zombies.patch diff --git a/patches/unapplied/server/Force-close-world-loading-screen.patch b/patches/server/Force-close-world-loading-screen.patch similarity index 100% rename from patches/unapplied/server/Force-close-world-loading-screen.patch rename to patches/server/Force-close-world-loading-screen.patch diff --git a/patches/unapplied/server/Freeze-Tick-Lock-API.patch b/patches/server/Freeze-Tick-Lock-API.patch similarity index 93% rename from patches/unapplied/server/Freeze-Tick-Lock-API.patch rename to patches/server/Freeze-Tick-Lock-API.patch index 1e2b46cfef..4485a65b2a 100644 --- a/patches/unapplied/server/Freeze-Tick-Lock-API.patch +++ b/patches/server/Freeze-Tick-Lock-API.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S private org.bukkit.util.Vector origin; @javax.annotation.Nullable private UUID originWorld; @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setRemainingFireTicks(this.remainingFireTicks - 1); } @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.setTicksFrozen(0); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (fromNetherPortal) { nbt.putBoolean("Paper.FromNetherPortal", true); } @@ -33,9 +33,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + nbt.putBoolean("Paper.FreezeLock", true); + } // Paper end - return nbt; + return nbttagcompound; } catch (Throwable throwable) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (spawnReason == null) { spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; } @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.level().getProfiler().pop(); this.level().getProfiler().push("freezing"); - if (!this.level().isClientSide && !this.isDeadOrDying()) { -+ if (!this.level().isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API ++ if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API int i = this.getTicksFrozen(); if (this.isInPowderSnow && this.canFreeze()) { @@ -79,4 +79,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - Freeze Tick Lock API @Override public void remove() { - this.entity.discard(); + this.entity.pluginRemoved = true; diff --git a/patches/unapplied/server/Furnace-RecipesUsed-API.patch b/patches/server/Furnace-RecipesUsed-API.patch similarity index 100% rename from patches/unapplied/server/Furnace-RecipesUsed-API.patch rename to patches/server/Furnace-RecipesUsed-API.patch diff --git a/patches/unapplied/server/Guard-against-invalid-entity-positions.patch b/patches/server/Guard-against-invalid-entity-positions.patch similarity index 98% rename from patches/unapplied/server/Guard-against-invalid-entity-positions.patch rename to patches/server/Guard-against-invalid-entity-positions.patch index 10114c430c..fdf3e66034 100644 --- a/patches/unapplied/server/Guard-against-invalid-entity-positions.patch +++ b/patches/server/Guard-against-invalid-entity-positions.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale); } 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/Implement-regenerateChunk.patch b/patches/server/Implement-regenerateChunk.patch similarity index 100% rename from patches/unapplied/server/Implement-regenerateChunk.patch rename to patches/server/Implement-regenerateChunk.patch diff --git a/patches/unapplied/server/Kick-on-main-for-illegal-chat.patch b/patches/server/Kick-on-main-for-illegal-chat.patch similarity index 74% rename from patches/unapplied/server/Kick-on-main-for-illegal-chat.patch rename to patches/server/Kick-on-main-for-illegal-chat.patch index c478e21d74..2fbc0edf6a 100644 --- a/patches/unapplied/server/Kick-on-main-for-illegal-chat.patch +++ b/patches/server/Kick-on-main-for-illegal-chat.patch @@ -6,6 +6,8 @@ Subject: [PATCH] Kick on main for illegal chat Makes the PlayerKickEvent fire on the main thread for illegal characters or chat out-of-order errors. +TODO: Check all the missing schedule on mains? (1.20.3) + diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -18,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause + }); // Paper - push to main for event firing } else { - Optional optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); + Optional optional = this.tryHandleChat(packet.lastSeenMessages()); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override @@ -28,15 +30,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper + }); // Paper - push to main for event firing } else { - Optional optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); + Optional optional = this.tryHandleChat(packet.lastSeenMessages()); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { - if (!this.updateChatOrder(timestamp)) { - ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); + private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { + ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString()); + if (exception.shouldDisconnect()) { + this.server.scheduleOnMain(() -> { // Paper - push to main - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes + this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes + }); // Paper - push to main - return Optional.empty(); } else { - Optional optional = this.unpackAndApplyLastSeen(acknowledgment); + this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); + } diff --git a/patches/unapplied/server/Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch similarity index 100% rename from patches/unapplied/server/Load-effect-amplifiers-greater-than-127-correctly.patch rename to patches/server/Load-effect-amplifiers-greater-than-127-correctly.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/Make-water-animal-spawn-height-configurable.patch b/patches/server/Make-water-animal-spawn-height-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-water-animal-spawn-height-configurable.patch rename to patches/server/Make-water-animal-spawn-height-configurable.patch diff --git a/patches/unapplied/server/More-PotionEffectType-API.patch b/patches/server/More-PotionEffectType-API.patch similarity index 96% rename from patches/unapplied/server/More-PotionEffectType-API.patch rename to patches/server/More-PotionEffectType-API.patch index 6992b5e226..a9373518d2 100644 --- a/patches/unapplied/server/More-PotionEffectType-API.patch +++ b/patches/server/More-PotionEffectType-API.patch @@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java @@ -0,0 +0,0 @@ public class CraftPotionEffectType extends PotionEffectType { - return CraftRegistry.getMinecraftRegistry(Registries.MOB_EFFECT) - .getOptional(CraftNamespacedKey.toMinecraft(bukkit.getKey())).orElseThrow(); + + return ((CraftPotionEffectType) bukkit).getHandle(); } + + // Paper start 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/Multi-Block-Change-API-Implementation.patch b/patches/server/Multi-Block-Change-API-Implementation.patch similarity index 100% rename from patches/unapplied/server/Multi-Block-Change-API-Implementation.patch rename to patches/server/Multi-Block-Change-API-Implementation.patch diff --git a/patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch b/patches/server/Multiple-Entries-with-Scoreboards.patch similarity index 97% rename from patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch rename to patches/server/Multiple-Entries-with-Scoreboards.patch index 3b45224e16..3a1cf2c5c0 100644 --- a/patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch +++ b/patches/server/Multiple-Entries-with-Scoreboards.patch @@ -49,8 +49,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Override - public void removePlayerFromTeam(String playerName, PlayerTeam team) { - super.removePlayerFromTeam(playerName, team); + public void removePlayerFromTeam(String scoreHolderName, PlayerTeam team) { + super.removePlayerFromTeam(scoreHolderName, team); @@ -0,0 +0,0 @@ public class ServerScoreboard extends Scoreboard { this.setDirty(); } diff --git a/patches/server/Optimise-random-block-ticking.patch b/patches/server/Optimise-random-block-ticking.patch index b27d62b2c2..37db335129 100644 --- a/patches/server/Optimise-random-block-ticking.patch +++ b/patches/server/Optimise-random-block-ticking.patch @@ -190,14 +190,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 timings.chunkTicksBlocks.stopTiming(); // Paper gameprofilerfiller.pop(); - } +@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting -- public void tickPrecipitation(BlockPos pos) { + public void tickPrecipitation(BlockPos pos) { - BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos); - BlockPos blockposition2 = blockposition1.below(); -+ public void tickPrecipitation(BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking -+ // Paper start - optimise chunk ticking ++ // Paper start - optimise chunk ticking ++ tickPrecipitation(pos.mutable(), this.getChunkAt(pos)); ++ } ++ public void tickPrecipitation(BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { + int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition1.getX() & 15, blockposition1.getZ() & 15) + 1; + int downY = normalY - 1; + blockposition1.setY(normalY); diff --git a/patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch similarity index 100% rename from patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch rename to patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.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-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/Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/Put-world-into-worldlist-before-initing-the-world.patch similarity index 100% rename from patches/unapplied/server/Put-world-into-worldlist-before-initing-the-world.patch rename to patches/server/Put-world-into-worldlist-before-initing-the-world.patch diff --git a/patches/unapplied/server/Reset-placed-block-on-exception.patch b/patches/server/Reset-placed-block-on-exception.patch similarity index 100% rename from patches/unapplied/server/Reset-placed-block-on-exception.patch rename to patches/server/Reset-placed-block-on-exception.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 94% 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 index 984b112fce..ad370bb48b 100644 --- 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 @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -0,0 +0,0 @@ public class ServerPlayerGameMode { - block.destroy(this.level, pos, iblockdata); + block.destroy(this.level, pos, iblockdata1); } + ItemStack mainHandStack = null; // Paper @@ -19,11 +19,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { ItemStack itemstack = this.player.getMainHandItem(); ItemStack itemstack1 = itemstack.copy(); - boolean flag1 = this.player.hasCorrectToolForDrops(iblockdata); + boolean flag1 = this.player.hasCorrectToolForDrops(iblockdata1); + mainHandStack = itemstack1; // Paper + isCorrectTool = flag1; // Paper - itemstack.mineBlock(this.level, iblockdata, pos, this.player); + itemstack.mineBlock(this.level, iblockdata1, pos, this.player); if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items @@ -0,0 +0,0 @@ public class ServerPlayerGameMode { if (flag && event != null) { diff --git a/patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch similarity index 100% rename from patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch rename to patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.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/Validate-usernames.patch b/patches/server/Validate-usernames.patch similarity index 95% rename from patches/unapplied/server/Validate-usernames.patch rename to patches/server/Validate-usernames.patch index ab1cf3261f..26dd83291a 100644 --- a/patches/unapplied/server/Validate-usernames.patch +++ b/patches/server/Validate-usernames.patch @@ -43,8 +43,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void handleHello(ServerboundHelloPacket packet) { Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]); - Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); -+ // Paper start - validate usernames + Validate.validState(Player.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); ++ // Paper start - validate usernames -- TODO: Do we need this? + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) { + if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) { + ServerLoginPacketListenerImpl.this.disconnect("Failed to verify username!"); 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 100% 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 diff --git a/patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch b/patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch deleted file mode 100644 index d6f4ec872b..0000000000 --- a/patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Doc -Date: Mon, 2 Aug 2021 11:24:39 -0400 -Subject: [PATCH] Add configurable height for slime spawn - - -diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Slime.java -+++ 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, RandomSource random) { - if (world.getDifficulty() != Difficulty.PEACEFUL) { -- if (world.getBiome(pos).is(BiomeTags.ALLOWS_SURFACE_SLIME_SPAWNS) && pos.getY() > 50 && pos.getY() < 70 && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) { -+ // Paper start - Replace rules for Height in Swamp Biome -+ final double maxHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.maximum; -+ final double minHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.minimum; -+ if (world.getBiome(pos).is(BiomeTags.ALLOWS_SURFACE_SLIME_SPAWNS) && pos.getY() > minHeightSwamp && pos.getY() < maxHeightSwamp && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) { -+ // Paper end - return checkMobSpawnRules(type, world, spawnReason, pos, random); - } - -@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { - ChunkPos chunkcoordintpair = new ChunkPos(pos); - boolean flag = world.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - -- if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { -+ // Paper start - Replace rules for Height in Slime Chunks -+ final double maxHeightSlimeChunk = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum; -+ if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) { -+ // Paper end - return checkMobSpawnRules(type, world, spawnReason, pos, random); - } - } diff --git a/patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch b/patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch deleted file mode 100644 index 26688633df..0000000000 --- a/patches/unapplied/server/Fix-slime-spawners-not-spawning-outside-slime-chunks.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Fri, 15 Apr 2022 17:09:28 -0700 -Subject: [PATCH] Fix slime spawners not spawning outside slime chunks - -Fixes MC-50647 by just checking if the spawn type is a SPAWNER -and then bypassing the spawn check logic if on slimes if it is. - -diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Slime.java -+++ 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, RandomSource random) { - if (world.getDifficulty() != Difficulty.PEACEFUL) { -+ // Paper start - fix slime spawners; Fixes MC-50647 -+ if (spawnReason == MobSpawnType.SPAWNER) { -+ return random.nextInt(10) == 0; -+ } -+ // Paper end - // Paper start - Replace rules for Height in Swamp Biome - final double maxHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.maximum; - final double minHeightSwamp = world.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.surfaceBiome.minimum;