Fix issue with hopppers

Fixes #10464
This commit is contained in:
Jake Potrebic 2024-04-27 17:31:32 -07:00
parent 4ad6022ee3
commit 8ce62b3492
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5

View file

@ -62,10 +62,10 @@ index 2cd2e260e9a958c8aee7b2fb4e010ef8fc600f53..b21daeeb043df885fba5e6a7572d311f
this.profiler.push(() -> { this.profiler.push(() -> {
String s = String.valueOf(worldserver); String s = String.valueOf(worldserver);
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index f444e5b96c1a768690afadec56e17ba67b2f36f2..fb26b3b10a6a12b7da86e30740a1338566faaeb1 100644 index f444e5b96c1a768690afadec56e17ba67b2f36f2..36e3415b9312d3a80c9f5e1c36b42b7ea30c31c5 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -794,7 +794,13 @@ public final class ItemStack implements DataComponentHolder { @@ -794,10 +794,16 @@ public final class ItemStack implements DataComponentHolder {
} }
public ItemStack copy() { public ItemStack copy() {
@ -79,7 +79,11 @@ index f444e5b96c1a768690afadec56e17ba67b2f36f2..fb26b3b10a6a12b7da86e30740a13385
+ // Paper end - Perf: Optimize Hoppers + // Paper end - Perf: Optimize Hoppers
return ItemStack.EMPTY; return ItemStack.EMPTY;
} else { } else {
ItemStack itemstack = new ItemStack(this.getItem(), this.count, this.components.copy()); - ItemStack itemstack = new ItemStack(this.getItem(), this.count, this.components.copy());
+ ItemStack itemstack = new ItemStack(originalItem ? this.item : this.getItem(), this.count, this.components.copy()); // Paper - Perf: Optimize Hoppers
itemstack.setPopTime(this.getPopTime());
return itemstack;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index a7dfad2696e7145af1355a5db132af14d09a6f30..b0421823684ff6b9474b81675742d2ee3b17edf7 100644 index a7dfad2696e7145af1355a5db132af14d09a6f30..b0421823684ff6b9474b81675742d2ee3b17edf7 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java