diff --git a/patches/server/0066-Fix-MC-26304.patch b/patches/server/0066-Fix-MC-26304.patch new file mode 100644 index 0000000..c031db9 --- /dev/null +++ b/patches/server/0066-Fix-MC-26304.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Fri, 23 Dec 2022 16:42:04 +0100 +Subject: [PATCH] Fix MC-26304 + +License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) +Gale - https://galemc.org + +This patch is based on the following patch: +"Fix brewing stands resetting their brewTime when being unloaded" +By: etil2jz <81570777+etil2jz@users.noreply.github.com> +As part of: Mirai (https://github.com/etil2jz/Mirai) +Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +index 55006724ccec9f3de828ec18693728e9741ff65f..7dfc0081591b1c8e5a7c704ebc5e9d83951cb300 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +@@ -6,6 +6,7 @@ import javax.annotation.Nullable; + import net.minecraft.core.BlockPos; + import net.minecraft.core.Direction; + import net.minecraft.core.NonNullList; ++import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.nbt.CompoundTag; + import net.minecraft.network.chat.Component; + import net.minecraft.world.ContainerHelper; +@@ -47,6 +48,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements + public static final int DATA_BREW_TIME = 0; + public static final int DATA_FUEL_USES = 1; + public static final int NUM_DATA_VALUES = 2; ++ private static final String[] INGREDIENT_NBT_KEYS = {"Gale.Ingredient", "Mirai.ingredient"}; // Gale - Mirai - fix MC-26304 + private NonNullList items; + public int brewTime; + private boolean[] lastPotionCount; +@@ -295,6 +297,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements + ContainerHelper.loadAllItems(nbt, this.items); + this.brewTime = nbt.getShort("BrewTime"); + this.fuel = nbt.getByte("Fuel"); ++ // Gale start - Mirai - fix MC-26304 ++ if (this.ingredient == null || this.ingredient == Items.AIR) { ++ for (String nbtKey : INGREDIENT_NBT_KEYS) { ++ try { ++ if (nbt.contains(nbtKey)) { ++ this.ingredient = BuiltInRegistries.ITEM.get(new net.minecraft.resources.ResourceLocation(nbt.getString(nbtKey))); ++ if (this.ingredient != null && this.ingredient != Items.AIR) { ++ break; ++ } ++ } ++ } catch (Throwable ignored) { ++ // Cannot be helped ++ } ++ } ++ } ++ // Gale end - Mirai - fix MC-26304 + } + + @Override +@@ -303,6 +321,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements + nbt.putShort("BrewTime", (short) this.brewTime); + ContainerHelper.saveAllItems(nbt, this.items); + nbt.putByte("Fuel", (byte) this.fuel); ++ // Gale start - Mirai - fix MC-26304 ++ if (this.ingredient != null && this.ingredient != Items.AIR) { ++ try { ++ String value = BuiltInRegistries.ITEM.getKey(this.ingredient).toString(); ++ for (String nbtKey : INGREDIENT_NBT_KEYS) { ++ nbt.putString(nbtKey, value); ++ } ++ } catch (Throwable ignored) { ++ // Cannot be helped ++ } ++ } ++ // Gale end - Mirai - fix MC-26304 + } + + @Override diff --git a/patches/server/0066-End-gateway-should-check-if-entity-can-use-portal.patch b/patches/server/0067-End-gateway-should-check-if-entity-can-use-portal.patch similarity index 100% rename from patches/server/0066-End-gateway-should-check-if-entity-can-use-portal.patch rename to patches/server/0067-End-gateway-should-check-if-entity-can-use-portal.patch diff --git a/patches/server/0067-Prevent-entities-eating-blocks-in-non-ticking-chunks.patch b/patches/server/0068-Prevent-entities-eating-blocks-in-non-ticking-chunks.patch similarity index 100% rename from patches/server/0067-Prevent-entities-eating-blocks-in-non-ticking-chunks.patch rename to patches/server/0068-Prevent-entities-eating-blocks-in-non-ticking-chunks.patch diff --git a/patches/server/0068-Make-arrow-movement-resetting-despawn-counter-config.patch b/patches/server/0069-Make-arrow-movement-resetting-despawn-counter-config.patch similarity index 100% rename from patches/server/0068-Make-arrow-movement-resetting-despawn-counter-config.patch rename to patches/server/0069-Make-arrow-movement-resetting-despawn-counter-config.patch diff --git a/patches/server/0069-Reduce-array-allocations.patch b/patches/server/0070-Reduce-array-allocations.patch similarity index 100% rename from patches/server/0069-Reduce-array-allocations.patch rename to patches/server/0070-Reduce-array-allocations.patch diff --git a/patches/server/0070-Optimize-sun-burn-tick.patch b/patches/server/0071-Optimize-sun-burn-tick.patch similarity index 100% rename from patches/server/0070-Optimize-sun-burn-tick.patch rename to patches/server/0071-Optimize-sun-burn-tick.patch diff --git a/patches/server/0071-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch b/patches/server/0072-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch similarity index 100% rename from patches/server/0071-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch rename to patches/server/0072-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch diff --git a/patches/server/0072-Replace-AI-goal-set-with-optimized-collection.patch b/patches/server/0073-Replace-AI-goal-set-with-optimized-collection.patch similarity index 100% rename from patches/server/0072-Replace-AI-goal-set-with-optimized-collection.patch rename to patches/server/0073-Replace-AI-goal-set-with-optimized-collection.patch diff --git a/patches/server/0073-Replace-game-rules-map-with-optimized-collection.patch b/patches/server/0074-Replace-game-rules-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0073-Replace-game-rules-map-with-optimized-collection.patch rename to patches/server/0074-Replace-game-rules-map-with-optimized-collection.patch diff --git a/patches/server/0074-Replace-AI-attributes-with-optimized-collections.patch b/patches/server/0075-Replace-AI-attributes-with-optimized-collections.patch similarity index 100% rename from patches/server/0074-Replace-AI-attributes-with-optimized-collections.patch rename to patches/server/0075-Replace-AI-attributes-with-optimized-collections.patch diff --git a/patches/server/0075-Replace-class-map-with-optimized-collection.patch b/patches/server/0076-Replace-class-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0075-Replace-class-map-with-optimized-collection.patch rename to patches/server/0076-Replace-class-map-with-optimized-collection.patch diff --git a/patches/server/0076-Replace-shape-full-block-cache-with-hashtable.patch b/patches/server/0077-Replace-shape-full-block-cache-with-hashtable.patch similarity index 100% rename from patches/server/0076-Replace-shape-full-block-cache-with-hashtable.patch rename to patches/server/0077-Replace-shape-full-block-cache-with-hashtable.patch diff --git a/patches/server/0077-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch b/patches/server/0078-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch similarity index 100% rename from patches/server/0077-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch rename to patches/server/0078-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch diff --git a/patches/server/0078-Cache-BlockStatePairKey-hash.patch b/patches/server/0079-Cache-BlockStatePairKey-hash.patch similarity index 100% rename from patches/server/0078-Cache-BlockStatePairKey-hash.patch rename to patches/server/0079-Cache-BlockStatePairKey-hash.patch diff --git a/patches/server/0079-Cache-CubeVoxelShape-shape-array.patch b/patches/server/0080-Cache-CubeVoxelShape-shape-array.patch similarity index 100% rename from patches/server/0079-Cache-CubeVoxelShape-shape-array.patch rename to patches/server/0080-Cache-CubeVoxelShape-shape-array.patch diff --git a/patches/server/0080-Replace-division-by-multiplication-in-CubePointRange.patch b/patches/server/0081-Replace-division-by-multiplication-in-CubePointRange.patch similarity index 100% rename from patches/server/0080-Replace-division-by-multiplication-in-CubePointRange.patch rename to patches/server/0081-Replace-division-by-multiplication-in-CubePointRange.patch diff --git a/patches/server/0081-Replace-parts-by-size-in-CubePointRange.patch b/patches/server/0082-Replace-parts-by-size-in-CubePointRange.patch similarity index 100% rename from patches/server/0081-Replace-parts-by-size-in-CubePointRange.patch rename to patches/server/0082-Replace-parts-by-size-in-CubePointRange.patch diff --git a/patches/server/0082-Check-frozen-ticks-before-landing-block.patch b/patches/server/0083-Check-frozen-ticks-before-landing-block.patch similarity index 100% rename from patches/server/0082-Check-frozen-ticks-before-landing-block.patch rename to patches/server/0083-Check-frozen-ticks-before-landing-block.patch diff --git a/patches/server/0083-Faster-chunk-serialization.patch b/patches/server/0084-Faster-chunk-serialization.patch similarity index 100% rename from patches/server/0083-Faster-chunk-serialization.patch rename to patches/server/0084-Faster-chunk-serialization.patch diff --git a/patches/server/0084-Update-boss-bar-within-tick.patch b/patches/server/0085-Update-boss-bar-within-tick.patch similarity index 100% rename from patches/server/0084-Update-boss-bar-within-tick.patch rename to patches/server/0085-Update-boss-bar-within-tick.patch diff --git a/patches/server/0085-Cache-ominous-banner-item.patch b/patches/server/0086-Cache-ominous-banner-item.patch similarity index 100% rename from patches/server/0085-Cache-ominous-banner-item.patch rename to patches/server/0086-Cache-ominous-banner-item.patch diff --git a/patches/server/0086-Precompute-piston-shapes.patch b/patches/server/0087-Precompute-piston-shapes.patch similarity index 100% rename from patches/server/0086-Precompute-piston-shapes.patch rename to patches/server/0087-Precompute-piston-shapes.patch diff --git a/patches/server/0087-Optimize-world-generation-chunk-and-block-access.patch b/patches/server/0088-Optimize-world-generation-chunk-and-block-access.patch similarity index 100% rename from patches/server/0087-Optimize-world-generation-chunk-and-block-access.patch rename to patches/server/0088-Optimize-world-generation-chunk-and-block-access.patch diff --git a/patches/server/0088-Cache-world-generator-sea-level.patch b/patches/server/0089-Cache-world-generator-sea-level.patch similarity index 100% rename from patches/server/0088-Cache-world-generator-sea-level.patch rename to patches/server/0089-Cache-world-generator-sea-level.patch diff --git a/patches/server/0089-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0090-Skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from patches/server/0089-Skip-entity-move-if-movement-is-zero.patch rename to patches/server/0090-Skip-entity-move-if-movement-is-zero.patch diff --git a/patches/server/0090-Store-mob-counts-in-an-array.patch b/patches/server/0091-Store-mob-counts-in-an-array.patch similarity index 100% rename from patches/server/0090-Store-mob-counts-in-an-array.patch rename to patches/server/0091-Store-mob-counts-in-an-array.patch diff --git a/patches/server/0091-Use-linked-map-for-entity-trackers.patch b/patches/server/0092-Use-linked-map-for-entity-trackers.patch similarity index 100% rename from patches/server/0091-Use-linked-map-for-entity-trackers.patch rename to patches/server/0092-Use-linked-map-for-entity-trackers.patch diff --git a/patches/server/0092-Optimize-noise-generation.patch b/patches/server/0093-Optimize-noise-generation.patch similarity index 100% rename from patches/server/0092-Optimize-noise-generation.patch rename to patches/server/0093-Optimize-noise-generation.patch diff --git a/patches/server/0093-Ignore-durability-change-equipment-updates.patch b/patches/server/0094-Ignore-durability-change-equipment-updates.patch similarity index 100% rename from patches/server/0093-Ignore-durability-change-equipment-updates.patch rename to patches/server/0094-Ignore-durability-change-equipment-updates.patch diff --git a/patches/server/0094-Hide-flames-on-entities-with-fire-resistance.patch b/patches/server/0095-Hide-flames-on-entities-with-fire-resistance.patch similarity index 100% rename from patches/server/0094-Hide-flames-on-entities-with-fire-resistance.patch rename to patches/server/0095-Hide-flames-on-entities-with-fire-resistance.patch diff --git a/patches/server/0095-Skip-cloning-advancement-criteria.patch b/patches/server/0096-Skip-cloning-advancement-criteria.patch similarity index 100% rename from patches/server/0095-Skip-cloning-advancement-criteria.patch rename to patches/server/0096-Skip-cloning-advancement-criteria.patch diff --git a/patches/server/0096-Player-canSee-by-entity-UUID.patch b/patches/server/0097-Player-canSee-by-entity-UUID.patch similarity index 100% rename from patches/server/0096-Player-canSee-by-entity-UUID.patch rename to patches/server/0097-Player-canSee-by-entity-UUID.patch diff --git a/patches/server/0097-Spread-out-sending-all-player-info.patch b/patches/server/0098-Spread-out-sending-all-player-info.patch similarity index 100% rename from patches/server/0097-Spread-out-sending-all-player-info.patch rename to patches/server/0098-Spread-out-sending-all-player-info.patch diff --git a/patches/server/0098-Optimize-player-list-for-sending-player-info.patch b/patches/server/0099-Optimize-player-list-for-sending-player-info.patch similarity index 100% rename from patches/server/0098-Optimize-player-list-for-sending-player-info.patch rename to patches/server/0099-Optimize-player-list-for-sending-player-info.patch diff --git a/patches/server/0099-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0100-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 100% rename from patches/server/0099-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to patches/server/0100-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch diff --git a/patches/server/0100-Send-multiple-keep-alive-packets.patch b/patches/server/0101-Send-multiple-keep-alive-packets.patch similarity index 100% rename from patches/server/0100-Send-multiple-keep-alive-packets.patch rename to patches/server/0101-Send-multiple-keep-alive-packets.patch diff --git a/patches/server/0101-Prevent-entities-random-strolling-into-non-ticking-c.patch b/patches/server/0102-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 100% rename from patches/server/0101-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to patches/server/0102-Prevent-entities-random-strolling-into-non-ticking-c.patch diff --git a/patches/server/0102-Specific-interval-TPS-API.patch b/patches/server/0103-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0102-Specific-interval-TPS-API.patch rename to patches/server/0103-Specific-interval-TPS-API.patch diff --git a/patches/server/0103-5-second-TPS-average.patch b/patches/server/0104-5-second-TPS-average.patch similarity index 100% rename from patches/server/0103-5-second-TPS-average.patch rename to patches/server/0104-5-second-TPS-average.patch diff --git a/patches/server/0104-Measure-last-tick-time.patch b/patches/server/0105-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0104-Measure-last-tick-time.patch rename to patches/server/0105-Measure-last-tick-time.patch diff --git a/patches/server/0105-Last-tick-time-API.patch b/patches/server/0106-Last-tick-time-API.patch similarity index 100% rename from patches/server/0105-Last-tick-time-API.patch rename to patches/server/0106-Last-tick-time-API.patch diff --git a/patches/server/0106-Show-last-tick-time-in-tps-command.patch b/patches/server/0107-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0106-Show-last-tick-time-in-tps-command.patch rename to patches/server/0107-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0107-Increase-time-statistics-in-intervals.patch b/patches/server/0108-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0107-Increase-time-statistics-in-intervals.patch rename to patches/server/0108-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0108-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0109-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0108-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0109-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0109-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0110-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0109-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0110-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0110-Reduce-RandomSource-instances.patch b/patches/server/0111-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0110-Reduce-RandomSource-instances.patch rename to patches/server/0111-Reduce-RandomSource-instances.patch diff --git a/patches/server/0111-Server-thread-priority-environment-variable.patch b/patches/server/0112-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0111-Server-thread-priority-environment-variable.patch rename to patches/server/0112-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0112-Thread-safety-annotations.patch b/patches/server/0113-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0112-Thread-safety-annotations.patch rename to patches/server/0113-Thread-safety-annotations.patch diff --git a/patches/server/0113-CPU-cores-estimation.patch b/patches/server/0114-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0113-CPU-cores-estimation.patch rename to patches/server/0114-CPU-cores-estimation.patch diff --git a/patches/server/0114-Mutex-utility.patch b/patches/server/0115-Mutex-utility.patch similarity index 100% rename from patches/server/0114-Mutex-utility.patch rename to patches/server/0115-Mutex-utility.patch diff --git a/patches/server/0115-Paired-lock-and-condition-utility.patch b/patches/server/0116-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0115-Paired-lock-and-condition-utility.patch rename to patches/server/0116-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0116-Unterminable-executor-utility.patch b/patches/server/0117-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0116-Unterminable-executor-utility.patch rename to patches/server/0117-Unterminable-executor-utility.patch diff --git a/patches/server/0117-FIFO-concurrent-queue-utility.patch b/patches/server/0118-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0117-FIFO-concurrent-queue-utility.patch rename to patches/server/0118-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0118-Base-thread-pools.patch b/patches/server/0119-Base-thread-pools.patch similarity index 100% rename from patches/server/0118-Base-thread-pools.patch rename to patches/server/0119-Base-thread-pools.patch diff --git a/patches/server/0119-Non-blocking-PooledObjects.patch b/patches/server/0120-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0119-Non-blocking-PooledObjects.patch rename to patches/server/0120-Non-blocking-PooledObjects.patch