diff --git a/patches/unapplied/server/Actually-optimise-explosions.patch b/patches/server/Actually-optimise-explosions.patch similarity index 99% rename from patches/unapplied/server/Actually-optimise-explosions.patch rename to patches/server/Actually-optimise-explosions.patch index 41c2b242a3..5beac1996e 100644 --- a/patches/unapplied/server/Actually-optimise-explosions.patch +++ b/patches/server/Actually-optimise-explosions.patch @@ -463,8 +463,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end } -- double d12 = (1.0D - d7) * this.getBlockDensity(vec3d, entity); // Paper - Optimize explosions -+ double d12 = (1.0D - d7) * this.getBlockDensity(vec3d, entity, blockCache, blockPos); // Paper - Optimize explosions +- double d12 = (1.0D - d7) * this.getBlockDensity(vec3d, entity) * (double) this.damageCalculator.getKnockbackMultiplier(entity); // Paper - Optimize explosions ++ double d12 = (1.0D - d7) * this.getBlockDensity(vec3d, entity, blockCache, blockPos) * (double) this.damageCalculator.getKnockbackMultiplier(entity); // Paper - Optimize explosions double d13; if (entity instanceof LivingEntity) { @@ -501,7 +501,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java +++ b/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java @@ -0,0 +0,0 @@ public class ExplosionDamageCalculator { - return true; + return 1.0F; } + @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper diff --git a/patches/unapplied/server/Distance-manager-tick-timings.patch b/patches/server/Distance-manager-tick-timings.patch similarity index 100% rename from patches/unapplied/server/Distance-manager-tick-timings.patch rename to patches/server/Distance-manager-tick-timings.patch diff --git a/patches/unapplied/server/Handle-Oversized-block-entities-in-chunks.patch b/patches/server/Handle-Oversized-block-entities-in-chunks.patch similarity index 100% rename from patches/unapplied/server/Handle-Oversized-block-entities-in-chunks.patch rename to patches/server/Handle-Oversized-block-entities-in-chunks.patch diff --git a/patches/unapplied/server/Improve-performance-of-mass-crafts.patch b/patches/server/Improve-performance-of-mass-crafts.patch similarity index 89% rename from patches/unapplied/server/Improve-performance-of-mass-crafts.patch rename to patches/server/Improve-performance-of-mass-crafts.patch index 6fab3c76ac..33c96569bf 100644 --- a/patches/unapplied/server/Improve-performance-of-mass-crafts.patch +++ b/patches/server/Improve-performance-of-mass-crafts.patch @@ -51,22 +51,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java @@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - RecipeHolder recipeholder = (RecipeHolder) map.get(id); + RecipeHolder recipeholder = this.byKeyTyped(type, id); if (recipeholder != null && recipeholder.value().matches(inventory, world)) { + inventory.setCurrentRecipe(recipeholder); // Paper - Perf: Improve mass crafting - return Optional.of(Pair.of(id, recipeholder)); + return Optional.of(recipeholder); } } - -+ inventory.setCurrentRecipe(null); // Paper - Perf: Improve mass crafting;; clear before it might be set again - return map.entrySet().stream().filter((entry) -> { - return ((RecipeHolder) entry.getValue()).value().matches(inventory, world); - }).findFirst().map((entry) -> { -+ inventory.setCurrentRecipe(entry.getValue()); // Paper - Perf: Improve mass crafting - return Pair.of((ResourceLocation) entry.getKey(), (RecipeHolder) entry.getValue()); - }); - } @@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { } diff --git a/patches/unapplied/server/Lag-compensation-ticks.patch b/patches/server/Lag-compensation-ticks.patch similarity index 98% rename from patches/unapplied/server/Lag-compensation-ticks.patch rename to patches/server/Lag-compensation-ticks.patch index b0ef72bf8c..d0cc606850 100644 --- a/patches/unapplied/server/Lag-compensation-ticks.patch +++ b/patches/server/Lag-compensation-ticks.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + worldserver.updateLagCompensationTick(); // Paper - lag compensation this.profiler.push(() -> { - return worldserver + " " + worldserver.dimension().location(); + String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/patches/unapplied/server/Optimise-chunk-tick-iteration.patch b/patches/server/Optimise-chunk-tick-iteration.patch similarity index 97% rename from patches/unapplied/server/Optimise-chunk-tick-iteration.patch rename to patches/server/Optimise-chunk-tick-iteration.patch index b6d1a0289e..cd9643bc6f 100644 --- a/patches/unapplied/server/Optimise-chunk-tick-iteration.patch +++ b/patches/server/Optimise-chunk-tick-iteration.patch @@ -79,17 +79,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class ChunkHolder { - int k = this.lightEngine.getMaxLightSection(); + int k = this.lightEngine.getMaxLightSection(); - if (y >= j && y <= k) { -+ this.addToBroadcastMap(); // Paper - optimise chunk tick iteration - int l = y - j; + if (y >= j && y <= k) { ++ this.addToBroadcastMap(); // Paper - optimise chunk tick iteration + int l = y - j; - if (lightType == LightLayer.SKY) { + if (lightType == LightLayer.SKY) { @@ -0,0 +0,0 @@ public class ChunkHolder { - } + this.broadcast(this.getPlayers(onChunkViewEdge), packet); // Paper - rewrite chunk system } - + // Paper end - starlight + // Paper start - optimise chunk tick iteration + public final boolean needsBroadcastChanges() { + return this.hasChangedSections || !this.skyChangedLightSectionFilter.isEmpty() || !this.blockChangedLightSectionFilter.isEmpty(); @@ -100,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.chunkMap.needsChangeBroadcasting.add(this); + } + // Paper end - optimise chunk tick iteration -+ + public void broadcastChanges(LevelChunk chunk) { - if (this.hasChangedSections || !this.skyChangedLightSectionFilter.isEmpty() || !this.blockChangedLightSectionFilter.isEmpty()) { + if (this.needsBroadcastChanges()) { // Paper - optimise chunk tick iteration; moved into above, other logic needs to call @@ -129,7 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - optimise chunk tick iteration public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { - super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); + super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } // Paper end - Optional per player mob spawns @@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } + // Paper - optimise chunk tick iteration - if (this.level.getServer().tickRateManager().runsNormally()) { + if (this.level.tickRateManager().runsNormally()) { gameprofilerfiller.popPush("naturalSpawnCount"); @@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource { gameprofilerfiller.popPush("spawnAndTick"); diff --git a/patches/unapplied/server/Optimise-nearby-player-retrieval.patch b/patches/server/Optimise-nearby-player-retrieval.patch similarity index 100% rename from patches/unapplied/server/Optimise-nearby-player-retrieval.patch rename to patches/server/Optimise-nearby-player-retrieval.patch diff --git a/patches/server/Properly-resend-entities.patch b/patches/server/Properly-resend-entities.patch index 149b20ad49..dd8417dae2 100644 --- a/patches/server/Properly-resend-entities.patch +++ b/patches/server/Properly-resend-entities.patch @@ -84,47 +84,6 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ import net.minecraft.nbt.CompoundTag; - import net.minecraft.network.Connection; - import net.minecraft.network.ConnectionProtocol; - import net.minecraft.network.TickablePacketListener; --import net.minecraft.network.chat.ChatDecorator; - import net.minecraft.network.chat.ChatType; - import net.minecraft.network.chat.Component; - import net.minecraft.network.chat.LastSeenMessages; -@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.PacketUtils; - import net.minecraft.network.protocol.common.ServerboundClientInformationPacket; - import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; - import net.minecraft.network.protocol.configuration.ConfigurationProtocols; --import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; - import net.minecraft.network.protocol.game.ClientboundBlockChangedAckPacket; - import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket; - import net.minecraft.network.protocol.game.ClientboundCommandSuggestionsPacket; -@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.entity.CrafterBlockEntity; - import net.minecraft.world.level.block.entity.JigsawBlockEntity; - import net.minecraft.world.level.block.entity.SignBlockEntity; - import net.minecraft.world.level.block.entity.StructureBlockEntity; --import net.minecraft.world.level.block.state.BlockBehaviour; - import net.minecraft.world.level.block.state.BlockState; - import net.minecraft.world.phys.AABB; - import net.minecraft.world.phys.BlockHitResult; -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; - import org.bukkit.craftbukkit.event.CraftEventFactory; - import org.bukkit.craftbukkit.inventory.CraftItemStack; - import org.bukkit.craftbukkit.inventory.CraftItemType; --import org.bukkit.craftbukkit.util.CraftChatMessage; - import org.bukkit.craftbukkit.util.CraftNamespacedKey; - import org.bukkit.craftbukkit.util.LazyPlayerSet; - import org.bukkit.craftbukkit.util.Waitable; -@@ -0,0 +0,0 @@ import org.bukkit.event.inventory.InventoryCreativeEvent; - import org.bukkit.event.inventory.InventoryType.SlotType; - import org.bukkit.event.inventory.SmithItemEvent; - import org.bukkit.event.player.AsyncPlayerChatEvent; --import org.bukkit.event.player.PlayerAnimationEvent; --import org.bukkit.event.player.PlayerAnimationType; - import org.bukkit.event.player.PlayerChatEvent; - import org.bukkit.event.player.PlayerCommandPreprocessEvent; - import org.bukkit.event.player.PlayerInteractAtEntityEvent; @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } diff --git a/patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch similarity index 100% rename from patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch rename to patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch