mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Patches!
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ 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)) {
|
36
removed-patches-1-20-5/0486-Cache-burn-durations.patch
Normal file
36
removed-patches-1-20-5/0486-Cache-burn-durations.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: lukas <lukasalt98@gmail.com>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
@@ -0,0 +0,0 @@ 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
|
@@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: chickeneer <emcchickeneer@gmail.com>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
@@ -0,0 +0,0 @@ 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();
|
Reference in New Issue
Block a user