From 0edb5458e51e6a9f5be1fdb7016030409eaa6236 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 7 Dec 2022 19:32:25 +0100 Subject: [PATCH] Patching patches --- .../0013-Rewrite-dataconverter-system.patch | 222 +++++++++-- .../server/0014-Starlight.patch | 74 ++-- .../server/0015-Not-implemeneted.patch | 0 .../server/0016-Rewrite-chunk-system.patch | 351 +++++++++--------- ...-option-to-load-extra-plugin-jars-no.patch | 8 +- ...actus-bamboo-and-reed-growth-heights.patch | 32 +- ...figurable-baby-zombie-movement-speed.patch | 4 +- ...020-Configurable-fishing-time-ranges.patch | 6 +- ...d-mobs-to-jump-and-take-water-damage.patch | 4 +- ...-despawn-distances-for-living-entiti.patch | 4 +- ...3-Allow-for-toggling-of-spawn-chunks.patch | 4 +- ...ck-and-tnt-entities-at-the-specified.patch | 12 +- ...ient-crashes-server-lists-and-Mojang.patch | 12 +- .../0026-Implement-Paper-VersionChecker.patch | 4 +- ...d-version-history-to-version-command.patch | 4 +- .../0028-Player-affects-spawning-API.patch | 26 +- ...029-Further-improve-server-tick-loop.patch | 20 +- ...030-Only-refresh-abilities-if-needed.patch | 4 +- .../server/0031-Entity-Origin-API.patch | 22 +- ...event-tile-entity-and-entity-crashes.patch | 10 +- ...nfigurable-top-of-nether-void-damage.patch | 4 +- ...e-before-converting-and-renaming-pla.patch | 0 .../0035-Always-tick-falling-blocks.patch | 0 .../0036-Configurable-end-credits.patch | 4 +- ...-explosions-processing-dead-entities.patch | 4 +- .../server/0038-Optimize-explosions.patch | 14 +- .../0039-Disable-explosion-knockback.patch | 12 +- .../server/0040-Disable-thunder.patch | 4 +- .../server/0041-Disable-ice-and-snow.patch | 8 +- ...2-Configurable-mob-spawner-tick-rate.patch | 10 +- ...43-Implement-PlayerLocaleChangeEvent.patch | 10 +- .../server/0044-Add-BeaconEffectEvent.patch | 10 +- ...figurable-container-update-tick-rate.patch | 6 +- .../0046-Use-UserCache-for-player-heads.patch | 4 +- .../0047-Disable-spigot-tick-limiters.patch | 4 +- .../0048-Add-PlayerInitialSpawnEvent.patch | 6 +- ...urable-Disabling-Cat-Chest-Detection.patch | 0 ...50-Ensure-commands-are-not-ran-async.patch | 22 +- ...chunks-are-slime-spawn-chunks-toggle.patch | 8 +- .../0052-Expose-server-CommandMap.patch | 4 +- ...e-informative-in-maxHealth-exception.patch | 0 .../0054-Ensure-inv-drag-is-in-bounds.patch | 4 +- .../0055-Player-Tab-List-and-Title-APIs.patch | 8 +- ...dd-configurable-portal-search-radius.patch | 6 +- .../server/0057-Add-velocity-warnings.patch | 8 +- ...ble-inter-world-teleportation-safety.patch | 4 +- .../0059-Add-exception-reporting-event.patch | 32 +- ...-don-t-need-to-when-cerealising-text.patch | 0 ...oreboards-for-non-players-by-default.patch | 8 +- ...working-with-arrows-stuck-in-living-.patch | 0 .../server/0063-Chunk-Save-Reattempt.patch | 2 +- .../0064-Complete-resource-pack-API.patch | 12 +- ...ading-permissions.yml-before-plugins.patch | 6 +- ...llow-Reloading-of-Custom-Permissions.patch | 4 +- .../0067-Remove-Metadata-on-reload.patch | 4 +- ...068-Handle-Item-Meta-Inconsistencies.patch | 12 +- 56 files changed, 611 insertions(+), 456 deletions(-) rename patches/{unapplied => }/server/0013-Rewrite-dataconverter-system.patch (99%) rename patches/{unapplied => }/server/0014-Starlight.patch (98%) rename patches/{unapplied => }/server/0015-Not-implemeneted.patch (100%) rename patches/{unapplied => }/server/0016-Rewrite-chunk-system.patch (98%) rename patches/{unapplied => }/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch (92%) rename patches/{unapplied => }/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch (71%) rename patches/{unapplied => }/server/0019-Configurable-baby-zombie-movement-speed.patch (93%) rename patches/{unapplied => }/server/0020-Configurable-fishing-time-ranges.patch (86%) rename patches/{unapplied => }/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch (93%) rename patches/{unapplied => }/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch (89%) rename patches/{unapplied => }/server/0023-Allow-for-toggling-of-spawn-chunks.patch (85%) rename patches/{unapplied => }/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch (86%) rename patches/{unapplied => }/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch (93%) rename patches/{unapplied => }/server/0026-Implement-Paper-VersionChecker.patch (97%) rename patches/{unapplied => }/server/0027-Add-version-history-to-version-command.patch (98%) rename patches/{unapplied => }/server/0028-Player-affects-spawning-API.patch (89%) rename patches/{unapplied => }/server/0029-Further-improve-server-tick-loop.patch (93%) rename patches/{unapplied => }/server/0030-Only-refresh-abilities-if-needed.patch (87%) rename patches/{unapplied => }/server/0031-Entity-Origin-API.patch (88%) rename patches/{unapplied => }/server/0032-Prevent-tile-entity-and-entity-crashes.patch (90%) rename patches/{unapplied => }/server/0033-Configurable-top-of-nether-void-damage.patch (94%) rename patches/{unapplied => }/server/0034-Check-online-mode-before-converting-and-renaming-pla.patch (100%) rename patches/{unapplied => }/server/0035-Always-tick-falling-blocks.patch (100%) rename patches/{unapplied => }/server/0036-Configurable-end-credits.patch (85%) rename patches/{unapplied => }/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch (89%) rename patches/{unapplied => }/server/0038-Optimize-explosions.patch (91%) rename patches/{unapplied => }/server/0039-Disable-explosion-knockback.patch (87%) rename patches/{unapplied => }/server/0040-Disable-thunder.patch (88%) rename patches/{unapplied => }/server/0041-Disable-ice-and-snow.patch (84%) rename patches/{unapplied => }/server/0042-Configurable-mob-spawner-tick-rate.patch (85%) rename patches/{unapplied => }/server/0043-Implement-PlayerLocaleChangeEvent.patch (85%) rename patches/{unapplied => }/server/0044-Add-BeaconEffectEvent.patch (89%) rename patches/{unapplied => }/server/0045-Configurable-container-update-tick-rate.patch (84%) rename patches/{unapplied => }/server/0046-Use-UserCache-for-player-heads.patch (87%) rename patches/{unapplied => }/server/0047-Disable-spigot-tick-limiters.patch (88%) rename patches/{unapplied => }/server/0048-Add-PlayerInitialSpawnEvent.patch (89%) rename patches/{unapplied => }/server/0049-Configurable-Disabling-Cat-Chest-Detection.patch (100%) rename patches/{unapplied => }/server/0050-Ensure-commands-are-not-ran-async.patch (91%) rename patches/{unapplied => }/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch (86%) rename patches/{unapplied => }/server/0052-Expose-server-CommandMap.patch (78%) rename patches/{unapplied => }/server/0053-Be-a-bit-more-informative-in-maxHealth-exception.patch (100%) rename patches/{unapplied => }/server/0054-Ensure-inv-drag-is-in-bounds.patch (87%) rename patches/{unapplied => }/server/0055-Player-Tab-List-and-Title-APIs.patch (96%) rename patches/{unapplied => }/server/0056-Add-configurable-portal-search-radius.patch (91%) rename patches/{unapplied => }/server/0057-Add-velocity-warnings.patch (93%) rename patches/{unapplied => }/server/0058-Configurable-inter-world-teleportation-safety.patch (91%) rename patches/{unapplied => }/server/0059-Add-exception-reporting-event.patch (90%) rename patches/{unapplied => }/server/0060-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch (100%) rename patches/{unapplied => }/server/0061-Disable-Scoreboards-for-non-players-by-default.patch (84%) rename patches/{unapplied => }/server/0062-Add-methods-for-working-with-arrows-stuck-in-living-.patch (100%) rename patches/{unapplied => }/server/0063-Chunk-Save-Reattempt.patch (96%) rename patches/{unapplied => }/server/0064-Complete-resource-pack-API.patch (90%) rename patches/{unapplied => }/server/0065-Default-loading-permissions.yml-before-plugins.patch (89%) rename patches/{unapplied => }/server/0066-Allow-Reloading-of-Custom-Permissions.patch (90%) rename patches/{unapplied => }/server/0067-Remove-Metadata-on-reload.patch (88%) rename patches/{unapplied => }/server/0068-Handle-Item-Meta-Inconsistencies.patch (97%) diff --git a/patches/unapplied/server/0013-Rewrite-dataconverter-system.patch b/patches/server/0013-Rewrite-dataconverter-system.patch similarity index 99% rename from patches/unapplied/server/0013-Rewrite-dataconverter-system.patch rename to patches/server/0013-Rewrite-dataconverter-system.patch index 49b2d11b8f..a10024b09e 100644 --- a/patches/unapplied/server/0013-Rewrite-dataconverter-system.patch +++ b/patches/server/0013-Rewrite-dataconverter-system.patch @@ -196,10 +196,10 @@ index 0000000000000000000000000000000000000000..dde9d36bf6212196caa18f3c9c535aec +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java new file mode 100644 -index 0000000000000000000000000000000000000000..b6817eef740b4dd0ebc00857085f7f01e6d2b7aa +index 0000000000000000000000000000000000000000..5ec18e5890541a9570cd08059ef3d8ec9a1aa6f9 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java -@@ -0,0 +1,363 @@ +@@ -0,0 +1,366 @@ +package ca.spottedleaf.dataconverter.minecraft; + +import ca.spottedleaf.dataconverter.converters.DataConverter; @@ -401,8 +401,11 @@ index 0000000000000000000000000000000000000000..b6817eef740b4dd0ebc00857085f7f01 + 3093, + 3094, + 3097, -+ 3108 -+ // All up to 1.19.1-pre2 ++ 3108, ++ 3201, ++ 3209, ++ 3214 ++ // All up to 1.19.3-rc1 + }; + Arrays.sort(converterVersions); + @@ -565,10 +568,10 @@ index 0000000000000000000000000000000000000000..b6817eef740b4dd0ebc00857085f7f01 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java new file mode 100644 -index 0000000000000000000000000000000000000000..51f869ba58b3f113017a3c32f68896b6d572dc7b +index 0000000000000000000000000000000000000000..3294e185c725c03645b9c237e3526db0e87c43e5 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java -@@ -0,0 +1,423 @@ +@@ -0,0 +1,432 @@ +package ca.spottedleaf.dataconverter.minecraft; + +@SuppressWarnings("unused") @@ -991,6 +994,15 @@ index 0000000000000000000000000000000000000000..51f869ba58b3f113017a3c32f68896b6 + public static final int V1_19_1_PRE1 = 3107; + public static final int V1_19_1_RC1 = 3109; + public static final int V1_19_1_PRE2 = 3110; ++ public static final int V22W42A = 3205; ++ public static final int V22W43A = 3206; ++ public static final int V22W44A = 3207; ++ public static final int V22W45A = 3208; ++ public static final int V22W46A = 3210; ++ public static final int V1_19_3_PRE1 = 3211; ++ public static final int V1_19_3_PRE2 = 3212; ++ public static final int V1_19_3_PRE3 = 3213; ++ public static final int V1_19_3_RC1 = 3215; +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/advancements/ConverterAbstractAdvancementsRename.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/advancements/ConverterAbstractAdvancementsRename.java new file mode 100644 @@ -5809,10 +5821,10 @@ index 0000000000000000000000000000000000000000..21176b8b96be6cb93d3dc1a74ae9f53f +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterFlattenSpawnEgg.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterFlattenSpawnEgg.java new file mode 100644 -index 0000000000000000000000000000000000000000..d88b12e6b9e381ba614dc04599a44e472a37ca03 +index 0000000000000000000000000000000000000000..4fa31e40b0a6f571a853299b4e242de921ccbda0 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterFlattenSpawnEgg.java -@@ -0,0 +1,83 @@ +@@ -0,0 +1,87 @@ +package ca.spottedleaf.dataconverter.minecraft.converters.itemstack; + +import ca.spottedleaf.dataconverter.converters.DataConverter; @@ -5838,8 +5850,10 @@ index 0000000000000000000000000000000000000000..d88b12e6b9e381ba614dc04599a44e47 + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:evocation_illager", "minecraft:evocation_illager_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:ghast", "minecraft:ghast_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:guardian", "minecraft:guardian_spawn_egg"); ++ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:ender_dragon", "minecraft:ender_dragon_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:horse", "minecraft:horse_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:husk", "minecraft:husk_spawn_egg"); ++ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:iron_golem", "minecraft:iron_golem_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:llama", "minecraft:llama_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:magma_cube", "minecraft:magma_cube_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:mooshroom", "minecraft:mooshroom_spawn_egg"); @@ -5856,6 +5870,7 @@ index 0000000000000000000000000000000000000000..d88b12e6b9e381ba614dc04599a44e47 + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:skeleton", "minecraft:skeleton_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:skeleton_horse", "minecraft:skeleton_horse_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:slime", "minecraft:slime_spawn_egg"); ++ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:snow_golem", "minecraft:snow_golem_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:spider", "minecraft:spider_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:squid", "minecraft:squid_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:stray", "minecraft:stray_spawn_egg"); @@ -5864,6 +5879,7 @@ index 0000000000000000000000000000000000000000..d88b12e6b9e381ba614dc04599a44e47 + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:villager", "minecraft:villager_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:vindication_illager", "minecraft:vindication_illager_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:witch", "minecraft:witch_spawn_egg"); ++ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wither", "minecraft:wither_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wither_skeleton", "minecraft:wither_skeleton_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wolf", "minecraft:wolf_spawn_egg"); + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:zombie", "minecraft:zombie_spawn_egg"); @@ -5872,8 +5888,8 @@ index 0000000000000000000000000000000000000000..d88b12e6b9e381ba614dc04599a44e47 + ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:zombie_villager", "minecraft:zombie_villager_spawn_egg"); + } + -+ public ConverterFlattenSpawnEgg() { -+ super(MCVersions.V17W47A,5); ++ public ConverterFlattenSpawnEgg(final int version, final int versionStep) { ++ super(version, versionStep); + } + + @Override @@ -6553,10 +6569,10 @@ index 0000000000000000000000000000000000000000..76a6e3efa5c69150e8f5e0063cb6357b +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/datatypes/MCTypeRegistry.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/datatypes/MCTypeRegistry.java new file mode 100644 -index 0000000000000000000000000000000000000000..602c210df505613482bb4b1bbb782c0d8d6a32c8 +index 0000000000000000000000000000000000000000..d4be142e862a8f114e9cca6bd64b7be205e2b0b1 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/datatypes/MCTypeRegistry.java -@@ -0,0 +1,236 @@ +@@ -0,0 +1,242 @@ +package ca.spottedleaf.dataconverter.minecraft.datatypes; + +import ca.spottedleaf.dataconverter.minecraft.versions.*; @@ -6789,6 +6805,12 @@ index 0000000000000000000000000000000000000000..602c210df505613482bb4b1bbb782c0d + V3094.register(); + V3097.register(); + V3108.register(); ++ V3201.register(); ++ // V3202 registers a simple tile entity ++ // V3203 registers a simple entity ++ // V3204 registers a simple tile entity ++ V3209.register(); ++ V3214.register(); + } + + private MCTypeRegistry() {} @@ -7119,7 +7141,7 @@ index 0000000000000000000000000000000000000000..7e8f42eb57c12c885a1c17eafab1c9d9 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V101.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V101.java new file mode 100644 -index 0000000000000000000000000000000000000000..bcdca74d1ca7265afaa3fc0f6913ddfb07800377 +index 0000000000000000000000000000000000000000..98fbbf59ca00dbf58982d93f561f7d5f5b81951f --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V101.java @@ -0,0 +1,73 @@ @@ -7151,7 +7173,7 @@ index 0000000000000000000000000000000000000000..bcdca74d1ca7265afaa3fc0f6913ddfb + if (textString.charAt(0) == '"' && textString.charAt(textString.length() - 1) == '"' + || textString.charAt(0) == '{' && textString.charAt(textString.length() - 1) == '}') { + try { -+ component = GsonHelper.fromJson(BlockEntitySignTextStrictJsonFix.GSON, textString, Component.class, true); ++ component = GsonHelper.fromNullableJson(BlockEntitySignTextStrictJsonFix.GSON, textString, Component.class, true); + if (component == null) { + component = CommonComponents.EMPTY; + } @@ -8300,7 +8322,7 @@ index 0000000000000000000000000000000000000000..711222cd33ee557b7f3d1f6ae73ad45d +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1451.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1451.java new file mode 100644 -index 0000000000000000000000000000000000000000..a1f270f55617e1608bf7821951fa589e611b6f7d +index 0000000000000000000000000000000000000000..b88616e5af3b9f213bd7ee514ab191a468c61be7 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1451.java @@ -0,0 +1,512 @@ @@ -8448,7 +8470,7 @@ index 0000000000000000000000000000000000000000..a1f270f55617e1608bf7821951fa589e + MCTypeRegistry.ITEM_STACK.addStructureConverter(new ConverterFlattenItemStack()); + + // V5 -+ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:spawn_egg", new ConverterFlattenSpawnEgg()); ++ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:spawn_egg", new ConverterFlattenSpawnEgg(VERSION, 5)); + /* This datafixer has been disabled because the collar colour handler did not change from 1.12 -> 1.13 at all. + // So clearly somebody fucked up. This fixes wolf colours incorrectly converting between versions + MCTypeRegistry.ENTITY.addConverterForId("minecraft:wolf", new DataConverter<>(VERSION, 5) { @@ -10822,10 +10844,10 @@ index 0000000000000000000000000000000000000000..7dbc6ac66a29d3b5e4df5d0105c8fc03 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1514.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1514.java new file mode 100644 -index 0000000000000000000000000000000000000000..86be7a09d19ca94a30186e69655dc164344ae74d +index 0000000000000000000000000000000000000000..952598369cb8e5fd567544853bae4f4f7778f6d5 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1514.java -@@ -0,0 +1,69 @@ +@@ -0,0 +1,68 @@ +package ca.spottedleaf.dataconverter.minecraft.versions; + +import ca.spottedleaf.dataconverter.converters.DataConverter; @@ -10833,7 +10855,6 @@ index 0000000000000000000000000000000000000000..86be7a09d19ca94a30186e69655dc164 +import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; +import ca.spottedleaf.dataconverter.types.MapType; +import net.minecraft.network.chat.Component; -+import net.minecraft.world.scores.criteria.ObjectiveCriteria; + +public final class V1514 { + @@ -10875,8 +10896,8 @@ index 0000000000000000000000000000000000000000..86be7a09d19ca94a30186e69655dc164 + }); + + MCTypeRegistry.OBJECTIVE.addStructureConverter(new DataConverter<>(VERSION) { -+ private static ObjectiveCriteria.RenderType getRenderType(String string) { -+ return string.equals("health") ? ObjectiveCriteria.RenderType.HEARTS : ObjectiveCriteria.RenderType.INTEGER; ++ private static String getRenderType(String string) { ++ return string.equals("health") ? "hearts" : "integer"; + } + + @Override @@ -10888,7 +10909,7 @@ index 0000000000000000000000000000000000000000..86be7a09d19ca94a30186e69655dc164 + + final String criteriaName = data.getString("CriteriaName", ""); + -+ data.setString("RenderType", getRenderType(criteriaName).getId()); ++ data.setString("RenderType", getRenderType(criteriaName)); + + return null; + } @@ -11044,7 +11065,7 @@ index 0000000000000000000000000000000000000000..7b304031e1e8af120c6535e599c2ee4f +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V165.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V165.java new file mode 100644 -index 0000000000000000000000000000000000000000..18c84de9e6015a40c189134cc5aaee84267f2669 +index 0000000000000000000000000000000000000000..20eebfbbf913c92886a21fa4790c64cca8d8ba88 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V165.java @@ -0,0 +1,79 @@ @@ -11088,7 +11109,7 @@ index 0000000000000000000000000000000000000000..18c84de9e6015a40c189134cc5aaee84 + if (!"null".equals(page) && !StringUtils.isEmpty(page)) { + if (page.charAt(0) == '"' && page.charAt(page.length() - 1) == '"' || page.charAt(0) == '{' && page.charAt(page.length() - 1) == '}') { + try { -+ component = GsonHelper.fromJson(BlockEntitySignTextStrictJsonFix.GSON, page, Component.class, true); ++ component = GsonHelper.fromNullableJson(BlockEntitySignTextStrictJsonFix.GSON, page, Component.class, true); + if (component == null) { + component = CommonComponents.EMPTY; + } @@ -17668,6 +17689,101 @@ index 0000000000000000000000000000000000000000..381b49f2c50d46e52f7f9c8f6baede4e + }); + } +} +diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java +new file mode 100644 +index 0000000000000000000000000000000000000000..24f661419cd08caa4f6d8b3ea66f0d484d07b5b9 +--- /dev/null ++++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java +@@ -0,0 +1,33 @@ ++package ca.spottedleaf.dataconverter.minecraft.versions; ++ ++import ca.spottedleaf.dataconverter.converters.DataConverter; ++import ca.spottedleaf.dataconverter.minecraft.MCVersions; ++import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; ++import ca.spottedleaf.dataconverter.types.MapType; ++ ++public final class V3201 { ++ ++ private static final int VERSION = MCVersions.V1_19_2 + 81; ++ ++ public static void register() { ++ MCTypeRegistry.OPTIONS.addStructureConverter(new DataConverter<>(VERSION) { ++ private static void fixList(final MapType data, final String target) { ++ if (data == null) { ++ return; ++ } ++ final String curr = data.getString(target); ++ if (curr == null) { ++ return; ++ } ++ data.setString(target, curr.replace("\"programer_art\"", "\"programmer_art\"")); ++ } ++ ++ @Override ++ public MapType convert(final MapType data, final long sourceVersion, final long toVersion) { ++ fixList(data, "resourcePacks"); ++ fixList(data, "incompatibleResourcePacks"); ++ return null; ++ } ++ }); ++ } ++} +diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java +new file mode 100644 +index 0000000000000000000000000000000000000000..f3a109ff01a96a750967e8becdc2a3e20b71b6dd +--- /dev/null ++++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java +@@ -0,0 +1,16 @@ ++package ca.spottedleaf.dataconverter.minecraft.versions; ++ ++import ca.spottedleaf.dataconverter.minecraft.MCVersions; ++import ca.spottedleaf.dataconverter.minecraft.converters.itemstack.ConverterFlattenSpawnEgg; ++import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; ++ ++public final class V3209 { ++ ++ private static final int VERSION = MCVersions.V22W45A + 1; ++ ++ public static void register() { ++ // Note: This converter reads entity id from its sub data, but we need no breakpoint because entity ids are not ++ // remapped this version ++ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:pig_spawn_egg", new ConverterFlattenSpawnEgg(VERSION, 0)); ++ } ++} +diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java +new file mode 100644 +index 0000000000000000000000000000000000000000..b01ae34d2e238f217eb8de8b2d3502e959b5b3a7 +--- /dev/null ++++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java +@@ -0,0 +1,28 @@ ++package ca.spottedleaf.dataconverter.minecraft.versions; ++ ++import ca.spottedleaf.dataconverter.converters.DataConverter; ++import ca.spottedleaf.dataconverter.minecraft.MCVersions; ++import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; ++import ca.spottedleaf.dataconverter.types.MapType; ++ ++public final class V3214 { ++ ++ private static final int VERSION = MCVersions.V1_19_3_PRE3 + 1; ++ ++ public static void register() { ++ MCTypeRegistry.OPTIONS.addStructureConverter(new DataConverter<>(VERSION) { ++ @Override ++ public MapType convert(final MapType data, final long sourceVersion, final long toVersion) { ++ final String value = data.getString("ao"); ++ ++ if ("0".equals(value)) { ++ data.setString("ao", "false"); ++ } else if ("1".equals(value) || "2".equals(value)) { ++ data.setString("ao", "true"); ++ } ++ ++ return null; ++ } ++ }); ++ } ++} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java new file mode 100644 index 0000000000000000000000000000000000000000..6ab2bf99d72983fc2742a1f6f2f7fa671611526d @@ -17998,10 +18114,10 @@ index 0000000000000000000000000000000000000000..88d9c0fcd88ccfd6d6b46ae050914079 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V704.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V704.java new file mode 100644 -index 0000000000000000000000000000000000000000..0185fd60943dfb53c9d0707f1ff879658230d488 +index 0000000000000000000000000000000000000000..1b7e01593952390fcbe86e672050a4c37a73e44e --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V704.java -@@ -0,0 +1,341 @@ +@@ -0,0 +1,383 @@ +package ca.spottedleaf.dataconverter.minecraft.versions; + +import ca.spottedleaf.dataconverter.converters.DataConverter; @@ -18015,12 +18131,19 @@ index 0000000000000000000000000000000000000000..0185fd60943dfb53c9d0707f1ff87965 +import ca.spottedleaf.dataconverter.types.ObjectType; +import ca.spottedleaf.dataconverter.types.MapType; +import com.mojang.logging.LogUtils; ++import net.minecraft.core.BlockPos; +import net.minecraft.core.Registry; ++import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; ++import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; ++import net.minecraft.world.level.block.entity.BlockEntity; ++import net.minecraft.world.level.block.entity.BlockEntityType; ++import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import java.util.HashMap; ++import java.util.LinkedHashMap; +import java.util.Map; + +public final class V704 { @@ -18161,23 +18284,58 @@ index 0000000000000000000000000000000000000000..0185fd60943dfb53c9d0707f1ff87965 + ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:sculk_catalyst", "minecraft:sculk_catalyst"); + ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:mangrove_sign", "minecraft:sign"); + ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:sculk_shrieker", "minecraft:sculk_shrieker"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:chiseled_bookshelf", "minecraft:chiseled_bookshelf"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:bamboo_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:oak_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:spruce_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:birch_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:jungle_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:acacia_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:dark_oak_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:mangrove_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:bamboo_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:crimson_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:warped_hanging_sign", "minecraft:sign"); ++ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:piglin_head", "minecraft:skull"); + } + + // This class is responsible for also integrity checking the item id to tile id map here, we just use the item registry to figure it out + + static { -+ for (final Item item : Registry.ITEM) { ++ for (final Item item : BuiltInRegistries.ITEM) { + if (!(item instanceof BlockItem)) { + continue; + } + -+ if (!(((BlockItem)item).getBlock() instanceof EntityBlock)) { ++ if (!(((BlockItem)item).getBlock() instanceof EntityBlock entityBlock)) { + continue; + } + -+ final String itemName = Registry.ITEM.getKey(item).toString(); -+ if (!ITEM_ID_TO_TILE_ENTITY_ID.containsKey(itemName)) { ++ String possibleId; ++ try { ++ final BlockEntity entity = entityBlock.newBlockEntity(new BlockPos(0, 0, 0), ((Block)entityBlock).defaultBlockState()); ++ if (entity != null) { ++ possibleId = BlockEntityType.getKey(entity.getType()).toString(); ++ } else { ++ possibleId = null; ++ } ++ } catch (final Throwable th) { ++ possibleId = null; ++ } ++ ++ final String itemName = BuiltInRegistries.ITEM.getKey(item).toString(); ++ final String mappedTo = ITEM_ID_TO_TILE_ENTITY_ID.get(itemName); ++ if (mappedTo == null) { + LOGGER.error("Item id " + itemName + " does not contain tile mapping! (V704)"); ++ } else if (possibleId != null && !mappedTo.equals(possibleId)) { ++ final boolean chestCase = mappedTo.equals("minecraft:chest") && possibleId.equals("minecraft:trapped_chest"); ++ final boolean signCase = mappedTo.equals("minecraft:sign") && possibleId.equals("minecraft:hanging_sign"); ++ // save data is identical for the chest and sign case, so we don't care ++ // it's also important to note that there is no versioning for this map, so it is possible ++ // that mapping them correctly could cause issues converting old data ++ if (!chestCase && !signCase) { ++ LOGGER.error("Item id " + itemName + " is mapped to the wrong tile entity! Mapped to: " + mappedTo + ", expected: " + possibleId); ++ } + } + } + } @@ -22720,10 +22878,10 @@ index 6701d07886325e33f45ac894bfaa1c5b91afad9d..5631345dee84001be1053fbf92def683 for(int l = this.levelHeightAccessor.getMinSection(); l < this.levelHeightAccessor.getMaxSection(); ++l) { diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java -index 963ad3ce1ef83888ae1537ff01accdbb5b04ffa1..a7cba5b828a586d7435bda4d512af68684244682 100644 +index 874f7ea643d27eec47d51a10ad472af7e8ec402e..4761aa772bc34dd66547dd4dd561c2e04c3229ad 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java -@@ -115,7 +115,7 @@ public class StructureCheck { +@@ -116,7 +116,7 @@ public class StructureCheck { CompoundTag compoundTag2; try { diff --git a/patches/unapplied/server/0014-Starlight.patch b/patches/server/0014-Starlight.patch similarity index 98% rename from patches/unapplied/server/0014-Starlight.patch rename to patches/server/0014-Starlight.patch index 94568e6b0b..a993536643 100644 --- a/patches/unapplied/server/0014-Starlight.patch +++ b/patches/server/0014-Starlight.patch @@ -4485,18 +4485,18 @@ index 74d1ae0104e8d0795df50f00317fd860de4f112e..a7feddc31da0870faa3d32a7108282e9 private final DebugBuffer chunkToSaveHistory; public int oldTicketLevel; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 44f12777f115ca4d465bc603e1e23932e102efb2..4f8346d25187153ce9c9b61b897a65bd2ed62e65 100644 +index fc5965f8f2ac21a8465285e5933d8490b015568d..ecb5a18874509341dd691b290ea7d1f8c17e0bd7 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -128,7 +128,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -131,7 +131,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final LongSet entitiesInLevel; public final ServerLevel level; private final ThreadedLevelLightEngine lightEngine; - private final BlockableEventLoop mainThreadExecutor; + public final BlockableEventLoop mainThreadExecutor; // Paper - public public ChunkGenerator generator; - private RandomState randomState; - public final Supplier overworldDataStorage; + private final RandomState randomState; + private final ChunkGeneratorStructureState chunkGeneratorState; diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java index fbe62a31ab199d83a1db0a4e0b1a813824e6f2c2..d38ad1b1eee92a6dbd2b79b4fcdb8959cdb4007d 100644 --- a/src/main/java/net/minecraft/server/level/DistanceManager.java @@ -4820,18 +4820,18 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..6051e5f272838ef23276a90e21c2fc82 public static TicketType create(String name, Comparator argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); 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 f0bd06ab32e99c188510b3c3fa41f1737ab4fe78..51ac731cf49e6d2cd574e48f26c4b151e9014826 100644 +index aa2f76ff47699f23474f2e409ef9b773e48d50b8..5bba39a066ede470cebc92724735c86ecfd4239d 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 -@@ -694,6 +694,7 @@ public abstract class BlockBehaviour { - this.hasPostProcess = blockbase_info.hasPostProcess; +@@ -726,6 +726,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.emissiveRendering = blockbase_info.emissiveRendering; this.offsetType = (BlockBehaviour.OffsetType) blockbase_info.offsetType.apply(this.asState()); + this.spawnParticlesOnBreak = blockbase_info.spawnParticlesOnBreak; + this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper } // Paper start -@@ -702,12 +703,25 @@ public abstract class BlockBehaviour { +@@ -734,6 +735,18 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; } // Paper end @@ -4849,7 +4849,8 @@ index f0bd06ab32e99c188510b3c3fa41f1737ab4fe78..51ac731cf49e6d2cd574e48f26c4b151 + // Paper end - starlight public void initCache() { - if (!this.getBlock().hasDynamicShape()) { + this.fluidState = ((Block) this.owner).getFluidState(this.asState()); +@@ -742,6 +755,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.cache = new BlockBehaviour.BlockStateBase.Cache(this.asState()); } this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here @@ -4858,7 +4859,7 @@ index f0bd06ab32e99c188510b3c3fa41f1737ab4fe78..51ac731cf49e6d2cd574e48f26c4b151 } diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -index fabc7df600c89b01d97a76eb0b1206a32407b906..0e787d877901dfcea714b0e14e9fc4358ee30bbe 100644 +index 3fdbb777d4722596cc4df79b2d4d7b9c553580fd..1b7496cec0ba5a95615a069e3168bd46308d0b40 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java @@ -81,6 +81,47 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -4910,10 +4911,10 @@ index fabc7df600c89b01d97a76eb0b1206a32407b906..0e787d877901dfcea714b0e14e9fc435 public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry biome, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable BlendingData blendingData) { this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java -index 441d46635caedfae3cb2f46d30b8d9ae95636e7b..e6240f891e396d91e31b02fdf3084be77e9d6697 100644 +index f4aab0bf544ef5c889c02e41389b1656cf1e4932..bf66cdb94daa6657e9415adfa16d16983b258ee3 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java -@@ -292,6 +292,17 @@ public class ChunkStatus { +@@ -293,6 +293,17 @@ public class ChunkStatus { return this.chunkType; } @@ -4929,7 +4930,7 @@ index 441d46635caedfae3cb2f46d30b8d9ae95636e7b..e6240f891e396d91e31b02fdf3084be7 + } + // Paper end public static ChunkStatus byName(String id) { - return (ChunkStatus) Registry.CHUNK_STATUS.get(ResourceLocation.tryParse(id)); + return (ChunkStatus) BuiltInRegistries.CHUNK_STATUS.get(ResourceLocation.tryParse(id)); } diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java index 587cc435a58d28e14e88860c8348425101334eda..2eb92dde607d7c8968cb07c6f3c24e1c45e9990f 100644 @@ -4977,7 +4978,7 @@ index 587cc435a58d28e14e88860c8348425101334eda..2eb92dde607d7c8968cb07c6f3c24e1c public BlockState getBlockState(BlockPos pos) { return Blocks.VOID_AIR.defaultBlockState(); diff --git a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java -index 3dff0f7c3ccd04a67b2153e402d801de2341e520..ac5dff35e2df23b8790bbe65c40acc6a3c77e6ac 100644 +index 80b98e6667f1a0c21d019c58a8a0d4cc5b0f48e1..8033c8741a0f73919a357893652592b317bfb417 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java @@ -31,6 +31,48 @@ public class ImposterProtoChunk extends ProtoChunk { @@ -5027,16 +5028,18 @@ index 3dff0f7c3ccd04a67b2153e402d801de2341e520..ac5dff35e2df23b8790bbe65c40acc6a + // Paper end - rewrite light engine + public ImposterProtoChunk(LevelChunk wrapped, boolean bl) { - super(wrapped.getPos(), UpgradeData.EMPTY, wrapped.levelHeightAccessor, wrapped.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), wrapped.getBlendingData()); + super(wrapped.getPos(), UpgradeData.EMPTY, wrapped.levelHeightAccessor, wrapped.getLevel().registryAccess().registryOrThrow(Registries.BIOME), wrapped.getBlendingData()); this.wrapped = wrapped; 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 1c6f51c227a0b6da81eeb817f996789645a547db..a6e364f88abcf1a6afcdd85b340ae8d62b753e4f 100644 +index 49f091183111958ebd3fb56964fc5d728c16755c..6f99f4acfdac5516dac07a6c9af220eed5c5358e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -93,6 +93,10 @@ public class LevelChunk extends ChunkAccess { +@@ -92,7 +92,11 @@ public class LevelChunk extends ChunkAccess { + } public LevelChunk(Level world, ChunkPos pos, UpgradeData upgradeData, LevelChunkTicks blockTickScheduler, LevelChunkTicks fluidTickScheduler, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable LevelChunk.PostLoadProcessor entityLoader, @Nullable BlendingData blendingData) { - super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), inhabitedTime, sectionArrayInitializer, blendingData); +- super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData); ++ super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registries.BIOME)), inhabitedTime, sectionArrayInitializer, blendingData); + // Paper start - rewrite light engine + this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world)); + this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world)); @@ -5058,7 +5061,7 @@ index 1c6f51c227a0b6da81eeb817f996789645a547db..a6e364f88abcf1a6afcdd85b340ae8d6 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..33eecdac9d844af2f70aad97c4788b138dab8896 100644 +index 7798cbbae6b72d64e6129cebf1f66696f21e15f9..e310b018004c8d7edbfec877f06671d17f7e47fd 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -142,7 +142,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @@ -5088,10 +5091,10 @@ index 92a64c49b1c7227a5b34488ea15d3d8adb0f9c80..0b67858f8d6689b34816f9556f3424af this.fluidTicks = fluidTickScheduler; } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8ae63d2f5a 100644 +index 6fdd5c92ab069896e3921faa042cbdb3c29d0538..942f8db571cf87d0e9614bdc7dd9525068cf1001 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -82,6 +82,14 @@ public class ChunkSerializer { +@@ -84,6 +84,14 @@ public class ChunkSerializer { public static final String BLOCK_LIGHT_TAG = "BlockLight"; public static final String SKY_LIGHT_TAG = "SkyLight"; @@ -5106,7 +5109,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a public ChunkSerializer() {} public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { -@@ -92,13 +100,20 @@ public class ChunkSerializer { +@@ -94,13 +102,20 @@ public class ChunkSerializer { } UpgradeData chunkconverter = nbt.contains("UpgradeData", 10) ? new UpgradeData(nbt.getCompound("UpgradeData"), world) : UpgradeData.EMPTY; @@ -5117,7 +5120,8 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a LevelChunkSection[] achunksection = new LevelChunkSection[i]; boolean flag1 = world.dimensionType().hasSkyLight(); ServerChunkCache chunkproviderserver = world.getChunkSource(); - LevelLightEngine lightengine = chunkproviderserver.getLightEngine(); +- LevelLightEngine lightengine = chunkproviderserver.getLightEngine(); ++ LevelLightEngine lightengine = chunkproviderserver.getLightEngine();; + // Paper start + ca.spottedleaf.starlight.common.light.SWMRNibbleArray[] blockNibbles = ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world); + ca.spottedleaf.starlight.common.light.SWMRNibbleArray[] skyNibbles = ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world); @@ -5125,10 +5129,10 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a + final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world); + boolean canReadSky = world.dimensionType().hasSkyLight(); + // Paper end - Registry iregistry = world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY); + Registry iregistry = world.registryAccess().registryOrThrow(Registries.BIOME); Codec>> codec = ChunkSerializer.makeBiomeCodecRW(iregistry); // CraftBukkit - read/write boolean flag2 = false; -@@ -106,7 +121,7 @@ public class ChunkSerializer { +@@ -108,7 +123,7 @@ public class ChunkSerializer { DataResult dataresult; for (int j = 0; j < nbttaglist.size(); ++j) { @@ -5137,7 +5141,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a byte b0 = nbttagcompound1.getByte("Y"); int k = world.getSectionIndexFromSectionY(b0); -@@ -147,19 +162,39 @@ public class ChunkSerializer { +@@ -149,19 +164,39 @@ public class ChunkSerializer { boolean flag3 = nbttagcompound1.contains("BlockLight", 7); boolean flag4 = flag1 && nbttagcompound1.contains("SkyLight", 7); @@ -5185,7 +5189,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a } } -@@ -188,6 +223,8 @@ public class ChunkSerializer { +@@ -190,6 +225,8 @@ public class ChunkSerializer { }, chunkPos); object1 = new LevelChunk(world.getLevel(), chunkPos, chunkconverter, levelchunkticks, levelchunkticks1, l, achunksection, ChunkSerializer.postLoadChunk(world, nbt), blendingdata); @@ -5193,9 +5197,9 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a + ((LevelChunk)object1).setSkyNibbles(skyNibbles); // Paper - replace light impl } else { ProtoChunkTicks protochunkticklist = ProtoChunkTicks.load(nbt.getList("block_ticks", 10), (s) -> { - return Registry.BLOCK.getOptional(ResourceLocation.tryParse(s)); -@@ -196,6 +233,8 @@ public class ChunkSerializer { - return Registry.FLUID.getOptional(ResourceLocation.tryParse(s)); + return BuiltInRegistries.BLOCK.getOptional(ResourceLocation.tryParse(s)); +@@ -198,6 +235,8 @@ public class ChunkSerializer { + return BuiltInRegistries.FLUID.getOptional(ResourceLocation.tryParse(s)); }, chunkPos); ProtoChunk protochunk = new ProtoChunk(chunkPos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, iregistry, blendingdata); + protochunk.setBlockNibbles(blockNibbles); // Paper - replace light impl @@ -5203,7 +5207,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a object1 = protochunk; protochunk.setInhabitedTime(l); -@@ -336,6 +375,12 @@ public class ChunkSerializer { +@@ -342,6 +381,12 @@ public class ChunkSerializer { // CraftBukkit end public static CompoundTag write(ServerLevel world, ChunkAccess chunk) { @@ -5216,7 +5220,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a ChunkPos chunkcoordintpair = chunk.getPos(); CompoundTag nbttagcompound = new CompoundTag(); -@@ -386,11 +431,14 @@ public class ChunkSerializer { +@@ -392,11 +437,14 @@ public class ChunkSerializer { for (int i = lightenginethreaded.getMinLightSection(); i < lightenginethreaded.getMaxLightSection(); ++i) { int j = chunk.getSectionIndexFromSectionY(i); boolean flag1 = j >= 0 && j < achunksection.length; @@ -5235,7 +5239,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a if (flag1) { LevelChunkSection chunksection = achunksection[j]; -@@ -405,13 +453,27 @@ public class ChunkSerializer { +@@ -411,13 +459,27 @@ public class ChunkSerializer { nbttagcompound1.put("biomes", (Tag) dataresult1.getOrThrow(false, logger1::error)); } @@ -5267,7 +5271,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a if (!nbttagcompound1.isEmpty()) { nbttagcompound1.putByte("Y", (byte) i); -@@ -422,7 +484,8 @@ public class ChunkSerializer { +@@ -428,7 +490,8 @@ public class ChunkSerializer { nbttagcompound.put("sections", nbttaglist); if (flag) { @@ -5277,7 +5281,7 @@ index 6c844a826892c5f31d5afb9ead56d4cff3ab5968..8da52553a9465bf88a0c22fd987a4d8a } ListTag nbttaglist1 = new ListTag(); -@@ -497,6 +560,17 @@ public class ChunkSerializer { +@@ -503,6 +566,17 @@ public class ChunkSerializer { })); } diff --git a/patches/unapplied/server/0015-Not-implemeneted.patch b/patches/server/0015-Not-implemeneted.patch similarity index 100% rename from patches/unapplied/server/0015-Not-implemeneted.patch rename to patches/server/0015-Not-implemeneted.patch diff --git a/patches/unapplied/server/0016-Rewrite-chunk-system.patch b/patches/server/0016-Rewrite-chunk-system.patch similarity index 98% rename from patches/unapplied/server/0016-Rewrite-chunk-system.patch rename to patches/server/0016-Rewrite-chunk-system.patch index 39e3cc4393..4f88e21c40 100644 --- a/patches/unapplied/server/0016-Rewrite-chunk-system.patch +++ b/patches/server/0016-Rewrite-chunk-system.patch @@ -12718,22 +12718,22 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292 @Override diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 4dd3af1416cbdad330365a19ad664079f3598c15..45db9f1b1d19319e7f92bd4e61be9ea9b06dd5e5 100644 +index b7399e29094c66c88a6f4c0e996a906bcaa3b4ca..e600563a9d2ddbfa37c106481decb13e67f71524 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -262,6 +262,7 @@ public class Main { +@@ -259,6 +259,7 @@ public class Main { convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata); */ + Class.forName(net.minecraft.world.entity.npc.VillagerTrades.class.getName());// Paper - load this sync so it won't fail later async final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> { - DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); + DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2b2b71f3963e66fa0d2683b10581b1a38c774549..0d2114be30df99c5b50f82def97b0a44e797e573 100644 +index ea35461400b55243a46989f1bbd57b428298e7a1..11fd961b2b522920ceb5cde7dbf5cc197044836a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -287,7 +287,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); @@ -12742,7 +12742,7 @@ index 2b2b71f3963e66fa0d2683b10581b1a38c774549..0d2114be30df99c5b50f82def97b0a44 ((MinecraftServer) atomicreference.get()).runServer(); }, "Server thread"); -@@ -576,7 +576,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit -@@ -1095,6 +1084,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop mainThreadExecutor; // Paper - public -@@ -133,16 +130,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - private RandomState randomState; +@@ -137,16 +134,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + private final ChunkGeneratorStructureState chunkGeneratorState; public final Supplier overworldDataStorage; private final PoiManager poiManager; - public final LongSet toDrop; @@ -13567,7 +13567,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b private final String storageName; private final PlayerMap playerMap; public final Int2ObjectMap entityMap; -@@ -151,37 +146,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -155,37 +150,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final Queue unloadQueue; int viewDistance; @@ -13609,7 +13609,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } -@@ -189,6 +168,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -193,6 +172,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkX = MCUtil.getChunkCoordinate(player.getX()); int chunkZ = MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -13617,7 +13617,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } // Paper end // Paper start -@@ -218,16 +198,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -222,16 +202,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) { @@ -13636,9 +13636,9 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b this.tickingGenerated = new AtomicInteger(); this.playerMap = new PlayerMap(); this.entityMap = new Int2ObjectOpenHashMap(); -@@ -254,19 +231,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - } +@@ -262,19 +239,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + this.chunkGeneratorState = chunkGenerator.createState(iregistrycustom.lookupOrThrow(Registries.STRUCTURE_SET), this.randomState, j); this.mainThreadExecutor = mainThreadExecutor; - ProcessorMailbox threadedmailbox = ProcessorMailbox.create(executor, "worldgen"); + // Paper - rewrite chunk system @@ -13660,8 +13660,8 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b + this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), null, null); // Paper - rewrite chunk system this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor); this.overworldDataStorage = persistentStateManagerFactory; - this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world.registryAccess(), world); -@@ -327,20 +302,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); +@@ -339,20 +314,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable protected ChunkHolder getUpdatingChunkIfPresent(long pos) { @@ -13691,7 +13691,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } public String getChunkDebugData(ChunkPos chunkPos) { -@@ -377,75 +354,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -389,75 +366,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end private CompletableFuture, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction distanceToStatus) { @@ -13768,7 +13768,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) { -@@ -475,261 +384,72 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -487,261 +396,72 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public CompletableFuture> prepareEntityTickingChunk(ChunkPos pos) { @@ -14050,7 +14050,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b return nbt.contains("Status", 8); } -@@ -765,45 +485,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -777,45 +497,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private CompletableFuture> scheduleChunkGeneration(ChunkHolder holder, ChunkStatus requiredStatus) { @@ -14097,7 +14097,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } protected void releaseLightTicket(ChunkPos pos) { -@@ -814,7 +496,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -826,7 +508,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider })); } @@ -14106,7 +14106,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b ChunkStatus chunkstatus1; if (distance == 0) { -@@ -826,7 +508,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -838,7 +520,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return chunkstatus1; } @@ -14115,7 +14115,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b if (!nbt.isEmpty()) { // CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities world.addWorldGenChunkEntities(EntityType.loadEntitiesRecursive(nbt, world).filter((entity) -> { -@@ -848,91 +530,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -860,91 +542,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private CompletableFuture> protoChunkToFullChunk(ChunkHolder chunkHolder) { @@ -14210,7 +14210,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } public int getTickingGenerated() { -@@ -940,94 +546,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -952,94 +558,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) { @@ -14313,7 +14313,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b public void setViewDistance(int watchDistance) { int j = Mth.clamp(watchDistance + 1, (int) 3, (int) 33); -@@ -1035,33 +569,18 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1047,33 +581,18 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int k = this.viewDistance; this.viewDistance = j; @@ -14350,7 +14350,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b if (chunk != null) { this.playerLoadedChunk(player, packet, chunk); -@@ -1091,30 +610,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1103,30 +622,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } void dumpChunks(Writer writer) throws IOException { @@ -14382,7 +14382,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } private static String printFuture(CompletableFuture> future) { -@@ -1133,6 +629,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1145,6 +641,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -14418,7 +14418,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b private CompletableFuture> readChunk(ChunkPos chunkPos) { return this.read(chunkPos).thenApplyAsync((optional) -> { return optional.map((nbttagcompound) -> this.upgradeChunkTag(nbttagcompound, chunkPos)); // CraftBukkit -@@ -1236,15 +761,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1248,15 +773,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.removePlayerFromDistanceMaps(player); // Paper - distance maps } @@ -14435,7 +14435,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } -@@ -1252,7 +769,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1264,7 +781,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider SectionPos sectionposition = SectionPos.of((EntityAccess) player); player.setLastSectionPos(sectionposition); @@ -14444,7 +14444,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b return sectionposition; } -@@ -1307,65 +824,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1319,65 +836,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int k1; int l1; @@ -14530,7 +14530,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } public void addEntity(Entity entity) { -@@ -1560,7 +1050,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1597,7 +1087,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Override protected boolean isChunkToRemove(long pos) { @@ -14539,7 +14539,7 @@ index 4f8346d25187153ce9c9b61b897a65bd2ed62e65..f69a4df520760fe9e849eb61512f410b } @Nullable -@@ -1641,7 +1131,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1678,7 +1168,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (player != this.entity) { Vec3 vec3d = player.position().subtract(this.entity.position()); @@ -15013,10 +15013,10 @@ index d38ad1b1eee92a6dbd2b79b4fcdb8959cdb4007d..ffa1e457decf8502c3283352bf5be94d + */ // Paper - rewrite chunk system } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a7923685b3c 100644 +index 28c8a3ba1caddf0ea334a6ef43cae25f982743e4..80d108ae7faf3fdcb024931e93032215935fe70b 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -366,7 +366,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -367,7 +367,7 @@ public class ServerChunkCache extends ChunkSource { public LevelChunk getChunkAtIfLoadedImmediately(int x, int z) { long k = ChunkPos.asLong(x, z); @@ -15025,7 +15025,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 return this.getChunkAtIfLoadedMainThread(x, z); } -@@ -388,11 +388,34 @@ public class ServerChunkCache extends ChunkSource { +@@ -389,11 +389,34 @@ public class ServerChunkCache extends ChunkSource { return ret; } // Paper end @@ -15061,7 +15061,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 return (ChunkAccess) CompletableFuture.supplyAsync(() -> { return this.getChunk(x, z, leastStatus, create); }, this.mainThreadProcessor).join(); -@@ -404,23 +427,20 @@ public class ServerChunkCache extends ChunkSource { +@@ -405,23 +428,20 @@ public class ServerChunkCache extends ChunkSource { ChunkAccess ichunkaccess; @@ -15091,7 +15091,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 this.level.timings.syncChunkLoad.stopTiming(); // Paper } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { -@@ -440,7 +460,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -441,7 +461,7 @@ public class ServerChunkCache extends ChunkSource { @Nullable @Override public LevelChunk getChunkNow(int chunkX, int chunkZ) { @@ -15100,7 +15100,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 return null; } else { this.level.getProfiler().incrementCounter("getChunkNow"); -@@ -486,7 +506,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -487,7 +507,7 @@ public class ServerChunkCache extends ChunkSource { } public CompletableFuture> getChunkFuture(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { @@ -15109,7 +15109,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 CompletableFuture completablefuture; if (flag1) { -@@ -507,47 +527,52 @@ public class ServerChunkCache extends ChunkSource { +@@ -508,47 +528,52 @@ public class ServerChunkCache extends ChunkSource { } private CompletableFuture> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { @@ -15195,7 +15195,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } @Override -@@ -558,22 +583,13 @@ public class ServerChunkCache extends ChunkSource { +@@ -559,22 +584,13 @@ public class ServerChunkCache extends ChunkSource { if (playerchunk == null) { return null; } else { @@ -15224,7 +15224,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } } -@@ -587,15 +603,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -588,15 +604,7 @@ public class ServerChunkCache extends ChunkSource { } boolean runDistanceManagerUpdates() { @@ -15241,7 +15241,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } // Paper start -@@ -605,17 +613,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -606,17 +614,10 @@ public class ServerChunkCache extends ChunkSource { // Paper end public boolean isPositionTicking(long pos) { @@ -15263,7 +15263,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } public void save(boolean flush) { -@@ -631,17 +632,13 @@ public class ServerChunkCache extends ChunkSource { +@@ -632,17 +633,13 @@ public class ServerChunkCache extends ChunkSource { this.close(true); } @@ -15284,7 +15284,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 this.level.getProfiler().push("purge"); this.distanceManager.purgeStaleTickets(); this.runDistanceManagerUpdates(); -@@ -662,6 +659,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -663,6 +660,7 @@ public class ServerChunkCache extends ChunkSource { this.level.getProfiler().popPush("chunks"); if (tickChunks) { this.level.timings.chunks.startTiming(); // Paper - timings @@ -15292,7 +15292,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 this.tickChunks(); this.level.timings.chunks.stopTiming(); // Paper - timings } -@@ -758,7 +756,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -759,7 +757,12 @@ public class ServerChunkCache extends ChunkSource { ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); if (playerchunk != null) { @@ -15306,7 +15306,7 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } } -@@ -920,17 +923,11 @@ public class ServerChunkCache extends ChunkSource { +@@ -925,17 +928,11 @@ public class ServerChunkCache extends ChunkSource { @Override // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task public boolean pollTask() { @@ -15327,19 +15327,19 @@ index 0bf02ffba51e0dda6d01972c3f8c834c42d72512..e63c655a9c65f0408c3d025ee4619a79 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acdb4bc81d4 100644 +index a6387b7dcc51cdf5d2646162cb24c1ba7f84795b..1fb159167321e9ac2b8e4a895914d21042ba1894 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -190,7 +190,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -193,7 +193,7 @@ public class ServerLevel extends Level implements WorldGenLevel { private final MinecraftServer server; public final PrimaryLevelData serverLevelData; // CraftBukkit - type final EntityTickList entityTickList; - public final PersistentEntitySectionManager entityManager; + //public final PersistentEntitySectionManager entityManager; // Paper - rewrite chunk system + private final GameEventDispatcher gameEventDispatcher; public boolean noSave; private final SleepStatus sleepStatus; - private int emptyTime; -@@ -315,7 +315,108 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -318,7 +318,108 @@ public class ServerLevel extends Level implements WorldGenLevel { } } } @@ -15449,7 +15449,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd // 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) { -@@ -359,16 +460,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -361,16 +462,16 @@ public class ServerLevel extends Level implements WorldGenLevel { // CraftBukkit end boolean flag2 = minecraftserver.forceSynchronousWrites(); DataFixer datafixer = minecraftserver.getFixerUpper(); @@ -15470,10 +15470,10 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd + this.chunkSource = new ServerChunkCache(this, convertable_conversionsession, datafixer, structuretemplatemanager, executor, chunkgenerator, j, k, flag2, worldloadlistener, null, () -> { // Paper - rewrite chunk system return minecraftserver.overworld().getDataStorage(); }); - chunkgenerator.ensureStructuresGenerated(this.chunkSource.randomState()); -@@ -397,6 +498,9 @@ public class ServerLevel extends Level implements WorldGenLevel { - + this.chunkSource.getGeneratorState().ensureStructuresGenerated(); +@@ -400,6 +501,9 @@ public class ServerLevel extends Level implements WorldGenLevel { this.sleepStatus = new SleepStatus(); + this.gameEventDispatcher = new GameEventDispatcher(this); this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit + + this.chunkTaskScheduler = new io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler(this, io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.workerThreads); // Paper - rewrite chunk system @@ -15481,7 +15481,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } public void setWeatherParameters(int clearDuration, int rainDuration, boolean raining, boolean thundering) { -@@ -500,7 +604,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -503,7 +607,7 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.push("checkDespawn"); entity.checkDespawn(); gameprofilerfiller.pop(); @@ -15490,16 +15490,14 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd Entity entity1 = entity.getVehicle(); if (entity1 != null) { -@@ -525,7 +629,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -528,13 +632,16 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.push("entityManagement"); - this.entityManager.tick(); + //this.entityManager.tick(); // Paper - rewrite chunk system - gameprofilerfiller.popPush("gameEvents"); - this.sendGameEvents(); gameprofilerfiller.pop(); -@@ -533,7 +637,10 @@ public class ServerLevel extends Level implements WorldGenLevel { + } @Override public boolean shouldTickBlocksAt(long chunkPos) { @@ -15511,7 +15509,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } protected void tickTime() { -@@ -975,6 +1082,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -996,6 +1103,11 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) { @@ -15523,7 +15521,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd ServerChunkCache chunkproviderserver = this.getChunkSource(); if (!savingDisabled) { -@@ -990,16 +1102,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1011,16 +1123,13 @@ public class ServerLevel extends Level implements WorldGenLevel { } timings.worldSaveChunks.startTiming(); // Paper @@ -15544,7 +15542,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd // CraftBukkit start - moved from MinecraftServer.saveChunks ServerLevel worldserver1 = this; -@@ -1116,7 +1225,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1156,7 +1265,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED); } @@ -15553,7 +15551,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } // CraftBukkit start -@@ -1132,7 +1241,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1172,7 +1281,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } // CraftBukkit end @@ -15562,7 +15560,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } } -@@ -1144,10 +1253,10 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1184,10 +1293,10 @@ public class ServerLevel extends Level implements WorldGenLevel { public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { // CraftBukkit end Stream stream = entity.getSelfAndPassengers().map(Entity::getUUID); // CraftBukkit - decompile error @@ -15576,7 +15574,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd return false; } else { this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit -@@ -1731,7 +1840,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1707,7 +1816,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -15585,7 +15583,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd bufferedwriter.write(String.format(Locale.ROOT, "block_entity_tickers: %d\n", this.blockEntityTickers.size())); bufferedwriter.write(String.format(Locale.ROOT, "block_ticks: %d\n", this.getBlockTicks().count())); bufferedwriter.write(String.format(Locale.ROOT, "fluid_ticks: %d\n", this.getFluidTicks().count())); -@@ -1780,7 +1889,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1756,7 +1865,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1); try { @@ -15594,7 +15592,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } catch (Throwable throwable4) { if (bufferedwriter2 != null) { try { -@@ -1801,7 +1910,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1777,7 +1886,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2); try { @@ -15603,16 +15601,16 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } catch (Throwable throwable6) { if (bufferedwriter3 != null) { try { -@@ -1943,7 +2052,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1919,7 +2028,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public String getWatchdogStats() { - return String.format(Locale.ROOT, "players: %s, entities: %s [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entityManager.gatherStats(), ServerLevel.getTypeCount(this.entityManager.getEntityGetter().getAll(), (entity) -> { + return String.format(Locale.ROOT, "players: %s, entities: %s [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entityLookup.getDebugInfo(), ServerLevel.getTypeCount(this.entityLookup.getAll(), (entity) -> { // Paper - rewrite chunk system - return Registry.ENTITY_TYPE.getKey(entity.getType()).toString(); + return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); }), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats()); } -@@ -2003,15 +2112,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1979,15 +2088,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public LevelEntityGetter getEntities() { org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot @@ -15631,7 +15629,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd } public void startTickingChunk(LevelChunk chunk) { -@@ -2027,34 +2136,49 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2003,34 +2112,49 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void close() throws IOException { super.close(); @@ -15687,7 +15685,7 @@ index 3049d732ce3df71a4755ee9160d4f3fae052d1b6..0d49f73d779b9e44c20ba923d5390acd + // Paper end - rewrite chunk system } - private final class EntityCallbacks implements LevelCallback { + @Override diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java index 275b7f7dd36a2073a3eb9f89f4c832839e5aa9af..660693c6dc0ef86f4013df980b6d0c11c03e46cd 100644 --- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java @@ -15898,10 +15896,10 @@ index 6051e5f272838ef23276a90e21c2fc821ca155d1..97d1ff2af23bac14e67bca5896843325 public static TicketType create(String name, Comparator argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 32d6e4b194c3c4eca7009059f8d185896b5ae556..51d3150e732f95be13f5f54d994dab1fa89ed3f2 100644 +index e96a0ca47e4701ba187555bd92c968345bc85677..73b96f804079288e9c5fcc11da54e61e89a6782a 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -498,4 +498,21 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -504,4 +504,21 @@ public class WorldGenRegion implements WorldGenLevel { public long nextSubTickCount() { return this.subTickCount.getAndIncrement(); } @@ -15924,10 +15922,10 @@ index 32d6e4b194c3c4eca7009059f8d185896b5ae556..51d3150e732f95be13f5f54d994dab1f + // Paper end } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2f2d92bfda1713c7454e73cb2d2e77f69184a2d4..1742efe86fe2017e58513f9a63e4b63579327f04 100644 +index 45c12d663330f166000db326c8a145b6af9e2c46..06d221dcc4091032016c85143cf3432a988780c0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -784,6 +784,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -776,6 +776,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.disconnect(Component.translatable("disconnect.spam")); return; } @@ -15942,22 +15940,22 @@ index 2f2d92bfda1713c7454e73cb2d2e77f69184a2d4..1742efe86fe2017e58513f9a63e4b635 StringReader stringreader = new StringReader(packet.getCommand()); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5f85d48fbd0ce34c21acec4849ad3efcc73c7210..e56635fe18e6264c8813834d3eb435ea6e4fffc9 100644 +index b1cd261b42a2c2de5f5a1aa844ecabc986afe00d..5463b07b24a4572bd9e83b6694fa0162d4911f7b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -245,7 +245,7 @@ public abstract class PlayerList { +@@ -251,7 +251,7 @@ public abstract class PlayerList { boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO); // Spigot - view distance -- playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, worldserver1.spigotConfig.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); -+ playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management +- playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, worldserver1.spigotConfig.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); ++ playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit + playerconnection.send(new ClientboundUpdateEnabledFeaturesPacket(FeatureFlags.REGISTRY.toNames(worldserver1.enabledFeatures()))); playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()))); - playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -773,8 +773,8 @@ public abstract class PlayerList { +@@ -783,8 +783,8 @@ public abstract class PlayerList { // CraftBukkit start LevelData worlddata = worldserver1.getLevelData(); - entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag, entityplayer1.getLastDeathLocation())); + entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), (byte) i, entityplayer1.getLastDeathLocation())); - entityplayer1.connection.send(new ClientboundSetChunkCacheRadiusPacket(worldserver1.spigotConfig.viewDistance)); // Spigot - entityplayer1.connection.send(new ClientboundSetSimulationDistancePacket(worldserver1.spigotConfig.simulationDistance)); // Spigot + entityplayer1.connection.send(new ClientboundSetChunkCacheRadiusPacket(worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance())); // Spigot // Paper - replace old player chunk management @@ -15965,7 +15963,7 @@ index 5f85d48fbd0ce34c21acec4849ad3efcc73c7210..e56635fe18e6264c8813834d3eb435ea entityplayer1.spawnIn(worldserver1); entityplayer1.unsetRemoved(); entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot())); -@@ -1280,7 +1280,7 @@ public abstract class PlayerList { +@@ -1271,7 +1271,7 @@ public abstract class PlayerList { public void setViewDistance(int viewDistance) { this.viewDistance = viewDistance; @@ -15974,7 +15972,7 @@ index 5f85d48fbd0ce34c21acec4849ad3efcc73c7210..e56635fe18e6264c8813834d3eb435ea Iterator iterator = this.server.getAllLevels().iterator(); while (iterator.hasNext()) { -@@ -1295,7 +1295,7 @@ public abstract class PlayerList { +@@ -1286,7 +1286,7 @@ public abstract class PlayerList { public void setSimulationDistance(int simulationDistance) { this.simulationDistance = simulationDistance; @@ -15984,7 +15982,7 @@ index 5f85d48fbd0ce34c21acec4849ad3efcc73c7210..e56635fe18e6264c8813834d3eb435ea while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java -index d1b2ba24ef54e01c6249c3b2ca16e80f03c001a6..5fcbb4fd003603408c48408230a17b692fabd519 100644 +index ca788f0dcec4a117b410fe8348969e056b138b1e..4f5f2c25e12ee6d977bc98d9118650cfe91e6c0e 100644 --- a/src/main/java/net/minecraft/util/SortedArraySet.java +++ b/src/main/java/net/minecraft/util/SortedArraySet.java @@ -22,6 +22,41 @@ public class SortedArraySet extends AbstractSet { @@ -16062,10 +16060,10 @@ index d1b2ba24ef54e01c6249c3b2ca16e80f03c001a6..5fcbb4fd003603408c48408230a17b69 public boolean remove(Object object) { int i = this.findIndex((T)object); diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java -index 821052e93ee753db6aaf499bbf39dc30598fe72f..2955c1ee153c410ea45fe367bac8597621c9bbd0 100644 +index 7de38549f08b9639f1e76256f12e10e8fa658c16..759b125cc1251b9b4f1f443c9f70c482ef5b32f8 100644 --- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java +++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java -@@ -182,7 +182,11 @@ public class WorldUpgrader { +@@ -186,7 +186,11 @@ public class WorldUpgrader { } WorldUpgrader.LOGGER.error("Error upgrading chunk {}", chunkcoordintpair, throwable); @@ -16078,7 +16076,7 @@ index 821052e93ee753db6aaf499bbf39dc30598fe72f..2955c1ee153c410ea45fe367bac85976 if (flag1) { ++this.converted; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4eba0f64a 100644 +index 23b22543c3d164e3fdf2f262f3e0124636b32fce..0cd735648314872e98e310627247b9ad425ab64d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -319,6 +319,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -16140,7 +16138,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 public Entity(EntityType type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.passengers = ImmutableList.of(); -@@ -2106,11 +2158,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2121,11 +2173,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return InteractionResult.PASS; } @@ -16154,7 +16152,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 return false; } -@@ -3345,6 +3397,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3389,6 +3441,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { }; } @@ -16171,7 +16169,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 public boolean hasExactlyOnePlayerPassenger() { return this.getIndirectPassengersStream().filter((entity) -> { return entity instanceof Player; -@@ -3647,6 +3709,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3697,6 +3759,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setPosRaw(double x, double y, double z) { @@ -16184,7 +16182,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 if (this.position.x != x || this.position.y != y || this.position.z != z) { this.position = new Vec3(x, y, z); int i = Mth.floor(x); -@@ -3742,6 +3810,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3792,6 +3860,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Override public final void setRemoved(Entity.RemovalReason reason) { @@ -16198,7 +16196,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 if (this.removalReason == null) { this.removalReason = reason; } -@@ -3750,7 +3825,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3800,7 +3875,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.stopRiding(); } @@ -16207,7 +16205,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 this.levelCallback.onRemove(reason); } -@@ -3765,7 +3840,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3815,7 +3890,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Override public boolean shouldBeSaved() { @@ -16217,7 +16215,7 @@ index 1a44c98b69398ba5dcb4115f0e8fdcf3f62fd920..1a2ee5824c6af6b548e7006d583b73f4 @Override diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java -index ffc3925e9e52c186e579bbc7342bd326b5d499cf..6d9ccb87265bcb5c2aecf2e5a0a043ac3c4cbefd 100644 +index 4569f21643812e73897c9812be684a371df60f74..440e4f35e38d38e5407a6fecf09ab9511a44a670 100644 --- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java +++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java @@ -38,12 +38,28 @@ import net.minecraft.world.level.chunk.storage.SectionStorage; @@ -16431,7 +16429,7 @@ index ffc3925e9e52c186e579bbc7342bd326b5d499cf..6d9ccb87265bcb5c2aecf2e5a0a043ac HAS_SPACE(PoiRecord::hasSpace), IS_OCCUPIED(PoiRecord::isOccupied), diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java -index 157c5f2d2738a9ed15949b97d176977905ada14c..e921e3cce8c746e28d73e1a7e67a7efe656ec09f 100644 +index 795a02941d7cecb58ec45b5e79c8d510ff21163a..3fc17817906876e83f040f908b8b1ba6cfa37b8b 100644 --- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java +++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java @@ -29,6 +29,7 @@ public class PoiSection { @@ -16441,7 +16439,7 @@ index 157c5f2d2738a9ed15949b97d176977905ada14c..e921e3cce8c746e28d73e1a7e67a7efe + public final Optional noAllocateOptional = Optional.of(this); // Paper - rewrite chunk system public static Codec codec(Runnable updateListener) { - return RecordCodecBuilder.create((instance) -> { // Paper - decompile fix + return RecordCodecBuilder.create((instance) -> { @@ -46,6 +47,12 @@ public class PoiSection { this(updateListener, true, ImmutableList.of()); } @@ -16456,7 +16454,7 @@ index 157c5f2d2738a9ed15949b97d176977905ada14c..e921e3cce8c746e28d73e1a7e67a7efe this.setDirty = updateListener; this.isValid = valid; diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index 7c5918f84d2b8f9c778258b7e7d745105effb082..f62e4e36dd26bde067e4787fd0da1440b15a57fa 100644 +index 127c4ebedb94631ceac92dbdcd465e904217d715..be6e3e21ad62da01e5e2dd78e300cbc8efdbeb42 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -18,6 +18,18 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -16479,22 +16477,22 @@ index 7c5918f84d2b8f9c778258b7e7d745105effb082..f62e4e36dd26bde067e4787fd0da1440 List getEntities(EntityTypeTest filter, AABB box, Predicate predicate); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 39d64f3aeb998df5452699e098148d86fdd48c98..c12e2ecaea13597f56254e3ab7fd83bff129ddd3 100644 +index 0640df782cff1aec27e1915f726c89275edeec69..bcbbb266302cbd1ac3b0b42fac58d09737357dd3 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -450,6 +450,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -453,6 +453,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(ChunkHolder.FullChunkStatus.TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i); + // Paper start - per player view distance - allow block updates for non-ticking chunks in player view distance + // if copied from above -+ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((ServerLevel)this).getChunkSource().chunkMap.playerChunkManager.broadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { // Paper - replace old player chunk management ++ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((ServerLevel)this).getChunkSource().chunkMap.playerChunkManager.broadcastMap.getObjectsInRange(io.papermc.paper.util.MCUtil.getCoordinateKey(blockposition)) != null)) { // Paper - replace old player chunk management + ((ServerLevel)this).getChunkSource().blockChanged(blockposition); + // Paper end - per player view distance } if ((i & 1) != 0) { -@@ -748,7 +753,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -805,7 +810,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return this.capturedTileEntities.get(blockposition); } // CraftBukkit end @@ -16503,7 +16501,7 @@ index 39d64f3aeb998df5452699e098148d86fdd48c98..c12e2ecaea13597f56254e3ab7fd83bf } public void setBlockEntity(BlockEntity blockEntity) { -@@ -839,26 +844,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -896,26 +901,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { this.getProfiler().incrementCounter("getEntities"); List list = Lists.newArrayList(); @@ -16531,54 +16529,61 @@ index 39d64f3aeb998df5452699e098148d86fdd48c98..c12e2ecaea13597f56254e3ab7fd83bf return list; } -@@ -867,27 +853,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - this.getProfiler().incrementCounter("getEntities"); - List list = Lists.newArrayList(); +@@ -933,34 +919,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { + this.getProfiler().incrementCounter("getEntities"); - this.getEntities().get(filter, box, (entity) -> { - if (predicate.test(entity)) { -- list.add(entity); +- result.add(entity); +- if (result.size() >= limit) { +- return AbortableIterationConsumer.Continuation.ABORT; +- } - } - - if (entity instanceof EnderDragon) { - EnderDragon entityenderdragon = (EnderDragon) entity; - EnderDragonPart[] aentitycomplexpart = entityenderdragon.getSubEntities(); -- int i = aentitycomplexpart.length; +- int j = aentitycomplexpart.length; - -- for (int j = 0; j < i; ++j) { -- EnderDragonPart entitycomplexpart = aentitycomplexpart[j]; +- for (int k = 0; k < j; ++k) { +- EnderDragonPart entitycomplexpart = aentitycomplexpart[k]; - T t0 = filter.tryCast(entitycomplexpart); // CraftBukkit - decompile error - - if (t0 != null && predicate.test(t0)) { -- list.add(t0); +- result.add(t0); +- if (result.size() >= limit) { +- return AbortableIterationConsumer.Continuation.ABORT; +- } - } - } + // Paper start - optimise this call -+ if (filter instanceof net.minecraft.world.entity.EntityType) { -+ ((ServerLevel)this).getEntityLookup().getEntities((net.minecraft.world.entity.EntityType)filter, box, list, predicate); ++ //TODO use limit ++ if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) { ++ ((ServerLevel) this).getEntityLookup().getEntities(entityTypeTest, box, result, predicate); + } else { + Predicate test = (obj) -> { + return filter.tryCast(obj) != null; + }; -+ predicate = predicate == null ? test : test.and((Predicate)predicate); ++ predicate = predicate == null ? test : test.and((Predicate) predicate); + Class base; + if (filter == null || (base = filter.getBaseClass()) == null || base == Entity.class) { -+ ((ServerLevel)this).getEntityLookup().getEntities((Entity) null, box, (List)list, (Predicate)predicate); ++ ((ServerLevel) this).getEntityLookup().getEntities((Entity) null, box, (List) result, (Predicate)predicate); + } else { -+ ((ServerLevel)this).getEntityLookup().getEntities(base, null, box, (List)list, (Predicate)predicate); // Paper - optimise this call ++ ((ServerLevel) this).getEntityLookup().getEntities(base, null, box, (List) result, (Predicate)predicate); // Paper - optimise this call } - +- return AbortableIterationConsumer.Continuation.CONTINUE; - }); + } + // Paper end - optimise this call - return list; } -@@ -1214,4 +1195,46 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - public long nextSubTickCount() { - return (long) (this.subTickCount++); + @Nullable +@@ -1293,4 +1268,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + + private ExplosionInteraction() {} } -+ + // Paper start + //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system + @@ -16622,10 +16627,10 @@ index 39d64f3aeb998df5452699e098148d86fdd48c98..c12e2ecaea13597f56254e3ab7fd83bf + // Paper end } diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 2b543472302faf4b6298efe9bc44c023051f4997..f284eefe5de6ad8b42f7d4185fc4c3b8b2cd5895 100644 +index 53cf5c1292bc919e1c396328211421cb8d4ff8bb..de9aac5a8ef1c95385d0dc532c7764fe2c394f12 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -@@ -288,7 +288,7 @@ public abstract class ChunkGenerator { +@@ -115,7 +115,7 @@ public abstract class ChunkGenerator { return CompletableFuture.supplyAsync(Util.wrapThreadWithTaskName("init_biomes", () -> { chunk.fillBiomesFromNoise(this.biomeSource, noiseConfig.sampler()); return chunk; @@ -16635,10 +16640,10 @@ index 2b543472302faf4b6298efe9bc44c023051f4997..f284eefe5de6ad8b42f7d4185fc4c3b8 public abstract void applyCarvers(WorldGenRegion chunkRegion, long seed, RandomState noiseConfig, BiomeManager biomeAccess, StructureManager structureAccessor, ChunkAccess chunk, GenerationStep.Carving carverStep); diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java -index e6240f891e396d91e31b02fdf3084be77e9d6697..00cb9dafc711607f28529ea9afbcdb492b1b2595 100644 +index bf66cdb94daa6657e9415adfa16d16983b258ee3..d3fe4f948d7ad8268f143c98211ef89b7fd96da1 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java -@@ -29,6 +29,30 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp +@@ -30,6 +30,30 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp public class ChunkStatus { @@ -16669,7 +16674,7 @@ index e6240f891e396d91e31b02fdf3084be77e9d6697..00cb9dafc711607f28529ea9afbcdb49 public static final int MAX_STRUCTURE_DISTANCE = 8; private static final EnumSet PRE_FEATURES = EnumSet.of(Heightmap.Types.OCEAN_FLOOR_WG, Heightmap.Types.WORLD_SURFACE_WG); public static final EnumSet POST_FEATURES = EnumSet.of(Heightmap.Types.OCEAN_FLOOR, Heightmap.Types.WORLD_SURFACE, Heightmap.Types.MOTION_BLOCKING, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES); -@@ -150,10 +174,8 @@ public class ChunkStatus { +@@ -151,10 +175,8 @@ public class ChunkStatus { protochunk.setStatus(chunkstatus); } @@ -16682,7 +16687,7 @@ index e6240f891e396d91e31b02fdf3084be77e9d6697..00cb9dafc711607f28529ea9afbcdb49 public static final ChunkStatus LIGHT = ChunkStatus.register("light", ChunkStatus.FEATURES, 1, ChunkStatus.POST_FEATURES, ChunkStatus.ChunkType.PROTOCHUNK, (chunkstatus, executor, worldserver, chunkgenerator, structuretemplatemanager, lightenginethreaded, function, list, ichunkaccess, flag) -> { return ChunkStatus.lightChunk(chunkstatus, lightenginethreaded, ichunkaccess); }, (chunkstatus, worldserver, structuretemplatemanager, lightenginethreaded, function, ichunkaccess) -> { -@@ -255,6 +277,13 @@ public class ChunkStatus { +@@ -256,6 +278,13 @@ public class ChunkStatus { this.chunkType = chunkType; this.heightmapsAfter = heightMapTypes; this.index = previous == null ? 0 : previous.getIndex() + 1; @@ -16697,7 +16702,7 @@ index e6240f891e396d91e31b02fdf3084be77e9d6697..00cb9dafc711607f28529ea9afbcdb49 public int getIndex() { 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 a6e364f88abcf1a6afcdd85b340ae8d62b753e4f..9f5f7510e7a28471088c44fa9b1f94c374b2d29e 100644 +index 6f99f4acfdac5516dac07a6c9af220eed5c5358e..652da141c3ae19c4de790dea1477f9c3f4c0dee1 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -183,6 +183,43 @@ public class LevelChunk extends ChunkAccess { @@ -16914,10 +16919,10 @@ index a6e364f88abcf1a6afcdd85b340ae8d62b753e4f..9f5f7510e7a28471088c44fa9b1f94c3 public void setFullStatus(Supplier levelTypeProvider) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3d0929fe1 100644 +index 942f8db571cf87d0e9614bdc7dd9525068cf1001..40cde4021c585aee4a4d7ac39e7ab043aba51418 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -92,7 +92,31 @@ public class ChunkSerializer { +@@ -94,7 +94,31 @@ public class ChunkSerializer { public ChunkSerializer() {} @@ -16949,7 +16954,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); if (!Objects.equals(chunkPos, chunkcoordintpair1)) { -@@ -156,7 +180,9 @@ public class ChunkSerializer { +@@ -158,7 +182,9 @@ public class ChunkSerializer { LevelChunkSection chunksection = new LevelChunkSection(b0, datapaletteblock, (PalettedContainer) object); // CraftBukkit - read/write achunksection[k] = chunksection; @@ -16959,7 +16964,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 } boolean flag3 = nbttagcompound1.contains("BlockLight", 7); -@@ -317,7 +343,7 @@ public class ChunkSerializer { +@@ -319,7 +345,7 @@ public class ChunkSerializer { } if (chunkstatus_type == ChunkStatus.ChunkType.LEVELCHUNK) { @@ -16968,7 +16973,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 } else { ProtoChunk protochunk1 = (ProtoChunk) object1; -@@ -356,9 +382,41 @@ public class ChunkSerializer { +@@ -362,9 +388,41 @@ public class ChunkSerializer { protochunk1.setCarvingMask(worldgenstage_features, new CarvingMask(nbttagcompound4.getLongArray(s1), ((ChunkAccess) object1).getMinBuildHeight())); } @@ -17011,7 +17016,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 private static void logErrors(ChunkPos chunkPos, int y, String message) { ChunkSerializer.LOGGER.error("Recoverable errors when loading section [" + chunkPos.x + ", " + y + ", " + chunkPos.z + "]: " + message); -@@ -375,6 +433,11 @@ public class ChunkSerializer { +@@ -381,6 +439,11 @@ public class ChunkSerializer { // CraftBukkit end public static CompoundTag write(ServerLevel world, ChunkAccess chunk) { @@ -17023,7 +17028,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 // Paper start - rewrite light impl final int minSection = io.papermc.paper.util.WorldUtil.getMinLightSection(world); final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world); -@@ -388,7 +451,7 @@ public class ChunkSerializer { +@@ -394,7 +457,7 @@ public class ChunkSerializer { nbttagcompound.putInt("xPos", chunkcoordintpair.x); nbttagcompound.putInt("yPos", chunk.getMinSection()); nbttagcompound.putInt("zPos", chunkcoordintpair.z); @@ -17032,7 +17037,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 nbttagcompound.putLong("InhabitedTime", chunk.getInhabitedTime()); nbttagcompound.putString("Status", chunk.getStatus().getName()); BlendingData blendingdata = chunk.getBlendingData(); -@@ -488,8 +551,17 @@ public class ChunkSerializer { +@@ -494,8 +557,17 @@ public class ChunkSerializer { nbttagcompound.putBoolean("isLightOn", false); // Paper - set to false but still store, this allows us to detect --eraseCache (as eraseCache _removes_) } @@ -17052,7 +17057,7 @@ index 8da52553a9465bf88a0c22fd987a4d8ae63d2f5a..d0b7533b8ed16f062a4ed2f1389b79c3 CompoundTag nbttagcompound2; -@@ -526,7 +598,14 @@ public class ChunkSerializer { +@@ -532,7 +604,14 @@ public class ChunkSerializer { nbttagcompound.put("CarvingMasks", nbttagcompound2); } @@ -17398,7 +17403,7 @@ index d9daf07132c46548964a75588b69d7a74680e917..e68205fe7169c7c5b7c6fdada2ee97d8 } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 8ba1c073387fa21a20bd42a873ec3cc314eae64e..45cec71b3b2f9444d7be7e5bf9fab166b28ea34d 100644 +index b9b50c56e79297bb824a92355f437a5d4d7e6760..18ef7025f7f4dc2a4aff85ca65ff5a2d35a1ef06 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -24,16 +24,37 @@ public class RegionFileStorage implements AutoCloseable { @@ -17477,7 +17482,7 @@ index 8ba1c073387fa21a20bd42a873ec3cc314eae64e..45cec71b3b2f9444d7be7e5bf9fab166 + } // Paper end } - public void scanChunk(ChunkPos chunkcoordintpair, StreamTagVisitor streamtagvisitor) throws IOException { + public void scanChunk(ChunkPos chunkPos, StreamTagVisitor scanner) throws IOException { @@ -130,7 +161,12 @@ public class RegionFileStorage implements AutoCloseable { } @@ -17692,10 +17697,10 @@ index 2830d32bba3dc85847e3a5d9b4d98f822e34b606..4cdfc433df67afcd455422e9baf56f16 } } diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java -index e66e52da84408eb705d23504e500bd8a98322b0e..298ea7c5776c4476dbb69e68debbd50376d14165 100644 +index e6c22cf9a682a88b271a78d8ca0b312c91a60177..cdc87f14e5d6336856c74d5089e50ae5ebad9923 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java -@@ -90,7 +90,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { +@@ -87,7 +87,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { return CompletableFuture.supplyAsync(Util.wrapThreadWithTaskName("init_biomes", () -> { this.doCreateBiomes(blender, noiseConfig, structureAccessor, chunk); return chunk; @@ -17704,7 +17709,7 @@ index e66e52da84408eb705d23504e500bd8a98322b0e..298ea7c5776c4476dbb69e68debbd503 } private void doCreateBiomes(Blender blender, RandomState noiseConfig, StructureManager structureAccessor, ChunkAccess chunk) { -@@ -289,7 +289,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { +@@ -286,7 +286,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { return CompletableFuture.supplyAsync(Util.wrapThreadWithTaskName("wgen_fill_noise", () -> { return this.doFill(blender, structureAccessor, noiseConfig, chunk, j, k); @@ -17783,10 +17788,10 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f for(SavedTick savedTick : this.pendingTicks) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 6d44634ae6dcbc392011f248f6ab429b9845af55..29465d24b6c9160fcd6293006dcc26bcfbeb5e10 100644 +index d58f6b48befbc637a58e669c83e994bae8872adf..cda6277a3a8eefc80de00ffc98687ce0afca7bf2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -119,7 +119,7 @@ public class CraftChunk implements Chunk { +@@ -120,7 +120,7 @@ public class CraftChunk implements Chunk { @Override public boolean isEntitiesLoaded() { @@ -17795,7 +17800,7 @@ index 6d44634ae6dcbc392011f248f6ab429b9845af55..29465d24b6c9160fcd6293006dcc26bc } @Override -@@ -128,51 +128,7 @@ public class CraftChunk implements Chunk { +@@ -129,51 +129,7 @@ public class CraftChunk implements Chunk { this.getWorld().getChunkAt(x, z); // Transient load for this tick } @@ -17849,10 +17854,10 @@ index 6d44634ae6dcbc392011f248f6ab429b9845af55..29465d24b6c9160fcd6293006dcc26bc @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eb5c7e15366ee5902d8c754a1e9daec50d26fb17..2103081cf6a8db00d78618340eef514082fede6e 100644 +index dc39c51ac4417857a75faeae5e28bc1b4f8b4d78..241e328dda2f9d32a16bbb47f4848af33d8d7b45 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1115,7 +1115,7 @@ public final class CraftServer implements Server { +@@ -1139,7 +1139,7 @@ public final class CraftServer implements Server { this.console.addLevel(internal); this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); @@ -17861,7 +17866,7 @@ index eb5c7e15366ee5902d8c754a1e9daec50d26fb17..2103081cf6a8db00d78618340eef5140 this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld())); return internal.getWorld(); -@@ -1159,7 +1159,7 @@ public final class CraftServer implements Server { +@@ -1183,7 +1183,7 @@ public final class CraftServer implements Server { } handle.getChunkSource().close(save); @@ -17870,7 +17875,7 @@ index eb5c7e15366ee5902d8c754a1e9daec50d26fb17..2103081cf6a8db00d78618340eef5140 handle.convertable.close(); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); -@@ -1974,7 +1974,7 @@ public final class CraftServer implements Server { +@@ -1998,7 +1998,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -17880,10 +17885,10 @@ index eb5c7e15366ee5902d8c754a1e9daec50d26fb17..2103081cf6a8db00d78618340eef5140 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b7fbbdd85 100644 +index e91305263fcf6929fe62e5e8da46721707b51517..3ad15c0909d14c6f974e9bf82055c3c332577526 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -314,10 +314,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -313,10 +313,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -17901,7 +17906,7 @@ index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null, true); for (ServerPlayer player : playersInRange) { -@@ -325,8 +329,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -324,8 +328,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -17911,7 +17916,7 @@ index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b return true; } -@@ -404,20 +407,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -403,20 +406,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -17933,7 +17938,7 @@ index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b } @Override -@@ -425,7 +415,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -424,7 +414,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -17942,7 +17947,7 @@ index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b long chunkKey = chunkTickets.getLongKey(); SortedArraySet> tickets = chunkTickets.getValue(); -@@ -1905,14 +1895,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1904,14 +1894,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot start @Override public int getViewDistance() { @@ -17999,10 +18004,10 @@ index e3d0a82387dfdcf65f1b07fd8ae2132be6e6d18f..fe2f5364e526cfe9e25760301165934b // Spigot start private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d5e6123622f6bbc4c3b8b91be7f9ba8e5c1c22d8..6708c2c88251f4e5f623cd785c14b2d3ed2d3de0 100644 +index a41b9663c2ec5a5ec9fc593531141edc7c48751e..af45674e2aff3756813834e866a0e4f9e4b361f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -174,6 +174,81 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -176,6 +176,81 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = System.currentTimeMillis(); } @@ -18085,10 +18090,10 @@ index d5e6123622f6bbc4c3b8b91be7f9ba8e5c1c22d8..6708c2c88251f4e5f623cd785c14b2d3 return this.getHandle().getGameProfile(); } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index cdf65df8a0da81eee3f159ec70dcda17712fbb21..12ebbd95cf7a8d8c926d4f2e5ba89927c26439cc 100644 +index 61767be202f95df16155e7a4c36701b21619f317..a9673a804d597599c35c83f4f245510c83005328 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -@@ -269,7 +269,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { +@@ -270,7 +270,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { return ichunkaccess1; }; @@ -18098,10 +18103,10 @@ index cdf65df8a0da81eee3f159ec70dcda17712fbb21..12ebbd95cf7a8d8c926d4f2e5ba89927 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -index 3bedc22c253c3632b5624c05e78ed3671e5d30ce..fbd82b6be6604bf854e01ed5718e4e072f42b265 100644 +index 9a80e0c390d13453a4a79e00d18c20b79afd3c7f..57acc7195f83b23c9b84ec4b94e0d7ab22851604 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -@@ -254,4 +254,20 @@ public class DummyGeneratorAccess implements WorldGenLevel { +@@ -259,4 +259,20 @@ public class DummyGeneratorAccess implements WorldGenLevel { public boolean destroyBlock(BlockPos pos, boolean drop, Entity breakingEntity, int maxUpdateDepth) { return false; // SPIGOT-6515 } diff --git a/patches/unapplied/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 92% rename from patches/unapplied/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch index 06b4a4b177..17dbe731e1 100644 --- a/patches/unapplied/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2103081cf6a8db00d78618340eef514082fede6e..6723b52fd9306b0f9e3f1d0eadcbfd76d383beee 100644 +index 241e328dda2f9d32a16bbb47f4848af33d8d7b45..1e8f5b6b74c469a77238b2798fe1d0897a7c6fb3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -405,10 +405,15 @@ public final class CraftServer implements Server { +@@ -418,10 +418,15 @@ public final class CraftServer implements Server { public void loadPlugins() { this.pluginManager.registerInterface(JavaPluginLoader.class); @@ -29,7 +29,7 @@ index 2103081cf6a8db00d78618340eef514082fede6e..6723b52fd9306b0f9e3f1d0eadcbfd76 for (Plugin plugin : plugins) { try { String message = String.format("Loading %s", plugin.getDescription().getFullName()); -@@ -423,6 +428,35 @@ public final class CraftServer implements Server { +@@ -436,6 +441,35 @@ public final class CraftServer implements Server { } } @@ -66,7 +66,7 @@ index 2103081cf6a8db00d78618340eef514082fede6e..6723b52fd9306b0f9e3f1d0eadcbfd76 if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e15bf67ed9463052c474a56e2ed9da45a710505e..ef0bbec06981afa13384fb75067599eaa1a87e33 100644 +index e2cf043fb35ae8474bf1f6ba2cc2505566973cfe..44b30d0f297af5eb4ace4160a0c601ff824632f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -149,6 +149,12 @@ public class Main { diff --git a/patches/unapplied/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 71% rename from patches/unapplied/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch index 7d405a11d6..4734439db3 100644 --- a/patches/unapplied/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/0018-Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Configurable cactus bamboo and reed growth heights Bamboo - Both the minimum fully-grown heights and the maximum are configurable - Machine_Maker -diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java -index 3a6894c3cdee0d55f0546cda50c824ea5e95bfe0..2db8fd4fb03642fce2c7eca9c6b189f38d5cbf4a 100644 ---- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java -@@ -130,7 +130,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +diff --git a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java +index 0d05ad9c0b5043e58d639041cfe3fb7a27f373a3..a5d391af2c6b733d653188f4aeeec2afffd96adf 100644 +--- a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java +@@ -130,7 +130,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { if (random.nextFloat() < (world.spigotConfig.bambooModifier / (100.0f * 3)) && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution int i = this.getHeightBelowUpToMax(world, pos) + 1; @@ -19,34 +19,34 @@ index 3a6894c3cdee0d55f0546cda50c824ea5e95bfe0..2db8fd4fb03642fce2c7eca9c6b189f3 this.growBamboo(state, world, pos, random, i); } } -@@ -161,7 +161,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -161,7 +161,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { int i = this.getHeightAboveUpToMax(world, pos); int j = this.getHeightBelowUpToMax(world, pos); -- return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; -+ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; // Paper +- return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; ++ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper } @Override -@@ -180,7 +180,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -180,7 +180,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { BlockPos blockposition1 = pos.above(i); BlockState iblockdata1 = world.getBlockState(blockposition1); -- if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here -+ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights +- if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here ++ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights return; } -@@ -221,7 +221,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -221,7 +221,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { } - int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; + int j = (Integer) state.getValue(BambooStalkBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; - int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1; + int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper // CraftBukkit start - if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) { -@@ -236,7 +236,7 @@ public class BambooBlock extends Block implements BonemealableBlock { + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooStalkBlock.AGE, j)).setValue(BambooStalkBlock.LEAVES, blockpropertybamboosize)).setValue(BambooStalkBlock.STAGE, k), 3)) { +@@ -236,7 +236,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { protected int getHeightAboveUpToMax(BlockGetter world, BlockPos pos) { int i; @@ -55,7 +55,7 @@ index 3a6894c3cdee0d55f0546cda50c824ea5e95bfe0..2db8fd4fb03642fce2c7eca9c6b189f3 ; } -@@ -246,7 +246,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -246,7 +246,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { protected int getHeightBelowUpToMax(BlockGetter world, BlockPos pos) { int i; diff --git a/patches/unapplied/server/0019-Configurable-baby-zombie-movement-speed.patch b/patches/server/0019-Configurable-baby-zombie-movement-speed.patch similarity index 93% rename from patches/unapplied/server/0019-Configurable-baby-zombie-movement-speed.patch rename to patches/server/0019-Configurable-baby-zombie-movement-speed.patch index e0d10bc34b..7b0cc4765a 100644 --- a/patches/unapplied/server/0019-Configurable-baby-zombie-movement-speed.patch +++ b/patches/server/0019-Configurable-baby-zombie-movement-speed.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable baby zombie movement speed diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index ee91459775aada8cc2e5c4403436b11c15e8e674..1b48576beca178af14bfab297bd427b5f5bdaf42 100644 +index 251487682550af7492068bd461bf0c61760de0fa..8ea60d388fff4a6368652ff96f648e5880053a2b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -77,6 +77,7 @@ public class Zombie extends Monster { @@ -16,7 +16,7 @@ index ee91459775aada8cc2e5c4403436b11c15e8e674..1b48576beca178af14bfab297bd427b5 private static final EntityDataAccessor DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); private static final EntityDataAccessor DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); public static final EntityDataAccessor DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); -@@ -184,9 +185,9 @@ public class Zombie extends Monster { +@@ -185,9 +186,9 @@ public class Zombie extends Monster { if (this.level != null && !this.level.isClientSide) { AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); diff --git a/patches/unapplied/server/0020-Configurable-fishing-time-ranges.patch b/patches/server/0020-Configurable-fishing-time-ranges.patch similarity index 86% rename from patches/unapplied/server/0020-Configurable-fishing-time-ranges.patch rename to patches/server/0020-Configurable-fishing-time-ranges.patch index 71d66591ff..c3a9c76630 100644 --- a/patches/unapplied/server/0020-Configurable-fishing-time-ranges.patch +++ b/patches/server/0020-Configurable-fishing-time-ranges.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable fishing time ranges diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 792d85ea46d392a27ac89c42e037dc90d33fad7f..00fe96650e4d973e97b46968297f55f4c3674629 100644 +index 41a3e97cda5e12658c69fc8f097250d1f2f5fdea..354fed07a1c8d88c97350be11388925e5bf82f9e 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -@@ -85,6 +85,10 @@ public class FishingHook extends Projectile { +@@ -86,6 +86,10 @@ public class FishingHook extends Projectile { this.noCulling = true; this.luck = Math.max(0, luckOfTheSeaLevel); this.lureSpeed = Math.max(0, lureLevel); @@ -19,7 +19,7 @@ index 792d85ea46d392a27ac89c42e037dc90d33fad7f..00fe96650e4d973e97b46968297f55f4 } public FishingHook(EntityType type, Level world) { -@@ -400,7 +404,7 @@ public class FishingHook extends Projectile { +@@ -401,7 +405,7 @@ public class FishingHook extends Projectile { } else { // CraftBukkit start - logic to modify fishing wait time this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime); diff --git a/patches/unapplied/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch similarity index 93% rename from patches/unapplied/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch rename to patches/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index eb521c2fe8..9bb1f00be2 100644 --- a/patches/unapplied/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/0021-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow nerfed mobs to jump and take water damage diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index c3357f65d3c5cec3446326b8a68750ee2cc27b9a..ecb86bb87468cdef07e47df9308e6548cf987fe4 100644 +index 10949455cc92ed6cb537fd7f148714c7ade4e360..c4b28340d62a89d6f896357c93fd933fe6cd934b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -110,6 +110,7 @@ public abstract class Mob extends LivingEntity { @@ -16,7 +16,7 @@ index c3357f65d3c5cec3446326b8a68750ee2cc27b9a..ecb86bb87468cdef07e47df9308e6548 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -818,7 +819,17 @@ public abstract class Mob extends LivingEntity { +@@ -836,7 +837,17 @@ public abstract class Mob extends LivingEntity { @Override protected final void serverAiStep() { ++this.noActionTime; diff --git a/patches/unapplied/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch similarity index 89% rename from patches/unapplied/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch index 236f40666c..d03d2638e4 100644 --- a/patches/unapplied/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/0022-Add-configurable-despawn-distances-for-living-entiti.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable despawn distances for living entities diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index ecb86bb87468cdef07e47df9308e6548cf987fe4..a27082368913e5c6dc926bd197f3b135a633f30d 100644 +index c4b28340d62a89d6f896357c93fd933fe6cd934b..99218eac34374a4d13451cfec15006c3bf0d755f 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -794,14 +794,14 @@ public abstract class Mob extends LivingEntity { +@@ -812,14 +812,14 @@ public abstract class Mob extends LivingEntity { if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/unapplied/server/0023-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0023-Allow-for-toggling-of-spawn-chunks.patch similarity index 85% rename from patches/unapplied/server/0023-Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/0023-Allow-for-toggling-of-spawn-chunks.patch index 69db9e2246..f41ff75ba7 100644 --- a/patches/unapplied/server/0023-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0023-Allow-for-toggling-of-spawn-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index c12e2ecaea13597f56254e3ab7fd83bff129ddd3..e4dfaec6a1efa7bb44c843a283dd3c3d3a4e199c 100644 +index bcbbb266302cbd1ac3b0b42fac58d09737357dd3..409f8440773ef09aecf8f2fd70004d0592f4bbe2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -253,6 +253,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -256,6 +256,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings diff --git a/patches/unapplied/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 86% rename from patches/unapplied/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch index 687d0b627a..9b5aa36e18 100644 --- a/patches/unapplied/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/0024-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..ba5f365cc0ae9773e63ff58ad0a8f8bb4087889a 100644 +index c186ea200e196ff97a9bbe78d4e550ccba2d40ac..c125564cfca5c4a616e11b334a9ec7929ebea496 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -137,6 +137,17 @@ public class FallingBlockEntity extends Entity { +@@ -139,6 +139,17 @@ public class FallingBlockEntity extends Entity { } this.move(MoverType.SELF, this.getDeltaMovement()); @@ -28,10 +28,10 @@ index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..ba5f365cc0ae9773e63ff58ad0a8f8bb BlockPos blockposition = this.blockPosition(); boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; 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 e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..54a8548e8d3ddee049d3fed41332c94e368ba2c4 100644 +index dd3eee50509f5388e78e0908e83925c43ab20628..43ec4bc45a3e553fbbf47aaf613f6e0aad2319cf 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -68,6 +68,12 @@ public class PrimedTnt extends Entity { +@@ -65,6 +65,12 @@ public class PrimedTnt extends Entity { } this.move(MoverType.SELF, this.getDeltaMovement()); @@ -45,10 +45,10 @@ index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..54a8548e8d3ddee049d3fed41332c94e if (this.onGround) { this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D)); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -index 5b31c85d3bb5bcbd966d69c129e3caea14148821..beb542b2f810da9fb8379056b4d16c2b98717f28 100644 +index 4740e39f39bd9b652db8ec3861cee36652310fa8..8443ddd751b3eae3c834aa957ea01b09306c9373 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -@@ -50,6 +50,12 @@ public class MinecartTNT extends AbstractMinecart { +@@ -52,6 +52,12 @@ public class MinecartTNT extends AbstractMinecart { public void tick() { super.tick(); if (this.fuse > 0) { diff --git a/patches/unapplied/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 93% rename from patches/unapplied/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index af99d15ea1..272ca6f08d 100644 --- a/patches/unapplied/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0025-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0d2114be30df99c5b50f82def97b0a44e797e573..2c78c2aebedef02fe66fe0c352d586b80f66144d 100644 +index 11fd961b2b522920ceb5cde7dbf5cc197044836a..7e313778c44c2b06543c95b5687c2dd841b5216a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1426,7 +1426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index a27082368913e5c6dc926bd197f3b135a633f30d..d315d9e0e6724e210924ec5814545e8c52ba2d8b 100644 +index 99218eac34374a4d13451cfec15006c3bf0d755f..bb7c459c126be789bb12d08a569fe344e08914b8 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -790,7 +790,7 @@ public abstract class Mob extends LivingEntity { +@@ -808,7 +808,7 @@ public abstract class Mob extends LivingEntity { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -34,10 +34,10 @@ index a27082368913e5c6dc926bd197f3b135a633f30d..d315d9e0e6724e210924ec5814545e8c if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -index 114352b9e8aeea7c728b6b58047e38e2530401a9..43e481377ba1596e740eacefd21d9664b7807883 100644 +index e368478dba01a9b11adf23ed64bed61c73a78a28..17fda4857f74d2994525262472700e7788dec383 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -@@ -24,7 +24,7 @@ public class SkeletonTrapGoal extends Goal { +@@ -25,7 +25,7 @@ public class SkeletonTrapGoal extends Goal { @Override public boolean canUse() { @@ -60,10 +60,10 @@ index 87f66fd33e404367d924137b2d8aac3b06937f43..2dcda3b03796655da443e1b3dd68c6f6 return false; } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 1b48576beca178af14bfab297bd427b5f5bdaf42..d3ca0706e8dc3160d2100d23788dd3d501b29215 100644 +index 8ea60d388fff4a6368652ff96f648e5880053a2b..8ecbb64f9db9346757c5597404489496a0945508 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -324,7 +324,7 @@ public class Zombie extends Monster { +@@ -325,7 +325,7 @@ public class Zombie extends Monster { if (NaturalSpawner.isSpawnPositionOk(entitypositiontypes_surface, this.level, blockposition, entitytypes) && SpawnPlacements.checkSpawnRules(entitytypes, worldserver, MobSpawnType.REINFORCEMENT, blockposition, this.level.random)) { entityzombie.setPos((double) i1, (double) j1, (double) k1); @@ -73,10 +73,10 @@ index 1b48576beca178af14bfab297bd427b5f5bdaf42..d3ca0706e8dc3160d2100d23788dd3d5 entityzombie.finalizeSpawn(worldserver, this.level.getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null, (CompoundTag) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 1883c6a4a6a58b25913eaed40786ea67785bad37..4751fea5e7319600422c4fb3e40026a36db85a6a 100644 +index dbe7588d4ea992155e3ff3b7d31af04181b01521..08c76c56e493f01bc159312aef512886631682f3 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -184,6 +184,9 @@ public abstract class Player extends LivingEntity { +@@ -179,6 +179,9 @@ public abstract class Player extends LivingEntity { private Optional lastDeathLocation; @Nullable public FishingHook fishing; @@ -87,10 +87,10 @@ index 1883c6a4a6a58b25913eaed40786ea67785bad37..4751fea5e7319600422c4fb3e40026a3 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index ab22310d5ab4ad7014b88080cbd44a2881002b55..b0ac72a69e13f2376aa4c66d9a1f5a01b480785c 100644 +index 068d01c749a86954915fdad1b7499720613e5af3..d172f4e00b064c6c8fb5b1f6b0b68fd44a6efb62 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -51,7 +51,7 @@ public abstract class BaseSpawner { +@@ -54,7 +54,7 @@ public abstract class BaseSpawner { } public boolean isNearPlayer(Level world, BlockPos pos) { @@ -100,7 +100,7 @@ index ab22310d5ab4ad7014b88080cbd44a2881002b55..b0ac72a69e13f2376aa4c66d9a1f5a01 public void clientTick(Level world, BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index f62e4e36dd26bde067e4787fd0da1440b15a57fa..abd74c6502e07857e0f64c5f99534b68975acd69 100644 +index be6e3e21ad62da01e5e2dd78e300cbc8efdbeb42..ea98625fe7c00743b8df74a24e6d4b75df4189a5 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -82,6 +82,11 @@ public interface EntityGetter { @@ -137,10 +137,10 @@ index f62e4e36dd26bde067e4787fd0da1440b15a57fa..abd74c6502e07857e0f64c5f99534b68 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6708c2c88251f4e5f623cd785c14b2d3ed2d3de0..182881c867e68e59e89f56f8dc66001b0d2b3add 100644 +index af45674e2aff3756813834e866a0e4f9e4b361f5..524e57251951d719eed227d779e3c420a9f38787 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2084,8 +2084,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2086,8 +2086,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return this.getHandle().locale; diff --git a/patches/unapplied/server/0029-Further-improve-server-tick-loop.patch b/patches/server/0029-Further-improve-server-tick-loop.patch similarity index 93% rename from patches/unapplied/server/0029-Further-improve-server-tick-loop.patch rename to patches/server/0029-Further-improve-server-tick-loop.patch index 2c1c8c05cc..ddcde507f6 100644 --- a/patches/unapplied/server/0029-Further-improve-server-tick-loop.patch +++ b/patches/server/0029-Further-improve-server-tick-loop.patch @@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2c78c2aebedef02fe66fe0c352d586b80f66144d..0955b4e0ee33a26c5bfee744242cdc24aebccb20 100644 +index 7e313778c44c2b06543c95b5687c2dd841b5216a..4aad7d7de77f82db9d442fbe709cdd52dced895e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -270,7 +270,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -279,7 +279,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit long j = i / 50L; -@@ -984,12 +1036,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ab2671c21f2f44973fb2507b178ac8e1e03bc8dc..3273b29bdd37a5dac5c8a1be38f514bdbdffbeeb 100644 +index 5cf04b209ae3fa6c52ad45e726343418d0de311f..128dd4749590905fdfa85907d33adc4e4dbe6c33 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -705,7 +705,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -23,7 +23,7 @@ index ab2671c21f2f44973fb2507b178ac8e1e03bc8dc..3273b29bdd37a5dac5c8a1be38f514bd } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index bb05ea288432ece497957c3503c3435655ce8997..f9cddc20563c2d44fdb1f91ae2b2f9b2321e4d81 100644 +index 98cdf291a5d0248091891ad30104adef708eec55..ff57611088eabfb7e2db8fcf6344b1551b17b87b 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -55,7 +55,7 @@ public class PortalForcer { diff --git a/patches/unapplied/server/0034-Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/0034-Check-online-mode-before-converting-and-renaming-pla.patch similarity index 100% rename from patches/unapplied/server/0034-Check-online-mode-before-converting-and-renaming-pla.patch rename to patches/server/0034-Check-online-mode-before-converting-and-renaming-pla.patch diff --git a/patches/unapplied/server/0035-Always-tick-falling-blocks.patch b/patches/server/0035-Always-tick-falling-blocks.patch similarity index 100% rename from patches/unapplied/server/0035-Always-tick-falling-blocks.patch rename to patches/server/0035-Always-tick-falling-blocks.patch diff --git a/patches/unapplied/server/0036-Configurable-end-credits.patch b/patches/server/0036-Configurable-end-credits.patch similarity index 85% rename from patches/unapplied/server/0036-Configurable-end-credits.patch rename to patches/server/0036-Configurable-end-credits.patch index f9bd0f14c2..1c6a3bf132 100644 --- a/patches/unapplied/server/0036-Configurable-end-credits.patch +++ b/patches/server/0036-Configurable-end-credits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable end credits diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d7e66a9669c67bf7d619bf69dc49daed42b3e83a..54dc00f521e7f7b4cb86b2653ac1d0058dcbb03b 100644 +index 72f9e0eedb142cb37f0cab85208d491c4918235e..38f40851a5927a2f71fb3126d554770ff6cb1107 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -989,6 +989,7 @@ public class ServerPlayer extends Player { +@@ -1011,6 +1011,7 @@ public class ServerPlayer extends Player { this.unRide(); this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.wonGame) { diff --git a/patches/unapplied/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch similarity index 89% rename from patches/unapplied/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch rename to patches/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch index 3a8886ecac..e4dde9fb71 100644 --- a/patches/unapplied/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/patches/server/0037-Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 2d4122eeee91dd857b2b4abeb5e9b3be19af6f4a..292571fc9fa999d3b92e0fdd56d07ebfb4ae7402 100644 +index e0efb6ad5f25522bd395018b85df00dda33a443a..77dc0b310f48471c1ca1dc95bf01c5e24f1ed6d8 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -206,7 +206,7 @@ public class Explosion { +@@ -202,7 +202,7 @@ public class Explosion { int i1 = Mth.floor(this.y + (double) f2 + 1.0D); int j1 = Mth.floor(this.z - (double) f2 - 1.0D); int k1 = Mth.floor(this.z + (double) f2 + 1.0D); diff --git a/patches/unapplied/server/0038-Optimize-explosions.patch b/patches/server/0038-Optimize-explosions.patch similarity index 91% rename from patches/unapplied/server/0038-Optimize-explosions.patch rename to patches/server/0038-Optimize-explosions.patch index f50ea33ab4..39e0382b29 100644 --- a/patches/unapplied/server/0038-Optimize-explosions.patch +++ b/patches/server/0038-Optimize-explosions.patch @@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0955b4e0ee33a26c5bfee744242cdc24aebccb20..093ac159fcc34de9901395ad9450372efdf7cb5b 100644 +index 4aad7d7de77f82db9d442fbe709cdd52dced895e..8989d13eb6ee94a1dbbe986cfcf0755faaa4e85c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1389,6 +1389,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1742efe86fe2017e58513f9a63e4b63579327f04..2be965faaed8ca25fc01d6ca1f496f7e41e6b7a0 100644 +index 06d221dcc4091032016c85143cf3432a988780c0..580f126ad3681306bfff24c1e19dab39a6d4e888 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2038,7 +2038,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2040,7 +2040,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return true; } @@ -33,16 +33,16 @@ index 1742efe86fe2017e58513f9a63e4b63579327f04..2be965faaed8ca25fc01d6ca1f496f7e for (int i = 0; i < message.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(message.charAt(i))) { return true; -@@ -2055,7 +2055,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2057,7 +2057,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } - OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(original); + OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); - if (!async && s.startsWith("/")) { + if (false && !async && s.startsWith("/")) { // Paper - don't handle commands in chat logic this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin -@@ -2158,7 +2158,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2147,7 +2147,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } @@ -74,10 +74,10 @@ index 1742efe86fe2017e58513f9a63e4b63579327f04..2be965faaed8ca25fc01d6ca1f496f7e if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 58f3ee6c47313b5c3b093a03b1b759e9fb0207ee..524338428265f27aa33774a23b53c24212d98ae2 100644 +index 40c9b6ca9a5b23f11b5b51b6357141d01c20d50e..b000fef0907a4259b42c320ff831857810cc572d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -863,6 +863,28 @@ public final class CraftServer implements Server { +@@ -876,6 +876,28 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot @@ -107,14 +107,14 @@ index 58f3ee6c47313b5c3b093a03b1b759e9fb0207ee..524338428265f27aa33774a23b53c242 return true; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3be63b51511fd12f295e1f07549f281246ee2dc0..55c9d229356e3eb75419f7630cfafdd8f883a5e0 100644 +index 30bbfb2bf6aeaf311453ccdd72eeee43ae89b972..e13af07709acdbe5060e2959f6762fcffa65fd05 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -502,7 +502,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -504,7 +504,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void chat(String msg) { if (this.getHandle().connection == null) return; -- this.getHandle().connection.chat(msg, PlayerChatMessage.system(new ChatMessageContent(msg)), false); +- this.getHandle().connection.chat(msg, PlayerChatMessage.system(msg), false); + // Paper start - improve chat handling + if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) { + this.getHandle().connection.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); @@ -124,7 +124,7 @@ index 3be63b51511fd12f295e1f07549f281246ee2dc0..55c9d229356e3eb75419f7630cfafdd8 + } else { + // TODO text filtering + // TODO chat decorating -+ this.getHandle().connection.chat(msg, PlayerChatMessage.system(new net.minecraft.network.chat.ChatMessageContent(msg)), false); ++ this.getHandle().connection.chat(msg, PlayerChatMessage.system(msg), false); + } + } + // Paper end diff --git a/patches/unapplied/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 86% rename from patches/unapplied/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch index a83c2278d3..a8f1031ff2 100644 --- a/patches/unapplied/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/patches/server/0051-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -5,10 +5,10 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index a62f88048d8243f5b98834988c049471114c4199..7b95d18fb5edbd1575f6be92bfcbb3e0d7f691c8 100644 +index 64c4b88f0a64436c126cf32d6e289b3876af8dfb..85abd62434cbe3beb63f61262504372b971d9684 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java -@@ -316,7 +316,7 @@ public class Slime extends Mob implements Enemy { +@@ -318,7 +318,7 @@ public class Slime extends Mob implements Enemy { } ChunkPos chunkcoordintpair = new ChunkPos(pos); @@ -18,10 +18,10 @@ index a62f88048d8243f5b98834988c049471114c4199..7b95d18fb5edbd1575f6be92bfcbb3e0 if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { return checkMobSpawnRules(type, world, spawnReason, pos, random); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 29465d24b6c9160fcd6293006dcc26bcfbeb5e10..fd50cc4cfc976a9dee82d4f6ad457bba18065614 100644 +index cda6277a3a8eefc80de00ffc98687ce0afca7bf2..46b1cce7d482adea911b71f3e3623ac0574a85ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -176,7 +176,7 @@ public class CraftChunk implements Chunk { +@@ -177,7 +177,7 @@ public class CraftChunk implements Chunk { @Override public boolean isSlimeChunk() { // 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk diff --git a/patches/unapplied/server/0052-Expose-server-CommandMap.patch b/patches/server/0052-Expose-server-CommandMap.patch similarity index 78% rename from patches/unapplied/server/0052-Expose-server-CommandMap.patch rename to patches/server/0052-Expose-server-CommandMap.patch index cf79a898e2..2b50fbff76 100644 --- a/patches/unapplied/server/0052-Expose-server-CommandMap.patch +++ b/patches/server/0052-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 524338428265f27aa33774a23b53c24212d98ae2..458c9ce406421f77c9a196f9081f2f36e7e675ea 100644 +index b000fef0907a4259b42c320ff831857810cc572d..d73c97e0d762e49b2ef757671cb52c68511f9ff6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1983,6 +1983,7 @@ public final class CraftServer implements Server { +@@ -2007,6 +2007,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/unapplied/server/0053-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0053-Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/unapplied/server/0053-Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/0053-Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/unapplied/server/0054-Ensure-inv-drag-is-in-bounds.patch b/patches/server/0054-Ensure-inv-drag-is-in-bounds.patch similarity index 87% rename from patches/unapplied/server/0054-Ensure-inv-drag-is-in-bounds.patch rename to patches/server/0054-Ensure-inv-drag-is-in-bounds.patch index da2779ebd5..407fdbf4db 100644 --- a/patches/unapplied/server/0054-Ensure-inv-drag-is-in-bounds.patch +++ b/patches/server/0054-Ensure-inv-drag-is-in-bounds.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure inv drag is in bounds diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 333cbbf6f7761d619a1e41f9a08d7fcf0abf44f9..66261330157cef50dfabb7f92e9ece6dcd280951 100644 +index f15415ff5fb099a048fe0f898e15bc4303a47ef5..f7976bd9561601a6ce1d5b4874b08bba9754d753 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -416,7 +416,7 @@ public abstract class AbstractContainerMenu { +@@ -417,7 +417,7 @@ public abstract class AbstractContainerMenu { this.resetQuickCraft(); } } else if (this.quickcraftStatus == 1) { diff --git a/patches/unapplied/server/0055-Player-Tab-List-and-Title-APIs.patch b/patches/server/0055-Player-Tab-List-and-Title-APIs.patch similarity index 96% rename from patches/unapplied/server/0055-Player-Tab-List-and-Title-APIs.patch rename to patches/server/0055-Player-Tab-List-and-Title-APIs.patch index 621fe540af..30401cd7f8 100644 --- a/patches/unapplied/server/0055-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0055-Player-Tab-List-and-Title-APIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 42514a0c7066dc79050c0496d6463528b593f9e4..70631b3fe080320dfea0d1a4deb23e87448da250 100644 +index e5ef4acbc74f3ef50ed8e162d3b2a7ae881a4b7a..76914b08c17a62a117319d458a6693070fc46348 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -439,6 +439,11 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -501,6 +501,11 @@ public class FriendlyByteBuf extends ByteBuf { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); } @@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4 // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 55c9d229356e3eb75419f7630cfafdd8f883a5e0..a4452324892c37c92e8e0c7cee1fdeda50e9d81b 100644 +index e13af07709acdbe5060e2959f6762fcffa65fd05..d7177eb9c3cf65cacc90752215d591058b8106b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -73,7 +73,7 @@ index 55c9d229356e3eb75419f7630cfafdd8f883a5e0..a4452324892c37c92e8e0c7cee1fdeda import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -348,6 +349,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -350,6 +351,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/unapplied/server/0056-Add-configurable-portal-search-radius.patch b/patches/server/0056-Add-configurable-portal-search-radius.patch similarity index 91% rename from patches/unapplied/server/0056-Add-configurable-portal-search-radius.patch rename to patches/server/0056-Add-configurable-portal-search-radius.patch index 81ae47cd1a..c2ff288804 100644 --- a/patches/unapplied/server/0056-Add-configurable-portal-search-radius.patch +++ b/patches/server/0056-Add-configurable-portal-search-radius.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable portal search radius diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3273b29bdd37a5dac5c8a1be38f514bdbdffbeeb..dc29c677e21a71b5ba1a48c7aea8acadc2689c77 100644 +index 128dd4749590905fdfa85907d33adc4e4dbe6c33..575ce3bb03c7eef215e71d238a46aa1cc8510f89 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3003,7 +3003,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3029,7 +3029,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); // CraftBukkit start @@ -24,7 +24,7 @@ index 3273b29bdd37a5dac5c8a1be38f514bdbdffbeeb..dc29c677e21a71b5ba1a48c7aea8acad return null; } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index f9cddc20563c2d44fdb1f91ae2b2f9b2321e4d81..953a1dfd71605ac123133dc1d4e8133a33884f4a 100644 +index ff57611088eabfb7e2db8fcf6344b1551b17b87b..d1c7eba29c64a6dbf55d3062ced9769eecb548ed 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -43,7 +43,7 @@ public class PortalForcer { diff --git a/patches/unapplied/server/0057-Add-velocity-warnings.patch b/patches/server/0057-Add-velocity-warnings.patch similarity index 93% rename from patches/unapplied/server/0057-Add-velocity-warnings.patch rename to patches/server/0057-Add-velocity-warnings.patch index 6d36cf0c55..2785feca89 100644 --- a/patches/unapplied/server/0057-Add-velocity-warnings.patch +++ b/patches/server/0057-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 458c9ce406421f77c9a196f9081f2f36e7e675ea..b8763c6f938319d4712222ecab3ebc132071597b 100644 +index d73c97e0d762e49b2ef757671cb52c68511f9ff6..37c1e4b31c06b9bf48325a7d5f293020b00445b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -280,6 +280,7 @@ public final class CraftServer implements Server { +@@ -293,6 +293,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -17,10 +17,10 @@ index 458c9ce406421f77c9a196f9081f2f36e7e675ea..b8763c6f938319d4712222ecab3ebc13 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index ddd0fde5c9065cc35b3bcf81defb119f5b0608d6..b9599f4f431098d63be98b5175890371103f8813 100644 +index 62c2780b165a520e85f17fdf5c0d1c29b7579ebc..91c0354f554edbf2fc68748a8fbf182cd8d93de5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -452,10 +452,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -454,10 +454,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/patches/unapplied/server/0058-Configurable-inter-world-teleportation-safety.patch b/patches/server/0058-Configurable-inter-world-teleportation-safety.patch similarity index 91% rename from patches/unapplied/server/0058-Configurable-inter-world-teleportation-safety.patch rename to patches/server/0058-Configurable-inter-world-teleportation-safety.patch index c4403cd8d8..3a0420f7e2 100644 --- a/patches/unapplied/server/0058-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0058-Configurable-inter-world-teleportation-safety.patch @@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended This only is the case if the player is teleporting between worlds. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a4452324892c37c92e8e0c7cee1fdeda50e9d81b..60850848e76d656d7b4e885c79dfe992108c8ad5 100644 +index d7177eb9c3cf65cacc90752215d591058b8106b8..af4e9891da2584c791ce85f5eb6315a06fcc77e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1129,7 +1129,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1131,7 +1131,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.connection.teleport(to); } else { diff --git a/patches/unapplied/server/0059-Add-exception-reporting-event.patch b/patches/server/0059-Add-exception-reporting-event.patch similarity index 90% rename from patches/unapplied/server/0059-Add-exception-reporting-event.patch rename to patches/server/0059-Add-exception-reporting-event.patch index e90ea3836a..935dd3e71d 100644 --- a/patches/unapplied/server/0059-Add-exception-reporting-event.patch +++ b/patches/server/0059-Add-exception-reporting-event.patch @@ -88,7 +88,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..fed09b886f4fa0006d160e5f2abb00df } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 1473664f94f228abd81b8c654d105b8a76cc49e9..65fd3a3c1f0a55d034e6f91c4f222e6454e7166c 100644 +index a36da18ac1ea613f1a77ce2fbb70d5cb05563714..86fc83f6ea7bbf445edf097b6ab501a09ec18e2b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1,5 +1,10 @@ @@ -102,7 +102,7 @@ index 1473664f94f228abd81b8c654d105b8a76cc49e9..65fd3a3c1f0a55d034e6f91c4f222e64 import com.google.common.collect.Lists; import com.mojang.serialization.Codec; import java.io.IOException; -@@ -705,6 +710,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -730,6 +735,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); @@ -111,18 +111,18 @@ index 1473664f94f228abd81b8c654d105b8a76cc49e9..65fd3a3c1f0a55d034e6f91c4f222e64 // Paper end } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 8f097817e38798b8e985bcbb9b8c9bdae24ed692..287ea1d056556e106a23987eb9f1b42e81ce6262 100644 +index 0e4f6893a2fce69782c4246c52e03926fe2df26f..5c58031279c0b74d2061c802e60b7bed50f27156 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -290,6 +290,7 @@ public final class NaturalSpawner { - } +@@ -291,6 +291,7 @@ public final class NaturalSpawner { + NaturalSpawner.LOGGER.warn("Can't spawn entity of type: {}", BuiltInRegistries.ENTITY_TYPE.getKey(type)); } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper - return null; } - } -@@ -402,6 +403,7 @@ public final class NaturalSpawner { + + return null; +@@ -404,6 +405,7 @@ public final class NaturalSpawner { entity = biomesettingsmobs_c.type.create(world.getLevel()); } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); @@ -131,7 +131,7 @@ index 8f097817e38798b8e985bcbb9b8c9bdae24ed692..287ea1d056556e106a23987eb9f1b42e } 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 f9980a781f02e10c1c96deaa39cfecbf4deedff9..ea2176501dfa773a1114f5db4e6dbe4c2d2c7abe 100644 +index d11a715dccaaf2a2faeef8af9ff6e5f1914416cb..b78e89eed44a06bb8c7a8a62e561574d4dc4b2de 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ @@ -163,7 +163,7 @@ index f9980a781f02e10c1c96deaa39cfecbf4deedff9..ea2176501dfa773a1114f5db4e6dbe4c // CraftBukkit end } } -@@ -1189,6 +1196,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1187,6 +1194,7 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent tile 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()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); @@ -191,18 +191,6 @@ index e68205fe7169c7c5b7c6fdada2ee97d86107ca97..aa8972fd1a1fade05d60ab69efb8ff24 if (filechannel != null) { try { filechannel.close(); -diff --git a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -index 90061d0b2363a31eaea760c09243e5d35154665c..2513069f4ffe594857762ef51f1b9a078b8b1d17 100644 ---- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -+++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -@@ -120,6 +120,7 @@ public class DimensionDataStorage { - - pushbackInputStream.close(); - } catch (Throwable var15) { -+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(var15); // Paper - try { - fileInputStream.close(); - } catch (Throwable var10) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 07c4d9cd5081378e1b903518f7174fca959cd9e3..dfc2789009fcaa08baa8054bdac915590b8701d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java diff --git a/patches/unapplied/server/0060-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/0060-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 100% rename from patches/unapplied/server/0060-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to patches/server/0060-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch diff --git a/patches/unapplied/server/0061-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch similarity index 84% rename from patches/unapplied/server/0061-Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch index 46585ba5c2..af35b90ec0 100644 --- a/patches/unapplied/server/0061-Disable-Scoreboards-for-non-players-by-default.patch +++ b/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch @@ -11,10 +11,10 @@ So avoid looking up scoreboards and short circuit to the "not on a team" logic which is most likely to be true. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index dc29c677e21a71b5ba1a48c7aea8acadc2689c77..70275d1db39c9809a5fc93cebb49beb32d616476 100644 +index 575ce3bb03c7eef215e71d238a46aa1cc8510f89..98067f625b49d93fdd91af5114790848a2228ac0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2641,6 +2641,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2660,6 +2660,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Nullable public Team getTeam() { @@ -23,10 +23,10 @@ index dc29c677e21a71b5ba1a48c7aea8acadc2689c77..70275d1db39c9809a5fc93cebb49beb3 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1738512d977f60c4021c01a5fce642f62d7e4c74..17426b43a16887653a63c34128aa97785a23796c 100644 +index 7e4f95e04a880ecb459228c90be462cbbec14620..eec1467eaaadaa66febc06e51372c5f602216fb5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -823,6 +823,7 @@ public abstract class LivingEntity extends Entity { +@@ -822,6 +822,7 @@ public abstract class LivingEntity extends Entity { if (nbt.contains("Team", 8)) { String s = nbt.getString("Team"); PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s); diff --git a/patches/unapplied/server/0062-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0062-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/server/0062-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/0062-Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/server/0063-Chunk-Save-Reattempt.patch b/patches/server/0063-Chunk-Save-Reattempt.patch similarity index 96% rename from patches/unapplied/server/0063-Chunk-Save-Reattempt.patch rename to patches/server/0063-Chunk-Save-Reattempt.patch index e8fab11cda..d58537d3da 100644 --- a/patches/unapplied/server/0063-Chunk-Save-Reattempt.patch +++ b/patches/server/0063-Chunk-Save-Reattempt.patch @@ -19,7 +19,7 @@ index aa8972fd1a1fade05d60ab69efb8ff24f344508a..ddcc212ba83d9365adb842b3d3ced64e } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 45cec71b3b2f9444d7be7e5bf9fab166b28ea34d..ece0fd4b51d124be232e24d08f115b9267cb21cb 100644 +index 18ef7025f7f4dc2a4aff85ca65ff5a2d35a1ef06..64e957650dafc9fc30fa997e7f7d3fd47cf60089 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -167,6 +167,7 @@ public class RegionFileStorage implements AutoCloseable { diff --git a/patches/unapplied/server/0064-Complete-resource-pack-API.patch b/patches/server/0064-Complete-resource-pack-API.patch similarity index 90% rename from patches/unapplied/server/0064-Complete-resource-pack-API.patch rename to patches/server/0064-Complete-resource-pack-API.patch index 662284faa9..fc5e97f56f 100644 --- a/patches/unapplied/server/0064-Complete-resource-pack-API.patch +++ b/patches/server/0064-Complete-resource-pack-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2be965faaed8ca25fc01d6ca1f496f7e41e6b7a0..5443c0008ae3bb0264dbfc1b2bb3921de306c1dd 100644 +index 580f126ad3681306bfff24c1e19dab39a6d4e888..8f21a18d2ba6e9fc1c8d3076ca668c885a9ba19e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1768,8 +1768,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1764,8 +1764,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); } @@ -23,10 +23,10 @@ index 2be965faaed8ca25fc01d6ca1f496f7e41e6b7a0..5443c0008ae3bb0264dbfc1b2bb3921d @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 60850848e76d656d7b4e885c79dfe992108c8ad5..15257f9236d0c32c1c74a15ce4e7decf4d9f2f91 100644 +index af4e9891da2584c791ce85f5eb6315a06fcc77e8..921c00c2a5e7d3487c35ee27714ae6bb6666f86f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -150,6 +150,7 @@ import org.bukkit.plugin.Plugin; +@@ -152,6 +152,7 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.profile.PlayerProfile; import org.bukkit.scoreboard.Scoreboard; @@ -34,7 +34,7 @@ index 60850848e76d656d7b4e885c79dfe992108c8ad5..15257f9236d0c32c1c74a15ce4e7decf import net.md_5.bungee.api.chat.BaseComponent; // Spigot -@@ -168,6 +169,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -170,6 +171,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private double healthScale = 20; private CraftWorldBorder clientWorldBorder = null; private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener(); @@ -45,7 +45,7 @@ index 60850848e76d656d7b4e885c79dfe992108c8ad5..15257f9236d0c32c1c74a15ce4e7decf public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2206,6 +2211,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2208,6 +2213,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/unapplied/server/0065-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch similarity index 89% rename from patches/unapplied/server/0065-Default-loading-permissions.yml-before-plugins.patch rename to patches/server/0065-Default-loading-permissions.yml-before-plugins.patch index 5e279dbea1..b9e9f452fd 100644 --- a/patches/unapplied/server/0065-Default-loading-permissions.yml-before-plugins.patch +++ b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch @@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe A config option has been added for those who depend on the previous behavior, but I don't expect that. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b8763c6f938319d4712222ecab3ebc132071597b..4d9a5297e53b1836e3ba438bae6b869f3822dd28 100644 +index 37c1e4b31c06b9bf48325a7d5f293020b00445b1..f2e27681e095439ff0df027ec16796a464e34239 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -462,6 +462,7 @@ public final class CraftServer implements Server { +@@ -475,6 +475,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); this.helpMap.initializeGeneralTopics(); @@ -27,7 +27,7 @@ index b8763c6f938319d4712222ecab3ebc132071597b..4d9a5297e53b1836e3ba438bae6b869f } Plugin[] plugins = this.pluginManager.getPlugins(); -@@ -481,7 +482,7 @@ public final class CraftServer implements Server { +@@ -494,7 +495,7 @@ public final class CraftServer implements Server { this.commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/patches/unapplied/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch similarity index 90% rename from patches/unapplied/server/0066-Allow-Reloading-of-Custom-Permissions.patch rename to patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch index 4271b0655d..ce92009ff7 100644 --- a/patches/unapplied/server/0066-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4d9a5297e53b1836e3ba438bae6b869f3822dd28..25373b05ab63e71294382c4b2a5b2658f98710a0 100644 +index f2e27681e095439ff0df027ec16796a464e34239..c056df734deb0f9ad2e102075e941a7fdcd78195 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2537,5 +2537,23 @@ public final class CraftServer implements Server { +@@ -2561,5 +2561,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/unapplied/server/0067-Remove-Metadata-on-reload.patch b/patches/server/0067-Remove-Metadata-on-reload.patch similarity index 88% rename from patches/unapplied/server/0067-Remove-Metadata-on-reload.patch rename to patches/server/0067-Remove-Metadata-on-reload.patch index 7e465a2091..f400f87a2a 100644 --- a/patches/unapplied/server/0067-Remove-Metadata-on-reload.patch +++ b/patches/server/0067-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 25373b05ab63e71294382c4b2a5b2658f98710a0..943971ce16c0c39085f029ab5b57685dda1c6b0f 100644 +index c056df734deb0f9ad2e102075e941a7fdcd78195..0b8f2a747b0e869dfd62ef463261941988d8dd16 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -950,8 +950,16 @@ public final class CraftServer implements Server { +@@ -963,8 +963,16 @@ public final class CraftServer implements Server { world.spigotConfig.init(); // Spigot } diff --git a/patches/unapplied/server/0068-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch similarity index 97% rename from patches/unapplied/server/0068-Handle-Item-Meta-Inconsistencies.patch rename to patches/server/0068-Handle-Item-Meta-Inconsistencies.patch index 5d25a8c8cd..b122f49288 100644 --- a/patches/unapplied/server/0068-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch @@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 1b83577ec8e78e20051f20a336e5cf3e7836c079..28a8ad5f42a5ba2e2a9d4c9a04a7add621b28e82 100644 +index f53d8bb8078109f6ff89121261be46f1cccb2860..6ca9a5cf426befde4882d78df5fd8202b73ddbeb 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -151,6 +151,23 @@ public final class ItemStack { +@@ -155,6 +155,23 @@ public final class ItemStack { return this.getItem().getTooltipImage(this); } @@ -45,7 +45,7 @@ index 1b83577ec8e78e20051f20a336e5cf3e7836c079..28a8ad5f42a5ba2e2a9d4c9a04a7add6 public ItemStack(ItemLike item) { this(item, 1); } -@@ -202,6 +219,7 @@ public final class ItemStack { +@@ -206,6 +223,7 @@ public final class ItemStack { // CraftBukkit start - make defensive copy as this data may be coming from the save thread this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end @@ -53,7 +53,7 @@ index 1b83577ec8e78e20051f20a336e5cf3e7836c079..28a8ad5f42a5ba2e2a9d4c9a04a7add6 this.getItem().verifyTagAfterLoad(this.tag); } -@@ -772,6 +790,7 @@ public final class ItemStack { +@@ -779,6 +797,7 @@ public final class ItemStack { public void setTag(@Nullable CompoundTag nbt) { this.tag = nbt; @@ -61,7 +61,7 @@ index 1b83577ec8e78e20051f20a336e5cf3e7836c079..28a8ad5f42a5ba2e2a9d4c9a04a7add6 if (this.getItem().canBeDepleted()) { this.setDamageValue(this.getDamageValue()); } -@@ -1061,6 +1080,7 @@ public final class ItemStack { +@@ -1072,6 +1091,7 @@ public final class ItemStack { ListTag nbttaglist = this.tag.getList("Enchantments", 10); nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level)); @@ -70,7 +70,7 @@ index 1b83577ec8e78e20051f20a336e5cf3e7836c079..28a8ad5f42a5ba2e2a9d4c9a04a7add6 public boolean isEnchanted() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 4b79b96579efbc4dd9a10e7183ed08b73b488794..c9093275d2b78b6e2f59e64efab0b4775ff0b43b 100644 +index 416b6b3d78dec5a25a4ddb329552d03d1da183dd..be2e114ed21344c9336b920238d0ee575b8d342b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -6,7 +6,6 @@ import java.util.Map;