From 1abd354df4196462450dbbc9d3c0a9ed3ec0ec77 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:42:25 +0800 Subject: [PATCH] just can build --- ...Alternative-block-placement-Protocol.patch | 44 +++++--- ...58-Elytra-aeronautics-no-chunk-load.patch} | 0 ...dds.patch => 0059-Cache-ignite-odds.patch} | 0 ...-riptide.patch => 0060-Lava-riptide.patch} | 0 ...tch => 0061-No-block-update-command.patch} | 0 ...062-Raider-die-skip-self-raid-check.patch} | 0 ... => 0063-Container-open-passthrough.patch} | 0 ...-support.patch => 0064-SIMD-support.patch} | 0 ...ont-respond-ping-before-start-fully.patch} | 0 ... => 0066-Faster-chunk-serialization.patch} | 0 ...067-Cache-world-generator-sea-level.patch} | 0 ...col.patch => 0068-Bladeren-Protocol.patch} | 0 ...Skip-secondary-POI-sensor-if-absent.patch} | 0 ...=> 0070-Bladeren-mspt-sync-protocol.patch} | 0 ...> 0071-Store-mob-counts-in-an-array.patch} | 0 ...h => 0072-Optimize-noise-generation.patch} | 0 ....patch => 0073-Disable-packet-limit.patch} | 0 ...ch => 0074-Reduce-array-allocations.patch} | 0 ...atch => 0075-Optimize-sun-burn-tick.patch} | 0 ...-Optional-allocation-in-EntityBased.patch} | 0 ...ignableFrom-call-in-ClassInstanceMu.patch} | 0 ...ch => 0078-Optimized-CubePointRange.patch} | 0 ...k-frozen-ticks-before-landing-block.patch} | 0 ...kip-entity-move-if-movement-is-zero.patch} | 0 ...1-Skip-cloning-advancement-criteria.patch} | 0 ...2-Fix-villagers-dont-release-memory.patch} | 0 ...h => 0083-Avoid-anvil-too-expensive.patch} | 0 ...-fix.patch => 0084-Bow-infinity-fix.patch} | 0 ...ants.patch => 0085-Zero-tick-plants.patch} | 0 ...pdater.patch => 0086-Leaves-Updater.patch} | 0 ... => 0087-Force-peaceful-mode-switch.patch} | 2 +- ...od-API.patch => 0088-Replay-Mod-API.patch} | 0 ...aves-I18n.patch => 0089-Leaves-I18n.patch} | 0 ...raft-hopper-not-work-without-player.patch} | 0 ...G-Fishing.patch => 0091-RNG-Fishing.patch} | 0 ...r.patch => 0092-Wool-Hopper-Counter.patch} | 0 ...patch => 0093-Leaves-Reload-Command.patch} | 0 ...=> 0094-Spider-jockeys-drop-gapples.patch} | 0 ...rade.patch => 0095-Force-Void-Trade.patch} | 2 +- ...=> 0096-Villager-infinite-discounts.patch} | 0 ...atch => 0097-CCE-update-suppression.patch} | 0 ...8-Disable-offline-warn-if-use-proxy.patch} | 0 ...099-Disable-moved-wrongly-threshold.patch} | 0 ...r-stand-cant-kill-by-mob-projectile.patch} | 0 ...atch => 0101-Make-Item-tick-vanilla.patch} | 0 ...atch => 0102-Copper-Bulb-1-gt-delay.patch} | 0 ...ay.patch => 0103-Crafter-1-gt-delay.patch} | 0 ...h => 0104-Linear-region-file-format.patch} | 105 ++++++++++++++++-- ...e.patch => 0105-No-TNT-place-update.patch} | 0 ...tocol.patch => 0106-Servux-Protocol.patch} | 27 +---- ...ed-hopper-no-longer-send-NC-updates.patch} | 0 ...e.patch => 0108-Renewable-deepslate.patch} | 0 ...ges.patch => 0109-Renewable-sponges.patch} | 0 ...coral.patch => 0110-Renewable-coral.patch} | 0 ...st-resume.patch => 0111-Fast-resume.patch} | 0 ...hopper.patch => 0112-Vanilla-hopper.patch} | 0 ...tch => 0113-Force-minecraft-command.patch} | 0 ...-Fix-falling-block-s-block-location.patch} | 2 +- ...tebuf-API.patch => 0115-Bytebuf-API.patch} | 0 ... 0116-Allow-grindstone-overstacking.patch} | 0 ...67.patch => 0117-Configurable-MC-67.patch} | 2 +- ...e-end-gateway-portal-entity-ticking.patch} | 0 ...able-crystal-portal-proximity-check.patch} | 0 ...ble-LivingEntity-aiStep-alive-check.patch} | 0 ...lugins.patch => 0121-Leaves-plugins.patch} | 0 ...atch => 0122-Fix-fortress-mob-spawn.patch} | 0 ...23-Fix-FallingBlockEntity-Duplicate.patch} | 0 ...h => 0124-Old-BlockEntity-behaviour.patch} | 2 +- ...s.patch => 0125-Revert-raid-changes.patch} | 0 ...6-Allow-anvil-destroy-item-entities.patch} | 0 ...-Collision-Behavior-for-Block-Shape.patch} | 0 ...tch => 0128-Disable-vault-blacklist.patch} | 0 72 files changed, 131 insertions(+), 55 deletions(-) rename patches/server/{0059-Elytra-aeronautics-no-chunk-load.patch => 0058-Elytra-aeronautics-no-chunk-load.patch} (100%) rename patches/server/{0060-Cache-ignite-odds.patch => 0059-Cache-ignite-odds.patch} (100%) rename patches/server/{0061-Lava-riptide.patch => 0060-Lava-riptide.patch} (100%) rename patches/server/{0062-No-block-update-command.patch => 0061-No-block-update-command.patch} (100%) rename patches/server/{0063-Raider-die-skip-self-raid-check.patch => 0062-Raider-die-skip-self-raid-check.patch} (100%) rename patches/server/{0064-Container-open-passthrough.patch => 0063-Container-open-passthrough.patch} (100%) rename patches/server/{0065-SIMD-support.patch => 0064-SIMD-support.patch} (100%) rename patches/server/{0066-Dont-respond-ping-before-start-fully.patch => 0065-Dont-respond-ping-before-start-fully.patch} (100%) rename patches/server/{0067-Faster-chunk-serialization.patch => 0066-Faster-chunk-serialization.patch} (100%) rename patches/server/{0068-Cache-world-generator-sea-level.patch => 0067-Cache-world-generator-sea-level.patch} (100%) rename patches/server/{0069-Bladeren-Protocol.patch => 0068-Bladeren-Protocol.patch} (100%) rename patches/server/{0070-Skip-secondary-POI-sensor-if-absent.patch => 0069-Skip-secondary-POI-sensor-if-absent.patch} (100%) rename patches/server/{0071-Bladeren-mspt-sync-protocol.patch => 0070-Bladeren-mspt-sync-protocol.patch} (100%) rename patches/server/{0072-Store-mob-counts-in-an-array.patch => 0071-Store-mob-counts-in-an-array.patch} (100%) rename patches/server/{0073-Optimize-noise-generation.patch => 0072-Optimize-noise-generation.patch} (100%) rename patches/server/{0074-Disable-packet-limit.patch => 0073-Disable-packet-limit.patch} (100%) rename patches/server/{0075-Reduce-array-allocations.patch => 0074-Reduce-array-allocations.patch} (100%) rename patches/server/{0076-Optimize-sun-burn-tick.patch => 0075-Optimize-sun-burn-tick.patch} (100%) rename patches/server/{0077-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch => 0076-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch} (100%) rename patches/server/{0078-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch => 0077-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch} (100%) rename patches/server/{0079-Optimized-CubePointRange.patch => 0078-Optimized-CubePointRange.patch} (100%) rename patches/server/{0080-Check-frozen-ticks-before-landing-block.patch => 0079-Check-frozen-ticks-before-landing-block.patch} (100%) rename patches/server/{0081-Skip-entity-move-if-movement-is-zero.patch => 0080-Skip-entity-move-if-movement-is-zero.patch} (100%) rename patches/server/{0082-Skip-cloning-advancement-criteria.patch => 0081-Skip-cloning-advancement-criteria.patch} (100%) rename patches/server/{0083-Fix-villagers-dont-release-memory.patch => 0082-Fix-villagers-dont-release-memory.patch} (100%) rename patches/server/{0084-Avoid-anvil-too-expensive.patch => 0083-Avoid-anvil-too-expensive.patch} (100%) rename patches/server/{0085-Bow-infinity-fix.patch => 0084-Bow-infinity-fix.patch} (100%) rename patches/server/{0086-Zero-tick-plants.patch => 0085-Zero-tick-plants.patch} (100%) rename patches/server/{0087-Leaves-Updater.patch => 0086-Leaves-Updater.patch} (100%) rename patches/server/{0088-Force-peaceful-mode-switch.patch => 0087-Force-peaceful-mode-switch.patch} (99%) rename patches/server/{0089-Replay-Mod-API.patch => 0088-Replay-Mod-API.patch} (100%) rename patches/server/{0090-Leaves-I18n.patch => 0089-Leaves-I18n.patch} (100%) rename patches/server/{0091-Fix-minecraft-hopper-not-work-without-player.patch => 0090-Fix-minecraft-hopper-not-work-without-player.patch} (100%) rename patches/server/{0092-RNG-Fishing.patch => 0091-RNG-Fishing.patch} (100%) rename patches/server/{0093-Wool-Hopper-Counter.patch => 0092-Wool-Hopper-Counter.patch} (100%) rename patches/server/{0094-Leaves-Reload-Command.patch => 0093-Leaves-Reload-Command.patch} (100%) rename patches/server/{0095-Spider-jockeys-drop-gapples.patch => 0094-Spider-jockeys-drop-gapples.patch} (100%) rename patches/server/{0096-Force-Void-Trade.patch => 0095-Force-Void-Trade.patch} (99%) rename patches/server/{0097-Villager-infinite-discounts.patch => 0096-Villager-infinite-discounts.patch} (100%) rename patches/server/{0098-CCE-update-suppression.patch => 0097-CCE-update-suppression.patch} (100%) rename patches/server/{0099-Disable-offline-warn-if-use-proxy.patch => 0098-Disable-offline-warn-if-use-proxy.patch} (100%) rename patches/server/{0100-Disable-moved-wrongly-threshold.patch => 0099-Disable-moved-wrongly-threshold.patch} (100%) rename patches/server/{0101-Armor-stand-cant-kill-by-mob-projectile.patch => 0100-Armor-stand-cant-kill-by-mob-projectile.patch} (100%) rename patches/server/{0102-Make-Item-tick-vanilla.patch => 0101-Make-Item-tick-vanilla.patch} (100%) rename patches/server/{0103-Copper-Bulb-1-gt-delay.patch => 0102-Copper-Bulb-1-gt-delay.patch} (100%) rename patches/server/{0104-Crafter-1-gt-delay.patch => 0103-Crafter-1-gt-delay.patch} (100%) rename patches/server/{0105-Linear-region-file-format.patch => 0104-Linear-region-file-format.patch} (86%) rename patches/server/{0106-No-TNT-place-update.patch => 0105-No-TNT-place-update.patch} (100%) rename patches/server/{0107-Servux-Protocol.patch => 0106-Servux-Protocol.patch} (97%) rename patches/server/{0108-Placing-locked-hopper-no-longer-send-NC-updates.patch => 0107-Placing-locked-hopper-no-longer-send-NC-updates.patch} (100%) rename patches/server/{0109-Renewable-deepslate.patch => 0108-Renewable-deepslate.patch} (100%) rename patches/server/{0110-Renewable-sponges.patch => 0109-Renewable-sponges.patch} (100%) rename patches/server/{0111-Renewable-coral.patch => 0110-Renewable-coral.patch} (100%) rename patches/server/{0112-Fast-resume.patch => 0111-Fast-resume.patch} (100%) rename patches/server/{0113-Vanilla-hopper.patch => 0112-Vanilla-hopper.patch} (100%) rename patches/server/{0114-Force-minecraft-command.patch => 0113-Force-minecraft-command.patch} (100%) rename patches/server/{0115-Fix-falling-block-s-block-location.patch => 0114-Fix-falling-block-s-block-location.patch} (92%) rename patches/server/{0116-Bytebuf-API.patch => 0115-Bytebuf-API.patch} (100%) rename patches/server/{0117-Allow-grindstone-overstacking.patch => 0116-Allow-grindstone-overstacking.patch} (100%) rename patches/server/{0118-Configurable-MC-67.patch => 0117-Configurable-MC-67.patch} (91%) rename patches/server/{0119-Disable-end-gateway-portal-entity-ticking.patch => 0118-Disable-end-gateway-portal-entity-ticking.patch} (100%) rename patches/server/{0120-Disable-crystal-portal-proximity-check.patch => 0119-Disable-crystal-portal-proximity-check.patch} (100%) rename patches/server/{0121-Can-disable-LivingEntity-aiStep-alive-check.patch => 0120-Can-disable-LivingEntity-aiStep-alive-check.patch} (100%) rename patches/server/{0122-Leaves-plugins.patch => 0121-Leaves-plugins.patch} (100%) rename patches/server/{0123-Fix-fortress-mob-spawn.patch => 0122-Fix-fortress-mob-spawn.patch} (100%) rename patches/server/{0124-Fix-FallingBlockEntity-Duplicate.patch => 0123-Fix-FallingBlockEntity-Duplicate.patch} (100%) rename patches/server/{0125-Old-BlockEntity-behaviour.patch => 0124-Old-BlockEntity-behaviour.patch} (98%) rename patches/server/{0126-Revert-raid-changes.patch => 0125-Revert-raid-changes.patch} (100%) rename patches/server/{0127-Allow-anvil-destroy-item-entities.patch => 0126-Allow-anvil-destroy-item-entities.patch} (100%) rename patches/server/{0128-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch => 0127-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch} (100%) rename patches/server/{0129-Disable-vault-blacklist.patch => 0128-Disable-vault-blacklist.patch} (100%) diff --git a/patches/server/0034-Alternative-block-placement-Protocol.patch b/patches/server/0034-Alternative-block-placement-Protocol.patch index 9c04013e..5f798511 100644 --- a/patches/server/0034-Alternative-block-placement-Protocol.patch +++ b/patches/server/0034-Alternative-block-placement-Protocol.patch @@ -102,10 +102,10 @@ index 48ced9994219dc21d593a7deaa0a318f55dd00c7..c6e872633f6044e9c8e2a63bcef6332d return this.defaultBlockState(); diff --git a/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java b/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java new file mode 100644 -index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862db57a3193 +index 0000000000000000000000000000000000000000..e5c5bee2518ff2843270979d36d264f17a5cf0a6 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java -@@ -0,0 +1,162 @@ +@@ -0,0 +1,167 @@ +package org.leavesmc.leaves.protocol; + +import net.minecraft.core.BlockPos; @@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862d +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.ComparatorMode; -+import net.minecraft.world.level.block.state.properties.DirectionProperty; ++import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Half; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.SlabType; @@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862d + return null; + } + -+ DirectionProperty directionProp = getFirstDirectionProperty(state); ++ EnumProperty directionProp = getFirstDirectionProperty(state); + int protocolValue = ((int) relativeHitX - 2) / 2; + + if (directionProp != null) { @@ -209,7 +209,8 @@ index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862d + return state; + } + -+ public static BlockState alternativeBlockPlacementFix(Block block, BlockPlaceContext context) { ++ @Nullable ++ public static BlockState alternativeBlockPlacementFix(Block block, @NotNull BlockPlaceContext context) { + Direction facing; + Vec3 vec3d = context.getClickLocation(); + BlockPos pos = context.getClickedPos(); @@ -258,22 +259,26 @@ index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862d + return null; + } + ++ @SuppressWarnings("unchecked") + @Nullable -+ public static DirectionProperty getFirstDirectionProperty(@NotNull BlockState state) { ++ public static EnumProperty getFirstDirectionProperty(@NotNull BlockState state) { + for (Property prop : state.getProperties()) { -+ if (prop instanceof DirectionProperty) { -+ return (DirectionProperty) prop; ++ if (prop instanceof EnumProperty enumProperty) { ++ if (enumProperty.getValueClass().equals(Direction.class)) { ++ return (EnumProperty) enumProperty; ++ } + } + } ++ + return null; + } +} diff --git a/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a4688f9eb +index 0000000000000000000000000000000000000000..eceb1b8322fa50809990636e6caed491828e2fd6 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java -@@ -0,0 +1,209 @@ +@@ -0,0 +1,214 @@ +package org.leavesmc.leaves.protocol; + +import com.google.common.collect.ImmutableSet; @@ -287,10 +292,11 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a +import net.minecraft.world.level.block.BedBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; -+import net.minecraft.world.level.block.state.properties.DirectionProperty; ++import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.SlabType; +import net.minecraft.world.phys.Vec3; ++import org.jetbrains.annotations.NotNull; +import org.leavesmc.leaves.LeavesLogger; + +import javax.annotation.Nullable; @@ -311,6 +317,8 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + BlockStateProperties.CHEST_TYPE, + BlockStateProperties.MODE_COMPARATOR, + BlockStateProperties.DOOR_HINGE, ++ BlockStateProperties.FACING_HOPPER, ++ BlockStateProperties.HORIZONTAL_FACING, + BlockStateProperties.ORIENTATION, + BlockStateProperties.RAIL_SHAPE, + BlockStateProperties.RAIL_SHAPE_STRAIGHT, @@ -326,14 +334,15 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + return applyPlacementProtocolV3(state, UseContext.from(context, context.getHand())); + } + -+ private static > BlockState applyPlacementProtocolV3(BlockState state, UseContext context) { ++ @Nullable ++ private static > BlockState applyPlacementProtocolV3(BlockState state, @NotNull UseContext context) { + int protocolValue = (int) (context.getHitVec().x - (double) context.getPos().getX()) - 2; + BlockState oldState = state; + if (protocolValue < 0) { + return oldState; + } + -+ @Nullable DirectionProperty property = CarpetAlternativeBlockPlacement.getFirstDirectionProperty(state); ++ EnumProperty property = CarpetAlternativeBlockPlacement.getFirstDirectionProperty(state); + + if (property != null && property != BlockStateProperties.VERTICAL_DIRECTION) { + state = applyDirectionProperty(state, context, property, protocolValue); @@ -358,7 +367,7 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + + try { + for (Property p : propList) { -+ if (!(p instanceof DirectionProperty) && WHITELISTED_PROPERTIES.contains(p)) { ++ if (((p instanceof EnumProperty ep) && !ep.getValueClass().equals(Direction.class)) && WHITELISTED_PROPERTIES.contains(p)) { + @SuppressWarnings("unchecked") + Property prop = (Property) p; + List list = new ArrayList<>(prop.getPossibleValues()); @@ -386,7 +395,7 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + } + } + } catch (Exception e) { -+ LeavesLogger.LOGGER.warning("Exception trying to apply placement protocol value"); ++ LeavesLogger.LOGGER.warning("Exception trying to apply placement protocol value", e); + } + + if (state.canSurvive(context.getWorld(), context.getPos())) { @@ -396,7 +405,7 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + } + } + -+ private static BlockState applyDirectionProperty(BlockState state, UseContext context, DirectionProperty property, int protocolValue) { ++ private static BlockState applyDirectionProperty(BlockState state, UseContext context, EnumProperty property, int protocolValue) { + Direction facingOrig = state.getValue(property); + Direction facing = facingOrig; + int decodedFacingIndex = (protocolValue & 0xF) >> 1; @@ -448,7 +457,8 @@ index 0000000000000000000000000000000000000000..92f90ebf04f00341360e9e0ba1da5e0a + this.itemPlacementContext = itemPlacementContext; + } + -+ public static UseContext from(BlockPlaceContext ctx, InteractionHand hand) { ++ @NotNull ++ public static UseContext from(@NotNull BlockPlaceContext ctx, InteractionHand hand) { + Vec3 pos = ctx.getClickLocation(); + return new UseContext(ctx.getLevel(), ctx.getClickedPos(), ctx.getClickedFace(), new Vec3(pos.x, pos.y, pos.z), ctx.getPlayer(), hand, ctx); + } diff --git a/patches/server/0059-Elytra-aeronautics-no-chunk-load.patch b/patches/server/0058-Elytra-aeronautics-no-chunk-load.patch similarity index 100% rename from patches/server/0059-Elytra-aeronautics-no-chunk-load.patch rename to patches/server/0058-Elytra-aeronautics-no-chunk-load.patch diff --git a/patches/server/0060-Cache-ignite-odds.patch b/patches/server/0059-Cache-ignite-odds.patch similarity index 100% rename from patches/server/0060-Cache-ignite-odds.patch rename to patches/server/0059-Cache-ignite-odds.patch diff --git a/patches/server/0061-Lava-riptide.patch b/patches/server/0060-Lava-riptide.patch similarity index 100% rename from patches/server/0061-Lava-riptide.patch rename to patches/server/0060-Lava-riptide.patch diff --git a/patches/server/0062-No-block-update-command.patch b/patches/server/0061-No-block-update-command.patch similarity index 100% rename from patches/server/0062-No-block-update-command.patch rename to patches/server/0061-No-block-update-command.patch diff --git a/patches/server/0063-Raider-die-skip-self-raid-check.patch b/patches/server/0062-Raider-die-skip-self-raid-check.patch similarity index 100% rename from patches/server/0063-Raider-die-skip-self-raid-check.patch rename to patches/server/0062-Raider-die-skip-self-raid-check.patch diff --git a/patches/server/0064-Container-open-passthrough.patch b/patches/server/0063-Container-open-passthrough.patch similarity index 100% rename from patches/server/0064-Container-open-passthrough.patch rename to patches/server/0063-Container-open-passthrough.patch diff --git a/patches/server/0065-SIMD-support.patch b/patches/server/0064-SIMD-support.patch similarity index 100% rename from patches/server/0065-SIMD-support.patch rename to patches/server/0064-SIMD-support.patch diff --git a/patches/server/0066-Dont-respond-ping-before-start-fully.patch b/patches/server/0065-Dont-respond-ping-before-start-fully.patch similarity index 100% rename from patches/server/0066-Dont-respond-ping-before-start-fully.patch rename to patches/server/0065-Dont-respond-ping-before-start-fully.patch diff --git a/patches/server/0067-Faster-chunk-serialization.patch b/patches/server/0066-Faster-chunk-serialization.patch similarity index 100% rename from patches/server/0067-Faster-chunk-serialization.patch rename to patches/server/0066-Faster-chunk-serialization.patch diff --git a/patches/server/0068-Cache-world-generator-sea-level.patch b/patches/server/0067-Cache-world-generator-sea-level.patch similarity index 100% rename from patches/server/0068-Cache-world-generator-sea-level.patch rename to patches/server/0067-Cache-world-generator-sea-level.patch diff --git a/patches/server/0069-Bladeren-Protocol.patch b/patches/server/0068-Bladeren-Protocol.patch similarity index 100% rename from patches/server/0069-Bladeren-Protocol.patch rename to patches/server/0068-Bladeren-Protocol.patch diff --git a/patches/server/0070-Skip-secondary-POI-sensor-if-absent.patch b/patches/server/0069-Skip-secondary-POI-sensor-if-absent.patch similarity index 100% rename from patches/server/0070-Skip-secondary-POI-sensor-if-absent.patch rename to patches/server/0069-Skip-secondary-POI-sensor-if-absent.patch diff --git a/patches/server/0071-Bladeren-mspt-sync-protocol.patch b/patches/server/0070-Bladeren-mspt-sync-protocol.patch similarity index 100% rename from patches/server/0071-Bladeren-mspt-sync-protocol.patch rename to patches/server/0070-Bladeren-mspt-sync-protocol.patch diff --git a/patches/server/0072-Store-mob-counts-in-an-array.patch b/patches/server/0071-Store-mob-counts-in-an-array.patch similarity index 100% rename from patches/server/0072-Store-mob-counts-in-an-array.patch rename to patches/server/0071-Store-mob-counts-in-an-array.patch diff --git a/patches/server/0073-Optimize-noise-generation.patch b/patches/server/0072-Optimize-noise-generation.patch similarity index 100% rename from patches/server/0073-Optimize-noise-generation.patch rename to patches/server/0072-Optimize-noise-generation.patch diff --git a/patches/server/0074-Disable-packet-limit.patch b/patches/server/0073-Disable-packet-limit.patch similarity index 100% rename from patches/server/0074-Disable-packet-limit.patch rename to patches/server/0073-Disable-packet-limit.patch diff --git a/patches/server/0075-Reduce-array-allocations.patch b/patches/server/0074-Reduce-array-allocations.patch similarity index 100% rename from patches/server/0075-Reduce-array-allocations.patch rename to patches/server/0074-Reduce-array-allocations.patch diff --git a/patches/server/0076-Optimize-sun-burn-tick.patch b/patches/server/0075-Optimize-sun-burn-tick.patch similarity index 100% rename from patches/server/0076-Optimize-sun-burn-tick.patch rename to patches/server/0075-Optimize-sun-burn-tick.patch diff --git a/patches/server/0077-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch b/patches/server/0076-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch similarity index 100% rename from patches/server/0077-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch rename to patches/server/0076-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch diff --git a/patches/server/0078-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch b/patches/server/0077-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch similarity index 100% rename from patches/server/0078-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch rename to patches/server/0077-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch diff --git a/patches/server/0079-Optimized-CubePointRange.patch b/patches/server/0078-Optimized-CubePointRange.patch similarity index 100% rename from patches/server/0079-Optimized-CubePointRange.patch rename to patches/server/0078-Optimized-CubePointRange.patch diff --git a/patches/server/0080-Check-frozen-ticks-before-landing-block.patch b/patches/server/0079-Check-frozen-ticks-before-landing-block.patch similarity index 100% rename from patches/server/0080-Check-frozen-ticks-before-landing-block.patch rename to patches/server/0079-Check-frozen-ticks-before-landing-block.patch diff --git a/patches/server/0081-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0080-Skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from patches/server/0081-Skip-entity-move-if-movement-is-zero.patch rename to patches/server/0080-Skip-entity-move-if-movement-is-zero.patch diff --git a/patches/server/0082-Skip-cloning-advancement-criteria.patch b/patches/server/0081-Skip-cloning-advancement-criteria.patch similarity index 100% rename from patches/server/0082-Skip-cloning-advancement-criteria.patch rename to patches/server/0081-Skip-cloning-advancement-criteria.patch diff --git a/patches/server/0083-Fix-villagers-dont-release-memory.patch b/patches/server/0082-Fix-villagers-dont-release-memory.patch similarity index 100% rename from patches/server/0083-Fix-villagers-dont-release-memory.patch rename to patches/server/0082-Fix-villagers-dont-release-memory.patch diff --git a/patches/server/0084-Avoid-anvil-too-expensive.patch b/patches/server/0083-Avoid-anvil-too-expensive.patch similarity index 100% rename from patches/server/0084-Avoid-anvil-too-expensive.patch rename to patches/server/0083-Avoid-anvil-too-expensive.patch diff --git a/patches/server/0085-Bow-infinity-fix.patch b/patches/server/0084-Bow-infinity-fix.patch similarity index 100% rename from patches/server/0085-Bow-infinity-fix.patch rename to patches/server/0084-Bow-infinity-fix.patch diff --git a/patches/server/0086-Zero-tick-plants.patch b/patches/server/0085-Zero-tick-plants.patch similarity index 100% rename from patches/server/0086-Zero-tick-plants.patch rename to patches/server/0085-Zero-tick-plants.patch diff --git a/patches/server/0087-Leaves-Updater.patch b/patches/server/0086-Leaves-Updater.patch similarity index 100% rename from patches/server/0087-Leaves-Updater.patch rename to patches/server/0086-Leaves-Updater.patch diff --git a/patches/server/0088-Force-peaceful-mode-switch.patch b/patches/server/0087-Force-peaceful-mode-switch.patch similarity index 99% rename from patches/server/0088-Force-peaceful-mode-switch.patch rename to patches/server/0087-Force-peaceful-mode-switch.patch index bd1dc457..e20c50b3 100644 --- a/patches/server/0088-Force-peaceful-mode-switch.patch +++ b/patches/server/0087-Force-peaceful-mode-switch.patch @@ -69,7 +69,7 @@ index aaaadb7be8abf867624a1ca83371595bef4ab633..d2ed6f4d066833ca31db02ca8826f5ed list1 = List.of(); } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 9f188a921781f9620b6dcdc6c7549a8a4709efa1..346e5e82b5cfed3dbe5363c153015a8e37ef79ca 100644 +index 4772d0b1c70213bb73aa22eca820ade21335b3a8..c553badbf28ce6aec7750d33a46f3f5e1a0df4d5 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -131,7 +131,12 @@ public final class NaturalSpawner { diff --git a/patches/server/0089-Replay-Mod-API.patch b/patches/server/0088-Replay-Mod-API.patch similarity index 100% rename from patches/server/0089-Replay-Mod-API.patch rename to patches/server/0088-Replay-Mod-API.patch diff --git a/patches/server/0090-Leaves-I18n.patch b/patches/server/0089-Leaves-I18n.patch similarity index 100% rename from patches/server/0090-Leaves-I18n.patch rename to patches/server/0089-Leaves-I18n.patch diff --git a/patches/server/0091-Fix-minecraft-hopper-not-work-without-player.patch b/patches/server/0090-Fix-minecraft-hopper-not-work-without-player.patch similarity index 100% rename from patches/server/0091-Fix-minecraft-hopper-not-work-without-player.patch rename to patches/server/0090-Fix-minecraft-hopper-not-work-without-player.patch diff --git a/patches/server/0092-RNG-Fishing.patch b/patches/server/0091-RNG-Fishing.patch similarity index 100% rename from patches/server/0092-RNG-Fishing.patch rename to patches/server/0091-RNG-Fishing.patch diff --git a/patches/server/0093-Wool-Hopper-Counter.patch b/patches/server/0092-Wool-Hopper-Counter.patch similarity index 100% rename from patches/server/0093-Wool-Hopper-Counter.patch rename to patches/server/0092-Wool-Hopper-Counter.patch diff --git a/patches/server/0094-Leaves-Reload-Command.patch b/patches/server/0093-Leaves-Reload-Command.patch similarity index 100% rename from patches/server/0094-Leaves-Reload-Command.patch rename to patches/server/0093-Leaves-Reload-Command.patch diff --git a/patches/server/0095-Spider-jockeys-drop-gapples.patch b/patches/server/0094-Spider-jockeys-drop-gapples.patch similarity index 100% rename from patches/server/0095-Spider-jockeys-drop-gapples.patch rename to patches/server/0094-Spider-jockeys-drop-gapples.patch diff --git a/patches/server/0096-Force-Void-Trade.patch b/patches/server/0095-Force-Void-Trade.patch similarity index 99% rename from patches/server/0096-Force-Void-Trade.patch rename to patches/server/0095-Force-Void-Trade.patch index 36f5140c..0b2daa43 100644 --- a/patches/server/0096-Force-Void-Trade.patch +++ b/patches/server/0095-Force-Void-Trade.patch @@ -74,7 +74,7 @@ index c7f0a3e36959843b557615f55d32e6f1b3e9f456..8ebc52da0f6914e5641e2f5a220a0e94 + // Leaves end - force void trade } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index a98f9c22f8485ff3a9812cce19d47a0b08f2c054..5f1b12bc2294d7c2e21c9bea212e29dbb93c7e02 100644 +index 662c46e465feaf3917a93a6f8942febb25590922..5e83099ac5e3698debd4ff5eb97d0ba3347c2ea8 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -348,6 +348,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler diff --git a/patches/server/0097-Villager-infinite-discounts.patch b/patches/server/0096-Villager-infinite-discounts.patch similarity index 100% rename from patches/server/0097-Villager-infinite-discounts.patch rename to patches/server/0096-Villager-infinite-discounts.patch diff --git a/patches/server/0098-CCE-update-suppression.patch b/patches/server/0097-CCE-update-suppression.patch similarity index 100% rename from patches/server/0098-CCE-update-suppression.patch rename to patches/server/0097-CCE-update-suppression.patch diff --git a/patches/server/0099-Disable-offline-warn-if-use-proxy.patch b/patches/server/0098-Disable-offline-warn-if-use-proxy.patch similarity index 100% rename from patches/server/0099-Disable-offline-warn-if-use-proxy.patch rename to patches/server/0098-Disable-offline-warn-if-use-proxy.patch diff --git a/patches/server/0100-Disable-moved-wrongly-threshold.patch b/patches/server/0099-Disable-moved-wrongly-threshold.patch similarity index 100% rename from patches/server/0100-Disable-moved-wrongly-threshold.patch rename to patches/server/0099-Disable-moved-wrongly-threshold.patch diff --git a/patches/server/0101-Armor-stand-cant-kill-by-mob-projectile.patch b/patches/server/0100-Armor-stand-cant-kill-by-mob-projectile.patch similarity index 100% rename from patches/server/0101-Armor-stand-cant-kill-by-mob-projectile.patch rename to patches/server/0100-Armor-stand-cant-kill-by-mob-projectile.patch diff --git a/patches/server/0102-Make-Item-tick-vanilla.patch b/patches/server/0101-Make-Item-tick-vanilla.patch similarity index 100% rename from patches/server/0102-Make-Item-tick-vanilla.patch rename to patches/server/0101-Make-Item-tick-vanilla.patch diff --git a/patches/server/0103-Copper-Bulb-1-gt-delay.patch b/patches/server/0102-Copper-Bulb-1-gt-delay.patch similarity index 100% rename from patches/server/0103-Copper-Bulb-1-gt-delay.patch rename to patches/server/0102-Copper-Bulb-1-gt-delay.patch diff --git a/patches/server/0104-Crafter-1-gt-delay.patch b/patches/server/0103-Crafter-1-gt-delay.patch similarity index 100% rename from patches/server/0104-Crafter-1-gt-delay.patch rename to patches/server/0103-Crafter-1-gt-delay.patch diff --git a/patches/server/0105-Linear-region-file-format.patch b/patches/server/0104-Linear-region-file-format.patch similarity index 86% rename from patches/server/0105-Linear-region-file-format.patch rename to patches/server/0104-Linear-region-file-format.patch index 677593e3..d643bc58 100644 --- a/patches/server/0105-Linear-region-file-format.patch +++ b/patches/server/0104-Linear-region-file-format.patch @@ -36,6 +36,30 @@ index a814512fcfb85312474ae2c2c21443843bf57831..c56812494d2cd270eb66bde1f0a8a9b4 public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite( final int chunkX, final int chunkZ, final CompoundTag compound +diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java +index 99f6f3e58b11b8967e6f1c3391c190d9a860ab7f..0ae12577584f8c5b0762ee28957acc952289a1c2 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java ++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java +@@ -1469,7 +1469,7 @@ public final class MoonriseRegionFileIO { + + public static interface IORunnable { + +- public void run(final RegionFile regionFile) throws IOException; ++ public void run(final org.leavesmc.leaves.region.AbstractRegionFile regionFile) throws IOException; // Leaves + + } + } +diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java +index 51c126735ace8fdde89ad97b5cab62f244212db0..054d03b0417077b30c34dbea1f3dc6b6de11b41b 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java ++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java +@@ -8,5 +8,5 @@ public interface ChunkSystemChunkBuffer { + + public void moonrise$setWriteOnClose(final boolean value); + +- public void moonrise$write(final RegionFile regionFile) throws IOException; ++ public void moonrise$write(final org.leavesmc.leaves.region.AbstractRegionFile regionFile) throws IOException; // Leaves + } diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java index 622d0cbe023774d92d212f242b60b96317720835..c182e2d26a72ebd28636b50bbbc050e34fa600cc 100644 --- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java @@ -86,7 +110,7 @@ index 622d0cbe023774d92d212f242b60b96317720835..c182e2d26a72ebd28636b50bbbc050e3 } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index 6a465d9b12c92b5385c394fef7456630be97c04d..3155e999b437d49ee99f0f8f362d08417e4bb60d 100644 +index 6a465d9b12c92b5385c394fef7456630be97c04d..6e4593e12408a23ce43a61fa0141ba489923a6d5 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -28,7 +28,7 @@ import net.minecraft.nbt.NbtIo; // Paper @@ -94,7 +118,7 @@ index 6a465d9b12c92b5385c394fef7456630be97c04d..3155e999b437d49ee99f0f8f362d0841 import org.slf4j.Logger; -public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile { // Paper - rewrite chunk system -+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile, org.leavesmc.leaves.region.AbstractRegionFile { // Paper - rewrite chunk system // Leaves ++public class RegionFile implements AutoCloseable, org.leavesmc.leaves.region.AbstractRegionFile { // Paper - rewrite chunk system // Leaves private static final Logger LOGGER = LogUtils.getLogger(); private static final int SECTOR_BYTES = 4096; @@ -107,6 +131,15 @@ index 6a465d9b12c92b5385c394fef7456630be97c04d..3155e999b437d49ee99f0f8f362d0841 if (!this.canRecalcHeader) { return false; } +@@ -810,7 +810,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche + } + } + +- protected synchronized void write(ChunkPos pos, ByteBuffer buf) throws IOException { ++ public synchronized void write(ChunkPos pos, ByteBuffer buf) throws IOException { // Leaves - protected -> public + int i = RegionFile.getOffsetIndex(pos); + int j = this.offsets.get(i); + int k = RegionFile.getSectorNumber(j); @@ -953,10 +953,10 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche private static int getChunkIndex(int x, int z) { return (x & 31) + (z & 31) * 32; @@ -129,8 +162,17 @@ index 6a465d9b12c92b5385c394fef7456630be97c04d..3155e999b437d49ee99f0f8f362d0841 Path file = getOversizedFile(x, z); try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) { return NbtIo.read((java.io.DataInput) out); +@@ -1021,7 +1021,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche + } + + @Override +- public final void moonrise$write(final RegionFile regionFile) throws IOException { ++ public final void moonrise$write(final org.leavesmc.leaves.region.AbstractRegionFile regionFile) throws IOException { // Leaves + regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count)); + } + // Paper end - rewrite chunk system 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 78922c3e9a69db1774dd846047b79e9523d7cf41..b70f26604e45fffed3c58c1fd5e36091287d2e94 100644 +index 78922c3e9a69db1774dd846047b79e9523d7cf41..6ce6037512a3eb5c01f87f5bf8d8011975e0990c 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 @@ -21,7 +21,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise @@ -207,6 +249,33 @@ index 78922c3e9a69db1774dd846047b79e9523d7cf41..b70f26604e45fffed3c58c1fd5e36091 this.regionCache.putAndMoveToFirst(key, ret); +@@ -117,7 +127,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise + } + + final ChunkPos pos = new ChunkPos(chunkX, chunkZ); +- final RegionFile regionFile = this.getRegionFile(pos); ++ final org.leavesmc.leaves.region.AbstractRegionFile regionFile = this.getRegionFile(pos); // Leaves + + // note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input + // (and, the regionfile parameter is unused for writing until the write call) +@@ -138,7 +148,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise + ) throws IOException { + final ChunkPos pos = new ChunkPos(chunkX, chunkZ); + if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) { +- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); ++ final org.leavesmc.leaves.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Leaves + if (regionFile != null) { + regionFile.clear(pos); + } // else: didn't exist +@@ -153,7 +163,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise + public final ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.ReadData moonrise$readData( + final int chunkX, final int chunkZ + ) throws IOException { +- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); ++ final org.leavesmc.leaves.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Leaves + + final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ)); + @@ -235,12 +245,12 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise } @@ -331,23 +400,23 @@ index 78922c3e9a69db1774dd846047b79e9523d7cf41..b70f26604e45fffed3c58c1fd5e36091 } catch (final IOException ex) { diff --git a/src/main/java/org/leavesmc/leaves/region/AbstractRegionFile.java b/src/main/java/org/leavesmc/leaves/region/AbstractRegionFile.java new file mode 100644 -index 0000000000000000000000000000000000000000..1b9da27d9f409684917680e41a1aae583f021c20 +index 0000000000000000000000000000000000000000..3f95d7ffa880c598242d38899f71174e4e264338 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/region/AbstractRegionFile.java -@@ -0,0 +1,39 @@ +@@ -0,0 +1,41 @@ +package org.leavesmc.leaves.region; + ++import ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.level.ChunkPos; -+import net.minecraft.world.level.chunk.status.ChunkStatus; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; ++import java.nio.ByteBuffer; +import java.nio.file.Path; -+import java.util.concurrent.locks.ReentrantLock; + -+public interface AbstractRegionFile { ++public interface AbstractRegionFile extends ChunkSystemRegionFile { + + Path getPath(); + @@ -372,6 +441,8 @@ index 0000000000000000000000000000000000000000..1b9da27d9f409684917680e41a1aae58 + void clear(ChunkPos pos) throws IOException; + + void setOversized(int x, int z, boolean oversized) throws IOException; ++ ++ void write(ChunkPos pos, ByteBuffer buf) throws IOException; +} + diff --git a/src/main/java/org/leavesmc/leaves/region/AbstractRegionFileFactory.java b/src/main/java/org/leavesmc/leaves/region/AbstractRegionFileFactory.java @@ -406,12 +477,13 @@ index 0000000000000000000000000000000000000000..72f4507aa10f2ecad545199ccb88038f +} diff --git a/src/main/java/org/leavesmc/leaves/region/LinearRegionFile.java b/src/main/java/org/leavesmc/leaves/region/LinearRegionFile.java new file mode 100644 -index 0000000000000000000000000000000000000000..381897d87b10147a67dbb13194eb054d4823c9de +index 0000000000000000000000000000000000000000..f903895b53eada8795a6ee9ab33cf30bf69c2c98 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/region/LinearRegionFile.java -@@ -0,0 +1,319 @@ +@@ -0,0 +1,331 @@ +package org.leavesmc.leaves.region; + ++import ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO; +import com.github.luben.zstd.ZstdInputStream; +import com.github.luben.zstd.ZstdOutputStream; +import com.mojang.logging.LogUtils; @@ -463,7 +535,6 @@ index 0000000000000000000000000000000000000000..381897d87b10147a67dbb13194eb054d + public boolean closed = false; + public Path path; + -+ + public LinearRegionFile(Path file, int compression) throws IOException { + this.path = file; + this.compressionLevel = compression; @@ -715,6 +786,18 @@ index 0000000000000000000000000000000000000000..381897d87b10147a67dbb13194eb054d + return false; + } + ++ @Override ++ public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(CompoundTag data, ChunkPos pos) { ++ DataOutputStream buff = getChunkDataOutputStream(pos); ++ return new MoonriseRegionFileIO.RegionDataController.WriteData( ++ data, MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.WRITE, ++ buff, LinearRegionFile::writeNothing ++ ); ++ } ++ ++ private static void writeNothing(AbstractRegionFile regionFile) { ++ } ++ + private class ChunkBuffer extends ByteArrayOutputStream { + private final ChunkPos pos; + diff --git a/patches/server/0106-No-TNT-place-update.patch b/patches/server/0105-No-TNT-place-update.patch similarity index 100% rename from patches/server/0106-No-TNT-place-update.patch rename to patches/server/0105-No-TNT-place-update.patch diff --git a/patches/server/0107-Servux-Protocol.patch b/patches/server/0106-Servux-Protocol.patch similarity index 97% rename from patches/server/0107-Servux-Protocol.patch rename to patches/server/0106-Servux-Protocol.patch index 422e68d3..9305efbd 100644 --- a/patches/server/0107-Servux-Protocol.patch +++ b/patches/server/0106-Servux-Protocol.patch @@ -141,10 +141,10 @@ index 0000000000000000000000000000000000000000..3a0e790f0d8e6866950601f9936984a8 +} diff --git a/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f38c24530 +index 0000000000000000000000000000000000000000..344496a4dc2f5064b014581a98e4e5a563f5952a --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java -@@ -0,0 +1,295 @@ +@@ -0,0 +1,278 @@ +package org.leavesmc.leaves.protocol.servux; + +import io.netty.buffer.Unpooled; @@ -157,7 +157,6 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.Entity; -+import net.minecraft.world.level.ChunkPos; +import net.minecraft.world.level.block.entity.BlockEntity; +import org.leavesmc.leaves.LeavesConfig; +import org.leavesmc.leaves.LeavesLogger; @@ -167,7 +166,6 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f +import org.leavesmc.leaves.protocol.core.ProtocolUtils; + +import java.util.HashMap; -+import java.util.List; +import java.util.Map; +import java.util.UUID; + @@ -290,9 +288,7 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f + PACKET_S2C_NBT_RESPONSE_DATA(11), + // For Packet Splitter (Oversize Packets, C2S) + PACKET_C2S_NBT_RESPONSE_START(12), -+ PACKET_C2S_NBT_RESPONSE_DATA(13), -+ PACKET_C2S_LITEMATICA_PASTE(14), -+ PACKET_C2S_REQUEST_ALL_ENTITIES_IN_CHUNK(15); ++ PACKET_C2S_NBT_RESPONSE_DATA(13); + + private static final class Helper { + static Map ID_TO_TYPE = new HashMap<>(); @@ -313,12 +309,11 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f + public static class EntityDataPayload implements LeavesCustomPayload { + + private final EntityDataPayloadType packetType; -+ private int transactionId; ++ private final int transactionId; + private int entityId; + private BlockPos pos; + private CompoundTag nbt; + private FriendlyByteBuf buffer; -+ private List requestingChunks; + + private EntityDataPayload(EntityDataPayloadType type) { + this.packetType = type; @@ -382,14 +377,6 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f + payload.nbt.merge(nbt); + } + } -+ -+ case PACKET_C2S_LITEMATICA_PASTE -> { -+ payload.nbt = buffer.readNbt(); -+ } -+ -+ case PACKET_C2S_REQUEST_ALL_ENTITIES_IN_CHUNK -> { -+ payload.requestingChunks = buffer.readList(FriendlyByteBuf::readChunkPos); -+ } + } + + return payload; @@ -424,11 +411,7 @@ index 0000000000000000000000000000000000000000..ffa483d369760faeb73555f9a93dac5f + buf.writeBytes(this.buffer.readBytes(this.buffer.readableBytes())); + } + -+ case PACKET_C2S_REQUEST_ALL_ENTITIES_IN_CHUNK -> { -+ buf.writeCollection(this.requestingChunks, FriendlyByteBuf::writeChunkPos); -+ } -+ -+ case PACKET_C2S_METADATA_REQUEST, PACKET_S2C_METADATA, PACKET_C2S_LITEMATICA_PASTE -> { ++ case PACKET_C2S_METADATA_REQUEST, PACKET_S2C_METADATA -> { + buf.writeNbt(this.nbt); + } + } diff --git a/patches/server/0108-Placing-locked-hopper-no-longer-send-NC-updates.patch b/patches/server/0107-Placing-locked-hopper-no-longer-send-NC-updates.patch similarity index 100% rename from patches/server/0108-Placing-locked-hopper-no-longer-send-NC-updates.patch rename to patches/server/0107-Placing-locked-hopper-no-longer-send-NC-updates.patch diff --git a/patches/server/0109-Renewable-deepslate.patch b/patches/server/0108-Renewable-deepslate.patch similarity index 100% rename from patches/server/0109-Renewable-deepslate.patch rename to patches/server/0108-Renewable-deepslate.patch diff --git a/patches/server/0110-Renewable-sponges.patch b/patches/server/0109-Renewable-sponges.patch similarity index 100% rename from patches/server/0110-Renewable-sponges.patch rename to patches/server/0109-Renewable-sponges.patch diff --git a/patches/server/0111-Renewable-coral.patch b/patches/server/0110-Renewable-coral.patch similarity index 100% rename from patches/server/0111-Renewable-coral.patch rename to patches/server/0110-Renewable-coral.patch diff --git a/patches/server/0112-Fast-resume.patch b/patches/server/0111-Fast-resume.patch similarity index 100% rename from patches/server/0112-Fast-resume.patch rename to patches/server/0111-Fast-resume.patch diff --git a/patches/server/0113-Vanilla-hopper.patch b/patches/server/0112-Vanilla-hopper.patch similarity index 100% rename from patches/server/0113-Vanilla-hopper.patch rename to patches/server/0112-Vanilla-hopper.patch diff --git a/patches/server/0114-Force-minecraft-command.patch b/patches/server/0113-Force-minecraft-command.patch similarity index 100% rename from patches/server/0114-Force-minecraft-command.patch rename to patches/server/0113-Force-minecraft-command.patch diff --git a/patches/server/0115-Fix-falling-block-s-block-location.patch b/patches/server/0114-Fix-falling-block-s-block-location.patch similarity index 92% rename from patches/server/0115-Fix-falling-block-s-block-location.patch rename to patches/server/0114-Fix-falling-block-s-block-location.patch index 8f9df2a0..724adfd0 100644 --- a/patches/server/0115-Fix-falling-block-s-block-location.patch +++ b/patches/server/0114-Fix-falling-block-s-block-location.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix falling block's block location diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index fa536b952668de17ace1e1c7538c48004010f047..9b9b6915ed9660853ea29062a957c1d2aaed392e 100644 +index 2a9ef9770e3b08ad0041593dcce04876b935bd25..42928113fa6150c55fdd9aaf5e3edda0fd33be76 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -5110,6 +5110,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0116-Bytebuf-API.patch b/patches/server/0115-Bytebuf-API.patch similarity index 100% rename from patches/server/0116-Bytebuf-API.patch rename to patches/server/0115-Bytebuf-API.patch diff --git a/patches/server/0117-Allow-grindstone-overstacking.patch b/patches/server/0116-Allow-grindstone-overstacking.patch similarity index 100% rename from patches/server/0117-Allow-grindstone-overstacking.patch rename to patches/server/0116-Allow-grindstone-overstacking.patch diff --git a/patches/server/0118-Configurable-MC-67.patch b/patches/server/0117-Configurable-MC-67.patch similarity index 91% rename from patches/server/0118-Configurable-MC-67.patch rename to patches/server/0117-Configurable-MC-67.patch index fab4f43b..b9da0f2f 100644 --- a/patches/server/0118-Configurable-MC-67.patch +++ b/patches/server/0117-Configurable-MC-67.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable MC-67 diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9b9b6915ed9660853ea29062a957c1d2aaed392e..754935d08cb4ae4bc4b336b4c55270c55536868a 100644 +index 42928113fa6150c55fdd9aaf5e3edda0fd33be76..3924808ef70707eca4b14fa8e9ec24b6d40ba7c0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4211,6 +4211,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0119-Disable-end-gateway-portal-entity-ticking.patch b/patches/server/0118-Disable-end-gateway-portal-entity-ticking.patch similarity index 100% rename from patches/server/0119-Disable-end-gateway-portal-entity-ticking.patch rename to patches/server/0118-Disable-end-gateway-portal-entity-ticking.patch diff --git a/patches/server/0120-Disable-crystal-portal-proximity-check.patch b/patches/server/0119-Disable-crystal-portal-proximity-check.patch similarity index 100% rename from patches/server/0120-Disable-crystal-portal-proximity-check.patch rename to patches/server/0119-Disable-crystal-portal-proximity-check.patch diff --git a/patches/server/0121-Can-disable-LivingEntity-aiStep-alive-check.patch b/patches/server/0120-Can-disable-LivingEntity-aiStep-alive-check.patch similarity index 100% rename from patches/server/0121-Can-disable-LivingEntity-aiStep-alive-check.patch rename to patches/server/0120-Can-disable-LivingEntity-aiStep-alive-check.patch diff --git a/patches/server/0122-Leaves-plugins.patch b/patches/server/0121-Leaves-plugins.patch similarity index 100% rename from patches/server/0122-Leaves-plugins.patch rename to patches/server/0121-Leaves-plugins.patch diff --git a/patches/server/0123-Fix-fortress-mob-spawn.patch b/patches/server/0122-Fix-fortress-mob-spawn.patch similarity index 100% rename from patches/server/0123-Fix-fortress-mob-spawn.patch rename to patches/server/0122-Fix-fortress-mob-spawn.patch diff --git a/patches/server/0124-Fix-FallingBlockEntity-Duplicate.patch b/patches/server/0123-Fix-FallingBlockEntity-Duplicate.patch similarity index 100% rename from patches/server/0124-Fix-FallingBlockEntity-Duplicate.patch rename to patches/server/0123-Fix-FallingBlockEntity-Duplicate.patch diff --git a/patches/server/0125-Old-BlockEntity-behaviour.patch b/patches/server/0124-Old-BlockEntity-behaviour.patch similarity index 98% rename from patches/server/0125-Old-BlockEntity-behaviour.patch rename to patches/server/0124-Old-BlockEntity-behaviour.patch index 0aaa81ce..f93820b2 100644 --- a/patches/server/0125-Old-BlockEntity-behaviour.patch +++ b/patches/server/0124-Old-BlockEntity-behaviour.patch @@ -57,7 +57,7 @@ index 0ed449a188d98f87dbddd2d76009fed02a29ed25..c760061bae7d1f58639f7f80afbe779b } } diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java -index aa7f993654de91f2af5d52fa41ab5d77aece47e1..fa8f3ed205e7b9fb6bf5a7b1461eb929e6c542c2 100644 +index ed903a9d79d1535a7786133242fbdc6f41a4ba71..c0c313fe5e176ce9c091e03152a85cf557676245 100644 --- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java @@ -182,10 +182,11 @@ public class ShulkerBoxBlock extends BaseEntityBlock { diff --git a/patches/server/0126-Revert-raid-changes.patch b/patches/server/0125-Revert-raid-changes.patch similarity index 100% rename from patches/server/0126-Revert-raid-changes.patch rename to patches/server/0125-Revert-raid-changes.patch diff --git a/patches/server/0127-Allow-anvil-destroy-item-entities.patch b/patches/server/0126-Allow-anvil-destroy-item-entities.patch similarity index 100% rename from patches/server/0127-Allow-anvil-destroy-item-entities.patch rename to patches/server/0126-Allow-anvil-destroy-item-entities.patch diff --git a/patches/server/0128-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch b/patches/server/0127-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch similarity index 100% rename from patches/server/0128-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch rename to patches/server/0127-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch diff --git a/patches/server/0129-Disable-vault-blacklist.patch b/patches/server/0128-Disable-vault-blacklist.patch similarity index 100% rename from patches/server/0129-Disable-vault-blacklist.patch rename to patches/server/0128-Disable-vault-blacklist.patch