9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/patches/server/0015-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch

36 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nostalgic853 <yuu8583@proton.me>
Date: Sun, 23 Oct 2022 23:21:45 +0800
Subject: [PATCH] KeYi: Add an option for spigot item merging mechanism
Original license: MIT
Original project: https://github.com/KeYiMC/KeYi
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 07f1f6c9613150fd1cdd460a940629a67539d8db..0fe02df86483809cef22fca2e2ce0af7b4a5c6d5 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -331,7 +331,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
ItemStack itemstack1 = other.getItem();
if (Objects.equals(this.target, other.target) && ItemEntity.areMergable(itemstack, itemstack1)) {
- if (true || itemstack1.getCount() < itemstack.getCount()) { // Spigot
+ if (org.dreeam.leaf.LeafConfig.useSpigotItemMergingMechanism || itemstack1.getCount() < itemstack.getCount()) { // Spigot // KeYi
ItemEntity.merge(this, itemstack, other, itemstack1);
} else {
ItemEntity.merge(other, itemstack1, this, itemstack);
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 9a29a8c414b32376f7398e96a27eda1e477cb83e..4b6ba35724d364da8397d991ba8453f22911ed07 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -181,7 +181,9 @@ public class LeafConfig {
maxUseItemDistance = getDouble("max-UseItem-distance", maxUseItemDistance, "The max distance of UseItem for players");
}
+ public static boolean useSpigotItemMergingMechanism = true;
private static void performance() {
+ useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
}
private static void network() {