From abdb5b653ef6ffe54cfc814e3da85dd004e9e463 Mon Sep 17 00:00:00 2001 From: granny Date: Sat, 26 Oct 2024 02:10:18 -0700 Subject: [PATCH] all patches have been applied \o/ --- ...246-Add-toggle-for-RNG-manipulation.patch} | 12 +- .../0247-Remove-Timings.patch} | 315 ++-- .../0248-Remove-Mojang-Profiler.patch} | 1678 +++++++++-------- ...r-output-for-invalid-movement-kicks.patch} | 6 +- .../0250-Add-Bee-API.patch} | 18 +- .../0251-Debug-Marker-API.patch} | 12 +- ...g-option-to-ignore-creative-players.patch} | 10 +- ...53-Add-skeleton-bow-accuracy-option.patch} | 24 +- .../0254-Add-death-screen-API.patch} | 4 +- ...5-Implement-ram-and-rambar-commands.patch} | 18 +- ...Configurable-block-blast-resistance.patch} | 8 +- ...gurable-block-fall-damage-modifiers.patch} | 14 +- .../0258-Language-API.patch} | 4 +- .../0259-Milk-Keeps-Beneficial-Effects.patch} | 44 +- ...s-not-looking-up-and-down-when-stra.patch} | 0 ...d-log-suppression-for-LibraryLoader.patch} | 4 +- ...n-to-fix-MC-3304-projectile-looting.patch} | 35 +- ...ow-creeper-to-encircle-target-when-.patch} | 6 +- .../0264-Fire-Immunity-API.patch} | 20 +- ...eport-to-spawn-on-nether-ceiling-da.patch} | 10 +- .../0266-Added-got-ram-event.patch} | 4 +- .../0267-Log-skipped-entity-s-position.patch} | 4 +- .../0268-End-Crystal-Cramming.patch} | 8 +- ...eacon-effects-when-covered-by-tinte.patch} | 8 +- ...ute-clamping-and-armor-limit-config.patch} | 4 +- ...ig-to-remove-explosion-radius-clamp.patch} | 24 +- ...ble-sugarcane-cactus-and-netherwart.patch} | 12 +- .../0273-Add-PreExplodeEvents.patch} | 26 +- ...4-Improve-output-of-plugins-command.patch} | 0 .../0275-Make-GUI-Great-Again.patch} | 8 +- .../0276-Stored-Bee-API.patch} | 6 +- .../0277-Shears-can-defuse-TNT.patch} | 8 +- .../0278-Explorer-Map-API.patch} | 8 +- ...Option-Ocelot-Spawn-Under-Sea-Level.patch} | 10 +- ...-piglins-to-ignore-gold-trimmed-arm.patch} | 18 +- ...ways-showing-item-in-player-death-m.patch} | 4 +- ...0282-place-end-crystal-on-any-block.patch} | 8 +- ...able-the-copper-oxidation-proximity.patch} | 14 +- ...4-register-minecraft-debug-commands.patch} | 12 +- ...Configurable-villager-search-radius.patch} | 45 +- ...-to-make-ravagers-afraid-of-rabbits.patch} | 12 +- .../0287-config-for-startup-commands.patch} | 8 +- ...onfig-to-reverse-bubble-column-flow.patch} | 8 +- .../0289-Adopt-MaterialRerouting.patch} | 0 ...rtHinderedEvent-when-attempting-to-.patch} | 4 +- .../0291-ItemStack-convenience-methods.patch} | 4 +- 46 files changed, 1262 insertions(+), 1247 deletions(-) rename patches/{unapplied-server/0251-Add-toggle-for-RNG-manipulation.patch => server/0246-Add-toggle-for-RNG-manipulation.patch} (85%) rename patches/{unapplied-server/0252-Remove-Timings.patch => server/0247-Remove-Timings.patch} (73%) rename patches/{unapplied-server/0253-Remove-Mojang-Profiler.patch => server/0248-Remove-Mojang-Profiler.patch} (55%) rename patches/{unapplied-server/0254-Add-more-logger-output-for-invalid-movement-kicks.patch => server/0249-Add-more-logger-output-for-invalid-movement-kicks.patch} (92%) rename patches/{unapplied-server/0255-Add-Bee-API.patch => server/0250-Add-Bee-API.patch} (74%) rename patches/{unapplied-server/0256-Debug-Marker-API.patch => server/0251-Debug-Marker-API.patch} (93%) rename patches/{unapplied-server/0257-mob-spawning-option-to-ignore-creative-players.patch => server/0252-mob-spawning-option-to-ignore-creative-players.patch} (86%) rename patches/{unapplied-server/0258-Add-skeleton-bow-accuracy-option.patch => server/0253-Add-skeleton-bow-accuracy-option.patch} (66%) rename patches/{unapplied-server/0259-Add-death-screen-API.patch => server/0254-Add-death-screen-API.patch} (87%) rename patches/{unapplied-server/0261-Implement-ram-and-rambar-commands.patch => server/0255-Implement-ram-and-rambar-commands.patch} (96%) rename patches/{unapplied-server/0262-Configurable-block-blast-resistance.patch => server/0256-Configurable-block-blast-resistance.patch} (88%) rename patches/{unapplied-server/0263-Configurable-block-fall-damage-modifiers.patch => server/0257-Configurable-block-fall-damage-modifiers.patch} (91%) rename patches/{unapplied-server/0264-Language-API.patch => server/0258-Language-API.patch} (89%) rename patches/{unapplied-server/0265-Milk-Keeps-Beneficial-Effects.patch => server/0259-Milk-Keeps-Beneficial-Effects.patch} (59%) rename patches/{unapplied-server/0266-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch => server/0260-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch} (100%) rename patches/{unapplied-server/0267-Add-log-suppression-for-LibraryLoader.patch => server/0261-Add-log-suppression-for-LibraryLoader.patch} (91%) rename patches/{unapplied-server/0268-Add-an-option-to-fix-MC-3304-projectile-looting.patch => server/0262-Add-an-option-to-fix-MC-3304-projectile-looting.patch} (72%) rename patches/{unapplied-server/0269-Add-option-to-allow-creeper-to-encircle-target-when-.patch => server/0263-Add-option-to-allow-creeper-to-encircle-target-when-.patch} (92%) rename patches/{unapplied-server/0270-Fire-Immunity-API.patch => server/0264-Fire-Immunity-API.patch} (80%) rename patches/{unapplied-server/0271-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch => server/0265-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch} (86%) rename patches/{unapplied-server/0272-Added-got-ram-event.patch => server/0266-Added-got-ram-event.patch} (86%) rename patches/{unapplied-server/0273-Log-skipped-entity-s-position.patch => server/0267-Log-skipped-entity-s-position.patch} (86%) rename patches/{unapplied-server/0274-End-Crystal-Cramming.patch => server/0268-End-Crystal-Cramming.patch} (87%) rename patches/{unapplied-server/0275-Option-to-allow-beacon-effects-when-covered-by-tinte.patch => server/0269-Option-to-allow-beacon-effects-when-covered-by-tinte.patch} (90%) rename patches/{unapplied-server/0276-Add-attribute-clamping-and-armor-limit-config.patch => server/0270-Add-attribute-clamping-and-armor-limit-config.patch} (95%) rename patches/{unapplied-server/0277-Config-to-remove-explosion-radius-clamp.patch => server/0271-Config-to-remove-explosion-radius-clamp.patch} (61%) rename patches/{unapplied-server/0278-bonemealable-sugarcane-cactus-and-netherwart.patch => server/0272-bonemealable-sugarcane-cactus-and-netherwart.patch} (94%) rename patches/{unapplied-server/0279-Add-PreExplodeEvents.patch => server/0273-Add-PreExplodeEvents.patch} (65%) rename patches/{unapplied-server/0280-Improve-output-of-plugins-command.patch => server/0274-Improve-output-of-plugins-command.patch} (100%) rename patches/{unapplied-server/0281-Make-GUI-Great-Again.patch => server/0275-Make-GUI-Great-Again.patch} (98%) rename patches/{unapplied-server/0282-Stored-Bee-API.patch => server/0276-Stored-Bee-API.patch} (97%) rename patches/{unapplied-server/0283-Shears-can-defuse-TNT.patch => server/0277-Shears-can-defuse-TNT.patch} (91%) rename patches/{unapplied-server/0284-Explorer-Map-API.patch => server/0278-Explorer-Map-API.patch} (87%) rename patches/{unapplied-server/0285-Option-Ocelot-Spawn-Under-Sea-Level.patch => server/0279-Option-Ocelot-Spawn-Under-Sea-Level.patch} (84%) rename patches/{unapplied-server/0286-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch => server/0280-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch} (74%) rename patches/{unapplied-server/0287-Add-option-for-always-showing-item-in-player-death-m.patch => server/0281-Add-option-for-always-showing-item-in-player-death-m.patch} (95%) rename patches/{unapplied-server/0288-place-end-crystal-on-any-block.patch => server/0282-place-end-crystal-on-any-block.patch} (88%) rename patches/{unapplied-server/0289-Add-option-to-disable-the-copper-oxidation-proximity.patch => server/0283-Add-option-to-disable-the-copper-oxidation-proximity.patch} (77%) rename patches/{unapplied-server/0290-register-minecraft-debug-commands.patch => server/0284-register-minecraft-debug-commands.patch} (86%) rename patches/{unapplied-server/0291-Configurable-villager-search-radius.patch => server/0285-Configurable-villager-search-radius.patch} (50%) rename patches/{unapplied-server/0292-option-to-make-ravagers-afraid-of-rabbits.patch => server/0286-option-to-make-ravagers-afraid-of-rabbits.patch} (82%) rename patches/{unapplied-server/0293-config-for-startup-commands.patch => server/0287-config-for-startup-commands.patch} (87%) rename patches/{unapplied-server/0294-Config-to-reverse-bubble-column-flow.patch => server/0288-Config-to-reverse-bubble-column-flow.patch} (89%) rename patches/{unapplied-server/0295-Adopt-MaterialRerouting.patch => server/0289-Adopt-MaterialRerouting.patch} (100%) rename patches/{unapplied-server/0296-Fire-EntityTeleportHinderedEvent-when-attempting-to-.patch => server/0290-Fire-EntityTeleportHinderedEvent-when-attempting-to-.patch} (85%) rename patches/{unapplied-server/0297-ItemStack-convenience-methods.patch => server/0291-ItemStack-convenience-methods.patch} (98%) diff --git a/patches/unapplied-server/0251-Add-toggle-for-RNG-manipulation.patch b/patches/server/0246-Add-toggle-for-RNG-manipulation.patch similarity index 85% rename from patches/unapplied-server/0251-Add-toggle-for-RNG-manipulation.patch rename to patches/server/0246-Add-toggle-for-RNG-manipulation.patch index 2b1969d48..a182279db 100644 --- a/patches/unapplied-server/0251-Add-toggle-for-RNG-manipulation.patch +++ b/patches/server/0246-Add-toggle-for-RNG-manipulation.patch @@ -7,10 +7,10 @@ Paper patches RNG maniplulation by using a shared (and locked) random source. This comes with a performance gain, but technical players may prefer the ability to manipulate RNG. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 338c2afa277178b3d4d667142799f015c7b97cd0..7e7d13424ea1328ca37b1201a74ac0d4f933a8c3 100644 +index d2f2301cff71b8ce64b803dadcb09610e8a2a289..aa0771c7ab8302c03d7a54c6c1282e21defc4de7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -582,7 +582,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -640,7 +640,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; @@ -20,10 +20,10 @@ index 338c2afa277178b3d4d667142799f015c7b97cd0..7e7d13424ea1328ca37b1201a74ac0d4 this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index ea474ba1d37a594177ada2fd93302f874ed5dc73..3ca9a7f289d8c3f0b0df8f1cd4a5ca1254653c50 100644 +index dd807cd532fbdbcc20bd29659e2b578714302d25..01cd55eaac78e35dc57f4f07628ad97bc535da5a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java -@@ -41,7 +41,7 @@ public class Squid extends WaterAnimal { +@@ -46,7 +46,7 @@ public class Squid extends AgeableWaterCreature { public Squid(EntityType type, Level world) { super(type, world); @@ -33,10 +33,10 @@ index ea474ba1d37a594177ada2fd93302f874ed5dc73..3ca9a7f289d8c3f0b0df8f1cd4a5ca12 } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index e90f8c2ca467d9567366ae5c04175e3b5bc7cfc4..72b51d2db04c6cc8a3c4f9bf350e40873ef51d8c 100644 +index 3853e9e894c19da5a0e74c30a5e248c3e8790160..a647855f277d79d4ebbf370cff0d15991acbb308 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -211,9 +211,11 @@ public class PurpurWorldConfig { +@@ -209,9 +209,11 @@ public class PurpurWorldConfig { public int entityLifeSpan = 0; public float entityLeftHandedChance = 0.05f; diff --git a/patches/unapplied-server/0252-Remove-Timings.patch b/patches/server/0247-Remove-Timings.patch similarity index 73% rename from patches/unapplied-server/0252-Remove-Timings.patch rename to patches/server/0247-Remove-Timings.patch index 2df116d04..66652ed34 100644 --- a/patches/unapplied-server/0252-Remove-Timings.patch +++ b/patches/server/0247-Remove-Timings.patch @@ -29,10 +29,10 @@ index 0c3c82b28e581286b798ee58ca4193efc2faff4a..24121a43aeb5e9bce013f30c92dddd15 // return true as command was handled return 1; diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index e2c24813f59c2fd075c740ac1842a38f20ed8554..01efbc507b3d58f13f78ee286f93df40cdc3f0cb 100644 +index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..0c8fe5b2500480c3a9e9ab3285ad22e0e599d953 100644 --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -@@ -52,7 +52,7 @@ public class PacketUtils { +@@ -32,7 +32,7 @@ public class PacketUtils { if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players if (listener.shouldHandleMessage(packet)) { co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings @@ -42,16 +42,20 @@ index e2c24813f59c2fd075c740ac1842a38f20ed8554..01efbc507b3d58f13f78ee286f93df40 } catch (Exception exception) { if (exception instanceof ReportedException) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 226fa1fa3b7949e23c3f6f283d728949694a8a5c..73d6c71c6e38dcfff9f09fd2f54949edba80c373 100644 +index c3c5d392f1295e7edc0e96881f90f96cace5486f..9ab3a164c079721d2c4650ff0cf5aec82ada09bc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1613,15 +1613,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { entityplayer.connection.suspendFlushing(); }); - MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper + //MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper // Purpur - this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit + this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit - MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper + //MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur // Paper start - Folia scheduler API ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); getAllLevels().forEach(level -> { -@@ -1774,21 +1774,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -211,7 +215,7 @@ index 6abae547de1c9de07a75800550631ca5ee693e0a..4b2a66b68e96b85e78c12a12c410ffab ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -987,17 +987,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -986,17 +986,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -233,10 +237,10 @@ index 6abae547de1c9de07a75800550631ca5ee693e0a..4b2a66b68e96b85e78c12a12c410ffab } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index dbc62bf37a9e6e1936558338521938a47a51e2d6..793f16cb4049d121a6ef7ca4fcd9519dc8c0a7b0 100644 +index 4b5985c284faac7b06c0f99d53065f5060ecff4a..96f9d18eb22380cccd35b486713583d6dfa46646 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -359,9 +359,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -423,9 +423,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon public void save(boolean flush) { // Paper - rewrite chunk system @@ -248,10 +252,10 @@ index dbc62bf37a9e6e1936558338521938a47a51e2d6..793f16cb4049d121a6ef7ca4fcd9519d } @Override -@@ -397,26 +397,25 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - @Override - public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { - this.level.getProfiler().push("purge"); +@@ -461,26 +461,25 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + ProfilerFiller gameprofilerfiller = Profiler.get(); + + gameprofilerfiller.push("purge"); - this.level.timings.doChunkMap.startTiming(); // Spigot + //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot @@ -261,7 +265,7 @@ index dbc62bf37a9e6e1936558338521938a47a51e2d6..793f16cb4049d121a6ef7ca4fcd9519d this.runDistanceManagerUpdates(); - this.level.timings.doChunkMap.stopTiming(); // Spigot + //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("chunks"); + gameprofilerfiller.popPush("chunks"); if (tickChunks) { - this.level.timings.chunks.startTiming(); // Paper - timings + //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur @@ -274,85 +278,57 @@ index dbc62bf37a9e6e1936558338521938a47a51e2d6..793f16cb4049d121a6ef7ca4fcd9519d - this.level.timings.doChunkUnload.startTiming(); // Spigot + //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("unload"); + gameprofilerfiller.popPush("unload"); this.chunkMap.tick(shouldKeepTicking); - this.level.timings.doChunkUnload.stopTiming(); // Spigot + //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur - this.level.getProfiler().pop(); + gameprofilerfiller.pop(); this.clearCache(); } -@@ -452,13 +451,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -561,10 +560,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + + private void tickChunks(ProfilerFiller profiler, long timeDelta, List chunks) { + profiler.popPush("naturalSpawnCount"); +- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings ++ //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur + int j = this.distanceManager.getNaturalSpawnChunkCount(); + NaturalSpawner.SpawnState spawnercreature_d = NaturalSpawner.createState(j, this.level.getAllEntities(), this::getFullChunk, new LocalMobCapCalculator(this.chunkMap)); +- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings ++ // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur + + this.lastSpawnState = spawnercreature_d; + profiler.popPush("spawnAndTick"); +@@ -605,13 +604,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } - // Paper end - chunk tick iteration optimisations - Iterator iterator = null; // Paper - chunk tick iteration optimisations -- if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper -+ //if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur - - // Paper - chunk tick iteration optimisations - - if (this.level.tickRateManager().runsNormally()) { - gameprofilerfiller.popPush("naturalSpawnCount"); -- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings -+ //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur - int k = this.distanceManager.getNaturalSpawnChunkCount(); - // Paper start - Optional per player mob spawns - int naturalSpawnChunkCount = k; -@@ -488,7 +487,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - // Pufferfish end - } - // Paper end - Optional per player mob spawns -- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings -+ // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur - - // this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously - gameprofilerfiller.popPush("spawnAndTick"); -@@ -529,19 +528,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - } - } -- this.level.timings.chunkTicks.stopTiming(); // Paper -+ //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur - - gameprofilerfiller.popPush("customSpawners"); - if (flag) { -- try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings -+ //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur - this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); -- } // Paper - timings -+ //} // Paper - timings // Purpur - } - } - - gameprofilerfiller.popPush("broadcast"); - // Paper start - chunk tick iteration optimisations -- this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing -+ //this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur - { - final it.unimi.dsi.fastutil.objects.ObjectArrayList chunks = (it.unimi.dsi.fastutil.objects.ObjectArrayList)list; - final ServerChunkCache.ChunkAndHolder[] raw = chunks.elements(); -@@ -555,7 +554,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - holder.holder().broadcastChanges(holder.chunk()); - } - } -- this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing -+ //this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur - // Paper end - chunk tick iteration optimisations - gameprofilerfiller.pop(); - gameprofilerfiller.pop(); -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e25300d47 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -687,7 +687,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } - gameprofilerfiller.popPush("tickPending"); +- this.level.timings.chunkTicks.stopTiming(); // Paper ++ //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur + + profiler.popPush("customSpawners"); + if (flag) { +- try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings ++ //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur + this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); +- } ++ //} // Purpur + } + + } +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index f2bf1a9856fb1200f750b06b64e83b1b12e4068d..6e4ca03d66d870cca45aef1e49c18a470ebd7dc0 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -757,7 +757,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + + gameprofilerfiller.push("tickPending"); - this.timings.scheduledBlocks.startTiming(); // Paper + //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur if (!this.isDebug() && flag) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); -@@ -696,24 +696,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -766,24 +766,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks gameprofilerfiller.pop(); } @@ -384,7 +360,7 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e } this.handlingTick = false; -@@ -726,7 +726,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -796,7 +796,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe if (flag1 || this.emptyTime++ < 300) { gameprofilerfiller.push("entities"); @@ -393,16 +369,16 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e if (this.dragonFight != null && flag) { gameprofilerfiller.push("dragonFight"); this.dragonFight.tick(); -@@ -734,7 +734,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -804,7 +804,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } org.spigotmc.ActivationRange.activateEntities(this); // Spigot - this.timings.entityTick.startTiming(); // Spigot + //this.timings.entityTick.startTiming(); // Spigot // Purpur this.entityTickList.forEach((entity) -> { - entity.activatedPriorityReset = false; // Pufferfish - DAB if (!entity.isRemoved()) { -@@ -775,8 +775,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. + if (!tickratemanager.isEntityFrozen(entity)) { +@@ -829,8 +829,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } }); @@ -413,7 +389,7 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e gameprofilerfiller.pop(); this.tickBlockEntities(); } -@@ -966,12 +966,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1014,12 +1014,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } // Paper - Option to disable ice and snow gameprofilerfiller.popPush("tickBlocks"); @@ -428,7 +404,7 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e gameprofilerfiller.pop(); } -@@ -1314,8 +1314,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1344,8 +1344,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // Spigot end // Paper start- timings final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); @@ -438,55 +414,17 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e + //try { // Purpur // Paper end - timings entity.setOldPosAndRot(); - ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -1331,7 +1331,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. + ProfilerFiller gameprofilerfiller = Profiler.get(); +@@ -1360,7 +1360,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity.postTick(); // CraftBukkit } else { entity.inactiveTick(); } // Paper - EAR 2 - this.getProfiler().pop(); -- } finally { timer.stopTiming(); } // Paper - timings -+ //} finally { timer.stopTiming(); } // Paper - timings // Purpur + gameprofilerfiller.pop(); +- } finally { timer.stopTiming(); } // Paper - timings // EAR 2 ++ //} finally { timer.stopTiming(); } // Paper - timings // EAR 2 // Purpur Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1354,8 +1354,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - if (passenger instanceof Player || this.entityTickList.contains(passenger)) { - // Paper - EAR 2 - final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); -- co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper -- try { -+ //co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper // Purpur -+ //try { // Purpur - // Paper end - passenger.setOldPosAndRot(); - ++passenger.tickCount; -@@ -1385,7 +1385,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - this.tickPassenger(passenger, entity2); - } - -- } finally { timer.stopTiming(); }// Paper - EAR2 timings -+ //} finally { timer.stopTiming(); }// Paper - EAR2 timings // Purpur - } - } else { - passenger.stopRiding(); -@@ -1405,7 +1405,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); - } - -- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) { -+ //try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) { // Purpur - if (doFull) { - this.saveLevelData(true); - } -@@ -1422,7 +1422,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); - } - // CraftBukkit end -- } -+ //} // Purpur - } - // Paper end - Incremental chunk and player saving - -@@ -1436,7 +1436,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1424,7 +1424,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit @@ -495,7 +433,7 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -1446,10 +1446,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1434,10 +1434,10 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -510,21 +448,17 @@ index bfc36c239dab4df5130cbde190d513655b9f12a1..b6fd5b83cff5ea21221d029b8729932e } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index c55f721a611dc215bcbf3f74f752b3bebfbe9ea4..0ea07da1b4bd420cd6765577b4719a2368b5740c 100644 +index a170b6b357987d6e1cb42a9b54a2b8d965395db6..988490d84188e61ce716506585c80c85e59c692a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1238,7 +1238,7 @@ public abstract class PlayerList { +@@ -1192,11 +1192,11 @@ public abstract class PlayerList { - public void saveAll(int interval) { + public void saveAll() { io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main - MinecraftTimings.savePlayers.startTiming(); // Paper + //MinecraftTimings.savePlayers.startTiming(); // Paper // Purpur - int numSaved = 0; - long now = MinecraftServer.currentTick; for (int i = 0; i < this.players.size(); ++i) { -@@ -1249,7 +1249,7 @@ public abstract class PlayerList { - } - // Paper end - Incremental chunk and player saving + this.save(this.players.get(i)); } - MinecraftTimings.savePlayers.stopTiming(); // Paper + //MinecraftTimings.savePlayers.stopTiming(); // Paper // Purpur @@ -564,15 +498,16 @@ index 9379dd4056018b52c93ed4888dcdc94579bd9691..612a14806ec63b0dcf31814396282f4b protected void tick(ServerLevel world, E entity, long time) { diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -index 85b4b24361e785acf75571ff98f924c00ae80748..09a7b418ddf564c0be13297f7c216db2e7ae1578 100644 +index 8bc7979fb9c2a796921a2a279b78294809f2ed03..043e078f2c108d9ff77d3b21f96a6a106bcea51d 100644 --- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java +++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -@@ -53,10 +53,10 @@ public abstract class Sensor { +@@ -56,11 +56,11 @@ public abstract class Sensor { if (--this.timeToTick <= 0L) { // Paper start - configurable sensor tick rate and timings this.timeToTick = java.util.Objects.requireNonNullElse(world.paperConfig().tickRates.sensor.get(entity.getType(), this.configKey), this.scanRate); - this.timing.startTiming(); + //this.timing.startTiming(); // Purpur + this.updateTargetingConditionRanges(entity); // Paper end this.doTick(world, entity); - this.timing.stopTiming(); // Paper - sensor timings @@ -581,11 +516,11 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..09a7b418ddf564c0be13297f7c216db2 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7bc1d9ed3a3e3679caff8da0a38a3de93fc9ebac..ccc6204141298deea56d996fab24254d25857da5 100644 +index 85ae5c9c873dab19f897fe50b70c62e3c094bd42..5a8b02d93f3d7eb882e93c9698858e7ae55c79e6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1415,15 +1415,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - ProfilerFiller gameprofilerfiller = this.getProfiler(); +@@ -1491,15 +1491,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + ProfilerFiller gameprofilerfiller = Profiler.get(); gameprofilerfiller.push("blockEntities"); - this.timings.tileEntityPending.startTiming(); // Spigot @@ -603,7 +538,7 @@ index 7bc1d9ed3a3e3679caff8da0a38a3de93fc9ebac..ccc6204141298deea56d996fab24254d // Spigot start // Iterator iterator = this.blockEntityTickers.iterator(); boolean flag = this.tickRateManager().runsNormally(); -@@ -1454,7 +1454,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1530,7 +1530,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 @@ -613,33 +548,33 @@ index 7bc1d9ed3a3e3679caff8da0a38a3de93fc9ebac..ccc6204141298deea56d996fab24254d co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index e524b27d185da3e88668f8ef107517272860bd66..735f39fed209e086a52185565f8bd6873c0b8d6e 100644 +index 6eb69ebe688c1c52d5a5986dfc63cdd42e66687e..f6fb4892c95f9716628ed8a90d1560b7c0a2e032 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -128,7 +128,7 @@ public final class NaturalSpawner { +@@ -155,7 +155,7 @@ public final class NaturalSpawner { + ProfilerFiller gameprofilerfiller = Profiler.get(); - public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { - world.getProfiler().push("spawner"); + gameprofilerfiller.push("spawner"); - world.timings.mobSpawn.startTiming(); // Spigot + //world.timings.mobSpawn.startTiming(); // Spigot // Purpur - MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; - int i = aenumcreaturetype.length; + Iterator iterator = spawnableGroups.iterator(); -@@ -181,7 +181,7 @@ public final class NaturalSpawner { + while (iterator.hasNext()) { +@@ -170,7 +170,7 @@ public final class NaturalSpawner { } } - world.timings.mobSpawn.stopTiming(); // Spigot + //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur - world.getProfiler().pop(); + gameprofilerfiller.pop(); } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 6282db087ac330d0e3a97c93f03eb64e8b3246f3..a0e6f39ba00212a078e04b21831a5ed22ad0825b 100644 +index e03d57f58a9f962cd429e8851fb3f35f3491e2c0..a1a5b34b059d3beaa042f8f2d0ba509191df6f15 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -680,7 +680,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system +@@ -691,7 +691,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + org.bukkit.craftbukkit.event.CraftEventFactory.callEntitiesLoadEvent(this.level, this.chunkPos, ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().getAllEntities()); // Paper - rewrite chunk system if (this.needsDecoration) { - try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper @@ -647,7 +582,7 @@ index 6282db087ac330d0e3a97c93f03eb64e8b3246f3..a0e6f39ba00212a078e04b21831a5ed2 this.needsDecoration = false; java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); -@@ -700,7 +700,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -711,7 +711,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); @@ -656,8 +591,8 @@ index 6282db087ac330d0e3a97c93f03eb64e8b3246f3..a0e6f39ba00212a078e04b21831a5ed2 } } } -@@ -1040,7 +1040,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); +@@ -1063,7 +1063,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + ProfilerFiller gameprofilerfiller = Profiler.get(); gameprofilerfiller.push(this::getType); - this.blockEntity.tickTimer.startTiming(); // Spigot @@ -665,7 +600,7 @@ index 6282db087ac330d0e3a97c93f03eb64e8b3246f3..a0e6f39ba00212a078e04b21831a5ed2 BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); if (this.blockEntity.getType().isValid(iblockdata)) { -@@ -1067,7 +1067,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -1089,7 +1089,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p // Paper end - Prevent block entity and entity crashes // Spigot start } finally { @@ -675,7 +610,7 @@ index 6282db087ac330d0e3a97c93f03eb64e8b3246f3..a0e6f39ba00212a078e04b21831a5ed2 } } diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 30ddb35140ae4a6faba98c191bb8eadbafc35377..48999a860a3b9ed691691c355beaf3e0674acb95 100644 +index 4178f48c1614af8e6796cf07fd018b9c6e67dcd0..c8eb39afabf6953c248b4d1dd4cac9948283aa47 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -504,10 +504,10 @@ public class CraftScheduler implements BukkitScheduler { @@ -688,7 +623,7 @@ index 30ddb35140ae4a6faba98c191bb8eadbafc35377..48999a860a3b9ed691691c355beaf3e0 temp.clear(); - MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper + //MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper // Purpur - //this.debugHead = this.debugHead.getNextHead(currentTick); // Paper + //this.debugHead = this.debugHead.getNextHead(this.currentTick); // Paper } @@ -550,7 +550,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -752,10 +687,10 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c // Paper end - add timings for scoreboard search } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index ba180127a50b1a1ed155ee4053440074e38adef4..ed1cdea66dd117ecafd14a52727f094430f39b60 100644 +index ca05c37dad39808683429276d85d970b7cc63f82..6936fa0d25377292a94ba694eaf50e4ea8277506 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -171,7 +171,7 @@ public class ActivationRange +@@ -167,7 +167,7 @@ public class ActivationRange */ public static void activateEntities(Level world) { @@ -764,7 +699,7 @@ index ba180127a50b1a1ed155ee4053440074e38adef4..ed1cdea66dd117ecafd14a52727f0944 final int miscActivationRange = world.spigotConfig.miscActivationRange; final int raiderActivationRange = world.spigotConfig.raiderActivationRange; final int animalActivationRange = world.spigotConfig.animalActivationRange; -@@ -251,7 +251,7 @@ public class ActivationRange +@@ -228,7 +228,7 @@ public class ActivationRange } // Paper end } diff --git a/patches/unapplied-server/0253-Remove-Mojang-Profiler.patch b/patches/server/0248-Remove-Mojang-Profiler.patch similarity index 55% rename from patches/unapplied-server/0253-Remove-Mojang-Profiler.patch rename to patches/server/0248-Remove-Mojang-Profiler.patch index b3075dec1..91f078bfc 100644 --- a/patches/unapplied-server/0253-Remove-Mojang-Profiler.patch +++ b/patches/server/0248-Remove-Mojang-Profiler.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove Mojang Profiler diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 929835b74d539bb0af1bb99f23b50b79f457594e..7e0a05608a205ab81b3597dd3a9b5d4446d92fec 100644 +index d8ee4422a13c7f09b84e9bbe8b57f0c139caac32..0ba926b6ff0bd54159765cc7f37d1753ded89dee 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -165,7 +165,7 @@ public class Commands { +@@ -169,7 +169,7 @@ public class Commands { DamageCommand.register(this.dispatcher, commandRegistryAccess); DataCommands.register(this.dispatcher); DataPackCommand.register(this.dispatcher); @@ -17,24 +17,24 @@ index 929835b74d539bb0af1bb99f23b50b79f457594e..7e0a05608a205ab81b3597dd3a9b5d44 DefaultGameModeCommands.register(this.dispatcher); DifficultyCommand.register(this.dispatcher); EffectCommands.register(this.dispatcher, commandRegistryAccess); -@@ -346,9 +346,9 @@ public class Commands { +@@ -351,9 +351,9 @@ public class Commands { // Paper end CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource(); -- commandlistenerwrapper.getServer().getProfiler().push(() -> { -+ /*commandlistenerwrapper.getServer().getProfiler().push(() -> { // Purpur +- Profiler.get().push(() -> { ++ /*Profiler.get().push(() -> { // Purpur return "/" + s; - }); + });*/ // Purpur ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent try { -@@ -378,7 +378,7 @@ public class Commands { +@@ -383,7 +383,7 @@ public class Commands { Commands.LOGGER.error("'/{}' threw an exception", s, exception); } } finally { -- commandlistenerwrapper.getServer().getProfiler().pop(); -+ //commandlistenerwrapper.getServer().getProfiler().pop(); // Purpur +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Purpur } } @@ -83,18 +83,16 @@ index e9775b4506909bee65a74964f0d5391a0513de1d..684f7f202305c09b1037c5d38a52a5ea } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 73d6c71c6e38dcfff9f09fd2f54949edba80c373..96902343e202617413672ddb609e4b91713e5b94 100644 +index 9ab3a164c079721d2c4650ff0cf5aec82ada09bc..195f5fa4f01a3c835bbb98e8aaf3d5666118daf5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -422,13 +422,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { + //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Purpur -+ //this.profiler = this.metricsRecorder.getProfiler(); // Purpur + /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur this.stopRecordingMetrics(); - }; @@ -106,9 +104,9 @@ index 73d6c71c6e38dcfff9f09fd2f54949edba80c373..96902343e202617413672ddb609e4b91 this.random = RandomSource.create(); this.port = -1; this.levels = Maps.newLinkedHashMap(); -@@ -1036,9 +1036,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - return false; - } : this::haveTime); -@@ -1338,7 +1338,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { + return false; +@@ -1332,7 +1332,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; - try { - this.isSaving = true; -@@ -1655,7 +1655,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur -- this.profiler.push(() -> { -+ /*this.profiler.push(() -> { // Purpur +- gameprofilerfiller.push(() -> { ++ /*gameprofilerfiller.push(() -> { // Purpur String s = String.valueOf(worldserver); return s + " " + String.valueOf(worldserver.dimension().location()); @@ -233,120 +245,110 @@ index 73d6c71c6e38dcfff9f09fd2f54949edba80c373..96902343e202617413672ddb609e4b91 + });*/ // Purpur /* Drop global time updates if (this.tickCount % 20 == 0) { -- this.profiler.push("timeSync"); -+ //this.profiler.push("timeSync"); // Purpur +- gameprofilerfiller.push("timeSync"); ++ //gameprofilerfiller.push("timeSync"); // Purpur this.synchronizeTime(worldserver); -- this.profiler.pop(); -+ //this.profiler.pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } // CraftBukkit end */ -- this.profiler.push("tick"); -+ //this.profiler.push("tick"); // Purpur +- gameprofilerfiller.push("tick"); ++ //gameprofilerfiller.push("tick"); // Purpur try { //worldserver.timings.doTick.startTiming(); // Spigot // Purpur -@@ -1846,17 +1846,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); -@@ -2868,40 +2868,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> functions, ResourceLocation label) { -- ProfilerFiller gameprofilerfiller = this.server.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur Objects.requireNonNull(label); - gameprofilerfiller.push(label::toString); @@ -420,17 +420,17 @@ index 9cd4f7c6910727c849ac7f5d675dc6105c4bbba2..4e4b7f2a6d7ed92a2ce06e566186027c Iterator iterator = functions.iterator(); while (iterator.hasNext()) { -@@ -65,15 +65,15 @@ public class ServerFunctionManager { +@@ -66,15 +66,15 @@ public class ServerFunctionManager { this.execute(commandfunction, this.getGameLoopSender()); } -- this.server.getProfiler().pop(); -+ //this.server.getProfiler().pop(); // Purpur +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Purpur } public void execute(CommandFunction function, CommandSourceStack source) { -- ProfilerFiller gameprofilerfiller = this.server.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push(() -> { + /*gameprofilerfiller.push(() -> { // Purpur @@ -440,7 +440,7 @@ index 9cd4f7c6910727c849ac7f5d675dc6105c4bbba2..4e4b7f2a6d7ed92a2ce06e566186027c try { InstantiatedFunction instantiatedfunction = function.instantiate((CompoundTag) null, this.getDispatcher()); -@@ -86,7 +86,7 @@ public class ServerFunctionManager { +@@ -87,7 +87,7 @@ public class ServerFunctionManager { } catch (Exception exception) { ServerFunctionManager.LOGGER.warn("Failed to execute function {}", function.id(), exception); } finally { @@ -489,15 +489,15 @@ index 8c587f829c5e8c6b6df3150024c4ae704988c47b..8ac4d5dbe7f8febf4226f26a6b035282 String string = String.format( Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId() diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 4b2a66b68e96b85e78c12a12c410ffab3c14ab71..1883abec14e05f8eb2e865446b4d81091b1aa5e0 100644 +index 987d8567034e06bfb916d3e0a4a87f6c9169bccf..fdc7cb58a5f106646448e4898dc03d473be8042d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -396,16 +396,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -373,16 +373,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected void tick(BooleanSupplier shouldKeepTicking) { -- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push("poi"); + //gameprofilerfiller.push("poi"); // Purpur @@ -514,133 +514,161 @@ index 4b2a66b68e96b85e78c12a12c410ffab3c14ab71..1883abec14e05f8eb2e865446b4d8109 public boolean hasWork() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 793f16cb4049d121a6ef7ca4fcd9519dc8c0a7b0..ebe872c4643038f0c99b289d4d5afdbedd76c6ef 100644 +index 96f9d18eb22380cccd35b486713583d6dfa46646..1961b18a2b5e5985181f0ca930ab14ba1d168c44 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -385,25 +385,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -444,30 +444,30 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + // CraftBukkit start - modelled on below public void purgeUnload() { if (true) return; // Paper - rewrite chunk system - this.level.getProfiler().push("purge"); -+ //this.level.getProfiler().push("purge"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("purge"); ++ //gameprofilerfiller.push("purge"); // Purpur this.distanceManager.purgeStaleTickets(); this.runDistanceManagerUpdates(); -- this.level.getProfiler().popPush("unload"); -+ //this.level.getProfiler().popPush("unload"); // Purpur +- gameprofilerfiller.popPush("unload"); ++ //gameprofilerfiller.popPush("unload"); // Purpur this.chunkMap.tick(() -> true); -- this.level.getProfiler().pop(); -+ //this.level.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur this.clearCache(); } // CraftBukkit end @Override public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { -- this.level.getProfiler().push("purge"); -+ //this.level.getProfiler().push("purge"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("purge"); ++ //gameprofilerfiller.push("purge"); // Purpur //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot this.distanceManager.purgeStaleTickets(); } this.runDistanceManagerUpdates(); //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur -- this.level.getProfiler().popPush("chunks"); -+ //this.level.getProfiler().popPush("chunks"); // Purpur +- gameprofilerfiller.popPush("chunks"); ++ //gameprofilerfiller.popPush("chunks"); // Purpur if (tickChunks) { //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system -@@ -413,10 +414,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -477,10 +477,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur -- this.level.getProfiler().popPush("unload"); -+ //this.level.getProfiler().popPush("unload"); // Purpur +- gameprofilerfiller.popPush("unload"); ++ //gameprofilerfiller.popPush("unload"); // Purpur this.chunkMap.tick(shouldKeepTicking); //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur -- this.level.getProfiler().pop(); -+ //this.level.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur this.clearCache(); } -@@ -427,10 +428,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -490,34 +490,34 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.lastInhabitedUpdate = i; if (!this.level.isDebug()) { -- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push("pollingChunks"); -- gameprofilerfiller.push("filteringLoadedChunks"); + //gameprofilerfiller.push("pollingChunks"); // Purpur -+ //gameprofilerfiller.push("filteringLoadedChunks"); // Purpur - // Paper start - chunk tick iteration optimisations - List list; - { -@@ -456,7 +457,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - // Paper - chunk tick iteration optimisations - if (this.level.tickRateManager().runsNormally()) { -- gameprofilerfiller.popPush("naturalSpawnCount"); -+ //gameprofilerfiller.popPush("naturalSpawnCount"); // Purpur - //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur - int k = this.distanceManager.getNaturalSpawnChunkCount(); - // Paper start - Optional per player mob spawns -@@ -490,7 +491,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur + List list = this.tickingChunks; - // this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously -- gameprofilerfiller.popPush("spawnAndTick"); -+ //gameprofilerfiller.popPush("spawnAndTick"); // Purpur - boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit - - if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.level.random); // Paper - per player mob spawns - do not need this when per-player is enabled -@@ -530,7 +531,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur - -- gameprofilerfiller.popPush("customSpawners"); -+ //gameprofilerfiller.popPush("customSpawners"); // Purpur - if (flag) { - //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur - this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); -@@ -538,7 +539,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + try { +- gameprofilerfiller.push("filteringTickingChunks"); ++ //gameprofilerfiller.push("filteringTickingChunks"); // Purpur + this.collectTickingChunks(list); +- gameprofilerfiller.popPush("shuffleChunks"); ++ //gameprofilerfiller.popPush("shuffleChunks"); // Purpur + // Paper start - chunk tick iteration optimisation + this.shuffleRandom.setSeed(this.level.random.nextLong()); + Util.shuffle(list, this.shuffleRandom); + // Paper end - chunk tick iteration optimisation +- this.tickChunks(gameprofilerfiller, j, list); +- gameprofilerfiller.pop(); ++ this.tickChunks(null, j, list); // Purpur ++ //gameprofilerfiller.pop(); // Purpur + } finally { + list.clear(); } } -- gameprofilerfiller.popPush("broadcast"); -+ //gameprofilerfiller.popPush("broadcast"); // Purpur - // Paper start - chunk tick iteration optimisations - //this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur - { -@@ -556,8 +557,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - //this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur - // Paper end - chunk tick iteration optimisations +- this.broadcastChangedChunks(gameprofilerfiller); - gameprofilerfiller.pop(); -- gameprofilerfiller.pop(); -+ //gameprofilerfiller.pop(); // Purpur ++ this.broadcastChangedChunks(null); // Purpur + //gameprofilerfiller.pop(); // Purpur } - - // Pufferfish start - optimize mob spawning -@@ -772,7 +773,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + } + +- private void broadcastChangedChunks(ProfilerFiller profiler) { +- profiler.push("broadcast"); ++ private void broadcastChangedChunks(ProfilerFiller profiler) { // Purpur ++ //profiler.push("broadcast"); // Purpur + Iterator iterator = this.chunkHoldersToBroadcast.iterator(); + + while (iterator.hasNext()) { +@@ -532,7 +532,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + } + + this.chunkHoldersToBroadcast.clear(); +- profiler.pop(); ++ //profiler.pop(); // Purpur + } + + private void collectTickingChunks(List chunks) { +@@ -558,15 +558,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + // Paper end - chunk tick iteration optimisation + } + +- private void tickChunks(ProfilerFiller profiler, long timeDelta, List chunks) { +- profiler.popPush("naturalSpawnCount"); ++ private void tickChunks(ProfilerFiller profiler, long timeDelta, List chunks) { // Purpur ++ //profiler.popPush("naturalSpawnCount"); // Purpur + //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur + int j = this.distanceManager.getNaturalSpawnChunkCount(); + NaturalSpawner.SpawnState spawnercreature_d = NaturalSpawner.createState(j, this.level.getAllEntities(), this::getFullChunk, new LocalMobCapCalculator(this.chunkMap)); + // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur + + this.lastSpawnState = spawnercreature_d; +- profiler.popPush("spawnAndTick"); ++ //profiler.popPush("spawnAndTick"); // Purpur + boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit + int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); + List list1; +@@ -606,7 +606,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + + //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur + +- profiler.popPush("customSpawners"); ++ //profiler.popPush("customSpawners"); // Purpur + if (flag) { + //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur + this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); +@@ -806,7 +806,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override protected void doRunTask(Runnable task) { -- ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); -+ //ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); // Purpur +- Profiler.get().incrementCounter("runTask"); ++ //Profiler.get().incrementCounter("runTask"); // Purpur super.doRunTask(task); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905211e8b63 100644 +index 6e4ca03d66d870cca45aef1e49c18a470ebd7dc0..96cc9d02379806704a5acd3eda0685204a192a6e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -645,16 +645,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -714,16 +714,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } public void tick(BooleanSupplier shouldKeepTicking) { -- ProfilerFiller gameprofilerfiller = this.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur this.handlingTick = true; TickRateManager tickratemanager = this.tickRateManager(); @@ -653,14 +681,14 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 - gameprofilerfiller.popPush("weather"); + //gameprofilerfiller.popPush("weather"); // Purpur this.advanceWeatherCycle(); + gameprofilerfiller.pop(); } - -@@ -686,30 +686,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -756,30 +756,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.tickTime(); } -- gameprofilerfiller.popPush("tickPending"); -+ //gameprofilerfiller.popPush("tickPending"); // Purpur +- gameprofilerfiller.push("tickPending"); ++ //gameprofilerfiller.push("tickPending"); // Purpur //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur if (!this.isDebug() && flag) { j = this.getGameTime(); @@ -693,7 +721,7 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 if (flag) { // this.timings.doSounds.startTiming(); // Spigot // Purpur this.runBlockEvents(); -@@ -717,7 +717,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -787,7 +787,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } this.handlingTick = false; @@ -702,7 +730,7 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 boolean flag1 = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this if (flag1) { -@@ -725,12 +725,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -795,12 +795,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } if (flag1 || this.emptyTime++ < 300) { @@ -718,31 +746,25 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 } org.spigotmc.ActivationRange.activateEntities(this); // Spigot -@@ -741,9 +741,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed - entity.discard(); - } else if (!tickratemanager.isEntityFrozen(entity)) { +@@ -808,9 +808,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + this.entityTickList.forEach((entity) -> { + if (!entity.isRemoved()) { + if (!tickratemanager.isEntityFrozen(entity)) { - gameprofilerfiller.push("checkDespawn"); + //gameprofilerfiller.push("checkDespawn"); // Purpur entity.checkDespawn(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur - if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - rewrite chunk system + if (true) { // Paper - rewrite chunk system Entity entity1 = entity.getVehicle(); -@@ -755,7 +755,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -822,22 +822,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity.stopRiding(); } - gameprofilerfiller.push("tick"); + //gameprofilerfiller.push("tick"); // Purpur - // Pufferfish start - copied from this.guardEntityTick - try { - this.tickNonPassenger(entity); // Pufferfish - changed -@@ -770,20 +770,20 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - this.moonrise$midTickTasks(); // Paper - rewrite chunk system - // Pufferfish end + this.guardEntityTick(this::tickNonPassenger, entity); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } @@ -764,18 +786,19 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 } @Override -@@ -916,8 +916,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -964,9 +964,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe boolean flag = this.isRaining(); int j = chunkcoordintpair.getMinBlockX(); int k = chunkcoordintpair.getMinBlockZ(); -- ProfilerFiller gameprofilerfiller = this.getProfiler(); -- gameprofilerfiller.push("thunder"); -+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur -+ //gameprofilerfiller.push("thunder"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Pufferfish - replace random with shouldDoLightning +- gameprofilerfiller.push("thunder"); ++ //gameprofilerfiller.push("thunder"); // Purpur + if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); -@@ -955,7 +955,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. + +@@ -1003,7 +1003,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } @@ -784,7 +807,7 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int l = 0; l < randomTickSpeed; ++l) { -@@ -965,14 +965,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1013,14 +1013,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } // Paper - Option to disable ice and snow @@ -801,37 +824,36 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 } @VisibleForTesting -@@ -1318,19 +1318,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1348,18 +1348,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe //try { // Purpur // Paper end - timings entity.setOldPosAndRot(); -- ProfilerFiller gameprofilerfiller = this.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur ++entity.tickCount; -- this.getProfiler().push(() -> { -+ /*this.getProfiler().push(() -> { // Purpur +- gameprofilerfiller.push(() -> { ++ /*gameprofilerfiller.push(() -> { // Purpur return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); - }); - gameprofilerfiller.incrementCounter("tickNonPassenger"); + });*/ // Purpur + //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur if (isActive) { // Paper - EAR 2 - TimingHistory.activatedEntityTicks++; entity.tick(); entity.postTick(); // CraftBukkit } else { entity.inactiveTick(); } // Paper - EAR 2 -- this.getProfiler().pop(); -+ //this.getProfiler().pop(); // Purpur - //} finally { timer.stopTiming(); } // Paper - timings // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + //} finally { timer.stopTiming(); } // Paper - timings // EAR 2 // Purpur Iterator iterator = entity.getPassengers().iterator(); -@@ -1359,12 +1359,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - // Paper end +@@ -1377,12 +1377,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + if (passenger instanceof Player || this.entityTickList.contains(passenger)) { passenger.setOldPosAndRot(); ++passenger.tickCount; -- ProfilerFiller gameprofilerfiller = this.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push(() -> { + /*gameprofilerfiller.push(() -> { // Purpur @@ -843,8 +865,8 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 // Paper start - EAR 2 if (isActive) { passenger.rideTick(); -@@ -1376,7 +1376,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - vehicle.positionRider(passenger); +@@ -1394,7 +1394,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + vehicle.positionRider(passenger); } // Paper end - EAR 2 - gameprofilerfiller.pop(); @@ -853,77 +875,75 @@ index b6fd5b83cff5ea21221d029b8729932e25300d47..067b10134b087626e05596225744b905 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6f6b9dbfa8bf4d67a9157ec870a4f14a8002ac01..d8bff9a83c4c2ad1ec1e7d44aac23068f6dc930b 100644 +index 3f804ddb25aa03bdd964d390a1a1aab4d09abfde..5b4edb2386bb624d3633385106472070868acccc 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1398,7 +1398,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1663,15 +1663,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple this.unsetRemoved(); */ // CraftBukkit end -- worldserver1.getProfiler().push("moving"); -+ //worldserver1.getProfiler().push("moving"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("moving"); ++ //gameprofilerfiller.push("moving"); // Purpur if (worldserver != null && resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit - empty to fall through to null to event this.enteredNetherPosition = this.position(); } -@@ -1414,8 +1414,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - worldserver = ((CraftWorld) exit.getWorld()).getHandle(); - // CraftBukkit end -- worldserver1.getProfiler().pop(); -- worldserver1.getProfiler().push("placing"); -+ //worldserver1.getProfiler().pop(); // Purpur -+ //worldserver1.getProfiler().push("placing"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("placing"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("placing"); // Purpur // CraftBukkit start this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds LevelData worlddata = worldserver.getLevelData(); -@@ -1433,7 +1433,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - this.connection.teleport(exit); // CraftBukkit - use internal teleport without event +@@ -1689,7 +1689,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple + this.connection.internalTeleport(PositionMoveRotation.of(teleportTarget), teleportTarget.relatives()); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); worldserver.addDuringTeleport(this); -- worldserver1.getProfiler().pop(); -+ //worldserver1.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur this.triggerDimensionChangeTriggers(worldserver1); + this.stopUsingItem(); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); - playerlist.sendLevelInfo(this, worldserver); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 87e904ef07cf04d7e59c8da418c5d0458902de2d..a9d54c80f682d826ad272731bd6477eed0fd44d5 100644 +index 7d276c191b391bca24948ddb36b8b7d0f1f03b03..49cb116fd55e6d5cd36b9773b39191e4ab06b7e0 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -267,7 +267,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -274,7 +274,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } protected void keepConnectionAlive() { -- this.server.getProfiler().push("keepAlive"); -+ //this.server.getProfiler().push("keepAlive"); // Purpur +- Profiler.get().push("keepAlive"); ++ //Profiler.get().push("keepAlive"); // Purpur // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings // This should effectively place the keepalive handling back to "as it was" before 1.12.2 long currentTime = Util.getMillis(); -@@ -300,7 +300,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -307,7 +307,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } // Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings -- this.server.getProfiler().pop(); -+ //this.server.getProfiler().pop(); // Purpur +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Purpur } private boolean checkIfClosed(long time) { diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -index f14113eef226e906c0d21641e74a27471254909d..0c25f3ed0a8a538edc7cadd3476100c9b3631f7a 100644 +index d2d82e4f22bfeac8881b6815e4bef56c254fded9..abc92e09b7bb636612f04ace8232947c8d454e68 100644 --- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -@@ -16,11 +16,11 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener - Executor applyExecutor +@@ -12,10 +12,10 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener + PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor ) { return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> { -- applyProfiler.startTick(); -- applyProfiler.push("listener"); -+ //applyProfiler.startTick(); // Purpur -+ //applyProfiler.push("listener"); // Purpur +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("listener"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("listener"); // Purpur this.onResourceManagerReload(manager); -- applyProfiler.pop(); -- applyProfiler.endTick(); -+ //applyProfiler.pop(); // Purpur -+ //applyProfiler.endTick(); // Purpur +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur }, applyExecutor); } @@ -978,10 +998,10 @@ index bce2dac613d29083dd5fbb68739304cc5a6d4d27..600a7036b503f60cc9c95f189f73c2db private ActiveProfiler.PathEntry getCurrentEntry() { diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java -index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60c6ff9818 100644 +index bc5c8879befe849ce81becf5e3fba6757b01cb70..ce81d6bd87f688a24003f2fbf6d5010ad6273917 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java +++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java -@@ -6,32 +6,44 @@ import net.minecraft.util.profiling.metrics.MetricCategory; +@@ -6,51 +6,68 @@ import net.minecraft.util.profiling.metrics.MetricCategory; public interface ProfilerFiller { String ROOT = "root"; @@ -1006,6 +1026,30 @@ index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60 + @io.papermc.paper.annotation.DoNotUse // Purpur void popPush(Supplier locationGetter); ++ @io.papermc.paper.annotation.DoNotUse // Purpur + default void addZoneText(String label) { + } + ++ @io.papermc.paper.annotation.DoNotUse // Purpur + default void addZoneValue(long value) { + } + ++ @io.papermc.paper.annotation.DoNotUse // Purpur + default void setZoneColor(int color) { + } + ++ @io.papermc.paper.annotation.DoNotUse // Purpur + default Zone zone(String name) { + this.push(name); + return new Zone(this); + } + ++ @io.papermc.paper.annotation.DoNotUse // Purpur + default Zone zone(Supplier nameSupplier) { + this.push(nameSupplier); + return new Zone(this); + } + + @io.papermc.paper.annotation.DoNotUse // Purpur void markForCharting(MetricCategory type); @@ -1027,350 +1071,387 @@ index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60 + @io.papermc.paper.annotation.DoNotUse // Purpur void incrementCounter(Supplier markerGetter, int num); - static ProfilerFiller tee(ProfilerFiller a, ProfilerFiller b) { -@@ -41,62 +53,62 @@ public interface ProfilerFiller { - return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() { - @Override - public void startTick() { -- a.startTick(); -- b.startTick(); -+ //a.startTick(); // Purpur -+ //b.startTick(); // Purpur - } + static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) { +@@ -72,80 +89,80 @@ public interface ProfilerFiller { - @Override - public void endTick() { -- a.endTick(); -- b.endTick(); -+ //a.endTick(); // Purpur -+ //b.endTick(); // Purpur - } - - @Override - public void push(String location) { -- a.push(location); -- b.push(location); -+ //a.push(location); // Purpur -+ //b.push(location); // Purpur - } - - @Override - public void push(Supplier locationGetter) { -- a.push(locationGetter); -- b.push(locationGetter); -+ //a.push(locationGetter); // Purpur -+ //b.push(locationGetter); // Purpur - } - - @Override - public void markForCharting(MetricCategory type) { -- a.markForCharting(type); -- b.markForCharting(type); -+ //a.markForCharting(type); // Purpur -+ //b.markForCharting(type); // Purpur - } - - @Override - public void pop() { -- a.pop(); -- b.pop(); -+ //a.pop(); // Purpur -+ //b.pop(); // Purpur - } - - @Override - public void popPush(String location) { -- a.popPush(location); -- b.popPush(location); -+ //a.popPush(location); // Purpur -+ //b.popPush(location); // Purpur - } - - @Override - public void popPush(Supplier locationGetter) { -- a.popPush(locationGetter); -- b.popPush(locationGetter); -+ //a.popPush(locationGetter); // Purpur -+ //b.popPush(locationGetter); // Purpur - } - - @Override - public void incrementCounter(String marker, int num) { -- a.incrementCounter(marker, num); -- b.incrementCounter(marker, num); -+ //a.incrementCounter(marker, num); // Purpur -+ //b.incrementCounter(marker, num); // Purpur - } - - @Override - public void incrementCounter(Supplier markerGetter, int num) { -- a.incrementCounter(markerGetter, num); -- b.incrementCounter(markerGetter, num); -+ //a.incrementCounter(markerGetter, num); // Purpur -+ //b.incrementCounter(markerGetter, num); // Purpur - } - }; + @Override + public void startTick() { +- this.first.startTick(); +- this.second.startTick(); ++ //this.first.startTick(); // Purpur ++ //this.second.startTick(); // Purpur } + + @Override + public void endTick() { +- this.first.endTick(); +- this.second.endTick(); ++ //this.first.endTick(); // Purpur ++ //this.second.endTick(); // Purpur + } + + @Override + public void push(String location) { +- this.first.push(location); +- this.second.push(location); ++ //this.first.push(location); // Purpur ++ //this.second.push(location); // Purpur + } + + @Override + public void push(Supplier locationGetter) { +- this.first.push(locationGetter); +- this.second.push(locationGetter); ++ //this.first.push(locationGetter); // Purpur ++ //this.second.push(locationGetter); // Purpur + } + + @Override + public void markForCharting(MetricCategory type) { +- this.first.markForCharting(type); +- this.second.markForCharting(type); ++ //this.first.markForCharting(type); // Purpur ++ //this.second.markForCharting(type); // Purpur + } + + @Override + public void pop() { +- this.first.pop(); +- this.second.pop(); ++ //this.first.pop(); // Purpur ++ //this.second.pop(); // Purpur + } + + @Override + public void popPush(String location) { +- this.first.popPush(location); +- this.second.popPush(location); ++ //this.first.popPush(location); // Purpur ++ //this.second.popPush(location); // Purpur + } + + @Override + public void popPush(Supplier locationGetter) { +- this.first.popPush(locationGetter); +- this.second.popPush(locationGetter); ++ //this.first.popPush(locationGetter); // Purpur ++ //this.second.popPush(locationGetter); // Purpur + } + + @Override + public void incrementCounter(String marker, int num) { +- this.first.incrementCounter(marker, num); +- this.second.incrementCounter(marker, num); ++ //this.first.incrementCounter(marker, num); // Purpur ++ //this.second.incrementCounter(marker, num); // Purpur + } + + @Override + public void incrementCounter(Supplier markerGetter, int num) { +- this.first.incrementCounter(markerGetter, num); +- this.second.incrementCounter(markerGetter, num); ++ //this.first.incrementCounter(markerGetter, num); // Purpur ++ //this.second.incrementCounter(markerGetter, num); // Purpur + } + + @Override + public void addZoneText(String label) { +- this.first.addZoneText(label); +- this.second.addZoneText(label); ++ //this.first.addZoneText(label); // Purpur ++ //this.second.addZoneText(label); // Purpur + } + + @Override + public void addZoneValue(long value) { +- this.first.addZoneValue(value); +- this.second.addZoneValue(value); ++ //this.first.addZoneValue(value); // Purpur ++ //this.second.addZoneValue(value); // Purpur + } + + @Override + public void setZoneColor(int color) { +- this.first.setZoneColor(color); +- this.second.setZoneColor(color); ++ //this.first.setZoneColor(color); // Purpur ++ //this.second.setZoneColor(color); // Purpur + } + } + } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7e7d13424ea1328ca37b1201a74ac0d4f933a8c3..95885f71825cbf1e46001d60f81dc88049ec6e22 100644 +index aa0771c7ab8302c03d7a54c6c1282e21defc4de7..1bab4593cfb738ed6253482d36dc99b755d4e55f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -889,7 +889,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -946,9 +946,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // CraftBukkit end public void baseTick() { -- this.level().getProfiler().push("entityBaseTick"); -+ //this.level().getProfiler().push("entityBaseTick"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("entityBaseTick"); ++ //gameprofilerfiller.push("entityBaseTick"); // Purpur if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups this.inBlockState = null; if (this.isPassenger() && this.getVehicle().isRemoved()) { -@@ -954,7 +954,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - Leashable.tickLeash((Entity & Leashable) this); // CraftBukkit - decompile error +@@ -1017,7 +1017,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } } -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } public void setSharedFlagOnFire(boolean onFire) { -@@ -1169,7 +1169,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1208,9 +1208,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } -- this.level().getProfiler().push("move"); -+ //this.level().getProfiler().push("move"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("move"); ++ //gameprofilerfiller.push("move"); // Purpur if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) { movement = movement.multiply(this.stuckSpeedMultiplier); this.stuckSpeedMultiplier = Vec3.ZERO; -@@ -1178,7 +1178,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1219,7 +1219,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // Paper start - ignore movement changes while inactive. - if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) { + if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) { setDeltaMovement(Vec3.ZERO); -- this.level.getProfiler().pop(); -+ //this.level.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur return; } // Paper end -@@ -1199,8 +1199,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1240,8 +1240,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); } -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("rest"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("rest"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("rest"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("rest"); // Purpur boolean flag = !Mth.equal(movement.x, vec3d1.x); boolean flag1 = !Mth.equal(movement.z, vec3d1.z); -@@ -1219,7 +1219,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1263,7 +1263,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } - this.checkFallDamage(vec3d1.y, this.onGround(), iblockdata, blockposition); if (this.isRemoved()) { -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } else { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); -@@ -1322,7 +1322,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - this.setRemainingFireTicks(-this.getFireImmuneTicks()); - } - -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - } - } - // Paper start - detailed watchdog information -@@ -3314,7 +3314,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3470,9 +3470,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.processPortalCooldown(); if (this.portalProcess != null) { if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) { -- worldserver.getProfiler().push("portal"); -+ //worldserver.getProfiler().push("portal"); // Purpur - this.setPortalCooldown(); - DimensionTransition dimensiontransition = this.portalProcess.getPortalDestination(worldserver, this); +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur -@@ -3326,7 +3326,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +- gameprofilerfiller.push("portal"); ++ //gameprofilerfiller.push("portal"); // Purpur + this.setPortalCooldown(); + TeleportTransition teleporttransition = this.portalProcess.getPortalDestination(worldserver, this); + +@@ -3484,7 +3484,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } -- worldserver.getProfiler().pop(); -+ //worldserver.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } else if (this.portalProcess.hasExpired()) { this.portalProcess = null; } -@@ -3829,7 +3829,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - } - } - -- worldserver.getProfiler().push("changeDimension"); -+ //worldserver.getProfiler().push("changeDimension"); // Purpur - Entity entity2 = worldserver1.dimension() == worldserver.dimension() ? this : this.getType().create(worldserver1); - - if (entity2 != null) { -@@ -3865,7 +3865,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - teleportTarget.postDimensionTransition().onTransition(entity2); - } - -- worldserver.getProfiler().pop(); -+ //worldserver.getProfiler().pop(); // Purpur - return entity2; +@@ -4035,12 +4035,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } + +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("teleportCrossDimension"); ++ //gameprofilerfiller.push("teleportCrossDimension"); // Purpur + entity = this.getType().create(world, EntitySpawnReason.DIMENSION_TRAVEL); + if (entity == null) { +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + return null; + } else { + // Paper start - Fix item duplication and teleport issues diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 409d5c775b3187f2d3b58879e3c945d16a690299..7e00f1f875c7761cfbc1964a3d76da08c36c60f1 100644 +index 60b0cf7cd5e4bcbe882590b79a70dafb23e6772f..38a7bde1bc2836352a62dfe1dd3b9a60877c20e2 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -444,7 +444,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -459,9 +459,9 @@ public abstract class LivingEntity extends Entity implements Attackable { } super.baseTick(); -- this.level().getProfiler().push("livingEntityBaseTick"); -+ //this.level().getProfiler().push("livingEntityBaseTick"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("livingEntityBaseTick"); ++ //gameprofilerfiller.push("livingEntityBaseTick"); // Purpur if (this.fireImmune() || this.level().isClientSide) { this.clearFire(); } -@@ -550,7 +550,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -569,7 +569,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO = this.yHeadRot; this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } @Override -@@ -3298,10 +3298,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3384,12 +3384,12 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.run += (f3 - this.run) * 0.3F; -- this.level().getProfiler().push("headTurn"); -+ //this.level().getProfiler().push("headTurn"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("headTurn"); ++ //gameprofilerfiller.push("headTurn"); // Purpur f2 = this.tickHeadTurn(f1, f2); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("rangeChecks"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("rangeChecks"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("rangeChecks"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("rangeChecks"); // Purpur // Paper start - stop large pitch and yaw changes from crashing the server this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; -@@ -3313,7 +3313,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3401,7 +3401,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; // Paper end -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur this.animStep += f2; if (this.isFallFlying()) { ++this.fallFlyTicks; -@@ -3553,19 +3553,19 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3631,21 +3631,21 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.setDeltaMovement(d0, d1, d2); -- this.level().getProfiler().push("ai"); -+ //this.level().getProfiler().push("ai"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("ai"); ++ //gameprofilerfiller.push("ai"); // Purpur if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; this.zza = 0.0F; } else if (this.isEffectiveAi()) { -- this.level().getProfiler().push("newAi"); -+ //this.level().getProfiler().push("newAi"); // Purpur +- gameprofilerfiller.push("newAi"); ++ //gameprofilerfiller.push("newAi"); // Purpur this.serverAiStep(); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("jump"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("jump"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("jump"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("jump"); // Purpur if (this.jumping && this.isAffectedByFluids()) { double d3; -@@ -3592,8 +3592,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3672,8 +3672,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.noJumpDelay = 0; } -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("travel"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("travel"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("travel"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("travel"); // Purpur this.xxa *= 0.98F; this.zza *= 0.98F; - this.updateFallFlying(); -@@ -3618,8 +3618,8 @@ public abstract class LivingEntity extends Entity implements Attackable { - this.travel(vec3d1); + if (this.isFallFlying()) { +@@ -3706,8 +3706,8 @@ public abstract class LivingEntity extends Entity implements Attackable { } -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("freezing"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("freezing"); // Purpur + this.calculateEntityAnimation(this instanceof FlyingAnimal); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("freezing"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("freezing"); // Purpur if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API int i = this.getTicksFrozen(); -@@ -3636,15 +3636,15 @@ public abstract class LivingEntity extends Entity implements Attackable { - this.hurt(this.damageSources().freeze(), 1.0F); +@@ -3728,15 +3728,15 @@ public abstract class LivingEntity extends Entity implements Attackable { + } } -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("push"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("push"); // Purpur +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("push"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("push"); // Purpur if (this.autoSpinAttackTicks > 0) { --this.autoSpinAttackTicks; this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } this.pushEntities(); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur // Paper start - Add EntityMoveEvent // Purpur start if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 518968c03e4e7ae99c2e40f6164c89ad27bad697..4b4bdaf8c43e15ba953c160a003a719aaf730318 100644 +index da1aefc4cdf2bca8e91c6c7833c24f3f0923f552..1fd6990fdf16283aab956c36daaafeb64aa5358b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -370,13 +370,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -371,15 +371,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void baseTick() { super.baseTick(); -- this.level().getProfiler().push("mobBaseTick"); -+ //this.level().getProfiler().push("mobBaseTick"); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("mobBaseTick"); ++ //gameprofilerfiller.push("mobBaseTick"); // Purpur if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) { this.resetAmbientSoundTime(); this.playAmbientSound(); } -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur incrementTicksSinceLastInteraction(); // Purpur } -@@ -706,7 +706,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -698,9 +698,9 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void aiStep() { super.aiStep(); -- this.level().getProfiler().push("looting"); -+ //this.level().getProfiler().push("looting"); // Purpur - if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { - Vec3i baseblockposition = this.getPickupReach(); - List list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ())); -@@ -726,7 +726,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("looting"); ++ //gameprofilerfiller.push("looting"); // Purpur + Level world = this.level(); + + if (world instanceof ServerLevel worldserver) { +@@ -724,7 +724,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab } } -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } protected Vec3i getPickupReach() { -@@ -950,48 +950,48 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -946,44 +946,44 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return; } // Paper end - Allow nerfed mobs to jump and float -- ProfilerFiller gameprofilerfiller = this.level().getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push("sensing"); + //gameprofilerfiller.push("sensing"); // Purpur @@ -1382,26 +1463,22 @@ index 518968c03e4e7ae99c2e40f6164c89ad27bad697..4b4bdaf8c43e15ba953c160a003a719a if (i % 2 != 0 && this.tickCount > 1) { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur - if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking this.targetSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur - if (this.goalSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking this.goalSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } else { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur - if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking this.targetSelector.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur - if (this.goalSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking this.goalSelector.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur @@ -1414,7 +1491,7 @@ index 518968c03e4e7ae99c2e40f6164c89ad27bad697..4b4bdaf8c43e15ba953c160a003a719a - gameprofilerfiller.push("mob tick"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("mob tick"); // Purpur - this.customServerAiStep(); + this.customServerAiStep((ServerLevel) this.level()); - gameprofilerfiller.pop(); - gameprofilerfiller.push("controls"); - gameprofilerfiller.push("move"); @@ -1436,21 +1513,21 @@ index 518968c03e4e7ae99c2e40f6164c89ad27bad697..4b4bdaf8c43e15ba953c160a003a719a } diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -index e32c3120f9c5ddf429d8428c370ff61320a38de6..c943a00b401c4e9f2d97113ffe1f7c344455d086 100644 +index 29ae74339a4831ccef3d01e8054931715ba192ad..74c5914bc51cff128d4b86853316e5e51e02b416 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -@@ -90,8 +90,8 @@ public class GoalSelector { +@@ -82,8 +82,8 @@ public class GoalSelector { } public void tick() { -- ProfilerFiller profilerFiller = this.profiler.get(); +- ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("goalCleanup"); -+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur + //profilerFiller.push("goalCleanup"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams -@@ -100,8 +100,8 @@ public class GoalSelector { +@@ -92,8 +92,8 @@ public class GoalSelector { } this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning()); @@ -1461,7 +1538,7 @@ index e32c3120f9c5ddf429d8428c370ff61320a38de6..c943a00b401c4e9f2d97113ffe1f7c34 for (WrappedGoal wrappedGoal2 : this.availableGoals) { // Paper start -@@ -121,13 +121,13 @@ public class GoalSelector { +@@ -113,13 +113,13 @@ public class GoalSelector { } } @@ -1471,14 +1548,14 @@ index e32c3120f9c5ddf429d8428c370ff61320a38de6..c943a00b401c4e9f2d97113ffe1f7c34 } public void tickRunningGoals(boolean tickAll) { -- ProfilerFiller profilerFiller = this.profiler.get(); +- ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("goalTick"); -+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur + //profilerFiller.push("goalTick"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) { -@@ -135,7 +135,7 @@ public class GoalSelector { +@@ -127,7 +127,7 @@ public class GoalSelector { } } @@ -1488,397 +1565,414 @@ index e32c3120f9c5ddf429d8428c370ff61320a38de6..c943a00b401c4e9f2d97113ffe1f7c34 public Set getAvailableGoals() { diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index 2e9991e6b3c05584002744a2ee2579b1dba218b2..544920a31b649985333f82beafa94a3392f5853e 100644 +index 48c0de870a5bbf647309e69361dfb10ab56c65ab..a5289b6c453c24cb7b8b3a301b72c3adf92c1d13 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -@@ -172,12 +172,12 @@ public abstract class PathNavigation { +@@ -188,13 +188,13 @@ public abstract class PathNavigation { } } // Paper end - EntityPathfindEvent -- this.level.getProfiler().push("pathfind"); -+ //this.level.getProfiler().push("pathfind"); // Purpur +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("pathfind"); ++ //ProfilerFiller profilerFiller = Profiler.get(); ++ //profilerFiller.push("pathfind"); // Purpur BlockPos blockPos = useHeadPos ? this.mob.blockPosition().above() : this.mob.blockPosition(); int i = (int)(followRange + (float)range); PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i)); Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier); -- this.level.getProfiler().pop(); -+ //this.level.getProfiler().pop(); // Purpur +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur if (path != null && path.getTarget() != null) { this.targetPos = path.getTarget(); this.reachRange = distance; diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java -index 51772f03a3469b11e7166ec6f3a1b9c64a606221..02f2f46ccc48bb4d9bd08555818b0489f60d9f13 100644 +index 116b1e251ffe68bae5c404d0823c2bc7c1afddf6..8f5a5db1a07fa6a95ecfacaab2f9de609202faf4 100644 --- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java -@@ -26,9 +26,9 @@ public class Sensing { +@@ -28,10 +28,10 @@ public class Sensing { } else if (this.unseen.contains(i)) { return false; } else { -- this.mob.level().getProfiler().push("hasLineOfSight"); -+ //this.mob.level().getProfiler().push("hasLineOfSight"); // Purpur +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("hasLineOfSight"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("hasLineOfSight"); // Purpur boolean bl = this.mob.hasLineOfSight(entity); -- this.mob.level().getProfiler().pop(); -+ //this.mob.level().getProfiler().pop(); // Purpur +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur if (bl) { this.seen.add(i); } else { diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -index 498cd9cec1693445e98333c62052189bc276b1bb..62c62fd26660d8405378340315042d7b95ac7046 100644 +index 5904b82b87bcdbe41367843885f7c1bd1272d1f1..f60961bd5fdf6d1417e458b92e311c1a0a62463d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -@@ -261,13 +261,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS - private int behaviorTick = 0; // Pufferfish +@@ -262,15 +262,15 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("allayBrain"); -+ //this.level().getProfiler().push("allayBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("allayActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("allayActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("allayBrain"); ++ //gameprofilerfiller.push("allayBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("allayActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("allayActivityUpdate"); // Purpur AllayAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -index 75c05990b9ee6fd429c24415be3b98e258638e89..5b024bc6166a9034eeba729bf3a53236446a03de 100644 +index 9ef53608f1608e88de7a7b3e96b43d8d2b4230ae..84516dcfc6cd0fe16c26538ccb86fb5c85b44ffa 100644 --- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -@@ -163,12 +163,12 @@ public class Armadillo extends Animal { +@@ -163,14 +163,14 @@ public class Armadillo extends Animal { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("armadilloBrain"); -+ //this.level().getProfiler().push("armadilloBrain"); // Purpur - ((Brain) this.brain).tick((ServerLevel) this.level(), this); // CraftBukkit - decompile error -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("armadilloActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("armadilloActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("armadilloBrain"); ++ //gameprofilerfiller.push("armadilloBrain"); // Purpur + ((Brain) this.brain).tick(world, this); // CraftBukkit - decompile error +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("armadilloActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("armadilloActivityUpdate"); // Purpur ArmadilloAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) { - this.playSound(SoundEvents.ARMADILLO_SCUTE_DROP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); this.forceDrops = true; // CraftBukkit + if (this.dropFromGiftLootTable(world, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) { diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index f7f37f71518f5a74eb872014e669e844cf01a15c..3359f492d6a8f193707e08768d73049454f178f4 100644 +index 91768d49c3cbef0a135cfd0e60bdb4e84bf109b3..c80d74caa393a31e09f2776cdb3cb950ef99e2ef 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -310,13 +310,13 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder, B + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("axolotlBrain"); -+ //this.level().getProfiler().push("axolotlBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("axolotlActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("axolotlActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("axolotlBrain"); ++ //gameprofilerfiller.push("axolotlBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("axolotlActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("axolotlActivityUpdate"); // Purpur AxolotlAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur if (!this.isNoAi()) { Optional optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index c567b946e013852acfae7f5a417a292706e218f4..e88d6d691bb176e33afeb294d735dfb2cbac12ff 100644 +index dbce71f45c008da883b6d244a06343d83ae25e7e..56d97225a909fd55f0d8aec992d5b6d42687c948 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -154,14 +154,14 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -154,16 +154,16 @@ public class Camel extends AbstractHorse { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("camelBrain"); -+ //this.level().getProfiler().push("camelBrain"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("camelBrain"); ++ //gameprofilerfiller.push("camelBrain"); // Purpur Brain behaviorcontroller = (Brain) this.getBrain(); // CraftBukkit - decompile error - behaviorcontroller.tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("camelActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("camelActivityUpdate"); // Purpur + behaviorcontroller.tick(world, this); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("camelActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("camelActivityUpdate"); // Purpur CamelAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 66dea405cd08c6b4ca3b5fe39fb83552bdd863b4..4c861b18fbfbae3cb2f1e3563393cfcf4005591c 100644 +index 49915ec0ee5fb6e7d25b079e0410942d44aa1e33..501a12398c56fe0df4e76a3bbce0f98c6c5aa6cb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -238,13 +238,13 @@ public class Frog extends Animal implements VariantHolder> { - private int behaviorTick = 0; // Pufferfish +@@ -240,14 +240,14 @@ public class Frog extends Animal implements VariantHolder> { + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("frogBrain"); -+ //this.level().getProfiler().push("frogBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel)this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("frogActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("frogActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("frogBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("frogBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- profilerFiller.pop(); +- profilerFiller.push("frogActivityUpdate"); ++ //profilerFiller.pop(); // Purpur ++ //profilerFiller.push("frogActivityUpdate"); // Purpur FrogAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java -index b05276065c977ea5eae3e74d15b2b5c90e352e61..5cd69dd546f42e80a3d3e3a674f65c2ac39f3af9 100644 +index fb91677fb03b7bc1decdf181b7b15d971ffacdc2..071d14cc6697587ec14f02c69c78df364e7d8a8f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java -@@ -123,13 +123,13 @@ public class Tadpole extends AbstractFish { - private int behaviorTick = 0; // Pufferfish +@@ -122,15 +122,15 @@ public class Tadpole extends AbstractFish { + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("tadpoleBrain"); -+ //this.level().getProfiler().push("tadpoleBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("tadpoleActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("tadpoleActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); + +- gameprofilerfiller.push("tadpoleBrain"); ++ //gameprofilerfiller.push("tadpoleBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("tadpoleActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("tadpoleActivityUpdate"); // Purpur TadpoleAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index 9513f9ba6bb677536d2ec136ae5b2f5c091c4c93..1b298bfb440e5ddcc88b0b41e8c733b3883c5998 100644 +index 7f196e8a8b5094375c9b13fe6e7311a3450dbb5f..51dcc3893b964e6d20a2b963d3105a2687b3c426 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -225,13 +225,13 @@ public class Goat extends Animal { - private int behaviorTick = 0; // Pufferfish +@@ -226,15 +226,15 @@ public class Goat extends Animal { + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("goatBrain"); -+ //this.level().getProfiler().push("goatBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -- this.level().getProfiler().push("goatActivityUpdate"); -+ //this.level().getProfiler().pop(); // Purpur -+ //this.level().getProfiler().push("goatActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("goatBrain"); ++ //gameprofilerfiller.push("goatBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); +- gameprofilerfiller.push("goatActivityUpdate"); ++ //gameprofilerfiller.pop(); // Purpur ++ //gameprofilerfiller.push("goatActivityUpdate"); // Purpur GoatAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index d82b036b5a759574fe83027ec1000d7eb0455a28..b6f5281705ce4c7a755e3818cf6c4a2235a024f9 100644 +index 464a16df15d8759d66f94ad080d1ea28b3f6474c..3fb4f12095883ea4ec6e0d60e0600b9de6ed7be2 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -505,11 +505,11 @@ public class Sniffer extends Animal { +@@ -495,13 +495,13 @@ public class Sniffer extends Animal { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("snifferBrain"); -+ //this.level().getProfiler().push("snifferBrain"); // Purpur - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().popPush("snifferActivityUpdate"); -+ //this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("snifferBrain"); ++ //gameprofilerfiller.push("snifferBrain"); // Purpur + this.getBrain().tick(world, this); +- gameprofilerfiller.popPush("snifferActivityUpdate"); ++ //gameprofilerfiller.popPush("snifferActivityUpdate"); // Purpur SnifferAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -index 6817f88c422480f201552300ae78053321e41bb8..0cf110be4ec7823996e89c1d1e014e091c1d3d8a 100644 +index cb20c018c11a0e707c2083cf964bd5303d216edd..f30ad422f19757664228f2064465fbcb22bb54f6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -@@ -266,10 +266,10 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { +@@ -281,11 +281,11 @@ public class Zoglin extends Monster implements HoglinBase { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("zoglinBrain"); -+ //this.level().getProfiler().push("zoglinBrain"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("zoglinBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("zoglinBrain"); // Purpur if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel)this.level(), this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur + this.getBrain().tick(world, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur this.updateActivity(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java -index ee9098f311b5db7251fcaf3ca199ae51ec1f2a2a..0d8e49e4f3c52244f8f84d6e4beeaa60aa6acdd9 100644 +index a16fd9c4679e874ad2d499f3c00c2ddfd780a7a5..0bc771e20a9bab139cd3fc03ff40baabf787b2f7 100644 --- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java -@@ -228,11 +228,11 @@ public class Breeze extends Monster { +@@ -235,12 +235,12 @@ public class Breeze extends Monster { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("breezeBrain"); -+ //this.level().getProfiler().push("breezeBrain"); // Purpur - this.getBrain().tick((ServerLevel)this.level(), this); -- this.level().getProfiler().popPush("breezeActivityUpdate"); -+ //this.level().getProfiler().popPush("breezeActivityUpdate"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("breezeBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("breezeBrain"); // Purpur + this.getBrain().tick(world, this); +- profilerFiller.popPush("breezeActivityUpdate"); ++ //profilerFiller.popPush("breezeActivityUpdate"); // Purpur BreezeAi.updateActivity(this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java -index 4b4a81f78d0f3e4a44b423e7c67423a7237cdeaf..6525155cdb5edb326b4f770e68400911ec25d95d 100644 +index 7520ab7ec5902f083aefd68895a7d9c47bf4e418..7afde99f81ec222ecbffbdcdad3aa6404e8221e0 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -194,10 +194,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { - private int behaviorTick; // Pufferfish +@@ -196,11 +196,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("hoglinBrain"); -+ //this.level().getProfiler().push("hoglinBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel)this.level(), this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("hoglinBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("hoglinBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur HoglinAi.updateActivity(this); if (this.isConverting()) { this.timeInOverworld++; diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index 63c2486b25c1fd88675e3cd9411f2b440c652700..e2b3256184b860b2f27fbcff4e09b70b43aedae8 100644 +index 7d5ce66c6691b0911ed5afcb1d4186525f09a15e..b53e4a312ea0dbbd16e948e61c3f6b836d46f3b8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -329,10 +329,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento - private int behaviorTick; // Pufferfish +@@ -339,12 +339,12 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento + @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("piglinBrain"); -+ //this.level().getProfiler().push("piglinBrain"); // Purpur - if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel) this.level(), this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("piglinBrain"); ++ //gameprofilerfiller.push("piglinBrain"); // Purpur + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // // Purpur - TODO: Pufferfish + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur PiglinAi.updateActivity(this); - super.customServerAiStep(); + super.customServerAiStep(world); } diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java -index 5537f4e2bdce05ef5863955b9403eda7b04ec0d5..2f43bef3acd9db78ecc869f5ff0f4d0f5e121d28 100644 +index bc3b0eb21200eae7e419b2571871b36fc1e07c0f..719179fb232a4f39a2c1642cc0e9593f4dea4bb8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java -@@ -139,10 +139,10 @@ public class PiglinBrute extends AbstractPiglin { +@@ -148,11 +148,11 @@ public class PiglinBrute extends AbstractPiglin { @Override - protected void customServerAiStep() { -- this.level().getProfiler().push("piglinBruteBrain"); -+ //this.level().getProfiler().push("piglinBruteBrain"); // Purpur + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("piglinBruteBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("piglinBruteBrain"); // Purpur if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider - this.getBrain().tick((ServerLevel)this.level(), this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur + this.getBrain().tick(world, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur PiglinBruteAi.updateActivity(this); PiglinBruteAi.maybePlayActivitySound(this); - super.customServerAiStep(); + super.customServerAiStep(world); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index e8af1136b76704767e1ef1859968448c28e07f41..8e24cd9ed03e2f11da6f4fb2dd58dd9b9e5d7a06 100644 +index fcfea2cdd5df9fe505df3f7c866cd8d27ad9b249..692261880d05daa75fc53dde31d0f2b95dc52746 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -@@ -301,10 +301,11 @@ public class Warden extends Monster implements VibrationSystem { - protected void customServerAiStep() { - ServerLevel worldserver = (ServerLevel) this.level(); +@@ -303,9 +303,9 @@ public class Warden extends Monster implements VibrationSystem { + protected void customServerAiStep(ServerLevel world) { + ProfilerFiller gameprofilerfiller = Profiler.get(); -- worldserver.getProfiler().push("wardenBrain"); -+ //worldserver.getProfiler().push("wardenBrain"); // Purpur -+ //if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - TODO: Move to Ridables patch - if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish - this.getBrain().tick(worldserver, this); -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur - super.customServerAiStep(); +- gameprofilerfiller.push("wardenBrain"); ++ //gameprofilerfiller.push("wardenBrain"); // Purpur + this.getBrain().tick(world, this); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur + super.customServerAiStep(world); if ((this.tickCount + this.getId()) % 120 == 0) { - Warden.applyDarknessAround(worldserver, this.position(), this, 20); + Warden.applyDarknessAround(world, this.position(), this, 20); diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 4af1857c4fbc18067b2fa0ae43501ce540630c6f..d58f845dc814011b8126cc641476b6e4e25bc328 100644 +index c885b214f4d7d91627e98d8779aab8515f205636..b4ffad429ace965f16ebf47119c880b709b27f2e 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -345,7 +345,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -340,9 +340,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } - protected void customServerAiStep(boolean inactive) { // Purpur - not final - // Paper end -- this.level().getProfiler().push("villagerBrain"); -+ //this.level().getProfiler().push("villagerBrain"); // Purpur + protected void customServerAiStep(ServerLevel world, boolean inactive) { // Purpur - not final + // Paper end - EAR 2 +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur + +- gameprofilerfiller.push("villagerBrain"); ++ //gameprofilerfiller.push("villagerBrain"); // Purpur // Purpur start if (this.level().purpurConfig.villagerLobotomizeEnabled) { // treat as inactive if lobotomized -@@ -360,7 +360,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -352,7 +352,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } - else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - // Pufferfish end -- this.level().getProfiler().pop(); -+ //this.level().getProfiler().pop(); // Purpur + // Purpur end + if (!inactive && (getRider() == null || !this.isControllable())) this.getBrain().tick(world, this); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; } -diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index f696afd7e241bf1966a2d505b5d59bff824b43e4..6395bd2ffd734ca73af17b003d1505971ea31a48 100644 ---- a/src/main/java/net/minecraft/world/level/Explosion.java -+++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -647,7 +647,7 @@ public class Explosion { - } - - if (flag1) { -- this.level.getProfiler().push("explosion_blocks"); -+ //this.level.getProfiler().push("explosion_blocks"); // Purpur - List> list = new ArrayList(); - - Util.shuffle(this.toBlow, this.level.random); -@@ -722,7 +722,7 @@ public class Explosion { - Block.popResource(this.level, (BlockPos) pair.getSecond(), (ItemStack) pair.getFirst()); - } - -- this.level.getProfiler().pop(); -+ //this.level.getProfiler().pop(); // Purpur - } - - if (this.fire) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ccc6204141298deea56d996fab24254d25857da5..5057d9d433ba002a22d22adfaf7323b2cfaee9af 100644 +index 5a8b02d93f3d7eb882e93c9698858e7ae55c79e6..28350e63cb6718af521eda3b6814418957028620 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -269,7 +269,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -271,7 +271,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List getEntitiesOfClass(final Class entityClass, final AABB boundingBox, final Predicate predicate) { -- this.getProfiler().incrementCounter("getEntities"); -+ //this.getProfiler().incrementCounter("getEntities"); // Purpur +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Purpur final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate); -@@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -281,7 +281,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate predicate) { -- this.getProfiler().incrementCounter("getEntities"); -+ //this.getProfiler().incrementCounter("getEntities"); // Purpur +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Purpur final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate); -@@ -1412,9 +1412,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1488,9 +1488,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } protected void tickBlockEntities() { -- ProfilerFiller gameprofilerfiller = this.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur - gameprofilerfiller.push("blockEntities"); + //gameprofilerfiller.push("blockEntities"); // Purpur //this.timings.tileEntityPending.startTiming(); // Spigot // Purpur this.tickingBlockEntities = true; if (!this.pendingBlockEntityTickers.isEmpty()) { -@@ -1457,7 +1457,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1533,7 +1533,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur this.tickingBlockEntities = false; co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper @@ -1887,62 +1981,44 @@ index ccc6204141298deea56d996fab24254d25857da5..5057d9d433ba002a22d22adfaf7323b2 this.spigotConfig.currentPrimedTnt = 0; // Spigot } -@@ -1686,7 +1686,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1702,7 +1702,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { -- this.getProfiler().incrementCounter("getEntities"); -+ //this.getProfiler().incrementCounter("getEntities"); // Purpur - // Paper start - rewrite chunk system - final List ret = new java.util.ArrayList<>(); +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Purpur + List list = Lists.newArrayList(); -@@ -1712,7 +1712,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + // Paper start - rewrite chunk system +@@ -1732,7 +1732,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void getEntities(final EntityTypeTest entityTypeTest, final AABB boundingBox, final Predicate predicate, final List into, final int maxCount) { -- this.getProfiler().incrementCounter("getEntities"); -+ //this.getProfiler().incrementCounter("getEntities"); // Purpur +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Purpur if (entityTypeTest instanceof net.minecraft.world.entity.EntityType byType) { if (maxCount != Integer.MAX_VALUE) { -@@ -2007,7 +2007,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - } - - public ProfilerFiller getProfiler() { -- if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish -+ if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur - return (ProfilerFiller) this.profiler.get(); - } - diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 735f39fed209e086a52185565f8bd6873c0b8d6e..4dc060bc677984d91a30a88155c576d5e187aa1b 100644 +index f6fb4892c95f9716628ed8a90d1560b7c0a2e032..4bdfba6dbe88dbc7ce901b235a524ba28027f203 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -127,7 +127,7 @@ public final class NaturalSpawner { - } - - public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { -- world.getProfiler().push("spawner"); -+ //world.getProfiler().push("spawner"); // Purpur - //world.timings.mobSpawn.startTiming(); // Spigot // Purpur - MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; - int i = aenumcreaturetype.length; -@@ -182,7 +182,7 @@ public final class NaturalSpawner { +@@ -171,7 +171,7 @@ public final class NaturalSpawner { } //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur -- world.getProfiler().pop(); -+ //world.getProfiler().pop(); // Purpur +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Purpur } // Paper start - Add mobcaps commands diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index a0e6f39ba00212a078e04b21831a5ed22ad0825b..a4578ae22409edb686d0bcbac8cbc1a2e1d7b988 100644 +index a1a5b34b059d3beaa042f8f2d0ba509191df6f15..a6b6bdbdd245e864bd7b8622c4d391c85bfeb8e9 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -397,11 +397,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); +@@ -407,11 +407,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + if (LightEngine.hasDifferentLightProperties(iblockdata1, iblockdata)) { + ProfilerFiller gameprofilerfiller = Profiler.get(); - gameprofilerfiller.push("updateSkyLightSources"); + //gameprofilerfiller.push("updateSkyLightSources"); // Purpur @@ -1955,65 +2031,67 @@ index a0e6f39ba00212a078e04b21831a5ed22ad0825b..a4578ae22409edb686d0bcbac8cbc1a2 } boolean flag3 = iblockdata1.hasBlockEntity(); -@@ -1037,9 +1037,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -1060,9 +1060,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p if (LevelChunk.this.isTicking(blockposition)) { try { -- ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); -+ //ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); - gameprofilerfiller.push(this::getType); + //gameprofilerfiller.push(this::getType); //this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); -@@ -1056,7 +1056,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -1079,7 +1079,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p // Paper end - Remove the Block Entity if it's invalid } - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) throw throwable; // Paper // Paper start - Prevent block entity and entity crashes + final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -index 18bbb3f8f99849333ff4bc020c8ce758a69312a5..404080976208c30e9e95e5bee47c2a749e709a45 100644 +index cc7d94144e39f7dace7b569b4567def98396e8f9..91abbda59446d462979dddc4b380c6f24d0b4c92 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -@@ -53,8 +53,8 @@ public class PathFinder { +@@ -58,9 +58,9 @@ public class PathFinder { @Nullable // Paper start - Perf: remove streams and optimize collection - private Path findPath(ProfilerFiller profiler, Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { -- profiler.push("find_path"); -- profiler.markForCharting(MetricCategory.PATH_FINDING); -+ //profiler.push("find_path"); // Purpur -+ //profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur + private Path findPath(Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("find_path"); +- profilerFiller.markForCharting(MetricCategory.PATH_FINDING); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur ++ //profilerFiller.push("find_path"); // Purpur ++ //profilerFiller.markForCharting(MetricCategory.PATH_FINDING); // Purpur // Set set = positions.keySet(); startNode.g = 0.0F; startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection -@@ -122,7 +122,7 @@ public class PathFinder { +@@ -128,7 +128,7 @@ public class PathFinder { if (best == null || comparator.compare(path, best) < 0) best = path; } -- profiler.pop(); -+ //profiler.pop(); // Purpur +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Purpur return best; // Paper end - Perf: remove streams and optimize collection } diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java -index 7a69564572357a7acc043e35b9c113beeb738951..a6d62abd3102770652f914b9d697c6d3c2533cfc 100644 +index 778e6476c86d823dc8efe603a95e589e8b2ea9d9..452fb3442221fd66debfe1e1d6e85ee17951e556 100644 --- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java +++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java -@@ -81,20 +81,20 @@ public class LevelTicks implements LevelTickAccess { +@@ -79,20 +79,20 @@ public class LevelTicks implements LevelTickAccess { } public void tick(long time, int maxTicks, BiConsumer ticker) { -- ProfilerFiller profilerFiller = this.profiler.get(); +- ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("collect"); - this.collectTicks(time, maxTicks, profilerFiller); - profilerFiller.popPush("run"); - profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); -+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur ++ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur + //profilerFiller.push("collect"); // Purpur + this.collectTicks(time, maxTicks, null); // Purpur + //profilerFiller.popPush("run"); // Purpur diff --git a/patches/unapplied-server/0254-Add-more-logger-output-for-invalid-movement-kicks.patch b/patches/server/0249-Add-more-logger-output-for-invalid-movement-kicks.patch similarity index 92% rename from patches/unapplied-server/0254-Add-more-logger-output-for-invalid-movement-kicks.patch rename to patches/server/0249-Add-more-logger-output-for-invalid-movement-kicks.patch index 842c0338f..4e89ceec2 100644 --- a/patches/unapplied-server/0254-Add-more-logger-output-for-invalid-movement-kicks.patch +++ b/patches/server/0249-Add-more-logger-output-for-invalid-movement-kicks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more logger output for invalid movement kicks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cdb5062d4d6325ada90dec3d4de6c0fd7546e8ab..682f353c0e409fcc7375efc62d9f64b4952ff230 100644 +index 8da850ab34e576caf89681171124f617f57d00a7..06050ed59dde5c8a5291160cc890621083425963 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -755,6 +755,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -727,6 +727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { @@ -16,7 +16,7 @@ index cdb5062d4d6325ada90dec3d4de6c0fd7546e8ab..682f353c0e409fcc7375efc62d9f64b4 this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause return; } -@@ -1360,7 +1361,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1337,7 +1338,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/unapplied-server/0255-Add-Bee-API.patch b/patches/server/0250-Add-Bee-API.patch similarity index 74% rename from patches/unapplied-server/0255-Add-Bee-API.patch rename to patches/server/0250-Add-Bee-API.patch index 6a2fecab9..e4abbb113 100644 --- a/patches/unapplied-server/0255-Add-Bee-API.patch +++ b/patches/server/0250-Add-Bee-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Bee API diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 46d55f60cb91fc32b505582c8eecb393959b5d3f..9a6ec5e465684be7f0d54b1f7e66bdf52603e442 100644 +index 4b32a783cabf05f5bae0dba22eea8ac7ba2cd285..dc8df0912c1d18176e18a8f4dc43c4f60f81b659 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -809,6 +809,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -954,6 +954,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (optional.isPresent()) { Bee.this.savedFlowerPos = (BlockPos) optional.get(); Bee.this.navigation.moveTo((double) Bee.this.savedFlowerPos.getX() + 0.5D, (double) Bee.this.savedFlowerPos.getY() + 0.5D, (double) Bee.this.savedFlowerPos.getZ() + 0.5D, 1.2000000476837158D); @@ -16,7 +16,7 @@ index 46d55f60cb91fc32b505582c8eecb393959b5d3f..9a6ec5e465684be7f0d54b1f7e66bdf5 return true; } else { Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60); -@@ -865,6 +866,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -997,6 +998,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.pollinating = false; Bee.this.navigation.stop(); Bee.this.remainingCooldownBeforeLocatingNewFlower = 200; @@ -24,11 +24,11 @@ index 46d55f60cb91fc32b505582c8eecb393959b5d3f..9a6ec5e465684be7f0d54b1f7e66bdf5 } @Override -@@ -911,6 +913,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { - this.setWantedPos(); - } +@@ -1046,6 +1048,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { + this.setWantedPos(); + } + if (this.successfulPollinatingTicks == 0) new org.purpurmc.purpur.event.entity.BeeStartedPollinatingEvent((org.bukkit.entity.Bee) Bee.this.getBukkitEntity(), io.papermc.paper.util.MCUtil.toLocation(Bee.this.level(), Bee.this.savedFlowerPos)).callEvent(); // Purpur - ++this.successfulPollinatingTicks; - if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) { - this.lastSoundPlayedTick = this.successfulPollinatingTicks; + ++this.successfulPollinatingTicks; + if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) { + this.lastSoundPlayedTick = this.successfulPollinatingTicks; diff --git a/patches/unapplied-server/0256-Debug-Marker-API.patch b/patches/server/0251-Debug-Marker-API.patch similarity index 93% rename from patches/unapplied-server/0256-Debug-Marker-API.patch rename to patches/server/0251-Debug-Marker-API.patch index e2a4a9335..ef87df975 100644 --- a/patches/unapplied-server/0256-Debug-Marker-API.patch +++ b/patches/server/0251-Debug-Marker-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Debug Marker API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8fc42922d2f5ab3de6050fe9e5f1d7a0b4ed19de..647c86b529d7da3fb96126a0a7b0fa37a52453f4 100644 +index 4eb332ed95fd0ca196f3712037deb7637bfa4d8b..da3c89bc037c42268987c5923ca58c93adace80d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1624,6 +1624,42 @@ public final class CraftServer implements Server { +@@ -1601,6 +1601,42 @@ public final class CraftServer implements Server { public void removeFuel(org.bukkit.Material material) { net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity.removeFuel(net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material))); } @@ -52,10 +52,10 @@ index 8fc42922d2f5ab3de6050fe9e5f1d7a0b4ed19de..647c86b529d7da3fb96126a0a7b0fa37 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9ad02908bbcbaec7b6ce2abd4091a8146ee1616b..0921894dbc0d81b943827ecda6e6befdbfd715f5 100644 +index 3be5c25f8ce15e2f035c92e5fe90693e0236967d..ea1b4f0073f775fdd18eb080886d60c71a08ab2c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2390,6 +2390,42 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2403,6 +2403,42 @@ public class CraftWorld extends CraftRegionAccessor implements World { public float getLocalDifficultyAt(Location location) { return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty(); } @@ -99,10 +99,10 @@ index 9ad02908bbcbaec7b6ce2abd4091a8146ee1616b..0921894dbc0d81b943827ecda6e6befd @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b6db9d9326f30deb02d5530e014bd3abbaf9c54e..531632ed0a1adaf87acf9bdd651001e9157b1200 100644 +index 0d7e460cc73d7e236883e71ab77d51c7ef5e72ce..c4935709b031a98f58c7de3b40e18dc558f76741 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3617,5 +3617,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3647,5 +3647,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetIdleTimer() { getHandle().resetLastActionTime(); } diff --git a/patches/unapplied-server/0257-mob-spawning-option-to-ignore-creative-players.patch b/patches/server/0252-mob-spawning-option-to-ignore-creative-players.patch similarity index 86% rename from patches/unapplied-server/0257-mob-spawning-option-to-ignore-creative-players.patch rename to patches/server/0252-mob-spawning-option-to-ignore-creative-players.patch index 94e00430f..7d8fad8d8 100644 --- a/patches/unapplied-server/0257-mob-spawning-option-to-ignore-creative-players.patch +++ b/patches/server/0252-mob-spawning-option-to-ignore-creative-players.patch @@ -5,10 +5,10 @@ Subject: [PATCH] mob spawning option to ignore creative players diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 4dc060bc677984d91a30a88155c576d5e187aa1b..061706ee732f9809d6b73305c14871257af8305e 100644 +index 4bdfba6dbe88dbc7ce901b235a524ba28027f203..3741c0bb2e7c67cd2b0600f1e8ada38eda8698f8 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -253,7 +253,7 @@ public final class NaturalSpawner { +@@ -230,7 +230,7 @@ public final class NaturalSpawner { blockposition_mutableblockposition.set(l, i, i1); double d0 = (double) l + 0.5D; double d1 = (double) i1 + 0.5D; @@ -18,10 +18,10 @@ index 4dc060bc677984d91a30a88155c576d5e187aa1b..061706ee732f9809d6b73305c1487125 if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 72b51d2db04c6cc8a3c4f9bf350e40873ef51d8c..a4e97284add91c54508759e7d38d9c992fdff89a 100644 +index a647855f277d79d4ebbf370cff0d15991acbb308..6afa859dd0d18d57ba438e34a73b512a137d7cb0 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -378,6 +378,7 @@ public class PurpurWorldConfig { +@@ -376,6 +376,7 @@ public class PurpurWorldConfig { public boolean phantomSpawning; public boolean villagerTraderSpawning; public boolean villageSiegeSpawning; @@ -29,7 +29,7 @@ index 72b51d2db04c6cc8a3c4f9bf350e40873ef51d8c..a4e97284add91c54508759e7d38d9c99 private void mobSpawnerSettings() { // values of "default" or null will default to true only if the world environment is normal (aka overworld) Predicate predicate = (bool) -> (bool != null && bool) || (bool == null && environment == World.Environment.NORMAL); -@@ -386,6 +387,7 @@ public class PurpurWorldConfig { +@@ -384,6 +385,7 @@ public class PurpurWorldConfig { phantomSpawning = getBoolean("gameplay-mechanics.mob-spawning.phantoms", predicate); villagerTraderSpawning = getBoolean("gameplay-mechanics.mob-spawning.wandering-traders", predicate); villageSiegeSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-sieges", predicate); diff --git a/patches/unapplied-server/0258-Add-skeleton-bow-accuracy-option.patch b/patches/server/0253-Add-skeleton-bow-accuracy-option.patch similarity index 66% rename from patches/unapplied-server/0258-Add-skeleton-bow-accuracy-option.patch rename to patches/server/0253-Add-skeleton-bow-accuracy-option.patch index ce64a75b8..f3006fb16 100644 --- a/patches/unapplied-server/0258-Add-skeleton-bow-accuracy-option.patch +++ b/patches/server/0253-Add-skeleton-bow-accuracy-option.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Add skeleton bow accuracy option diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index 4aeb23de31e826d5cf27f8c91bd60c911f769a17..f9532a45419699585d1f20d27d5857a3e953ec55 100644 +index 2cadbc0d56908ca978e1735eff07f5e634548606..39d02cf0e31832e30c4f034b0b5385e3e0057e60 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -185,7 +185,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo - double d2 = target.getZ() - this.getZ(); - double d3 = Math.sqrt(d0 * d0 + d2 * d2); +@@ -197,7 +197,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo + } -- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4)); -+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, this.level().purpurConfig.skeletonBowAccuracyMap.getOrDefault(this.level().getDifficulty().getId(), (float) (14 - this.level().getDifficulty().getId() * 4))); // Purpur - // CraftBukkit start - org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper - if (event.isCancelled()) { + if (event.getProjectile() == entityarrow.getBukkitEntity()) { +- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4)); ++ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, this.level().purpurConfig.skeletonBowAccuracyMap.getOrDefault(this.level().getDifficulty().getId(), (float) (14 - this.level().getDifficulty().getId() * 4))); // Purpur + } + // CraftBukkit end + } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index a4e97284add91c54508759e7d38d9c992fdff89a..cb2ef867f74711c9e7f111c833b2aefb9c32a672 100644 +index 6afa859dd0d18d57ba438e34a73b512a137d7cb0..c5028b16ee9ae1ad042bb99f5398163e28c48d12 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -2589,6 +2589,8 @@ public class PurpurWorldConfig { +@@ -2585,6 +2585,8 @@ public class PurpurWorldConfig { public boolean skeletonAlwaysDropExp = false; public double skeletonHeadVisibilityPercent = 0.5D; public int skeletonFeedWitherRoses = 0; @@ -30,7 +30,7 @@ index a4e97284add91c54508759e7d38d9c992fdff89a..cb2ef867f74711c9e7f111c833b2aefb private void skeletonSettings() { skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable); skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater); -@@ -2604,6 +2606,18 @@ public class PurpurWorldConfig { +@@ -2600,6 +2602,18 @@ public class PurpurWorldConfig { skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp); skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent); skeletonFeedWitherRoses = getInt("mobs.skeleton.feed-wither-roses", skeletonFeedWitherRoses); diff --git a/patches/unapplied-server/0259-Add-death-screen-API.patch b/patches/server/0254-Add-death-screen-API.patch similarity index 87% rename from patches/unapplied-server/0259-Add-death-screen-API.patch rename to patches/server/0254-Add-death-screen-API.patch index 38a0f1a44..678522759 100644 --- a/patches/unapplied-server/0259-Add-death-screen-API.patch +++ b/patches/server/0254-Add-death-screen-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add death screen API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 531632ed0a1adaf87acf9bdd651001e9157b1200..1dd883ac37389b67a380680b868e665daef3938e 100644 +index c4935709b031a98f58c7de3b40e18dc558f76741..820ddd8114af64d72fcf0b8757f2058c909956c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3655,5 +3655,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3685,5 +3685,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (this.getHandle().connection == null) return; this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload())); } diff --git a/patches/unapplied-server/0261-Implement-ram-and-rambar-commands.patch b/patches/server/0255-Implement-ram-and-rambar-commands.patch similarity index 96% rename from patches/unapplied-server/0261-Implement-ram-and-rambar-commands.patch rename to patches/server/0255-Implement-ram-and-rambar-commands.patch index 47f81944e..aa9527ab1 100644 --- a/patches/unapplied-server/0261-Implement-ram-and-rambar-commands.patch +++ b/patches/server/0255-Implement-ram-and-rambar-commands.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement ram and rambar commands diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 7e0a05608a205ab81b3597dd3a9b5d4446d92fec..4fa19a701a61ad359f07d2e3ff99c731c9a60f43 100644 +index 0ba926b6ff0bd54159765cc7f37d1753ded89dee..cbbddb924f46203bd600b838fc22902cbcb2124b 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -256,6 +256,8 @@ public class Commands { +@@ -261,6 +261,8 @@ public class Commands { org.purpurmc.purpur.command.UptimeCommand.register(this.dispatcher); // Purpur org.purpurmc.purpur.command.TPSBarCommand.register(this.dispatcher); // Purpur org.purpurmc.purpur.command.CompassCommand.register(this.dispatcher); // Purpur @@ -18,10 +18,10 @@ index 7e0a05608a205ab81b3597dd3a9b5d4446d92fec..4fa19a701a61ad359f07d2e3ff99c731 if (environment.includeIntegrated) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d8bff9a83c4c2ad1ec1e7d44aac23068f6dc930b..4f72ce384f4c0dbae98effa89aed5c3bb802e635 100644 +index 5b4edb2386bb624d3633385106472070868acccc..b7ba01f174aa8a4c43684866f62fbeadbdf24a2f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -305,6 +305,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -326,6 +326,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public boolean purpurClient = false; // Purpur private boolean tpsBar = false; // Purpur private boolean compassBar = false; // Purpur @@ -29,7 +29,7 @@ index d8bff9a83c4c2ad1ec1e7d44aac23068f6dc930b..4f72ce384f4c0dbae98effa89aed5c3b // Paper start - rewrite chunk system private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; -@@ -604,6 +605,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -690,6 +691,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple if (nbt.contains("Purpur.TPSBar")) { this.tpsBar = nbt.getBoolean("Purpur.TPSBar"); } // Purpur if (nbt.contains("Purpur.CompassBar")) { this.compassBar = nbt.getBoolean("Purpur.CompassBar"); } // Purpur @@ -37,15 +37,15 @@ index d8bff9a83c4c2ad1ec1e7d44aac23068f6dc930b..4f72ce384f4c0dbae98effa89aed5c3b } @Override -@@ -680,6 +682,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - }); +@@ -742,6 +744,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple } + this.saveEnderPearls(nbt); + nbt.putBoolean("Purpur.RamBar", this.ramBar); // Purpur nbt.putBoolean("Purpur.TPSBar", this.tpsBar); // Purpur nbt.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur } -@@ -3104,5 +3107,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -3459,5 +3462,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public void compassBar(boolean compassBar) { this.compassBar = compassBar; } @@ -60,7 +60,7 @@ index d8bff9a83c4c2ad1ec1e7d44aac23068f6dc930b..4f72ce384f4c0dbae98effa89aed5c3b // Purpur end } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 585fa894e7c4b72b93de6a5abb60471b1689f9b6..b49138a7bc45d6d56f7fab393e9b1e11e4a2ec40 100644 +index afb165af34f365210fdfa6542cf7a81435096738..7ce9115c4a90e22befdd6b82c2e6588f2be3a07c 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -184,6 +184,8 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0262-Configurable-block-blast-resistance.patch b/patches/server/0256-Configurable-block-blast-resistance.patch similarity index 88% rename from patches/unapplied-server/0262-Configurable-block-blast-resistance.patch rename to patches/server/0256-Configurable-block-blast-resistance.patch index adc974e57..56c131598 100644 --- a/patches/unapplied-server/0262-Configurable-block-blast-resistance.patch +++ b/patches/server/0256-Configurable-block-blast-resistance.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable block blast resistance diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index dd607038f42a73f6311d7a6003a2cf57c1589c83..40f15a30b1a0dd2040e75045f32f33082e70aaeb 100644 +index 6b987ee220d94b482d2aeb4ff6bf271853605dc1..852bfe68ab722a5cbdd90dbd70501b751fe81a78 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -86,7 +86,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -91,7 +91,7 @@ public abstract class BlockBehaviour implements FeatureElement { protected static final Direction[] UPDATE_SHAPE_ORDER = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; public final boolean hasCollision; @@ -18,10 +18,10 @@ index dd607038f42a73f6311d7a6003a2cf57c1589c83..40f15a30b1a0dd2040e75045f32f3308 protected final SoundType soundType; protected final float friction; diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index b49138a7bc45d6d56f7fab393e9b1e11e4a2ec40..061a364c4c0b0a3117e8a3ae09386b27c0a24c7f 100644 +index 7ce9115c4a90e22befdd6b82c2e6588f2be3a07c..60f522926b5c8dada7720142573d03af34e5a330 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -499,4 +499,19 @@ public class PurpurConfig { +@@ -497,4 +497,19 @@ public class PurpurConfig { String setPattern = getString("settings.username-valid-characters", defaultPattern); usernameValidCharactersPattern = java.util.regex.Pattern.compile(setPattern == null || setPattern.isBlank() ? defaultPattern : setPattern); } diff --git a/patches/unapplied-server/0263-Configurable-block-fall-damage-modifiers.patch b/patches/server/0257-Configurable-block-fall-damage-modifiers.patch similarity index 91% rename from patches/unapplied-server/0263-Configurable-block-fall-damage-modifiers.patch rename to patches/server/0257-Configurable-block-fall-damage-modifiers.patch index 88f37db3e..9be8ba33c 100644 --- a/patches/unapplied-server/0263-Configurable-block-fall-damage-modifiers.patch +++ b/patches/server/0257-Configurable-block-fall-damage-modifiers.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable block fall damage modifiers diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index b59dd6b512021c335f3c21999958e2ea081daf69..17c994a39a1b99cc7727e328ce7493d534247a21 100644 +index 3b19395f2ddee654a77df5738a1942a08c20c179..c130d316e87f1f896d33ab43831063a89e3bef2b 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -181,7 +181,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -183,7 +183,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock @Override public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { @@ -18,7 +18,7 @@ index b59dd6b512021c335f3c21999958e2ea081daf69..17c994a39a1b99cc7727e328ce7493d5 @Override diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 6673133b93677d9329bab814ee64e37de3578dde..4ff7e3693305069e7fad185802a3b0481ab70a4a 100644 +index e8c649d1db3dd82bb544aa6e96b6a19e96559b09..395a093c1daf8236faaa92405472a500afc3ce68 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -88,6 +88,10 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -32,7 +32,7 @@ index 6673133b93677d9329bab814ee64e37de3578dde..4ff7e3693305069e7fad185802a3b048 // Paper start public final boolean isDestroyable() { return io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits || -@@ -485,7 +489,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -480,7 +484,7 @@ public class Block extends BlockBehaviour implements ItemLike { } public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { @@ -40,7 +40,7 @@ index 6673133b93677d9329bab814ee64e37de3578dde..4ff7e3693305069e7fad185802a3b048 + entity.causeFallDamage(fallDistance * fallDistanceMultiplier, fallDamageMultiplier, entity.damageSources().fall()); // Purpur } - public void updateEntityAfterFallOn(BlockGetter world, Entity entity) { + public void updateEntityMovementAfterFallOn(BlockGetter world, Entity entity) { diff --git a/src/main/java/net/minecraft/world/level/block/HayBlock.java b/src/main/java/net/minecraft/world/level/block/HayBlock.java index ef364aa171a48482a45bc18cfe730ec20c3f7be6..74971d90506aa253d5ee821b5390fb2551a3a393 100644 --- a/src/main/java/net/minecraft/world/level/block/HayBlock.java @@ -54,10 +54,10 @@ index ef364aa171a48482a45bc18cfe730ec20c3f7be6..74971d90506aa253d5ee821b5390fb25 } } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 061a364c4c0b0a3117e8a3ae09386b27c0a24c7f..c8540178affcffaf0e300b612b21fdca006b6350 100644 +index 60f522926b5c8dada7720142573d03af34e5a330..0304e57559d6791cf4ddbec1a8dd2c2b6caa2d8e 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -514,4 +514,50 @@ public class PurpurConfig { +@@ -512,4 +512,50 @@ public class PurpurConfig { block.explosionResistance = blastResistance.floatValue(); }); } diff --git a/patches/unapplied-server/0264-Language-API.patch b/patches/server/0258-Language-API.patch similarity index 89% rename from patches/unapplied-server/0264-Language-API.patch rename to patches/server/0258-Language-API.patch index 7606de6fc..f10a80be0 100644 --- a/patches/unapplied-server/0264-Language-API.patch +++ b/patches/server/0258-Language-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Language API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 300c8a94771d56e6bb6da692092882c329a9f0e4..479a8422a6786a8ada8536d528e7f57a06c8107a 100644 +index da3c89bc037c42268987c5923ca58c93adace80d..8499ed65b3af621d25474c55fb23c35c0f7e127c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -411,6 +411,20 @@ public final class CraftServer implements Server { +@@ -413,6 +413,20 @@ public final class CraftServer implements Server { this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager); this.pluginManager.paperPluginManager = this.paperPluginManager; // Paper end diff --git a/patches/unapplied-server/0265-Milk-Keeps-Beneficial-Effects.patch b/patches/server/0259-Milk-Keeps-Beneficial-Effects.patch similarity index 59% rename from patches/unapplied-server/0265-Milk-Keeps-Beneficial-Effects.patch rename to patches/server/0259-Milk-Keeps-Beneficial-Effects.patch index 290761d73..6260f3dca 100644 --- a/patches/unapplied-server/0265-Milk-Keeps-Beneficial-Effects.patch +++ b/patches/server/0259-Milk-Keeps-Beneficial-Effects.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Milk Keeps Beneficial Effects diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7e00f1f875c7761cfbc1964a3d76da08c36c60f1..f714e2dc212a3b70977e93c55e94f8b272c5b02d 100644 +index 38a7bde1bc2836352a62dfe1dd3b9a60877c20e2..ade67ca5e0b203f9554b792302da576c6d419ea5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1129,6 +1129,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - for (flag = false; iterator.hasNext(); flag = true) { - // CraftBukkit start - MobEffectInstance effect = (MobEffectInstance) iterator.next(); +@@ -1151,6 +1151,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + + while (iterator.hasNext()) { + MobEffectInstance effect = iterator.next(); + if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); if (event.isCancelled()) { continue; diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index d342752271c76b447bb8cde50d57407259b93c43..360514d5afcafcf6dd83335938bfa09bb02e41d0 100644 +index ac4b31ab1297b34b5105c7bdc30ddea6d2d5e9a3..959e10586cddaae2590d2d84f5fd809dad80889b 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -115,7 +115,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -116,7 +116,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill return this.canDrinkPotion && this.level().isNight() && !entityvillagertrader.isInvisible(); // Paper - Add more WanderingTrader API })); this.goalSelector.addGoal(0, new UseItemGoal<>(this, new ItemStack(Items.MILK_BUCKET), SoundEvents.WANDERING_TRADER_REAPPEARED, (entityvillagertrader) -> { @@ -30,22 +30,22 @@ index d342752271c76b447bb8cde50d57407259b93c43..360514d5afcafcf6dd83335938bfa09b this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this)); this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Zombie.class, 8.0F, 0.5D, 0.5D)); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index cb2ef867f74711c9e7f111c833b2aefb9c32a672..267b3b4f0977f13ee166a3662b864de32975ade8 100644 +index c5028b16ee9ae1ad042bb99f5398163e28c48d12..ebc20d82351dc6b9834a3dcb3ed61d22e821a45c 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -131,6 +131,7 @@ public class PurpurWorldConfig { - public boolean imposeTeleportRestrictionsOnNetherPortals = false; - public boolean imposeTeleportRestrictionsOnEndPortals = false; - public boolean milkCuresBadOmen = true; -+ public boolean milkClearsBeneficialEffects = true; - public boolean noteBlockIgnoreAbove = false; - public boolean persistentDroppableEntityDisplayNames = true; +@@ -144,6 +144,7 @@ public class PurpurWorldConfig { public boolean persistentTileEntityLore = false; -@@ -158,6 +159,7 @@ public class PurpurWorldConfig { - imposeTeleportRestrictionsOnNetherPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-nether-portals", imposeTeleportRestrictionsOnNetherPortals); - imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals); - milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen); + public boolean persistentTileEntityDisplayName = true; + public int mobLastHurtByPlayerTime = 100; ++ public boolean milkClearsBeneficialEffects = true; + private void miscGameplayMechanicsSettings() { + useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending); + alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative); +@@ -176,6 +177,7 @@ public class PurpurWorldConfig { + persistentTileEntityLore = getBoolean("gameplay-mechanics.persistent-tileentity-lore", persistentTileEntityLore); + persistentTileEntityDisplayName = getBoolean("gameplay-mechanics.persistent-tileentity-display-name", persistentTileEntityDisplayName); + mobLastHurtByPlayerTime = getInt("gameplay-mechanics.mob-last-hurt-by-player-time", mobLastHurtByPlayerTime); + milkClearsBeneficialEffects = getBoolean("gameplay-mechanics.milk-clears-beneficial-effects", milkClearsBeneficialEffects); - noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove); - if (PurpurConfig.version < 35) { - boolean oldVal = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityLore); + } + + public int daytimeTicks = 12000; diff --git a/patches/unapplied-server/0266-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch b/patches/server/0260-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch similarity index 100% rename from patches/unapplied-server/0266-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch rename to patches/server/0260-MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch diff --git a/patches/unapplied-server/0267-Add-log-suppression-for-LibraryLoader.patch b/patches/server/0261-Add-log-suppression-for-LibraryLoader.patch similarity index 91% rename from patches/unapplied-server/0267-Add-log-suppression-for-LibraryLoader.patch rename to patches/server/0261-Add-log-suppression-for-LibraryLoader.patch index c4235b2bd..955c232dd 100644 --- a/patches/unapplied-server/0267-Add-log-suppression-for-LibraryLoader.patch +++ b/patches/server/0261-Add-log-suppression-for-LibraryLoader.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add log suppression for LibraryLoader diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index c8540178affcffaf0e300b612b21fdca006b6350..d6b99dd0fffaf3247ddfc5dd23dffdc2fb4e7897 100644 +index 0304e57559d6791cf4ddbec1a8dd2c2b6caa2d8e..e13ec4125047db4edc9dc5de3a2adcdde51bce12 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -472,11 +472,14 @@ public class PurpurConfig { +@@ -470,11 +470,14 @@ public class PurpurConfig { public static boolean loggerSuppressIgnoredAdvancementWarnings = false; public static boolean loggerSuppressUnrecognizedRecipeErrors = false; public static boolean loggerSuppressSetBlockFarChunk = false; diff --git a/patches/unapplied-server/0268-Add-an-option-to-fix-MC-3304-projectile-looting.patch b/patches/server/0262-Add-an-option-to-fix-MC-3304-projectile-looting.patch similarity index 72% rename from patches/unapplied-server/0268-Add-an-option-to-fix-MC-3304-projectile-looting.patch rename to patches/server/0262-Add-an-option-to-fix-MC-3304-projectile-looting.patch index 845209a2c..1ea21d23d 100644 --- a/patches/unapplied-server/0268-Add-an-option-to-fix-MC-3304-projectile-looting.patch +++ b/patches/server/0262-Add-an-option-to-fix-MC-3304-projectile-looting.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add an option to fix MC-3304 (projectile looting) diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 2ace900721f4aa185b8ed28ac95feb50cb89453f..1dd61ee306231f77664dee7e4f2b617fe2e3659f 100644 +index 75d65b795a7802c0c5b5bd4a6ed429209f987452..f91519f73e766cf891351a95d76abb416da2f957 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -80,6 +80,7 @@ public abstract class AbstractArrow extends Projectile { @@ -16,7 +16,7 @@ index 2ace900721f4aa185b8ed28ac95feb50cb89453f..1dd61ee306231f77664dee7e4f2b617f // Spigot Start @Override -@@ -589,6 +590,12 @@ public abstract class AbstractArrow extends Projectile { +@@ -623,6 +624,12 @@ public abstract class AbstractArrow extends Projectile { return this.firedFromWeapon; } @@ -30,10 +30,10 @@ index 2ace900721f4aa185b8ed28ac95feb50cb89453f..1dd61ee306231f77664dee7e4f2b617f return SoundEvents.ARROW_HIT; } diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java -index 32dd0b13a0819f597d8a93c6bc3a155781067544..9751eea2d8aa3a45da34f09377d2fc81fe9a90d8 100644 +index 78ba170a83f8c026bd110eae494c52577182ed61..c2ae50872cead7202246b9cce4db6e0a81e1cf5f 100644 --- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java +++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java -@@ -110,6 +110,8 @@ public abstract class ProjectileWeaponItem extends Item { +@@ -105,6 +105,8 @@ public abstract class ProjectileWeaponItem extends Item { entityarrow.setCritArrow(true); } @@ -43,24 +43,25 @@ index 32dd0b13a0819f597d8a93c6bc3a155781067544..9751eea2d8aa3a45da34f09377d2fc81 } diff --git a/src/main/java/net/minecraft/world/item/TridentItem.java b/src/main/java/net/minecraft/world/item/TridentItem.java -index 1be074074283f12543ac771ac9201580e7736289..8cf0b69fee110af05b89afa8e3236575aa6850e2 100644 +index 4e863ae1f94291b391a142e04e0c41e83417ab70..d7eb680b977656556a618431b1511c1050f6db5e 100644 --- a/src/main/java/net/minecraft/world/item/TridentItem.java +++ b/src/main/java/net/minecraft/world/item/TridentItem.java -@@ -86,6 +86,8 @@ public class TridentItem extends Item implements ProjectileItem { - entitythrowntrident.pickup = AbstractArrow.Pickup.CREATIVE_ONLY; - } - -+ entitythrowntrident.setActualEnchantments(stack.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting +@@ -100,6 +100,9 @@ public class TridentItem extends Item implements ProjectileItem { + return false; + } + ThrownTrident entitythrowntrident = tridentDelayed.projectile(); // Paper - PlayerLaunchProjectileEvent + - // CraftBukkit start - // Paper start - PlayerLaunchProjectileEvent - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), (org.bukkit.entity.Projectile) entitythrowntrident.getBukkitEntity()); ++ entitythrowntrident.setActualEnchantments(stack.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting ++ + if (event.shouldConsume()) stack.hurtWithoutBreaking(1, entityhuman); // Paper - PlayerLaunchProjectileEvent + entitythrowntrident.pickupItemStack = stack.copy(); // SPIGOT-4511 update since damage call moved + // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java -index d86189bd446c7cd7215cfbcef72b2125a064e3d1..53608b9dbb81c58819b9ae6bc676ffb3ed01ce70 100644 +index 5f27e1ce23f2ed68e4c8af1986fafce940dbf826..3eff81e1e83e8f4fa4b91ea5d472407e6081f01b 100644 --- a/src/main/java/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java +++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java @@ -66,6 +66,11 @@ public class EnchantedCountIncreaseFunction extends LootItemConditionalFunction - Entity entity = context.getParamOrNull(LootContextParams.ATTACKING_ENTITY); + Entity entity = context.getOptionalParameter(LootContextParams.ATTACKING_ENTITY); if (entity instanceof LivingEntity livingEntity) { int i = EnchantmentHelper.getEnchantmentLevel(this.enchantment, livingEntity); + // Purpur start - Add an option to fix MC-3304 projectile looting @@ -72,10 +73,10 @@ index d86189bd446c7cd7215cfbcef72b2125a064e3d1..53608b9dbb81c58819b9ae6bc676ffb3 return stack; } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index d6b99dd0fffaf3247ddfc5dd23dffdc2fb4e7897..9a60abb073d9512cb85b1ea1ae542d07e594300e 100644 +index e13ec4125047db4edc9dc5de3a2adcdde51bce12..b881bfac6c8204bfe7ccd38583daf48013c5f639 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -503,6 +503,11 @@ public class PurpurConfig { +@@ -501,6 +501,11 @@ public class PurpurConfig { usernameValidCharactersPattern = java.util.regex.Pattern.compile(setPattern == null || setPattern.isBlank() ? defaultPattern : setPattern); } diff --git a/patches/unapplied-server/0269-Add-option-to-allow-creeper-to-encircle-target-when-.patch b/patches/server/0263-Add-option-to-allow-creeper-to-encircle-target-when-.patch similarity index 92% rename from patches/unapplied-server/0269-Add-option-to-allow-creeper-to-encircle-target-when-.patch rename to patches/server/0263-Add-option-to-allow-creeper-to-encircle-target-when-.patch index 61b02c6a6..b8f7eefba 100644 --- a/patches/unapplied-server/0269-Add-option-to-allow-creeper-to-encircle-target-when-.patch +++ b/patches/server/0263-Add-option-to-allow-creeper-to-encircle-target-when-.patch @@ -24,10 +24,10 @@ index 137ec75ee803789deb7b1ca93dd9369c9af362b9..ca95d25af3e9a0536868b0c7fd8e7d2f } } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 267b3b4f0977f13ee166a3662b864de32975ade8..6f1a035e5e1d8f7477fc311eceff24b4e92e2b35 100644 +index ebc20d82351dc6b9834a3dcb3ed61d22e821a45c..f8a0049919f7542d8eccf5f2b1b5d2ee1a696943 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -1426,6 +1426,7 @@ public class PurpurWorldConfig { +@@ -1424,6 +1424,7 @@ public class PurpurWorldConfig { public boolean creeperHealthRadius = false; public boolean creeperAlwaysDropExp = false; public double creeperHeadVisibilityPercent = 0.5D; @@ -35,7 +35,7 @@ index 267b3b4f0977f13ee166a3662b864de32975ade8..6f1a035e5e1d8f7477fc311eceff24b4 private void creeperSettings() { creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable); creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater); -@@ -1445,6 +1446,7 @@ public class PurpurWorldConfig { +@@ -1443,6 +1444,7 @@ public class PurpurWorldConfig { creeperHealthRadius = getBoolean("mobs.creeper.health-impacts-explosion", creeperHealthRadius); creeperAlwaysDropExp = getBoolean("mobs.creeper.always-drop-exp", creeperAlwaysDropExp); creeperHeadVisibilityPercent = getDouble("mobs.creeper.head-visibility-percent", creeperHeadVisibilityPercent); diff --git a/patches/unapplied-server/0270-Fire-Immunity-API.patch b/patches/server/0264-Fire-Immunity-API.patch similarity index 80% rename from patches/unapplied-server/0270-Fire-Immunity-API.patch rename to patches/server/0264-Fire-Immunity-API.patch index e45ebe28d..fd84b135e 100644 --- a/patches/unapplied-server/0270-Fire-Immunity-API.patch +++ b/patches/server/0264-Fire-Immunity-API.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Fire Immunity API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 95885f71825cbf1e46001d60f81dc88049ec6e22..0e3494fc7a073eb6cde1a2e62303b1238d59b156 100644 +index 1bab4593cfb738ed6253482d36dc99b755d4e55f..285ef87b7088f905bb77c408465ccbca6644454f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -433,6 +433,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - public boolean activatedPriorityReset = false; // Pufferfish - DAB - public int activatedPriority = gg.pufferfish.pufferfish.PufferfishConfig.maximumActivationPrio; // Pufferfish - DAB (golf score) - public final BlockPos.MutableBlockPos cachedBlockPos = new BlockPos.MutableBlockPos(); // Pufferfish - reduce entity allocations +@@ -432,6 +432,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + private UUID originWorld; + public boolean freezeLocked = false; // Paper - Freeze Tick Lock API + public boolean fixedPose = false; // Paper - Expand Pose API + public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -1880,7 +1881,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1950,7 +1951,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean fireImmune() { @@ -25,7 +25,7 @@ index 95885f71825cbf1e46001d60f81dc88049ec6e22..0e3494fc7a073eb6cde1a2e62303b123 } public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { -@@ -2589,6 +2590,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2705,6 +2706,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess nbttagcompound.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -37,7 +37,7 @@ index 95885f71825cbf1e46001d60f81dc88049ec6e22..0e3494fc7a073eb6cde1a2e62303b123 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2736,6 +2742,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2853,6 +2859,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -50,10 +50,10 @@ index 95885f71825cbf1e46001d60f81dc88049ec6e22..0e3494fc7a073eb6cde1a2e62303b123 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 7b7a58039eb1a288262228444712c84d6e2aef24..770606c4462d85d116f6d0bf91192dc49f438d0f 100644 +index b5885d16cd3371d34bd031bd00a22a0ba6db6509..cc7d5aeb2044019aabad93dd79a16178c7483037 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -87,6 +87,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -88,6 +88,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Purpur start - API for any mob to burn daylight diff --git a/patches/unapplied-server/0271-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch b/patches/server/0265-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch similarity index 86% rename from patches/unapplied-server/0271-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch rename to patches/server/0265-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch index d519d9b3f..13513ea71 100644 --- a/patches/unapplied-server/0271-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch +++ b/patches/server/0265-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option to teleport to spawn on nether ceiling damage diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0e3494fc7a073eb6cde1a2e62303b1238d59b156..7aadcaa1785c6560eb1ce2f1179225facca47d84 100644 +index 285ef87b7088f905bb77c408465ccbca6644454f..49da1a25e39d6e58786f6f20177610d5aa7626f6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -970,6 +970,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1032,6 +1032,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { // Paper end - Configurable nether ceiling damage @@ -17,10 +17,10 @@ index 0e3494fc7a073eb6cde1a2e62303b1238d59b156..7aadcaa1785c6560eb1ce2f1179225fa } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 6f1a035e5e1d8f7477fc311eceff24b4e92e2b35..05572fa65d666afb6af697c398521457dea9821d 100644 +index f8a0049919f7542d8eccf5f2b1b5d2ee1a696943..c6d307c69afd9fc58c4bde7f8b755d96d9bcf9d6 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -418,6 +418,7 @@ public class PurpurWorldConfig { +@@ -416,6 +416,7 @@ public class PurpurWorldConfig { public String playerDeathExpDropEquation = "expLevel * 7"; public int playerDeathExpDropMax = 100; public boolean teleportIfOutsideBorder = false; @@ -28,7 +28,7 @@ index 6f1a035e5e1d8f7477fc311eceff24b4e92e2b35..05572fa65d666afb6af697c398521457 public boolean totemOfUndyingWorksInInventory = false; public boolean playerFixStuckPortal = false; public boolean creativeOnePunch = false; -@@ -445,6 +446,7 @@ public class PurpurWorldConfig { +@@ -443,6 +444,7 @@ public class PurpurWorldConfig { playerDeathExpDropEquation = getString("gameplay-mechanics.player.exp-dropped-on-death.equation", playerDeathExpDropEquation); playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax); teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder); diff --git a/patches/unapplied-server/0272-Added-got-ram-event.patch b/patches/server/0266-Added-got-ram-event.patch similarity index 86% rename from patches/unapplied-server/0272-Added-got-ram-event.patch rename to patches/server/0266-Added-got-ram-event.patch index 5a1c62812..dcb26dc15 100644 --- a/patches/unapplied-server/0272-Added-got-ram-event.patch +++ b/patches/server/0266-Added-got-ram-event.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added got ram event diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index 1b298bfb440e5ddcc88b0b41e8c733b3883c5998..004a0212540c0a9061eb3aed458857d3da4c1c3d 100644 +index 51dcc3893b964e6d20a2b963d3105a2687b3c426..ebf53d48b09918c7453f982a5e4f9a1584dfc544 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -429,6 +429,7 @@ public class Goat extends Animal { +@@ -432,6 +432,7 @@ public class Goat extends Animal { // Paper start - Goat ram API public void ram(net.minecraft.world.entity.LivingEntity entity) { diff --git a/patches/unapplied-server/0273-Log-skipped-entity-s-position.patch b/patches/server/0267-Log-skipped-entity-s-position.patch similarity index 86% rename from patches/unapplied-server/0273-Log-skipped-entity-s-position.patch rename to patches/server/0267-Log-skipped-entity-s-position.patch index 634716115..1357e3005 100644 --- a/patches/unapplied-server/0273-Log-skipped-entity-s-position.patch +++ b/patches/server/0267-Log-skipped-entity-s-position.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Log skipped entity's position diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index bad5b622477a637440649ec18ea5a79c321bc523..d3de0362dd1ef3954d05c4d8fa56a25edfe1bb2b 100644 +index 663dde75a9fc4fd7323ae9abe73cdb83aa74f2b3..f297e771e677ddefa3bf0d6f50d04f2e50197c30 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -627,6 +627,12 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -691,6 +691,12 @@ public class EntityType implements FeatureElement, EntityTypeT entity.load(nbt); }, () -> { EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); diff --git a/patches/unapplied-server/0274-End-Crystal-Cramming.patch b/patches/server/0268-End-Crystal-Cramming.patch similarity index 87% rename from patches/unapplied-server/0274-End-Crystal-Cramming.patch rename to patches/server/0268-End-Crystal-Cramming.patch index efaf8143b..ce1a99167 100644 --- a/patches/unapplied-server/0274-End-Crystal-Cramming.patch +++ b/patches/server/0268-End-Crystal-Cramming.patch @@ -5,7 +5,7 @@ Subject: [PATCH] End Crystal Cramming diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java -index 02f1d0418395b100cabfad7294466aaad34ac7c6..c0275197cc9aab2a49d88476e072a94f8e17e9ee 100644 +index 305c3350116f656c3d0e6134e4d8023eac50f3ad..b1db1e92de3a88a0f0e0fdb42b0bf9732095c8a9 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java @@ -102,6 +102,7 @@ public class EndCrystal extends Entity { @@ -17,10 +17,10 @@ index 02f1d0418395b100cabfad7294466aaad34ac7c6..c0275197cc9aab2a49d88476e072a94f // Purpur start diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 05572fa65d666afb6af697c398521457dea9821d..1b8386bbdf197d5f241f821fec2b4ba3d5b53f72 100644 +index c6d307c69afd9fc58c4bde7f8b755d96d9bcf9d6..91d4c39e72296147bc095c1fee943c63082cf848 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -915,6 +915,7 @@ public class PurpurWorldConfig { +@@ -913,6 +913,7 @@ public class PurpurWorldConfig { public double basedEndCrystalExplosionPower = 6.0D; public boolean basedEndCrystalExplosionFire = false; public net.minecraft.world.level.Level.ExplosionInteraction basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; @@ -28,7 +28,7 @@ index 05572fa65d666afb6af697c398521457dea9821d..1b8386bbdf197d5f241f821fec2b4ba3 private void endCrystalSettings() { if (PurpurConfig.version < 31) { if ("DESTROY".equals(getString("blocks.end-crystal.baseless.explosion-effect", baselessEndCrystalExplosionEffect.name()))) { -@@ -942,6 +943,7 @@ public class PurpurWorldConfig { +@@ -940,6 +941,7 @@ public class PurpurWorldConfig { log(Level.SEVERE, "Unknown value for `blocks.end-crystal.base.explosion-effect`! Using default of `BLOCK`"); basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; } diff --git a/patches/unapplied-server/0275-Option-to-allow-beacon-effects-when-covered-by-tinte.patch b/patches/server/0269-Option-to-allow-beacon-effects-when-covered-by-tinte.patch similarity index 90% rename from patches/unapplied-server/0275-Option-to-allow-beacon-effects-when-covered-by-tinte.patch rename to patches/server/0269-Option-to-allow-beacon-effects-when-covered-by-tinte.patch index 416598999..f9f8e15ee 100644 --- a/patches/unapplied-server/0275-Option-to-allow-beacon-effects-when-covered-by-tinte.patch +++ b/patches/server/0269-Option-to-allow-beacon-effects-when-covered-by-tinte.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Option to allow beacon effects when covered by tinted glass diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index d1fb77d83d48183a9a37dbeec7bb0fda623d7e9b..df02a78855f1d0c32d1f744c20803fc97a8085c0 100644 +index fbc6b0099af34b0247f6144a9cef020f9ccddeef..2d190b3a6378b8cbadfa65510df1ccfbd5882ef8 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -178,6 +178,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -23,7 +23,7 @@ index d1fb77d83d48183a9a37dbeec7bb0fda623d7e9b..df02a78855f1d0c32d1f744c20803fc9 + if (world.purpurConfig.beaconAllowEffectsWithTintedGlass && block.equals(Blocks.TINTED_GLASS)) { + isTintedGlass = true; + } - if (tileentitybeacon_beaconcolortracker == null || iblockdata1.getLightBlock(world, blockposition1) >= 15 && !iblockdata1.is(Blocks.BEDROCK)) { + if (tileentitybeacon_beaconcolortracker == null || iblockdata1.getLightBlock() >= 15 && !iblockdata1.is(Blocks.BEDROCK)) { blockEntity.checkingBeamSections.clear(); blockEntity.lastCheckY = l; @@ -230,7 +234,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -36,10 +36,10 @@ index d1fb77d83d48183a9a37dbeec7bb0fda623d7e9b..df02a78855f1d0c32d1f744c20803fc9 BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 1b8386bbdf197d5f241f821fec2b4ba3d5b53f72..ef6f0febae8db9e0c6a7a61e40c3498a7bf35375 100644 +index 91d4c39e72296147bc095c1fee943c63082cf848..fc772f2be46eada82f6a3db52fef930c82a76e6c 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -814,11 +814,13 @@ public class PurpurWorldConfig { +@@ -812,11 +812,13 @@ public class PurpurWorldConfig { public int beaconLevelTwo = 30; public int beaconLevelThree = 40; public int beaconLevelFour = 50; diff --git a/patches/unapplied-server/0276-Add-attribute-clamping-and-armor-limit-config.patch b/patches/server/0270-Add-attribute-clamping-and-armor-limit-config.patch similarity index 95% rename from patches/unapplied-server/0276-Add-attribute-clamping-and-armor-limit-config.patch rename to patches/server/0270-Add-attribute-clamping-and-armor-limit-config.patch index 79e236e37..dd577e894 100644 --- a/patches/unapplied-server/0276-Add-attribute-clamping-and-armor-limit-config.patch +++ b/patches/server/0270-Add-attribute-clamping-and-armor-limit-config.patch @@ -39,10 +39,10 @@ index f0703302e7dbbda88de8c648d20d87c55ed9b1e0..a913ebabaa5f443afa987b972355a8f8 } } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 9a60abb073d9512cb85b1ea1ae542d07e594300e..c5a516d647dd694b311013a7b2b0dac9d30b94c6 100644 +index b881bfac6c8204bfe7ccd38583daf48013c5f639..569d178584ddafd38c476e56ed1809da0ddc3b1f 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -508,6 +508,16 @@ public class PurpurConfig { +@@ -506,6 +506,16 @@ public class PurpurConfig { fixProjectileLootingTransfer = getBoolean("settings.fix-projectile-looting-transfer", fixProjectileLootingTransfer); } diff --git a/patches/unapplied-server/0277-Config-to-remove-explosion-radius-clamp.patch b/patches/server/0271-Config-to-remove-explosion-radius-clamp.patch similarity index 61% rename from patches/unapplied-server/0277-Config-to-remove-explosion-radius-clamp.patch rename to patches/server/0271-Config-to-remove-explosion-radius-clamp.patch index d6ec03560..1e7304e10 100644 --- a/patches/unapplied-server/0277-Config-to-remove-explosion-radius-clamp.patch +++ b/patches/server/0271-Config-to-remove-explosion-radius-clamp.patch @@ -4,20 +4,20 @@ Date: Mon, 9 Jan 2023 19:45:55 -0500 Subject: [PATCH] Config to remove explosion radius clamp -diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 6395bd2ffd734ca73af17b003d1505971ea31a48..261613d254edef33431794d5e1f7802cc8793a6e 100644 ---- a/src/main/java/net/minecraft/world/level/Explosion.java -+++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -341,7 +341,7 @@ public class Explosion { - this.hitPlayers = Maps.newHashMap(); +diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java +index bbbd451ff184be8fa13bd93d53c89a9502f9951a..913f7d5fd9823eea9fad2d4e6689511f8d0cfda6 100644 +--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java ++++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java +@@ -311,7 +311,7 @@ public class ServerExplosion implements Explosion { + public ServerExplosion(ServerLevel world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, Vec3 pos, float power, boolean createFire, Explosion.BlockInteraction destructionType) { this.level = world; this.source = entity; - this.radius = (float) Math.max(power, 0.0); // CraftBukkit - clamp bad values + this.radius = (float) (world == null || world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur - this.x = x; - this.y = y; - this.z = z; -@@ -404,7 +404,7 @@ public class Explosion { + this.center = pos; + this.fire = createFire; + this.blockInteraction = destructionType; +@@ -666,7 +666,7 @@ public class ServerExplosion implements Explosion { public void explode() { // CraftBukkit start @@ -27,10 +27,10 @@ index 6395bd2ffd734ca73af17b003d1505971ea31a48..261613d254edef33431794d5e1f7802c } // CraftBukkit end diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index ef6f0febae8db9e0c6a7a61e40c3498a7bf35375..6076db7b948d932575a179d99dfae229f6f884ea 100644 +index fc772f2be46eada82f6a3db52fef930c82a76e6c..df551a65fbd722c15de5b5a14fb1dff60a839e85 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -225,6 +225,11 @@ public class PurpurWorldConfig { +@@ -223,6 +223,11 @@ public class PurpurWorldConfig { infinityWorksWithoutArrows = getBoolean("gameplay-mechanics.infinity-bow.works-without-arrows", infinityWorksWithoutArrows); } diff --git a/patches/unapplied-server/0278-bonemealable-sugarcane-cactus-and-netherwart.patch b/patches/server/0272-bonemealable-sugarcane-cactus-and-netherwart.patch similarity index 94% rename from patches/unapplied-server/0278-bonemealable-sugarcane-cactus-and-netherwart.patch rename to patches/server/0272-bonemealable-sugarcane-cactus-and-netherwart.patch index 9dfdb62cf..d8c014db7 100644 --- a/patches/unapplied-server/0278-bonemealable-sugarcane-cactus-and-netherwart.patch +++ b/patches/server/0272-bonemealable-sugarcane-cactus-and-netherwart.patch @@ -5,10 +5,10 @@ Subject: [PATCH] bonemealable sugarcane, cactus, and netherwart diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index 9200d75b05ce535f7b7f5c1572cd8f6261c6955b..066181ed274a492762baebf05bf51ac7848878cc 100644 +index bbfd8f5d404d0add94f0d8ac89a2964692b37e44..9f163ed07f8e6a5370c4c355b4e910f7a49b6bcd 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -@@ -23,7 +23,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; +@@ -24,7 +24,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit @@ -17,7 +17,7 @@ index 9200d75b05ce535f7b7f5c1572cd8f6261c6955b..066181ed274a492762baebf05bf51ac7 public static final MapCodec CODEC = simpleCodec(CactusBlock::new); public static final IntegerProperty AGE = BlockStateProperties.AGE_15; -@@ -134,4 +134,34 @@ public class CactusBlock extends Block { +@@ -135,4 +135,34 @@ public class CactusBlock extends Block { protected boolean isPathfindable(BlockState state, PathComputationType type) { return false; } @@ -89,7 +89,7 @@ index da1c7999ca64199387054de46489d3ff4a299289..b8355ea1de26c4b6905f477fb4e110f1 // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java -index c48c622e92cedeaa46b929c7adfedec98dd5a3fb..6449b5c424443b5f0ee7e3fce803449418fbed2a 100644 +index 547ea09ed84595286c97c128b3b96f6d387ae25f..d0f8a13f27132257ece6dadf736c2dc6b1e5720e 100644 --- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java @@ -20,7 +20,7 @@ import net.minecraft.world.level.material.FluidState; @@ -137,10 +137,10 @@ index c48c622e92cedeaa46b929c7adfedec98dd5a3fb..6449b5c424443b5f0ee7e3fce8034494 + // Purpur end } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 6076db7b948d932575a179d99dfae229f6f884ea..e363a2af2d5ac8bde8894017e5403213c1877823 100644 +index df551a65fbd722c15de5b5a14fb1dff60a839e85..44f6d8b1b4653bf4398f914045deadb9c34a3d35 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -868,8 +868,20 @@ public class PurpurWorldConfig { +@@ -866,8 +866,20 @@ public class PurpurWorldConfig { } public boolean cactusBreaksFromSolidNeighbors = true; diff --git a/patches/unapplied-server/0279-Add-PreExplodeEvents.patch b/patches/server/0273-Add-PreExplodeEvents.patch similarity index 65% rename from patches/unapplied-server/0279-Add-PreExplodeEvents.patch rename to patches/server/0273-Add-PreExplodeEvents.patch index 31b3a5e2d..e0195de0c 100644 --- a/patches/unapplied-server/0279-Add-PreExplodeEvents.patch +++ b/patches/server/0273-Add-PreExplodeEvents.patch @@ -4,24 +4,23 @@ Date: Mon, 26 Dec 2022 23:42:37 +0100 Subject: [PATCH] Add PreExplodeEvents -diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 261613d254edef33431794d5e1f7802cc8793a6e..4ea1ce1cface25b9bf0e3958d55ba2fbbff69a9e 100644 ---- a/src/main/java/net/minecraft/world/level/Explosion.java -+++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -408,6 +408,25 @@ public class Explosion { +diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java +index 913f7d5fd9823eea9fad2d4e6689511f8d0cfda6..3c3d219c9339f64c23ec0b31783bf68a4423636c 100644 +--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java ++++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java +@@ -670,6 +670,23 @@ public class ServerExplosion implements Explosion { return; } // CraftBukkit end -+ + // Purpur start - add PreExplodeEvents -+ if(this.source != null){ -+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z); ++ if (this.source != null) { ++ Location location = new Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); + if(!new org.purpurmc.purpur.event.entity.PreEntityExplodeEvent(this.source.getBukkitEntity(), location, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) { + this.wasCanceled = true; + return; + } -+ }else { -+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z); ++ } else { ++ Location location = new Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); + org.bukkit.block.Block block = location.getBlock(); + org.bukkit.block.BlockState blockState = (this.damageSource.getDirectBlockState() != null) ? this.damageSource.getDirectBlockState() : block.getState(); + if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) { @@ -29,8 +28,7 @@ index 261613d254edef33431794d5e1f7802cc8793a6e..4ea1ce1cface25b9bf0e3958d55ba2fb + return; + } + } -+ //Purpur end -+ - this.level.gameEvent(this.source, (Holder) GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z)); - ++ // Purpur end // Paper start - collision optimisations + this.blockCache = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(); + this.chunkPosCache = new long[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH]; diff --git a/patches/unapplied-server/0280-Improve-output-of-plugins-command.patch b/patches/server/0274-Improve-output-of-plugins-command.patch similarity index 100% rename from patches/unapplied-server/0280-Improve-output-of-plugins-command.patch rename to patches/server/0274-Improve-output-of-plugins-command.patch diff --git a/patches/unapplied-server/0281-Make-GUI-Great-Again.patch b/patches/server/0275-Make-GUI-Great-Again.patch similarity index 98% rename from patches/unapplied-server/0281-Make-GUI-Great-Again.patch rename to patches/server/0275-Make-GUI-Great-Again.patch index f377f2b43..58c76fab2 100644 --- a/patches/unapplied-server/0281-Make-GUI-Great-Again.patch +++ b/patches/server/0275-Make-GUI-Great-Again.patch @@ -96,10 +96,10 @@ index 0000000000000000000000000000000000000000..15a226e3854d731f7724025ea3459c8a + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 4bd75f2a4f932fc63efd4e4d884aa834184250fa..6e6f4dffceb0032153c5be119303c5809629cfcc 100644 +index 51abda23e30e56d79b3e020d0407c1cfe25d8ab9..73216c774f2ee5455c4b118180b2dcc2e3a24f0d 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -114,6 +114,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -113,6 +113,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface return; } // Paper start - Use TerminalConsoleAppender @@ -398,11 +398,11 @@ index 0000000000000000000000000000000000000000..d75fb5e77eff27d86135ed7d605dbc25 + } +} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index d2a75850af9c6ad2aca66a5f994f1b587d73eac4..a056aa167887abef9e6d531a9edd2cda433567d2 100644 +index 637d64da9938e51a97338b9253b43889585c67bb..f9313059b4e3b2d100e66ed8a70d4811dc394031 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -2,7 +2,16 @@ - + - diff --git a/patches/unapplied-server/0282-Stored-Bee-API.patch b/patches/server/0276-Stored-Bee-API.patch similarity index 97% rename from patches/unapplied-server/0282-Stored-Bee-API.patch rename to patches/server/0276-Stored-Bee-API.patch index 40c7a13e4..02dbe502a 100644 --- a/patches/unapplied-server/0282-Stored-Bee-API.patch +++ b/patches/server/0276-Stored-Bee-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Stored Bee API diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 5e982bab268746a05b97f5b9f71422548ea12983..a9cff34c85e1907bcbca2b051289781484580a15 100644 +index b7ad467d7d7f50bcb90e50f00f905873e89c7956..def408384cbd571b7bee23f5cecf430a5d690c4b 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -146,11 +146,33 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -147,11 +147,33 @@ public class BeehiveBlockEntity extends BlockEntity { return list; } @@ -42,7 +42,7 @@ index 5e982bab268746a05b97f5b9f71422548ea12983..a9cff34c85e1907bcbca2b0512897814 // Paper start - Add EntityBlockStorage clearEntities public void clearBees() { this.stored.clear(); -@@ -471,9 +493,9 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -472,9 +494,9 @@ public class BeehiveBlockEntity extends BlockEntity { } } diff --git a/patches/unapplied-server/0283-Shears-can-defuse-TNT.patch b/patches/server/0277-Shears-can-defuse-TNT.patch similarity index 91% rename from patches/unapplied-server/0283-Shears-can-defuse-TNT.patch rename to patches/server/0277-Shears-can-defuse-TNT.patch index a3f56a5f3..8a90fc0ea 100644 --- a/patches/unapplied-server/0283-Shears-can-defuse-TNT.patch +++ b/patches/server/0277-Shears-can-defuse-TNT.patch @@ -8,10 +8,10 @@ Shears can now defuse TNT. Each world can have a configured chance for the TNT t By default the option is disabled to avoid breaking any possible vanilla mechanics. diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index 42bd2d9a1528b6210e4dfb56233062fd97c9743b..2a4425d04917b32c7ae5af3e7422c0bafc2aa1c2 100644 +index de87483600e55d88176fe25db621bbd3e464729f..5d3002ae9f8e73851c65c2131343b2762dc9eae8 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -230,4 +230,29 @@ public class PrimedTnt extends Entity implements TraceableEntity { +@@ -249,4 +249,29 @@ public class PrimedTnt extends Entity implements TraceableEntity { return !level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid(); } // Paper end - Option to prevent TNT from moving in water @@ -42,10 +42,10 @@ index 42bd2d9a1528b6210e4dfb56233062fd97c9743b..2a4425d04917b32c7ae5af3e7422c0ba + // Purpur end - Shears can defuse TNT } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index e363a2af2d5ac8bde8894017e5403213c1877823..a47f3ef381b67e1cf0b0ca96c1bd1a22ba5f7429 100644 +index 44f6d8b1b4653bf4398f914045deadb9c34a3d35..1e561d12f4b04a536cc891e6a6d123c90e77266c 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -3399,4 +3399,11 @@ public class PurpurWorldConfig { +@@ -3395,4 +3395,11 @@ public class PurpurWorldConfig { cauldronDripstoneWaterFillChance = (float) getDouble("blocks.cauldron.fill-chances.dripstone-water", cauldronDripstoneWaterFillChance); cauldronDripstoneLavaFillChance = (float) getDouble("blocks.cauldron.fill-chances.dripstone-lava", cauldronDripstoneLavaFillChance); } diff --git a/patches/unapplied-server/0284-Explorer-Map-API.patch b/patches/server/0278-Explorer-Map-API.patch similarity index 87% rename from patches/unapplied-server/0284-Explorer-Map-API.patch rename to patches/server/0278-Explorer-Map-API.patch index bb6f01625..6dc1b0f67 100644 --- a/patches/unapplied-server/0284-Explorer-Map-API.patch +++ b/patches/server/0278-Explorer-Map-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Explorer Map API diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java -index ce461b1a8d7fab87ae28e30205f6fab67f1808b6..608390ed36710a419de1542b80340dd3fcc7299c 100644 +index 571f2540a1e9422025efe651167e26b44b437daa..c2f3c8b3d8eeb609b6d6067c4fb404aefbf94ec5 100644 --- a/src/main/java/net/minecraft/world/item/MapItem.java +++ b/src/main/java/net/minecraft/world/item/MapItem.java -@@ -195,6 +195,7 @@ public class MapItem extends ComplexItem { +@@ -194,6 +194,7 @@ public class MapItem extends Item { public static void renderBiomePreviewMap(ServerLevel world, ItemStack map) { MapItemSavedData mapItemSavedData = getSavedData(map, world); if (mapItemSavedData != null) { @@ -17,10 +17,10 @@ index ce461b1a8d7fab87ae28e30205f6fab67f1808b6..608390ed36710a419de1542b80340dd3 int i = 1 << mapItemSavedData.scale; int j = mapItemSavedData.centerX; diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 6794466051dd4b725d579b2136c37844995a648e..769d283cd98cba829262e45020ce3936c484938a 100644 +index ae321b3b8d98e42ef07fd1f0f738c1a2b428f6db..26da9e7c25ef6a89482838010d8ed6bcf8c87511 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -@@ -80,6 +80,7 @@ public class MapItemSavedData extends SavedData { +@@ -81,6 +81,7 @@ public class MapItemSavedData extends SavedData { private final Map frameMarkers = Maps.newHashMap(); private int trackedDecorationCount; private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper diff --git a/patches/unapplied-server/0285-Option-Ocelot-Spawn-Under-Sea-Level.patch b/patches/server/0279-Option-Ocelot-Spawn-Under-Sea-Level.patch similarity index 84% rename from patches/unapplied-server/0285-Option-Ocelot-Spawn-Under-Sea-Level.patch rename to patches/server/0279-Option-Ocelot-Spawn-Under-Sea-Level.patch index 47e1e6de4..408df9232 100644 --- a/patches/unapplied-server/0285-Option-Ocelot-Spawn-Under-Sea-Level.patch +++ b/patches/server/0279-Option-Ocelot-Spawn-Under-Sea-Level.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Option Ocelot Spawn Under Sea Level diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -index 92b71f76c7518068b4b5d19b5f41f2d1c796ac47..82ba970f265142e2fe7c8c5152f5004af984dc03 100644 +index 14634de26c218a3d26afd3e7e6ca89c1a0595178..dee59cb4b87845c940ee089aa932aa69dd2539d6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -@@ -285,7 +285,7 @@ public class Ocelot extends Animal { +@@ -284,7 +284,7 @@ public class Ocelot extends Animal { if (world.isUnobstructed(this) && !world.containsAnyLiquid(this.getBoundingBox())) { BlockPos blockposition = this.blockPosition(); @@ -18,10 +18,10 @@ index 92b71f76c7518068b4b5d19b5f41f2d1c796ac47..82ba970f265142e2fe7c8c5152f5004a } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index a47f3ef381b67e1cf0b0ca96c1bd1a22ba5f7429..5c0212eb9536b60a54b91a4a91ebfdca9ce0f88b 100644 +index 1e561d12f4b04a536cc891e6a6d123c90e77266c..a433ca73bdc61aed436743daadaa58e818d54f50 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -2139,6 +2139,7 @@ public class PurpurWorldConfig { +@@ -2135,6 +2135,7 @@ public class PurpurWorldConfig { public int ocelotBreedingTicks = 6000; public boolean ocelotTakeDamageFromWater = false; public boolean ocelotAlwaysDropExp = false; @@ -29,7 +29,7 @@ index a47f3ef381b67e1cf0b0ca96c1bd1a22ba5f7429..5c0212eb9536b60a54b91a4a91ebfdca private void ocelotSettings() { ocelotRidable = getBoolean("mobs.ocelot.ridable", ocelotRidable); ocelotRidableInWater = getBoolean("mobs.ocelot.ridable-in-water", ocelotRidableInWater); -@@ -2153,6 +2154,7 @@ public class PurpurWorldConfig { +@@ -2149,6 +2150,7 @@ public class PurpurWorldConfig { ocelotBreedingTicks = getInt("mobs.ocelot.breeding-delay-ticks", ocelotBreedingTicks); ocelotTakeDamageFromWater = getBoolean("mobs.ocelot.takes-damage-from-water", ocelotTakeDamageFromWater); ocelotAlwaysDropExp = getBoolean("mobs.ocelot.always-drop-exp", ocelotAlwaysDropExp); diff --git a/patches/unapplied-server/0286-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch b/patches/server/0280-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch similarity index 74% rename from patches/unapplied-server/0286-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch rename to patches/server/0280-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch index ee140a213..e4017c47f 100644 --- a/patches/unapplied-server/0286-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch +++ b/patches/server/0280-add-an-option-for-piglins-to-ignore-gold-trimmed-arm.patch @@ -5,15 +5,15 @@ Subject: [PATCH] add an option for piglins to ignore gold-trimmed armor diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -index b9810a1f6ac91ae9631dd1ebc225f009d91b7845..d6cac5ed7916040104f2a79ed38eb8b453ea3db6 100644 +index e283b1296c1e831376bfe9491cbf02ed4b3fffe4..49e57d9fb96cab6ee8204600d86430b04e3b4861 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -@@ -606,11 +606,18 @@ public class PiglinAi { - ItemStack itemstack = (ItemStack) iterator.next(); +@@ -605,11 +605,18 @@ public class PiglinAi { + } - item = itemstack.getItem(); -- } while (!(item instanceof ArmorItem) || !((ArmorItem) item).getMaterial().is(ArmorMaterials.GOLD)); -+ } while (!(item instanceof ArmorItem) || !((ArmorItem) item).getMaterial().is(ArmorMaterials.GOLD) && (!entity.level().purpurConfig.piglinIgnoresArmorWithGoldTrim || !isWearingGoldTrim(item))); // Purpur + itemstack = (ItemStack) iterator.next(); +- } while (!itemstack.is(ItemTags.PIGLIN_SAFE_ARMOR)); ++ } while (!itemstack.is(ItemTags.PIGLIN_SAFE_ARMOR) && (!entity.level().purpurConfig.piglinIgnoresArmorWithGoldTrim || !isWearingGoldTrim(item))); // Purpur return true; } @@ -29,10 +29,10 @@ index b9810a1f6ac91ae9631dd1ebc225f009d91b7845..d6cac5ed7916040104f2a79ed38eb8b4 piglin.getBrain().eraseMemory(MemoryModuleType.WALK_TARGET); piglin.getNavigation().stop(); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 5c0212eb9536b60a54b91a4a91ebfdca9ce0f88b..c7587d62ad302abc399e24c7be76a3646326a543 100644 +index a433ca73bdc61aed436743daadaa58e818d54f50..10b7fabd0c04a62b328dfd8cf0ad6797e3d5e4ee 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -2316,6 +2316,7 @@ public class PurpurWorldConfig { +@@ -2312,6 +2312,7 @@ public class PurpurWorldConfig { public int piglinPortalSpawnModifier = 2000; public boolean piglinAlwaysDropExp = false; public double piglinHeadVisibilityPercent = 0.5D; @@ -40,7 +40,7 @@ index 5c0212eb9536b60a54b91a4a91ebfdca9ce0f88b..c7587d62ad302abc399e24c7be76a364 private void piglinSettings() { piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable); piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater); -@@ -2332,6 +2333,7 @@ public class PurpurWorldConfig { +@@ -2328,6 +2329,7 @@ public class PurpurWorldConfig { piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier); piglinAlwaysDropExp = getBoolean("mobs.piglin.always-drop-exp", piglinAlwaysDropExp); piglinHeadVisibilityPercent = getDouble("mobs.piglin.head-visibility-percent", piglinHeadVisibilityPercent); diff --git a/patches/unapplied-server/0287-Add-option-for-always-showing-item-in-player-death-m.patch b/patches/server/0281-Add-option-for-always-showing-item-in-player-death-m.patch similarity index 95% rename from patches/unapplied-server/0287-Add-option-for-always-showing-item-in-player-death-m.patch rename to patches/server/0281-Add-option-for-always-showing-item-in-player-death-m.patch index 25e8ff948..1fb63c3fb 100644 --- a/patches/unapplied-server/0287-Add-option-for-always-showing-item-in-player-death-m.patch +++ b/patches/server/0281-Add-option-for-always-showing-item-in-player-death-m.patch @@ -31,10 +31,10 @@ index d95d122601dd47a27e8d82a13b071919c360fe68..4a96d914f8aa6f0c5f13fc85369a311f } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index c5a516d647dd694b311013a7b2b0dac9d30b94c6..c7cd04e40a34bbb4a909490007e90f49b1c5507b 100644 +index 569d178584ddafd38c476e56ed1809da0ddc3b1f..6d7b5a84ac541c92747d4154298c5e62c9987199 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -578,4 +578,9 @@ public class PurpurConfig { +@@ -576,4 +576,9 @@ public class PurpurConfig { block.fallDistanceMultiplier = fallDistanceMultiplier.floatValue(); }); } diff --git a/patches/unapplied-server/0288-place-end-crystal-on-any-block.patch b/patches/server/0282-place-end-crystal-on-any-block.patch similarity index 88% rename from patches/unapplied-server/0288-place-end-crystal-on-any-block.patch rename to patches/server/0282-place-end-crystal-on-any-block.patch index dde9f35ee..0a45aa69d 100644 --- a/patches/unapplied-server/0288-place-end-crystal-on-any-block.patch +++ b/patches/server/0282-place-end-crystal-on-any-block.patch @@ -5,7 +5,7 @@ Subject: [PATCH] place end crystal on any block diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java -index cc1e5882bee94864ad189d7f01ce78223411e51d..4c827c26656ac487cc8c66eeb67e4f38a29fec36 100644 +index b62db8c7c8c57e43869ee239ebf4b02f112355d9..f60e39e56a5dab2de62ae9cfd7a30a70b4985c09 100644 --- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java +++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java @@ -27,7 +27,7 @@ public class EndCrystalItem extends Item { @@ -18,10 +18,10 @@ index cc1e5882bee94864ad189d7f01ce78223411e51d..4c827c26656ac487cc8c66eeb67e4f38 } else { BlockPos blockposition1 = blockposition.above(); final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index c7587d62ad302abc399e24c7be76a3646326a543..069d6623c2a228cbb645b3716cb5c2cc832753d8 100644 +index 10b7fabd0c04a62b328dfd8cf0ad6797e3d5e4ee..62beabc316c3faba3b1c4d471fb33e33cd4b1a3d 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -935,6 +935,7 @@ public class PurpurWorldConfig { +@@ -933,6 +933,7 @@ public class PurpurWorldConfig { public boolean basedEndCrystalExplosionFire = false; public net.minecraft.world.level.Level.ExplosionInteraction basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; public int endCrystalCramming = 0; @@ -29,7 +29,7 @@ index c7587d62ad302abc399e24c7be76a3646326a543..069d6623c2a228cbb645b3716cb5c2cc private void endCrystalSettings() { if (PurpurConfig.version < 31) { if ("DESTROY".equals(getString("blocks.end-crystal.baseless.explosion-effect", baselessEndCrystalExplosionEffect.name()))) { -@@ -963,6 +964,7 @@ public class PurpurWorldConfig { +@@ -961,6 +962,7 @@ public class PurpurWorldConfig { basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; } endCrystalCramming = getInt("blocks.end-crystal.cramming-amount", endCrystalCramming); diff --git a/patches/unapplied-server/0289-Add-option-to-disable-the-copper-oxidation-proximity.patch b/patches/server/0283-Add-option-to-disable-the-copper-oxidation-proximity.patch similarity index 77% rename from patches/unapplied-server/0289-Add-option-to-disable-the-copper-oxidation-proximity.patch rename to patches/server/0283-Add-option-to-disable-the-copper-oxidation-proximity.patch index 502ae19aa..79ea65ee4 100644 --- a/patches/unapplied-server/0289-Add-option-to-disable-the-copper-oxidation-proximity.patch +++ b/patches/server/0283-Add-option-to-disable-the-copper-oxidation-proximity.patch @@ -18,21 +18,21 @@ index daae7fd6e0148cfba8e359d990748a0c83a3376e..0e06b1bcd906e92c083dc74d56d6d0a2 return random.nextFloat() < f1 ? this.getNext(state) : Optional.empty(); } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 069d6623c2a228cbb645b3716cb5c2cc832753d8..d8841b0a294083c36d4bb8806fa8c9756fc9856e 100644 +index 62beabc316c3faba3b1c4d471fb33e33cd4b1a3d..84efc4ae58a3a33ac15282c462df72982248dac3 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -146,6 +146,7 @@ public class PurpurWorldConfig { - public boolean rainStopsAfterSleep = true; - public boolean thunderStopsAfterSleep = true; +@@ -145,6 +145,7 @@ public class PurpurWorldConfig { + public boolean persistentTileEntityDisplayName = true; public int mobLastHurtByPlayerTime = 100; + public boolean milkClearsBeneficialEffects = true; + public boolean disableOxidationProximityPenalty = false; private void miscGameplayMechanicsSettings() { useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending); alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative); -@@ -180,6 +181,7 @@ public class PurpurWorldConfig { - rainStopsAfterSleep = getBoolean("gameplay-mechanics.rain-stops-after-sleep", rainStopsAfterSleep); - thunderStopsAfterSleep = getBoolean("gameplay-mechanics.thunder-stops-after-sleep", thunderStopsAfterSleep); +@@ -178,6 +179,7 @@ public class PurpurWorldConfig { + persistentTileEntityDisplayName = getBoolean("gameplay-mechanics.persistent-tileentity-display-name", persistentTileEntityDisplayName); mobLastHurtByPlayerTime = getInt("gameplay-mechanics.mob-last-hurt-by-player-time", mobLastHurtByPlayerTime); + milkClearsBeneficialEffects = getBoolean("gameplay-mechanics.milk-clears-beneficial-effects", milkClearsBeneficialEffects); + disableOxidationProximityPenalty = getBoolean("gameplay-mechanics.disable-oxidation-proximity-penalty", disableOxidationProximityPenalty); } diff --git a/patches/unapplied-server/0290-register-minecraft-debug-commands.patch b/patches/server/0284-register-minecraft-debug-commands.patch similarity index 86% rename from patches/unapplied-server/0290-register-minecraft-debug-commands.patch rename to patches/server/0284-register-minecraft-debug-commands.patch index 7b74e767c..c6210344d 100644 --- a/patches/unapplied-server/0290-register-minecraft-debug-commands.patch +++ b/patches/server/0284-register-minecraft-debug-commands.patch @@ -5,10 +5,10 @@ Subject: [PATCH] register minecraft debug commands diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 4fa19a701a61ad359f07d2e3ff99c731c9a60f43..ac93dcca5576b9d4e7d15305f5d0dbaf940b7b1d 100644 +index cbbddb924f46203bd600b838fc22902cbcb2124b..647a3ac2aea4dadd638836f831cc3768d10c7b74 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -221,8 +221,8 @@ public class Commands { +@@ -226,8 +226,8 @@ public class Commands { JfrCommand.register(this.dispatcher); } @@ -20,10 +20,10 @@ index 4fa19a701a61ad359f07d2e3ff99c731c9a60f43..ac93dcca5576b9d4e7d15305f5d0dbaf DebugPathCommand.register(this.dispatcher); DebugMobSpawningCommand.register(this.dispatcher); diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 85a0a07707a2b4029879b8caea79ded4bd849dab..aad2cdf4c2237caf2c99695d0cbb01f56c0074e2 100644 +index cccdf61ff0b08531ec0f2165588abe5dd4d488eb..5af4bed9602fb3bb2e5c92f97e95b97294ee6123 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -123,6 +123,7 @@ public class Main { +@@ -122,6 +122,7 @@ public class Main { // Purpur start - load config files early org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings")); org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels"); @@ -32,10 +32,10 @@ index 85a0a07707a2b4029879b8caea79ded4bd849dab..aad2cdf4c2237caf2c99695d0cbb01f5 io.papermc.paper.plugin.PluginInitializerManager.load(optionset); // Paper diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index c7cd04e40a34bbb4a909490007e90f49b1c5507b..e7ef546de2259a3969a63765d951a36e37a548c3 100644 +index 6d7b5a84ac541c92747d4154298c5e62c9987199..c1f14b11dbd472bc84993156d41a777167ec9ad7 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -583,4 +583,9 @@ public class PurpurConfig { +@@ -581,4 +581,9 @@ public class PurpurConfig { private static void playerDeathsAlwaysShowItem() { playerDeathsAlwaysShowItem = getBoolean("settings.player-deaths-always-show-item", playerDeathsAlwaysShowItem); } diff --git a/patches/unapplied-server/0291-Configurable-villager-search-radius.patch b/patches/server/0285-Configurable-villager-search-radius.patch similarity index 50% rename from patches/unapplied-server/0291-Configurable-villager-search-radius.patch rename to patches/server/0285-Configurable-villager-search-radius.patch index 4b0002173..837e6f29a 100644 --- a/patches/unapplied-server/0291-Configurable-villager-search-radius.patch +++ b/patches/server/0285-Configurable-villager-search-radius.patch @@ -5,36 +5,39 @@ Subject: [PATCH] Configurable-villager-search-radius diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -index e1b6fe9ecda25f86431baf414f1bfd3a26a8b2bd..ecd1bbd17cb0134cf1f4e99a3fea9e205d38f46b 100644 +index e8aa27547e3fa1a42720889c7038d4fb0273e7b5..928f7fb89329df8cc3192af122cf6644a869b48d 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -@@ -73,7 +73,7 @@ public class AcquirePoi { +@@ -72,7 +72,7 @@ public class AcquirePoi { + } }; - // Paper start - optimise POI access - java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); -- io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); -+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, world.purpurConfig.villagerAcquirePoiSearchRadius*world.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); // Purpur - Set, BlockPos>> set = new java.util.HashSet<>(poiposes); - // Paper end - optimise POI access - Path path = findPathToPois(entity, set); + Set, BlockPos>> set = poiManager.findAllClosestFirstWithType( +- poiPredicate, predicate2, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE ++ poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE + ) + .limit(5L) + .collect(Collectors.toSet()); diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java -index 92731b6b593289e9f583c9b705b219e81fcd8e73..9104d7010bda6f9f73b478c11490ef9c53f76da2 100644 +index d5a549f08b98c80a5cf0eef02cb8a389c32dfecb..2903703a5fb09649dbbc8d640af15039cab42434 100644 --- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java +++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java -@@ -56,7 +56,7 @@ public class NearestBedSensor extends Sensor { - // Paper start - optimise POI access - java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); - // don't ask me why it's unbounded. ask mojang. -- io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes); -+ io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes); // Purpur - Path path = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes)); - // Paper end - optimise POI access +@@ -54,9 +54,9 @@ public class NearestBedSensor extends Sensor { + } + }; + Set, BlockPos>> set = poiManager.findAllWithType( +- holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY ++ holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY + ) +- .collect(Collectors.toSet()); ++ .collect(Collectors.toSet()); // Purpur + Path path = AcquirePoi.findPathToPois(entity, set); if (path != null && path.canReach()) { + BlockPos blockPos = path.getTarget(); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index d8841b0a294083c36d4bb8806fa8c9756fc9856e..e58de3cdd77fdb64db93b15192705148d621407a 100644 +index 84efc4ae58a3a33ac15282c462df72982248dac3..4b01853b4aaae722738e5d1e0256f87d468b0df7 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -2992,6 +2992,8 @@ public class PurpurWorldConfig { +@@ -2988,6 +2988,8 @@ public class PurpurWorldConfig { public boolean villagerDisplayTradeItem = true; public int villagerSpawnIronGolemRadius = 0; public int villagerSpawnIronGolemLimit = 0; @@ -43,7 +46,7 @@ index d8841b0a294083c36d4bb8806fa8c9756fc9856e..e58de3cdd77fdb64db93b15192705148 private void villagerSettings() { villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable); villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater); -@@ -3029,6 +3031,8 @@ public class PurpurWorldConfig { +@@ -3025,6 +3027,8 @@ public class PurpurWorldConfig { villagerDisplayTradeItem = getBoolean("mobs.villager.display-trade-item", villagerDisplayTradeItem); villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius); villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit); diff --git a/patches/unapplied-server/0292-option-to-make-ravagers-afraid-of-rabbits.patch b/patches/server/0286-option-to-make-ravagers-afraid-of-rabbits.patch similarity index 82% rename from patches/unapplied-server/0292-option-to-make-ravagers-afraid-of-rabbits.patch rename to patches/server/0286-option-to-make-ravagers-afraid-of-rabbits.patch index 46a80017b..89acf9e04 100644 --- a/patches/unapplied-server/0292-option-to-make-ravagers-afraid-of-rabbits.patch +++ b/patches/server/0286-option-to-make-ravagers-afraid-of-rabbits.patch @@ -6,22 +6,22 @@ Subject: [PATCH] option to make ravagers afraid of rabbits https://github.com/PurpurMC/Purpur/discussions/713 diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -index 963df673d7f63e2aea25d4dce28edef06899eabe..4f10d4686f12a81a77f5fc103139aa03069b398c 100644 +index 06aa58b0e036ce4e9615365d03060eb9d9a518b7..487f21c6e6ffc0dc9c0733241a8ded8c73a5ec8f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -113,6 +113,7 @@ public class Ravager extends Raider { - super.registerGoals(); +@@ -122,6 +122,7 @@ public class Ravager extends Raider { this.goalSelector.addGoal(0, new FloatGoal(this)); this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); + if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index e58de3cdd77fdb64db93b15192705148d621407a..3bcbf5e2dbb991a8416d827ddfe59e04f701ebf7 100644 +index 4b01853b4aaae722738e5d1e0256f87d468b0df7..b6b308735adc57e1cefeda63d90460716ee4a65f 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -2474,6 +2474,7 @@ public class PurpurWorldConfig { +@@ -2470,6 +2470,7 @@ public class PurpurWorldConfig { public boolean ravagerTakeDamageFromWater = false; public List ravagerGriefableBlocks = new ArrayList<>(); public boolean ravagerAlwaysDropExp = false; @@ -29,7 +29,7 @@ index e58de3cdd77fdb64db93b15192705148d621407a..3bcbf5e2dbb991a8416d827ddfe59e04 private void ravagerSettings() { ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable); ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater); -@@ -2505,6 +2506,7 @@ public class PurpurWorldConfig { +@@ -2501,6 +2502,7 @@ public class PurpurWorldConfig { } }); ravagerAlwaysDropExp = getBoolean("mobs.ravager.always-drop-exp", ravagerAlwaysDropExp); diff --git a/patches/unapplied-server/0293-config-for-startup-commands.patch b/patches/server/0287-config-for-startup-commands.patch similarity index 87% rename from patches/unapplied-server/0293-config-for-startup-commands.patch rename to patches/server/0287-config-for-startup-commands.patch index f4bb8425c..868336a30 100644 --- a/patches/unapplied-server/0293-config-for-startup-commands.patch +++ b/patches/server/0287-config-for-startup-commands.patch @@ -5,10 +5,10 @@ Subject: [PATCH] config for startup commands diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 96902343e202617413672ddb609e4b91713e5b94..d78cb68c3a53b277aa26186062efc716c8f80f36 100644 +index 195f5fa4f01a3c835bbb98e8aaf3d5666118daf5..c069393863937cbd37718ab5a93c97a63acd79dd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1272,6 +1272,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop