diff --git a/patches/unapplied/server/Add-config-option-for-logging-player-ip-addresses.patch b/patches/server/Add-config-option-for-logging-player-ip-addresses.patch similarity index 99% rename from patches/unapplied/server/Add-config-option-for-logging-player-ip-addresses.patch rename to patches/server/Add-config-option-for-logging-player-ip-addresses.patch index 791b519564..80c5c62d49 100644 --- a/patches/unapplied/server/Add-config-option-for-logging-player-ip-addresses.patch +++ b/patches/server/Add-config-option-for-logging-player-ip-addresses.patch @@ -52,7 +52,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } public String getUserName() { @@ -63,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } - @Nullable + @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/patches/unapplied/server/Add-packet-limiter-config.patch b/patches/server/Add-packet-limiter-config.patch similarity index 100% rename from patches/unapplied/server/Add-packet-limiter-config.patch rename to patches/server/Add-packet-limiter-config.patch diff --git a/patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch similarity index 100% rename from patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch rename to patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch diff --git a/patches/unapplied/server/Add-root-admin-user-detection.patch b/patches/server/Add-root-admin-user-detection.patch similarity index 100% rename from patches/unapplied/server/Add-root-admin-user-detection.patch rename to patches/server/Add-root-admin-user-detection.patch diff --git a/patches/unapplied/server/Allow-controlled-flushing-for-network-manager.patch b/patches/server/Allow-controlled-flushing-for-network-manager.patch similarity index 100% rename from patches/unapplied/server/Allow-controlled-flushing-for-network-manager.patch rename to patches/server/Allow-controlled-flushing-for-network-manager.patch diff --git a/patches/unapplied/server/Always-allow-item-changing-in-Fireball.patch b/patches/server/Always-allow-item-changing-in-Fireball.patch similarity index 100% rename from patches/unapplied/server/Always-allow-item-changing-in-Fireball.patch rename to patches/server/Always-allow-item-changing-in-Fireball.patch diff --git a/patches/unapplied/server/Async-catch-modifications-to-critical-entity-state.patch b/patches/server/Async-catch-modifications-to-critical-entity-state.patch similarity index 100% rename from patches/unapplied/server/Async-catch-modifications-to-critical-entity-state.patch rename to patches/server/Async-catch-modifications-to-critical-entity-state.patch diff --git a/patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch similarity index 99% rename from patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch rename to patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 75a4281ba5..e56d40017e 100644 --- a/patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -705,12 +705,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.sync = dsync; } @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { - Files.createDirectories(this.folder); + FileUtil.createDirectoriesSafe(this.folder); Path path = this.folder; int j = chunkcoordintpair.getRegionX(); - Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); + Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); // Paper - diff on change - if (existingOnly && !Files.exists(path1)) return null; // CraftBukkit + if (existingOnly && !java.nio.file.Files.exists(path1)) return null; // CraftBukkit - RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync); + RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync, this.isChunkData); // Paper - allow for chunk regionfiles to regen header diff --git a/patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch b/patches/server/Check-requirement-before-suggesting-root-nodes.patch similarity index 100% rename from patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch rename to patches/server/Check-requirement-before-suggesting-root-nodes.patch diff --git a/patches/unapplied/server/Configurable-feature-seeds.patch b/patches/server/Configurable-feature-seeds.patch similarity index 100% rename from patches/unapplied/server/Configurable-feature-seeds.patch rename to patches/server/Configurable-feature-seeds.patch diff --git a/patches/unapplied/server/Consolidate-flush-calls-for-entity-tracker-packets.patch b/patches/server/Consolidate-flush-calls-for-entity-tracker-packets.patch similarity index 100% rename from patches/unapplied/server/Consolidate-flush-calls-for-entity-tracker-packets.patch rename to patches/server/Consolidate-flush-calls-for-entity-tracker-packets.patch diff --git a/patches/unapplied/server/Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/Custom-table-implementation-for-blockstate-state-loo.patch similarity index 99% rename from patches/unapplied/server/Custom-table-implementation-for-blockstate-state-loo.patch rename to patches/server/Custom-table-implementation-for-blockstate-state-loo.patch index 1d1dd2dbf5..280406878f 100644 --- a/patches/unapplied/server/Custom-table-implementation-for-blockstate-state-loo.patch +++ b/patches/server/Custom-table-implementation-for-blockstate-state-loo.patch @@ -235,7 +235,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - optimise state lookup } - public void populateNeighbours(Map, Comparable>, S> states) { + public , V extends T> S trySetValue(Property property, V value) { @@ -0,0 +0,0 @@ public abstract class StateHolder { } } diff --git a/patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch b/patches/server/Detail-more-information-in-watchdog-dumps.patch similarity index 99% rename from patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch rename to patches/server/Detail-more-information-in-watchdog-dumps.patch index 084b89e786..fc4a8c8208 100644 --- a/patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/Detail-more-information-in-watchdog-dumps.patch @@ -193,7 +193,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Paper } - public void setDeltaMovement(double x, double y, double z) { + public void addDeltaMovement(Vec3 velocity) { @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } // Paper end - fix MC-4 diff --git a/patches/unapplied/server/Distance-manager-tick-timings.patch b/patches/server/Distance-manager-tick-timings.patch similarity index 100% rename from patches/unapplied/server/Distance-manager-tick-timings.patch rename to patches/server/Distance-manager-tick-timings.patch diff --git a/patches/unapplied/server/Do-not-run-raytrace-logic-for-AIR.patch b/patches/server/Do-not-run-raytrace-logic-for-AIR.patch similarity index 100% rename from patches/unapplied/server/Do-not-run-raytrace-logic-for-AIR.patch rename to patches/server/Do-not-run-raytrace-logic-for-AIR.patch diff --git a/patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch b/patches/server/Don-t-log-debug-logging-being-disabled.patch similarity index 100% rename from patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch rename to patches/server/Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/unapplied/server/Don-t-lookup-fluid-state-when-raytracing.patch b/patches/server/Don-t-lookup-fluid-state-when-raytracing.patch similarity index 100% rename from patches/unapplied/server/Don-t-lookup-fluid-state-when-raytracing.patch rename to patches/server/Don-t-lookup-fluid-state-when-raytracing.patch diff --git a/patches/unapplied/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch b/patches/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch similarity index 100% rename from patches/unapplied/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch rename to patches/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch diff --git a/patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch similarity index 100% rename from patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch rename to patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch diff --git a/patches/unapplied/server/Ensure-valid-vehicle-status.patch b/patches/server/Ensure-valid-vehicle-status.patch similarity index 100% rename from patches/unapplied/server/Ensure-valid-vehicle-status.patch rename to patches/server/Ensure-valid-vehicle-status.patch diff --git a/patches/unapplied/server/Execute-chunk-tasks-mid-tick.patch b/patches/server/Execute-chunk-tasks-mid-tick.patch similarity index 100% rename from patches/unapplied/server/Execute-chunk-tasks-mid-tick.patch rename to patches/server/Execute-chunk-tasks-mid-tick.patch diff --git a/patches/unapplied/server/Fix-Bukkit-NamespacedKey-shenanigans.patch b/patches/server/Fix-Bukkit-NamespacedKey-shenanigans.patch similarity index 100% rename from patches/unapplied/server/Fix-Bukkit-NamespacedKey-shenanigans.patch rename to patches/server/Fix-Bukkit-NamespacedKey-shenanigans.patch diff --git a/patches/unapplied/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch similarity index 100% rename from patches/unapplied/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch rename to patches/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch diff --git a/patches/unapplied/server/Fix-CraftCriteria-defaults-map.patch b/patches/server/Fix-CraftCriteria-defaults-map.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftCriteria-defaults-map.patch rename to patches/server/Fix-CraftCriteria-defaults-map.patch diff --git a/patches/unapplied/server/Fix-GameProfileCache-concurrency.patch b/patches/server/Fix-GameProfileCache-concurrency.patch similarity index 100% rename from patches/unapplied/server/Fix-GameProfileCache-concurrency.patch rename to patches/server/Fix-GameProfileCache-concurrency.patch diff --git a/patches/unapplied/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 100% rename from patches/unapplied/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch diff --git a/patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch similarity index 100% rename from patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch rename to patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch diff --git a/patches/unapplied/server/Fix-upstreams-block-state-factories.patch b/patches/server/Fix-upstreams-block-state-factories.patch similarity index 92% rename from patches/unapplied/server/Fix-upstreams-block-state-factories.patch rename to patches/server/Fix-upstreams-block-state-factories.patch index 585e2f002d..fffd695550 100644 --- a/patches/unapplied/server/Fix-upstreams-block-state-factories.patch +++ b/patches/server/Fix-upstreams-block-state-factories.patch @@ -76,6 +76,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Arrays.asList( - Material.ACACIA_SIGN, - Material.ACACIA_WALL_SIGN, +- Material.BAMBOO_SIGN, +- Material.BAMBOO_WALL_SIGN, - Material.BIRCH_SIGN, - Material.BIRCH_WALL_SIGN, - Material.CRIMSON_SIGN, @@ -97,10 +99,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - register( - Arrays.asList( +- Material.ACACIA_HANGING_SIGN, +- Material.ACACIA_WALL_HANGING_SIGN, +- Material.BAMBOO_HANGING_SIGN, +- Material.BAMBOO_WALL_HANGING_SIGN, +- Material.BIRCH_HANGING_SIGN, +- Material.BIRCH_WALL_HANGING_SIGN, +- Material.CRIMSON_HANGING_SIGN, +- Material.CRIMSON_WALL_HANGING_SIGN, +- Material.DARK_OAK_HANGING_SIGN, +- Material.DARK_OAK_WALL_HANGING_SIGN, +- Material.JUNGLE_HANGING_SIGN, +- Material.JUNGLE_WALL_HANGING_SIGN, +- Material.MANGROVE_HANGING_SIGN, +- Material.MANGROVE_WALL_HANGING_SIGN, +- Material.OAK_HANGING_SIGN, +- Material.OAK_WALL_HANGING_SIGN, +- Material.SPRUCE_HANGING_SIGN, +- Material.SPRUCE_WALL_HANGING_SIGN, +- Material.WARPED_HANGING_SIGN, +- Material.WARPED_WALL_HANGING_SIGN +- ), CraftHangingSign.class, CraftHangingSign::new, HangingSignBlockEntity::new +- ); +- +- register( +- Arrays.asList( - Material.CREEPER_HEAD, - Material.CREEPER_WALL_HEAD, - Material.DRAGON_HEAD, - Material.DRAGON_WALL_HEAD, +- Material.PIGLIN_HEAD, +- Material.PIGLIN_WALL_HEAD, - Material.PLAYER_HEAD, - Material.PLAYER_WALL_HEAD, - Material.SKELETON_SKULL, @@ -220,6 +249,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - register(Material.BLAST_FURNACE, CraftBlastFurnace.class, CraftBlastFurnace::new, BlastFurnaceBlockEntity::new); - register(Material.BREWING_STAND, CraftBrewingStand.class, CraftBrewingStand::new, BrewingStandBlockEntity::new); - register(Material.CHEST, CraftChest.class, CraftChest::new, ChestBlockEntity::new); +- register(Material.CHISELED_BOOKSHELF, CraftChiseledBookshelf.class, CraftChiseledBookshelf::new, ChiseledBookShelfBlockEntity::new); - register(Material.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new); - register(Material.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new); - register(Material.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new); @@ -257,6 +287,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + register(BlockEntityType.BLAST_FURNACE, CraftBlastFurnace.class, CraftBlastFurnace::new); + register(BlockEntityType.BREWING_STAND, CraftBrewingStand.class, CraftBrewingStand::new); + register(BlockEntityType.CHEST, CraftChest.class, CraftChest::new); ++ register(BlockEntityType.CHISELED_BOOKSHELF, CraftChiseledBookshelf.class, CraftChiseledBookshelf::new); + register(BlockEntityType.COMPARATOR, CraftComparator.class, CraftComparator::new); + register(BlockEntityType.CONDUIT, CraftConduit.class, CraftConduit::new); + register(BlockEntityType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new); diff --git a/patches/unapplied/server/Log-when-the-async-catcher-is-tripped.patch b/patches/server/Log-when-the-async-catcher-is-tripped.patch similarity index 100% rename from patches/unapplied/server/Log-when-the-async-catcher-is-tripped.patch rename to patches/server/Log-when-the-async-catcher-is-tripped.patch diff --git a/patches/unapplied/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch similarity index 100% rename from patches/unapplied/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch rename to patches/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch diff --git a/patches/unapplied/server/Manually-inline-methods-in-BlockPosition.patch b/patches/server/Manually-inline-methods-in-BlockPosition.patch similarity index 97% rename from patches/unapplied/server/Manually-inline-methods-in-BlockPosition.patch rename to patches/server/Manually-inline-methods-in-BlockPosition.patch index ebd1ff6c94..36591598bc 100644 --- a/patches/unapplied/server/Manually-inline-methods-in-BlockPosition.patch +++ b/patches/server/Manually-inline-methods-in-BlockPosition.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java @@ -0,0 +0,0 @@ public class Vec3i implements Comparable { - return IntStream.of(vec3i.getX(), vec3i.getY(), vec3i.getZ()); + return IntStream.of(vec.getX(), vec.getY(), vec.getZ()); }); public static final Vec3i ZERO = new Vec3i(0, 0, 0); - private int x; diff --git a/patches/unapplied/server/Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/Name-craft-scheduler-threads-according-to-the-plugin.patch similarity index 100% rename from patches/unapplied/server/Name-craft-scheduler-threads-according-to-the-plugin.patch rename to patches/server/Name-craft-scheduler-threads-according-to-the-plugin.patch diff --git a/patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch b/patches/server/Oprimise-map-impl-for-tracked-players.patch similarity index 100% rename from patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch rename to patches/server/Oprimise-map-impl-for-tracked-players.patch diff --git a/patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch b/patches/server/Optimise-BlockSoil-nearby-water-lookup.patch similarity index 100% rename from patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch rename to patches/server/Optimise-BlockSoil-nearby-water-lookup.patch diff --git a/patches/unapplied/server/Optimise-chunk-tick-iteration.patch b/patches/server/Optimise-chunk-tick-iteration.patch similarity index 100% rename from patches/unapplied/server/Optimise-chunk-tick-iteration.patch rename to patches/server/Optimise-chunk-tick-iteration.patch diff --git a/patches/unapplied/server/Optimise-general-POI-access.patch b/patches/server/Optimise-general-POI-access.patch similarity index 98% rename from patches/unapplied/server/Optimise-general-POI-access.patch rename to patches/server/Optimise-general-POI-access.patch index 1cefeed619..5ef8bc2e7c 100644 --- a/patches/unapplied/server/Optimise-general-POI-access.patch +++ b/patches/server/Optimise-general-POI-access.patch @@ -840,19 +840,19 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 -@@ -0,0 +0,0 @@ public class AcquirePoi extends Behavior { - return true; - } - }; -- Set, BlockPos>> set = poiManager.findAllClosestFirstWithType(this.poiType, predicate, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE).limit(5L).collect(Collectors.toSet()); -+ // Paper start - optimise POI access -+ java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); -+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, this.poiType, predicate, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); -+ Set, BlockPos>> set = new java.util.HashSet<>(poiposes); -+ // Paper end - optimise POI access - Path path = findPathToPois(entity, set); - if (path != null && path.canReach()) { - BlockPos blockPos = path.getTarget(); +@@ -0,0 +0,0 @@ public class AcquirePoi { + return true; + } + }; +- Set, BlockPos>> set = poiManager.findAllClosestFirstWithType(poiPredicate, predicate2, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE).limit(5L).collect(Collectors.toSet()); ++ // 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); ++ Set, BlockPos>> set = new java.util.HashSet<>(poiposes); ++ // Paper end - optimise POI access + Path path = findPathToPois(entity, set); + if (path != null && path.canReach()) { + BlockPos blockPos = path.getTarget(); 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java diff --git a/patches/unapplied/server/Optimise-nearby-player-lookups.patch b/patches/server/Optimise-nearby-player-lookups.patch similarity index 99% rename from patches/unapplied/server/Optimise-nearby-player-lookups.patch rename to patches/server/Optimise-nearby-player-lookups.patch index 6824cafb61..81542eda36 100644 --- a/patches/unapplied/server/Optimise-nearby-player-lookups.patch +++ b/patches/server/Optimise-nearby-player-lookups.patch @@ -191,7 +191,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Add env and gen to constructor, IWorldDataServer -> WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { - // Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error + // Holder holder = worlddimension.type(); // CraftBukkit - decompile error @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { } diff --git a/patches/unapplied/server/Optimise-non-flush-packet-sending.patch b/patches/server/Optimise-non-flush-packet-sending.patch similarity index 100% rename from patches/unapplied/server/Optimise-non-flush-packet-sending.patch rename to patches/server/Optimise-non-flush-packet-sending.patch diff --git a/patches/unapplied/server/Optimise-random-block-ticking.patch b/patches/server/Optimise-random-block-ticking.patch similarity index 93% rename from patches/unapplied/server/Optimise-random-block-ticking.patch rename to patches/server/Optimise-random-block-ticking.patch index b396a29ca5..01150b0400 100644 --- a/patches/unapplied/server/Optimise-random-block-ticking.patch +++ b/patches/server/Optimise-random-block-ticking.patch @@ -118,8 +118,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { + int l; - gameprofilerfiller.popPush("iceandsnow"); if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow - blockposition = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, this.getBlockRandomPos(j, 0, k, 15)); - BlockPos blockposition1 = blockposition.below(); @@ -141,14 +141,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } if (flag) { + int i1 = this.getGameRules().getInt(GameRules.RULE_SNOW_ACCUMULATION_HEIGHT); + BlockState iblockdata; + + blockposition.setY(normalY); // Paper - if (biomebase.shouldSnow(this, blockposition)) { - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.defaultBlockState(), null); // CraftBukkit + if (i1 > 0 && biomebase.shouldSnow(this, blockposition)) { + iblockdata = this.getBlockState(blockposition); + if (iblockdata.is(Blocks.SNOW)) { +@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.defaultBlockState(), null); // CraftBukkit + } } + blockposition.setY(downY); // Paper -- BlockState iblockdata = this.getBlockState(blockposition1); -+ BlockState iblockdata = this.getBlockState(blockposition); // Paper +- iblockdata = this.getBlockState(blockposition1); ++ iblockdata = this.getBlockState(blockposition); // Paper Biome.Precipitation biomebase_precipitation = biomebase.getPrecipitation(); - if (biomebase_precipitation == Biome.Precipitation.RAIN && biomebase.coldEnoughToSnow(blockposition1)) { @@ -167,19 +174,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 timings.chunkTicksBlocks.startTiming(); // Paper if (randomTickSpeed > 0) { - LevelChunkSection[] achunksection = chunk.getSections(); -- int l = achunksection.length; +- int j1 = achunksection.length; - -- for (int i1 = 0; i1 < l; ++i1) { -- LevelChunkSection chunksection = achunksection[i1]; +- for (int k1 = 0; k1 < j1; ++k1) { +- LevelChunkSection chunksection = achunksection[k1]; - - if (chunksection.isRandomlyTicking()) { -- int j1 = chunksection.bottomBlockY(); +- int l1 = chunksection.bottomBlockY(); - -- for (int k1 = 0; k1 < randomTickSpeed; ++k1) { -- BlockPos blockposition2 = this.getBlockRandomPos(j, j1, k, 15); +- for (l = 0; l < randomTickSpeed; ++l) { +- BlockPos blockposition2 = this.getBlockRandomPos(j, l1, k, 15); - - gameprofilerfiller.push("randomTick"); -- BlockState iblockdata1 = chunksection.getBlockState(blockposition2.getX() - j, blockposition2.getY() - j1, blockposition2.getZ() - k); +- BlockState iblockdata2 = chunksection.getBlockState(blockposition2.getX() - j, blockposition2.getY() - l1, blockposition2.getZ() - k); + LevelChunkSection[] sections = chunk.getSections(); + int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); + for (int sectionIndex = 0; sectionIndex < sections.length; ++sectionIndex) { @@ -188,8 +195,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + continue; + } -- if (iblockdata1.isRandomlyTicking()) { -- iblockdata1.randomTick(this, blockposition2, this.random); +- if (iblockdata2.isRandomlyTicking()) { +- iblockdata2.randomTick(this, blockposition2, this.random); - } + int yPos = (sectionIndex + minSection) << 4; + for (int a = 0; a < randomTickSpeed; ++a) { @@ -199,7 +206,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + continue; + } -- FluidState fluid = iblockdata1.getFluidState(); +- FluidState fluid = iblockdata2.getFluidState(); + long raw = section.tickingList.getRaw(index); + int location = com.destroystokyo.paper.util.maplist.IBlockDataList.getLocationFromRaw(raw); + int randomX = location & 15; @@ -216,7 +223,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } + iblockdata.randomTick(this, blockposition2, this.randomTickRandom); + // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock). -+ // TODO CHECK ON UPDATE ++ // TODO CHECK ON UPDATE (ping the Canadian) } } } diff --git a/patches/unapplied/server/Preserve-overstacked-loot.patch b/patches/server/Preserve-overstacked-loot.patch similarity index 65% rename from patches/unapplied/server/Preserve-overstacked-loot.patch rename to patches/server/Preserve-overstacked-loot.patch index e74bcd37e0..b8b707b939 100644 --- a/patches/unapplied/server/Preserve-overstacked-loot.patch +++ b/patches/server/Preserve-overstacked-loot.patch @@ -17,27 +17,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.compositeFunction = LootItemFunctions.compose(functions); } -+ @Deprecated // Paper - preserve overstacked items - public static Consumer createStackSplitter(Consumer lootConsumer) { + // Paper start - preserve overstacked items -+ return createStackSplitter(lootConsumer, null); ++ @Deprecated + public static Consumer createStackSplitter(LootContext context, Consumer consumer) { ++ return createStackSplitter(context, consumer, null); + } -+ -+ public static Consumer createStackSplitter(Consumer lootConsumer, @org.jetbrains.annotations.Nullable net.minecraft.server.level.ServerLevel world) { -+ boolean skipSplitter = world != null && !world.paperConfig().fixes.splitOverstackedLoot; -+ // Paper end ++ public static Consumer createStackSplitter(LootContext context, Consumer consumer, @org.jetbrains.annotations.Nullable net.minecraft.server.level.ServerLevel level) { ++ boolean skipSplitter = level != null && !level.paperConfig().fixes.splitOverstackedLoot; ++ // Paper end return (itemstack) -> { -- if (itemstack.getCount() < itemstack.getMaxStackSize()) { -+ if (skipSplitter || itemstack.getCount() < itemstack.getMaxStackSize()) { // Paper - preserve overstacked items - lootConsumer.accept(itemstack); - } else { - int i = itemstack.getCount(); + if (itemstack.isItemEnabled(context.getLevel().enabledFeatures())) { +- if (itemstack.getCount() < itemstack.getMaxStackSize()) { ++ if (skipSplitter || itemstack.getCount() < itemstack.getMaxStackSize()) { // Paper - preserve overstacked items + consumer.accept(itemstack); + } else { + int i = itemstack.getCount(); + ++ + while (i > 0) { + ItemStack itemstack1 = itemstack.copy(); + @@ -0,0 +0,0 @@ public class LootTable { } public void getRandomItems(LootContext context, Consumer lootConsumer) { -- this.getRandomItemsRaw(context, LootTable.createStackSplitter(lootConsumer)); -+ this.getRandomItemsRaw(context, LootTable.createStackSplitter(lootConsumer, context.getLevel())); // Paper - preserve overstacked items +- this.getRandomItemsRaw(context, LootTable.createStackSplitter(context, lootConsumer)); ++ this.getRandomItemsRaw(context, LootTable.createStackSplitter(context, lootConsumer, context.getLevel())); // Paper - preserve overstacked items } public ObjectArrayList getRandomItems(LootContext context) { @@ -49,8 +54,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 NonNullList nonNullList = NonNullList.create(); this.entries.forEach((entry) -> { entry.expand(context, (choice) -> { -- choice.createItemStack(LootTable.createStackSplitter(nonNullList::add), context); -+ choice.createItemStack(LootTable.createStackSplitter(nonNullList::add, context.getLevel()), context); // Paper - preserve overstacked items +- choice.createItemStack(LootTable.createStackSplitter(context, nonNullList::add), context); ++ choice.createItemStack(LootTable.createStackSplitter(context, nonNullList::add, context.getLevel()), context); // Paper - preserve overstacked items }); }); CompoundTag compoundTag = new CompoundTag(); diff --git a/patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/Prevent-excessive-velocity-through-repeated-crits.patch similarity index 100% rename from patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch rename to patches/server/Prevent-excessive-velocity-through-repeated-crits.patch diff --git a/patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/Prevent-softlocked-end-exit-portal-generation.patch similarity index 100% rename from patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch rename to patches/server/Prevent-softlocked-end-exit-portal-generation.patch diff --git a/patches/unapplied/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch similarity index 100% rename from patches/unapplied/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch rename to patches/server/Reduce-worldgen-thread-worker-count-for-low-core-cou.patch diff --git a/patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/Remove-client-side-code-using-deprecated-for-removal.patch similarity index 100% rename from patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch rename to patches/server/Remove-client-side-code-using-deprecated-for-removal.patch diff --git a/patches/unapplied/server/Remove-streams-for-villager-AI.patch b/patches/server/Remove-streams-for-villager-AI.patch similarity index 69% rename from patches/unapplied/server/Remove-streams-for-villager-AI.patch rename to patches/server/Remove-streams-for-villager-AI.patch index 524f34f2a1..392aa3baa1 100644 --- a/patches/unapplied/server/Remove-streams-for-villager-AI.patch +++ b/patches/server/Remove-streams-for-villager-AI.patch @@ -8,94 +8,66 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java -@@ -0,0 +0,0 @@ public class GateBehavior extends Behavior { +@@ -0,0 +0,0 @@ public class GateBehavior implements BehaviorControl + if (this.hasRequiredMemories(entity)) { + this.status = Behavior.Status.RUNNING; + this.orderPolicy.apply(this.behaviors); +- this.runningPolicy.apply(this.behaviors.stream(), world, entity, time); ++ this.runningPolicy.apply(this.behaviors.entries, world, entity, time); + return true; + } else { + return false; +@@ -0,0 +0,0 @@ public class GateBehavior implements BehaviorControl @Override - protected boolean canStillUse(ServerLevel world, E entity, long time) { -- return this.behaviors.stream().filter((task) -> { -- return task.getStatus() == Behavior.Status.RUNNING; -- }).anyMatch((task) -> { -- return task.canStillUse(world, entity, time); -- }); -+ // Paper start - remove streams -+ List>> entries = this.behaviors.entries; -+ for (int i = 0; i < entries.size(); i++) { -+ ShufflingList.WeightedEntry> entry = entries.get(i); -+ Behavior behavior = entry.getData(); -+ if (behavior.getStatus() == Status.RUNNING) { -+ if (behavior.canStillUse(world, entity, time)) { -+ return true; -+ } -+ } -+ } -+ return false; -+ // Paper end - remove streams - } - - @Override -@@ -0,0 +0,0 @@ public class GateBehavior extends Behavior { - @Override - protected void start(ServerLevel world, E entity, long time) { - this.orderPolicy.apply(this.behaviors); -- this.runningPolicy.apply(this.behaviors.stream(), world, entity, time); -+ this.runningPolicy.apply(this.behaviors.entries, world, entity, time); // Paper - remove streams - } - - @Override - protected void tick(ServerLevel world, E entity, long time) { + public final void tickOrStop(ServerLevel world, E entity, long time) { - this.behaviors.stream().filter((task) -> { - return task.getStatus() == Behavior.Status.RUNNING; - }).forEach((task) -> { - task.tickOrStop(world, entity, time); - }); -+ // Paper start - remove streams -+ List>> entries = this.behaviors.entries; -+ for (int i = 0; i < entries.size(); i++) { -+ ShufflingList.WeightedEntry> entry = entries.get(i); -+ Behavior behavior = entry.getData(); -+ if (behavior.getStatus() == Status.RUNNING) { -+ behavior.tickOrStop(world, entity, time); ++ // Paper start ++ for (BehaviorControl task : this.behaviors) { ++ if (task.getStatus() == Behavior.Status.RUNNING) { ++ task.tickOrStop(world, entity, time); + } + } -+ // Paper end - remove streams - } - ++ // Paper end + if (this.behaviors.stream().noneMatch((task) -> { + return task.getStatus() == Behavior.Status.RUNNING; + })) { +@@ -0,0 +0,0 @@ public class GateBehavior implements BehaviorControl @Override - protected void stop(ServerLevel world, E entity, long time) { + public final void doStop(ServerLevel world, E entity, long time) { + this.status = Behavior.Status.STOPPED; - this.behaviors.stream().filter((task) -> { - return task.getStatus() == Behavior.Status.RUNNING; - }).forEach((task) -> { - task.doStop(world, entity, time); - }); -+ // Paper start - remove streams -+ List>> entries = this.behaviors.entries; -+ for (int i = 0; i < entries.size(); i++) { -+ ShufflingList.WeightedEntry> entry = entries.get(i); -+ Behavior behavior = entry.getData(); -+ if (behavior.getStatus() == Status.RUNNING) { ++ for (BehaviorControl behavior : this.behaviors) { ++ if (behavior.getStatus() == Behavior.Status.RUNNING) { + behavior.doStop(world, entity, time); + } + } -+ // Paper end - remove streams this.exitErasedMemories.forEach(entity.getBrain()::eraseMemory); } -@@ -0,0 +0,0 @@ public class GateBehavior extends Behavior { +@@ -0,0 +0,0 @@ public class GateBehavior implements BehaviorControl public static enum RunningPolicy { RUN_ONE { @Override -- public void apply(Stream> tasks, ServerLevel world, E entity, long time) { +- public void apply(Stream> tasks, ServerLevel world, E entity, long time) { - tasks.filter((task) -> { - return task.getStatus() == Behavior.Status.STOPPED; - }).filter((task) -> { - return task.tryStart(world, entity, time); - }).findFirst(); + // Paper start - remove streams -+ public void apply(List>> tasks, ServerLevel world, E entity, long time) { -+ for (int i = 0; i < tasks.size(); i++) { -+ ShufflingList.WeightedEntry> task = tasks.get(i); -+ Behavior behavior = task.getData(); -+ if (behavior.getStatus() == Status.STOPPED && behavior.tryStart(world, entity, time)) { ++ public void apply(List>> tasks, ServerLevel world, E entity, long time) { ++ for (ShufflingList.WeightedEntry> task : tasks) { ++ final BehaviorControl behavior = task.getData(); ++ if (behavior.getStatus() == Behavior.Status.STOPPED && behavior.tryStart(world, entity, time)) { + break; + } + } @@ -104,18 +76,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }, TRY_ALL { @Override -- public void apply(Stream> tasks, ServerLevel world, E entity, long time) { +- public void apply(Stream> tasks, ServerLevel world, E entity, long time) { - tasks.filter((task) -> { - return task.getStatus() == Behavior.Status.STOPPED; - }).forEach((task) -> { - task.tryStart(world, entity, time); - }); + // Paper start - remove streams -+ public void apply(List>> tasks, ServerLevel world, E entity, long time) { -+ for (int i = 0; i < tasks.size(); i++) { -+ ShufflingList.WeightedEntry> task = tasks.get(i); -+ Behavior behavior = task.getData(); -+ if (behavior.getStatus() == Status.STOPPED) { ++ public void apply(List>> tasks, ServerLevel world, E entity, long time) { ++ for (ShufflingList.WeightedEntry> task : tasks) { ++ final BehaviorControl behavior = task.getData(); ++ if (behavior.getStatus() == Behavior.Status.STOPPED) { + behavior.tryStart(world, entity, time); + } + } @@ -123,8 +94,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } }; -- public abstract void apply(Stream> tasks, ServerLevel world, E entity, long time); -+ public abstract void apply(List>> tasks, ServerLevel world, E entity, long time); // Paper - remove streams +- public abstract void apply(Stream> tasks, ServerLevel world, E entity, long time); ++ public abstract void apply(List>> tasks, ServerLevel world, E entity, long time); // Paper - remove streams } } diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java @@ -134,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ import java.util.stream.Stream; import net.minecraft.util.RandomSource; - public class ShufflingList { + public class ShufflingList implements Iterable { - protected final List> entries; + public final List> entries; // Paper - public private final RandomSource random = RandomSource.create(); diff --git a/patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch b/patches/server/Sanitize-ResourceLocation-error-logging.patch similarity index 55% rename from patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch rename to patches/server/Sanitize-ResourceLocation-error-logging.patch index 007997f370..5a7142abe8 100644 --- a/patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch +++ b/patches/server/Sanitize-ResourceLocation-error-logging.patch @@ -9,14 +9,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/resources/ResourceLocation.java +++ b/src/main/java/net/minecraft/resources/ResourceLocation.java @@ -0,0 +0,0 @@ public class ResourceLocation implements Comparable { - this.namespace = StringUtils.isEmpty(id[0]) ? "minecraft" : id[0]; - this.path = id[1]; - if (!isValidNamespace(this.namespace)) { -- throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + this.namespace + ":" + this.path); -+ throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + org.apache.commons.lang3.StringUtils.normalizeSpace(this.namespace) + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(this.path)); // Paper - } else if (!isValidPath(this.path)) { -- throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + this.namespace + ":" + this.path); -+ throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + this.namespace + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(this.path)); // Paper - } - } + private static String assertValidNamespace(String namespace, String path) { + if (!isValidNamespace(namespace)) { +- throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + namespace + ":" + path); ++ throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + org.apache.commons.lang3.StringUtils.normalizeSpace(namespace) + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(path)); // Paper + } else { + return namespace; + } +@@ -0,0 +0,0 @@ public class ResourceLocation implements Comparable { + + private static String assertValidPath(String namespace, String path) { + if (!isValidPath(path)) { +- throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + namespace + ":" + path); ++ throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + namespace + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(path)); // Paper + } else { + return path; + } diff --git a/patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch similarity index 100% rename from patches/unapplied/server/Send-full-pos-packets-for-hard-colliding-entities.patch rename to patches/server/Send-full-pos-packets-for-hard-colliding-entities.patch diff --git a/patches/unapplied/server/Time-scoreboard-search.patch b/patches/server/Time-scoreboard-search.patch similarity index 100% rename from patches/unapplied/server/Time-scoreboard-search.patch rename to patches/server/Time-scoreboard-search.patch diff --git a/patches/unapplied/server/Update-head-rotation-in-missing-places.patch b/patches/server/Update-head-rotation-in-missing-places.patch similarity index 100% rename from patches/unapplied/server/Update-head-rotation-in-missing-places.patch rename to patches/server/Update-head-rotation-in-missing-places.patch diff --git a/patches/unapplied/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch similarity index 99% rename from patches/unapplied/server/Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/Use-Velocity-compression-and-cipher-natives.patch index 0f091be17a..c01f1e860b 100644 --- a/patches/unapplied/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -344,7 +344,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } SecretKey secretkey = packet.getSecretKey(privatekey); diff --git a/patches/unapplied/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch b/patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch similarity index 100% rename from patches/unapplied/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch rename to patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch diff --git a/patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch b/patches/server/don-t-attempt-to-teleport-dead-entities.patch similarity index 100% rename from patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch rename to patches/server/don-t-attempt-to-teleport-dead-entities.patch diff --git a/patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch b/patches/server/fix-various-menus-with-empty-level-accesses.patch similarity index 100% rename from patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch rename to patches/server/fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/server/incremental-chunk-and-player-saving.patch b/patches/server/incremental-chunk-and-player-saving.patch index 2c93d1474d..1db0450ea9 100644 --- a/patches/server/incremental-chunk-and-player-saving.patch +++ b/patches/server/incremental-chunk-and-player-saving.patch @@ -104,7 +104,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + this.serverLevelData.setWorldBorder(worldserver1.getWorldBorder().createSettings()); + this.serverLevelData.setCustomBossEvents(this.server.getCustomBossEvents().save()); -+ this.convertable.saveDataTag(this.server.registryHolder, this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); ++ this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); + } + // CraftBukkit end + } diff --git a/patches/unapplied/server/prevent-unintended-light-block-manipulation.patch b/patches/server/prevent-unintended-light-block-manipulation.patch similarity index 94% rename from patches/unapplied/server/prevent-unintended-light-block-manipulation.patch rename to patches/server/prevent-unintended-light-block-manipulation.patch index 1b78f8b4c5..e4e3c41a36 100644 --- a/patches/unapplied/server/prevent-unintended-light-block-manipulation.patch +++ b/patches/server/prevent-unintended-light-block-manipulation.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock { @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - if (!world.isClientSide) { + if (!world.isClientSide && player.canUseGameMasterBlocks()) { + if (player.getItemInHand(hand).getItem() != Items.LIGHT || !player.mayInteract(world, pos) || !player.mayUseItemAt(pos, hit.getDirection(), player.getItemInHand(hand))) { return InteractionResult.FAIL; } // Paper world.setBlock(pos, state.cycle(LEVEL), 2); return InteractionResult.SUCCESS; diff --git a/patches/unapplied/server/Use-correct-LevelStem-registry-when-loading-default-.patch b/patches/unapplied/server/Use-correct-LevelStem-registry-when-loading-default-.patch deleted file mode 100644 index 80f0117697..0000000000 --- a/patches/unapplied/server/Use-correct-LevelStem-registry-when-loading-default-.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Sat, 16 Oct 2021 17:38:35 -0700 -Subject: [PATCH] Use correct LevelStem registry when loading default - end/nether - -Co-authored-by: Jake Potrebic - -diff --git a/src/main/java/net/minecraft/resources/RegistryLoader.java b/src/main/java/net/minecraft/resources/RegistryLoader.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/resources/RegistryLoader.java -+++ b/src/main/java/net/minecraft/resources/RegistryLoader.java -@@ -0,0 +0,0 @@ public class RegistryLoader { - RegistryLoader.ReadCache readCache = this.readCache(registryRef); - DataResult> dataResult = readCache.values.get(entryKey); - if (dataResult != null) { -+ // Paper start - register in registry due to craftbukkit running this 3 times instead of once -+ if (registryRef == (ResourceKey) Registry.LEVEL_STEM_REGISTRY && dataResult.result().isPresent()) { -+ // OptionalInt.empty() because the LevelStem registry is only loaded from the resource manager, not the InMemory resource access -+ registry.registerOrOverride(java.util.OptionalInt.empty(), entryKey, dataResult.result().get().value(), dataResult.lifecycle()); -+ } -+ // Paper end - return dataResult; - } else { - Holder holder = registry.getOrCreateHolderOrThrow(entryKey); -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); -- LevelStem worlddimension = (LevelStem) iregistry.get(dimensionKey); -+ // Paper start - Use correct LevelStem registry -+ final LevelStem worlddimension; -+ if (dimensionKey == LevelStem.END || dimensionKey == LevelStem.NETHER) { -+ worlddimension = generatorsettings.dimensions().get(dimensionKey); -+ } else { -+ worlddimension = iregistry.get(dimensionKey); -+ } -+ // Paper end - - org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), worlddimension.typeHolder().value()); - if (biomeProvider == null && gen != null) {