diff --git a/patches/server/Add-Channel-initialization-listeners.patch b/patches/server/Add-Channel-initialization-listeners.patch index 674184bb90..2dfe5b2ddf 100644 --- a/patches/server/Add-Channel-initialization-listeners.patch +++ b/patches/server/Add-Channel-initialization-listeners.patch @@ -129,7 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { this.channel.pipeline().addBefore("encoder", "compress", new CompressionEncoder(compressionThreshold)); } -+ this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper ++ this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper - Add Channel initialization listeners } else { if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) { this.channel.pipeline().remove("decompress"); @@ -137,7 +137,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.channel.pipeline().get("compress") instanceof CompressionEncoder) { this.channel.pipeline().remove("compress"); } -+ this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_DISABLED); // Paper ++ this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_DISABLED); // Paper - Add Channel initialization listeners } } @@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 pending.add(object); // Paper ((Connection) object).configurePacketHandler(channelpipeline); ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); -+ io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper ++ io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper - Add Channel initialization listeners } }).group(eventloopgroup).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit } diff --git a/patches/server/Add-EntityBlockStorage-clearEntities.patch b/patches/server/Add-EntityBlockStorage-clearEntities.patch index 64f5f109ef..586950bd22 100644 --- a/patches/server/Add-EntityBlockStorage-clearEntities.patch +++ b/patches/server/Add-EntityBlockStorage-clearEntities.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void clearBees() { + this.stored.clear(); + } -+ // Paper end ++ // Paper end - Add EntityBlockStorage clearEntities public static int getHoneyLevel(BlockState state) { return (Integer) state.getValue(BeehiveBlock.HONEY_LEVEL); } diff --git a/patches/server/Added-PlayerBedFailEnterEvent.patch b/patches/server/Add-PlayerBedFailEnterEvent.patch similarity index 86% rename from patches/server/Added-PlayerBedFailEnterEvent.patch rename to patches/server/Add-PlayerBedFailEnterEvent.patch index 3ee20afbf4..4c0b4ed1fd 100644 --- a/patches/server/Added-PlayerBedFailEnterEvent.patch +++ b/patches/server/Add-PlayerBedFailEnterEvent.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 24 Dec 2020 12:27:41 -0800 -Subject: [PATCH] Added PlayerBedFailEnterEvent +Subject: [PATCH] Add PlayerBedFailEnterEvent diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java @@ -18,19 +18,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!event.callEvent()) { + return; + } -+ // Paper end ++ // Paper end - PlayerBedFailEnterEvent // CraftBukkit start - handling bed explosion from below here - if (!world.dimensionType().bedWorks()) { -+ if (event.getWillExplode()) { // Paper ++ if (event.getWillExplode()) { // Paper - PlayerBedFailEnterEvent this.explodeBed(finaliblockdata, world, finalblockposition); } else // CraftBukkit end if (entityhuman_enumbedresult.getMessage() != null) { - player.displayClientMessage(entityhuman_enumbedresult.getMessage(), true); -+ final net.kyori.adventure.text.Component message = event.getMessage(); // Paper -+ if (message != null) player.displayClientMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), true); // Paper ++ final net.kyori.adventure.text.Component message = event.getMessage(); // Paper - PlayerBedFailEnterEvent ++ if (message != null) player.displayClientMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), true); // Paper - PlayerBedFailEnterEvent } -+ } // Paper ++ } // Paper - PlayerBedFailEnterEvent }); return InteractionResult.SUCCESS; diff --git a/patches/server/Added-PlayerDeepSleepEvent.patch b/patches/server/Add-PlayerDeepSleepEvent.patch similarity index 86% rename from patches/server/Added-PlayerDeepSleepEvent.patch rename to patches/server/Add-PlayerDeepSleepEvent.patch index 1a556f2b4b..d7806b8dfb 100644 --- a/patches/server/Added-PlayerDeepSleepEvent.patch +++ b/patches/server/Add-PlayerDeepSleepEvent.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 21 Apr 2021 15:58:19 -0700 -Subject: [PATCH] Added PlayerDeepSleepEvent +Subject: [PATCH] Add PlayerDeepSleepEvent diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -12,11 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.isSleeping()) { ++this.sleepCounter; -+ // Paper start ++ // Paper start - Add PlayerDeepSleepEvent + if (this.sleepCounter == 100) { + if (!new io.papermc.paper.event.player.PlayerDeepSleepEvent((org.bukkit.entity.Player) getBukkitEntity()).callEvent()) { this.sleepCounter = Integer.MIN_VALUE; } + } -+ // Paper end ++ // Paper end - Add PlayerDeepSleepEvent if (this.sleepCounter > 100) { this.sleepCounter = 100; } diff --git a/patches/server/Add-Unix-domain-socket-support.patch b/patches/server/Add-Unix-domain-socket-support.patch index e42635de18..cd5ab47c16 100644 --- a/patches/server/Add-Unix-domain-socket-support.patch +++ b/patches/server/Add-Unix-domain-socket-support.patch @@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { @@ -0,0 +0,0 @@ public class ServerConnectionListener { ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); - io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper + io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper - Add Channel initialization listeners } - }).group(eventloopgroup).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit + }).group(eventloopgroup).localAddress(address)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit // Paper - Unix domain socket support @@ -125,7 +125,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL // Paper end // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! - if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper + if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check + // Paper start - Unix domain socket support + java.net.SocketAddress socketAddress = this.connection.getRemoteAddress(); this.connection.hostname = split[0]; diff --git a/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch index 3497a939e3..f627bc15cf 100644 --- a/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch +++ b/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -13,16 +13,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return MobType.UNDEAD; } -+ // Paper start ++ // Paper start - shouldBurnInDay API + private boolean shouldBurnInDay = true; + public boolean shouldBurnInDay() { return shouldBurnInDay; } + public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } -+ // Paper end ++ // Paper end - shouldBurnInDay API + @Override public void aiStep() { - boolean flag = this.isSunBurnTick(); -+ boolean flag = shouldBurnInDay && this.isSunBurnTick(); // Paper - Configurable Burning ++ boolean flag = shouldBurnInDay && this.isSunBurnTick(); // Paper - shouldBurnInDay API if (flag) { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); @@ -30,20 +30,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); this.reassessWeaponGoal(); -+ // Paper start ++ // Paper start - shouldBurnInDay API + if (nbt.contains("Paper.ShouldBurnInDay")) { + this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); + } -+ // Paper end ++ // Paper end - shouldBurnInDay API + } + -+ // Paper start ++ // Paper start - shouldBurnInDay API + @Override + public void addAdditionalSaveData(CompoundTag nbt) { + super.addAdditionalSaveData(nbt); + nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); } -+ // Paper end ++ // Paper end - shouldBurnInDay API @Override public void setItemSlot(EquipmentSlot slot, ItemStack stack) { @@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void aiStep() { - if (this.isAlive() && this.isSunBurnTick()) { -+ if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning ++ if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API this.setSecondsOnFire(8); } diff --git a/patches/server/Add-bypass-host-check.patch b/patches/server/Add-bypass-host-check.patch index bd1989dfb8..4bc32b2957 100644 --- a/patches/server/Add-bypass-host-check.patch +++ b/patches/server/Add-bypass-host-check.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper end // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! - if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { -+ if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper ++ if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check this.connection.hostname = split[0]; this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); this.connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); diff --git a/patches/server/Add-environment-variable-to-disable-server-gui.patch b/patches/server/Add-environment-variable-to-disable-server-gui.patch index 656ff73e78..bf7cb984e5 100644 --- a/patches/server/Add-environment-variable-to-disable-server-gui.patch +++ b/patches/server/Add-environment-variable-to-disable-server-gui.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); -+ if(!Boolean.parseBoolean(System.getenv().getOrDefault("PAPER_DISABLE_SERVER_GUI", String.valueOf(false)))) // Paper ++ if(!Boolean.parseBoolean(System.getenv().getOrDefault("PAPER_DISABLE_SERVER_GUI", String.valueOf(false)))) // Paper - Add environment variable to disable server gui if (flag1 && !GraphicsEnvironment.isHeadless()) { dedicatedserver1.showGui(); } diff --git a/patches/server/Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/Add-fast-alternative-constructor-for-Rotations.patch index 81a66d2f29..a78b0189eb 100644 --- a/patches/server/Add-fast-alternative-constructor-for-Rotations.patch +++ b/patches/server/Add-fast-alternative-constructor-for-Rotations.patch @@ -3,7 +3,6 @@ From: Irmo van den Berge Date: Wed, 10 Mar 2021 21:26:31 +0100 Subject: [PATCH] Add fast alternative constructor for Rotations -Signed-off-by: Irmo van den Berge diff --git a/src/main/java/net/minecraft/core/Rotations.java b/src/main/java/net/minecraft/core/Rotations.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -23,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static Rotations createWithoutValidityChecks(float x, float y, float z) { + return new Rotations(x, y, z, null); + } -+ // Paper end ++ // Paper end - faster alternative constructor + public ListTag save() { ListTag listTag = new ListTag(); diff --git a/patches/server/Add-more-WanderingTrader-API.patch b/patches/server/Add-more-WanderingTrader-API.patch index de5c1c3f43..4eddf85de0 100644 --- a/patches/server/Add-more-WanderingTrader-API.patch +++ b/patches/server/Add-more-WanderingTrader-API.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Add more WanderingTrader API + public boolean canDrinkPotion = true; + public boolean canDrinkMilk = true; -+ // Paper end ++ // Paper end - Add more WanderingTrader API public WanderingTrader(EntityType type, Level world) { super(type, world); diff --git a/patches/server/Allow-using-signs-inside-spawn-protection.patch b/patches/server/Allow-using-signs-inside-spawn-protection.patch index 592c874435..9d96d232a5 100644 --- a/patches/server/Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/Allow-using-signs-inside-spawn-protection.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (blockposition.getY() < i) { - if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) { -+ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - sign check ++ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706 InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock); diff --git a/patches/server/Drop-carried-item-when-player-has-disconnected.patch b/patches/server/Drop-carried-item-when-player-has-disconnected.patch index 05eb06b90c..790560c6fe 100644 --- a/patches/server/Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/Drop-carried-item-when-player-has-disconnected.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + entityplayer.containerMenu.setCarried(net.minecraft.world.item.ItemStack.EMPTY); + entityplayer.drop(carried, false); + } -+ // Paper end ++ // Paper end - Drop carried item when player has disconnected + this.save(entityplayer); if (entityplayer.isPassenger()) { diff --git a/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch index 79470b895e..6ff3ca5a27 100644 --- a/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch +++ b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch @@ -216,7 +216,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 thread.setDaemon(true); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER)); - thread.start(); -+ // thread.start(); // Paper - moved down ++ // thread.start(); // Paper - Enhance console tab completions for brigadier commands; moved down DedicatedServer.LOGGER.info("Starting minecraft server version {}", SharedConstants.getCurrentVersion().getName()); if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); @@ -224,7 +224,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames // Paper end - convert old users earlier after PlayerList creation but before file load/save org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread -+ thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized ++ thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now @@ -236,11 +236,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public class ConsoleCommandCompleter implements Completer { private final DedicatedServer server; // Paper - CraftServer -> DedicatedServer -+ private final io.papermc.paper.console.BrigadierCommandCompleter brigadierCompleter; // Paper ++ private final io.papermc.paper.console.BrigadierCommandCompleter brigadierCompleter; // Paper - Enhance console tab completions for brigadier commands public ConsoleCommandCompleter(DedicatedServer server) { // Paper - CraftServer -> DedicatedServer this.server = server; -+ this.brigadierCompleter = new io.papermc.paper.console.BrigadierCommandCompleter(this.server); // Paper ++ this.brigadierCompleter = new io.papermc.paper.console.BrigadierCommandCompleter(this.server); // Paper - Enhance console tab completions for brigadier commands } // Paper start - Change method signature for JLine update @@ -265,7 +265,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 try { List offers = waitable.get(); if (offers == null) { -+ this.addCompletions(reader, line, candidates, Collections.emptyList()); // Paper ++ this.addCompletions(reader, line, candidates, Collections.emptyList()); // Paper - Enhance console tab completions for brigadier commands return; // Paper - Method returns void } diff --git a/patches/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch index e8c3c107c5..f97ae9f887 100644 --- a/patches/server/Entity-load-save-limit-per-chunk.patch +++ b/patches/server/Entity-load-save-limit-per-chunk.patch @@ -16,11 +16,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 final Spliterator spliterator = entityNbtList.spliterator(); return StreamSupport.stream(new Spliterator() { -+ final java.util.Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper ++ final java.util.Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper - Entity load/save limit per chunk public boolean tryAdvance(Consumer consumer) { return spliterator.tryAdvance((nbtbase) -> { EntityType.loadEntityRecursive((CompoundTag) nbtbase, world, (entity) -> { -+ // Paper start ++ // Paper start - Entity load/save limit per chunk + final EntityType entityType = entity.getType(); + final int saveLimit = world.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1); + if (saveLimit > -1) { @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + this.loadedEntityCounts.merge(entityType, 1, Integer::sum); + } -+ // Paper end ++ // Paper end - Entity load/save limit per chunk consumer.accept(entity); return entity; }); @@ -41,9 +41,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } ListTag listTag = new ListTag(); -+ final java.util.Map, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper ++ final java.util.Map, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper - Entity load/save limit per chunk entities.forEach((entity) -> { // diff here: use entities parameter -+ // Paper start ++ // Paper start - Entity load/save limit per chunk + final EntityType entityType = entity.getType(); + final int saveLimit = level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1); + if (saveLimit > -1) { @@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + savedEntityCounts.merge(entityType, 1, Integer::sum); + } -+ // Paper end ++ // Paper end - Entity load/save limit per chunk CompoundTag compoundTag = new CompoundTag(); if (entity.save(compoundTag)) { listTag.add(compoundTag); diff --git a/patches/server/Expand-EntityUnleashEvent.patch b/patches/server/Expand-EntityUnleashEvent.patch index fc08441ed8..a1130ddb30 100644 --- a/patches/server/Expand-EntityUnleashEvent.patch +++ b/patches/server/Expand-EntityUnleashEvent.patch @@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.dropLeash(true, false); + // Paper start - drop leash variable + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, false); -+ if (!event.callEvent()) { return; } ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end this.getAllSlots().forEach((itemstack) -> { @@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.dropLeash(true, true); + // Paper start - drop leash variable + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true); -+ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ if (!event.callEvent()) return; + this.dropLeash(true, event.isDropLeash()); + // Paper end } @@ -94,7 +94,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.dropLeash(true, true); + // Paper start - drop leash variable + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true); -+ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ if (!event.callEvent()) return; + this.dropLeash(true, event.isDropLeash()); + // Paper end this.goalSelector.disableControlFlag(Goal.Flag.MOVE); diff --git a/patches/server/additions-to-PlayerGameModeChangeEvent.patch b/patches/server/Expand-PlayerGameModeChangeEvent.patch similarity index 89% rename from patches/server/additions-to-PlayerGameModeChangeEvent.patch rename to patches/server/Expand-PlayerGameModeChangeEvent.patch index decce69efd..e5e2454d03 100644 --- a/patches/server/additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/Expand-PlayerGameModeChangeEvent.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 15 May 2021 10:04:43 -0700 -Subject: [PATCH] additions to PlayerGameModeChangeEvent +Subject: [PATCH] Expand PlayerGameModeChangeEvent diff --git a/src/main/java/net/minecraft/server/commands/DefaultGameModeCommands.java b/src/main/java/net/minecraft/server/commands/DefaultGameModeCommands.java @@ -14,12 +14,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for(ServerPlayer serverPlayer : minecraftServer.getPlayerList().getPlayers()) { - if (serverPlayer.setGameMode(gameType)) { - ++i; -+ // Paper start - extend PlayerGameModeChangeEvent ++ // Paper start - Expand PlayerGameModeChangeEvent + org.bukkit.event.player.PlayerGameModeChangeEvent event = serverPlayer.setGameMode(gameType, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, net.kyori.adventure.text.Component.empty()); + if (event != null && event.isCancelled()) { + source.sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(event.cancelMessage()), false); } -+ // Paper end ++ // Paper end - Expand PlayerGameModeChangeEvent + ++i; } } @@ -33,14 +33,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for(ServerPlayer serverPlayer : targets) { - if (serverPlayer.setGameMode(gameMode)) { -+ // Paper start - extend PlayerGameModeChangeEvent ++ // Paper start - Expand PlayerGameModeChangeEvent + org.bukkit.event.player.PlayerGameModeChangeEvent event = serverPlayer.setGameMode(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.COMMAND, net.kyori.adventure.text.Component.empty()); + if (event != null && !event.isCancelled()) { logGamemodeChange(context.getSource(), serverPlayer, gameMode); ++i; + } else if (event != null && event.cancelMessage() != null) { + context.getSource().sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(event.cancelMessage()), true); -+ // Paper end ++ // Paper end - Expand PlayerGameModeChangeEvent } } @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean setGameMode(GameType gameMode) { - if (!this.gameMode.changeGameModeForPlayer(gameMode)) { - return false; -+ // Paper start - Add cause and nullable message to event ++ // Paper start - Expand PlayerGameModeChangeEvent + org.bukkit.event.player.PlayerGameModeChangeEvent event = this.setGameMode(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.UNKNOWN, null); + return event == null ? false : event.isCancelled(); + } @@ -62,8 +62,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public org.bukkit.event.player.PlayerGameModeChangeEvent setGameMode(GameType gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause cause, @Nullable net.kyori.adventure.text.Component message) { + org.bukkit.event.player.PlayerGameModeChangeEvent event = this.gameMode.changeGameModeForPlayer(gameMode, cause, message); + if (event == null || event.isCancelled()) { -+ // Paper end + return null; ++ // Paper end - Expand PlayerGameModeChangeEvent } else { this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); if (gameMode == GameType.SPECTATOR) { @@ -72,7 +72,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.onUpdateAbilities(); this.updateEffectVisibility(); - return true; -+ return event; // Paper ++ return event; // Paper - Expand PlayerGameModeChangeEvent } } @@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void loadGameTypes(@Nullable CompoundTag nbt) { -+ // Paper start ++ // Paper start - Expand PlayerGameModeChangeEvent + if (this.server.getForcedGameType() != null && this.server.getForcedGameType() != ServerPlayer.readPlayerMode(nbt, "playerGameType")) { + if (new org.bukkit.event.player.PlayerGameModeChangeEvent(this.getBukkitEntity(), org.bukkit.GameMode.getByValue(this.server.getDefaultGameType().getId()), org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, null).callEvent()) { + this.gameMode.setGameModeForPlayer(this.server.getForcedGameType(), GameType.DEFAULT_MODE); @@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + return; + } -+ // Paper end ++ // Paper end - Expand PlayerGameModeChangeEvent this.gameMode.setGameModeForPlayer(this.calculateGameModeForNewPlayer(ServerPlayer.readPlayerMode(nbt, "playerGameType")), ServerPlayer.readPlayerMode(nbt, "previousPlayerGameType")); } @@ -101,16 +101,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public boolean changeGameModeForPlayer(GameType gameMode) { -+ // Paper end ++ // Paper end - Expand PlayerGameModeChangeEvent + PlayerGameModeChangeEvent event = this.changeGameModeForPlayer(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.UNKNOWN, null); + return event != null && event.isCancelled(); + } + @Nullable + public PlayerGameModeChangeEvent changeGameModeForPlayer(GameType gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause cause, @Nullable net.kyori.adventure.text.Component cancelMessage) { -+ // Paper end ++ // Paper end - Expand PlayerGameModeChangeEvent if (gameMode == this.gameModeForPlayer) { - return false; -+ return null; // Paper ++ return null; // Paper - Expand PlayerGameModeChangeEvent } else { // CraftBukkit start - PlayerGameModeChangeEvent event = new PlayerGameModeChangeEvent(this.player.getBukkitEntity(), GameMode.getByValue(gameMode.getId())); @@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.level.getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { - return false; -+ return event; // Paper ++ return event; // Paper - Expand PlayerGameModeChangeEvent } // CraftBukkit end this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer); @@ -126,7 +126,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.level.updateSleepingPlayerList(); - return true; -+ return event; // Paper ++ return event; // Paper - Expand PlayerGameModeChangeEvent } } @@ -139,7 +139,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { - this.player.setGameMode(GameType.SPECTATOR); -+ this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper ++ this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper - Expand PlayerGameModeChangeEvent ((GameRules.BooleanValue) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server); } } @@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.getHandle().connection == null) return; - this.getHandle().setGameMode(GameType.byId(mode.getValue())); -+ this.getHandle().setGameMode(GameType.byId(mode.getValue()), org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.PLUGIN, null); // Paper ++ this.getHandle().setGameMode(GameType.byId(mode.getValue()), org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.PLUGIN, null); // Paper - Expand PlayerGameModeChangeEvent } @Override diff --git a/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch similarity index 71% rename from patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/server/Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch index 38ecf9cf4b..331be4518a 100644 --- a/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch @@ -1,8 +1,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Thu, 22 Apr 2021 17:17:47 -0700 -Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent +From: HexedHero <6012891+HexedHero@users.noreply.github.com> +Date: Fri, 23 Apr 2021 22:42:42 +0100 +Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues +Co-authored-by: Jake Potrebic 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 @@ -13,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.player.wonGame) { this.player.wonGame = false; - this.player = this.server.getPlayerList().respawn(this.player, true, RespawnReason.END_PORTAL); -+ this.player = this.server.getPlayerList().respawn(this.player, this.server.getLevel(this.player.getRespawnDimension()), true, null, true, RespawnReason.END_PORTAL, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL); // Paper - add isEndCreditsRespawn argument ++ this.player = this.server.getPlayerList().respawn(this.player, this.server.getLevel(this.player.getRespawnDimension()), true, null, true, RespawnReason.END_PORTAL, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL); // Paper - Expand PlayerRespawnEvent CriteriaTriggers.CHANGED_DIMENSION.trigger(this.player, Level.END, Level.OVERWORLD); } else { if (this.player.getHealth() > 0.0F) { @@ -25,21 +26,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) { -+ // Paper start ++ // Paper start - Expand PlayerRespawnEvent + return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]); + } + + public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) { -+ // Paper end ++ // Paper end - Expand PlayerRespawnEvent entityplayer.stopRiding(); // CraftBukkit this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot +@@ -0,0 +0,0 @@ public abstract class PlayerList { + + // Paper start + boolean isBedSpawn = false; ++ boolean isAnchorSpawn = false; // Paper - Fix PlayerRespawnEvent + boolean isRespawn = false; + boolean isLocAltered = false; // Paper - Fix SPIGOT-5989 + // Paper end +@@ -0,0 +0,0 @@ public abstract class PlayerList { + if (optional.isPresent()) { + BlockState iblockdata = worldserver1.getBlockState(blockposition); + boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR); ++ isAnchorSpawn = flag3; // Paper - Fix PlayerRespawnEvent + Vec3 vec3d = (Vec3) optional.get(); + float f1; + @@ -0,0 +0,0 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); -- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason); // Paper - Fix anchor respawn acting as a bed respawn from the end portal -+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason, com.google.common.collect.ImmutableSet.builder().add(respawnFlags)); // Paper - Fix anchor respawn acting as a bed respawn from the end portal +- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2, reason); ++ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason, com.google.common.collect.ImmutableSet.builder().add(respawnFlags)); // Paper - PlayerRespawnEvent changes this.cserver.getPluginManager().callEvent(respawnEvent); // Spigot Start if (entityplayer.connection.isDisconnected()) { diff --git a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch index b6a7bcabfc..0e5aecd9ef 100644 --- a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -167,7 +167,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 { - return event; // Paper + return event; // Paper - Expand PlayerGameModeChangeEvent } // CraftBukkit end - this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer); @@ -483,7 +483,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition); new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent(); - // Paper end + // Paper end - beacon activation/deactivation events + // Paper start - fix MC-153086 + if (this.levels > 0 && !this.beamSections.isEmpty()) { BeaconBlockEntity.playSound(this.level, this.worldPosition, SoundEvents.BEACON_DEACTIVATE); diff --git a/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch deleted file mode 100644 index e4505a6564..0000000000 --- a/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: HexedHero <6012891+HexedHero@users.noreply.github.com> -Date: Fri, 23 Apr 2021 22:42:42 +0100 -Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end - portal - - -diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/players/PlayerList.java -+++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -0,0 +0,0 @@ public abstract class PlayerList { - - // Paper start - boolean isBedSpawn = false; -+ boolean isAnchorSpawn = false; - boolean isRespawn = false; - boolean isLocAltered = false; // Paper - Fix SPIGOT-5989 - // Paper end -@@ -0,0 +0,0 @@ public abstract class PlayerList { - if (optional.isPresent()) { - BlockState iblockdata = worldserver1.getBlockState(blockposition); - boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR); -+ isAnchorSpawn = flag3; // Paper - Fix anchor respawn acting as a bed respawn from the end portal - Vec3 vec3d = (Vec3) optional.get(); - float f1; - -@@ -0,0 +0,0 @@ public abstract class PlayerList { - } - - Player respawnPlayer = entityplayer1.getBukkitEntity(); -- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2, reason); -+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason); // Paper - Fix anchor respawn acting as a bed respawn from the end portal - this.cserver.getPluginManager().callEvent(respawnEvent); - // Spigot Start - if (entityplayer.connection.isDisconnected()) { diff --git a/patches/server/Fix-silent-equipment-change-for-mobs.patch b/patches/server/Fix-silent-equipment-change-for-mobs.patch index 739afaba74..ec53232009 100644 --- a/patches/server/Fix-silent-equipment-change-for-mobs.patch +++ b/patches/server/Fix-silent-equipment-change-for-mobs.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -0,0 +0,0 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo - // Paper end + // Paper end - shouldBurnInDay API @Override - public void setItemSlot(EquipmentSlot slot, ItemStack stack) { diff --git a/patches/server/Introduce-beacon-activation-deactivation-events.patch b/patches/server/Introduce-beacon-activation-deactivation-events.patch index 99a05ba266..36cfb53312 100644 --- a/patches/server/Introduce-beacon-activation-deactivation-events.patch +++ b/patches/server/Introduce-beacon-activation-deactivation-events.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); + new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent(); + } -+ // Paper end ++ // Paper end - beacon activation/deactivation events if (blockEntity.lastCheckY >= l) { blockEntity.lastCheckY = world.getMinBuildHeight() - 1; @@ -28,10 +28,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void setRemoved() { -+ // Paper start - BeaconDeactivatedEvent ++ // Paper start - beacon activation/deactivation events + org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition); + new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent(); -+ // Paper end ++ // Paper end - beacon activation/deactivation events BeaconBlockEntity.playSound(this.level, this.worldPosition, SoundEvents.BEACON_DEACTIVATE); super.setRemoved(); } diff --git a/patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch index 1a0ea0e920..ecde6ff0c8 100644 --- a/patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/Pass-ServerLevel-for-gamerule-callbacks.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { - this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper + this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper - Expand PlayerGameModeChangeEvent - ((GameRules.BooleanValue) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server); + ((GameRules.BooleanValue) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.player.serverLevel()); // Paper - Pass ServerLevel for gamerule callbacks } diff --git a/patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch index de657bb183..40cd6436c1 100644 --- a/patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch +++ b/patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch @@ -14,11 +14,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void sendCommands(ServerPlayer player) { - if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot + // Paper start - Send empty commands if tab completion is disabled -+ if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) { //return; // Spigot ++ if (org.spigotmc.SpigotConfig.tabComplete < 0) { + player.connection.send(new ClientboundCommandsPacket(new RootCommandNode<>())); + return; + } -+ // Paper end ++ // Paper end - Send empty commands if tab completion is disabled // CraftBukkit start // Register Vanilla commands into builtRoot as before // Paper start - Async command map building diff --git a/patches/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch index da2a629e20..0ee0e5b92f 100644 --- a/patches/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -318,7 +318,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.channel.pipeline().addBefore("encoder", "compress", new CompressionEncoder(compressionThreshold)); + this.channel.pipeline().addBefore("encoder", "compress", new CompressionEncoder(compressor, compressionThreshold)); // Paper - Use Velocity cipher } - this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper + this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper - Add Channel initialization listeners } else { diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch index 00dccd1645..2eb2836e92 100644 --- a/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch +++ b/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end flag1 = true; - if (flag3) { -+ if (flag3 && furnaceBurnEvent.willConsumeFuel()) { // Paper ++ if (flag3 && furnaceBurnEvent.willConsumeFuel()) { // Paper - add consumeFuel to FurnaceBurnEvent Item item = itemstack.getItem(); itemstack.shrink(1); diff --git a/patches/server/fix-PigZombieAngerEvent-cancellation.patch b/patches/server/fix-PigZombieAngerEvent-cancellation.patch index 51855004c9..69c482b91f 100644 --- a/patches/server/fix-PigZombieAngerEvent-cancellation.patch +++ b/patches/server/fix-PigZombieAngerEvent-cancellation.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private int ticksUntilNextAlert; private static final float ZOMBIFIED_PIGLIN_EYE_HEIGHT = 1.79F; private static final float ZOMBIFIED_PIGLIN_BABY_EYE_HEIGHT_ADJUSTMENT = 0.82F; -+ private HurtByTargetGoal pathfinderGoalHurtByTarget; // Paper ++ private HurtByTargetGoal pathfinderGoalHurtByTarget; // Paper - fix PigZombieAngerEvent cancellation public ZombifiedPiglin(EntityType type, Level world) { super(type, world); @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); - this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); -+ this.targetSelector.addGoal(1, pathfinderGoalHurtByTarget = (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); // Paper - assign field ++ this.targetSelector.addGoal(1, pathfinderGoalHurtByTarget = (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); // Paper - fix PigZombieAngerEvent cancellation this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); } @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.level().getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { this.setPersistentAngerTarget(null); -+ pathfinderGoalHurtByTarget.stop(); // Paper - clear goalTargets to fix cancellation ++ pathfinderGoalHurtByTarget.stop(); // Paper - fix PigZombieAngerEvent cancellation return; } this.setRemainingPersistentAngerTime(event.getNewAnger());