diff options
author | Owen1212055 <[email protected]> | 2024-04-24 09:46:45 -0400 |
---|---|---|
committer | Owen1212055 <[email protected]> | 2024-04-24 09:46:45 -0400 |
commit | 2d9d0d8b1dcf64e8790b17119b7480361d5f33e3 (patch) | |
tree | 1acc16ee2a00d4890e05764a9566818520bcffca /removed-patches-1-20-5 | |
parent | 5be858e9b72f34dac684578a6a8a3f3ac883e16c (diff) | |
download | Paper-2d9d0d8b1dcf64e8790b17119b7480361d5f33e3.tar.gz Paper-2d9d0d8b1dcf64e8790b17119b7480361d5f33e3.zip |
Patches!
Diffstat (limited to 'removed-patches-1-20-5')
3 files changed, 90 insertions, 0 deletions
diff --git a/removed-patches-1-20-5/0452-Reduce-blockpos-allocation-from-pathfinding.patch b/removed-patches-1-20-5/0452-Reduce-blockpos-allocation-from-pathfinding.patch new file mode 100644 index 0000000000..0ead9a9fe2 --- /dev/null +++ b/removed-patches-1-20-5/0452-Reduce-blockpos-allocation-from-pathfinding.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf <[email protected]> +Date: Sat, 25 Apr 2020 17:10:55 -0700 +Subject: [PATCH] Reduce blockpos allocation from pathfinding + + +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +index b125b9903454891e22a15a0a794d67be67fdb083..1cd7f0f1c7d62552e6609997c83f3df8dae13316 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +@@ -483,7 +483,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + return BlockPathTypes.DANGER_FIRE; + } + +- if (world.getFluidState(pos).is(FluidTags.WATER)) { ++ if (blockState.getFluidState().is(FluidTags.WATER)) { // Paper - Perf: Reduce blockpos allocation from pathfinding + return BlockPathTypes.WATER_BORDER; + } + +@@ -516,7 +516,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + } else if (blockState.is(Blocks.COCOA)) { + return BlockPathTypes.COCOA; + } else if (!blockState.is(Blocks.WITHER_ROSE) && !blockState.is(Blocks.POINTED_DRIPSTONE)) { +- FluidState fluidState = world.getFluidState(pos); ++ FluidState fluidState = blockState.getFluidState(); // Paper - Perf: Reduce blockpos allocation from pathfinding + if (fluidState.is(FluidTags.LAVA)) { + return BlockPathTypes.LAVA; + } else if (isBurningBlock(blockState)) { diff --git a/removed-patches-1-20-5/0486-Cache-burn-durations.patch b/removed-patches-1-20-5/0486-Cache-burn-durations.patch new file mode 100644 index 0000000000..32d702d124 --- /dev/null +++ b/removed-patches-1-20-5/0486-Cache-burn-durations.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: lukas <[email protected]> +Date: Sun, 27 Dec 2020 16:47:00 +0100 +Subject: [PATCH] Cache burn durations + + +diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +index 9801b777bc6ab7de91d82b29a142459292ee8605..8f7029e602300f68b3c8411caa2d9e0b1e8be62e 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +@@ -134,7 +134,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit + this.recipeType = recipeType; // Paper - cook speed multiplier API + } + ++ private static Map<Item, Integer> cachedBurnDurations = null; // Paper - cache burn durations + public static Map<Item, Integer> getFuel() { ++ // Paper start - cache burn durations ++ if(cachedBurnDurations != null) { ++ return cachedBurnDurations; ++ } ++ // Paper end - cache burn durations + Map<Item, Integer> map = Maps.newLinkedHashMap(); + + AbstractFurnaceBlockEntity.add(map, (ItemLike) Items.LAVA_BUCKET, 20000); +@@ -196,7 +202,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit + AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.AZALEA, 100); + AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.FLOWERING_AZALEA, 100); + AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.MANGROVE_ROOTS, 300); +- return map; ++ // Paper start - cache burn durations ++ cachedBurnDurations = com.google.common.collect.ImmutableMap.copyOf(map); ++ return cachedBurnDurations; ++ // Paper end - cache burn durations + } + + // CraftBukkit start - add fields and methods diff --git a/removed-patches-1-20-5/0532-Prevent-grindstones-from-overstacking-items.patch b/removed-patches-1-20-5/0532-Prevent-grindstones-from-overstacking-items.patch new file mode 100644 index 0000000000..d98bb3f1c4 --- /dev/null +++ b/removed-patches-1-20-5/0532-Prevent-grindstones-from-overstacking-items.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: chickeneer <[email protected]> +Date: Tue, 16 Feb 2021 21:37:51 -0600 +Subject: [PATCH] Prevent grindstones from overstacking items + + +diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +index 1783661f38a6f5fb655ea83953b9467bd91a1302..95ac3446fba1f37637c9700080de2e1ce7a3550a 100644 +--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java ++++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +@@ -198,13 +198,13 @@ public class GrindstoneMenu extends AbstractContainerMenu { + i = Math.max(item.getMaxDamage() - l, 0); + itemstack2 = this.mergeEnchants(itemstack, itemstack1); + if (!itemstack2.isDamageableItem()) { +- if (!ItemStack.matches(itemstack, itemstack1)) { ++ if (!ItemStack.matches(itemstack, itemstack1) || (itemstack2.getMaxStackSize() == 1 && !io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowGrindstoneOverstacking)) { // Paper - add max stack size check & config value + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(this.getBukkitView(), ItemStack.EMPTY); // CraftBukkit + this.broadcastChanges(); + return; + } + +- b0 = 2; ++ b0 = 2; // Paper - add max stack size check & config value; the problem line for above change, causing over-stacking + } + } else { + boolean flag3 = !itemstack.isEmpty(); |