mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-30 20:39:21 +00:00
48 lines
2.8 KiB
Diff
48 lines
2.8 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 7b0374b6e22105e59b29995983a6ac50268c722e..da45ccd3b96158dace1dec4c291aa98f9d5c4ac5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -37,6 +37,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
|
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
|
// CraftBukkit end
|
|
import org.bukkit.event.player.PlayerAttemptPickupItemEvent; // Paper
|
|
+import org.dreeam.leaf.LeafConfig;
|
|
|
|
public class ItemEntity extends Entity {
|
|
|
|
@@ -316,7 +317,7 @@ public class ItemEntity extends Entity {
|
|
ItemStack itemstack1 = other.getItem();
|
|
|
|
if (Objects.equals(this.getOwner(), other.getOwner()) && ItemEntity.areMergable(itemstack, itemstack1)) {
|
|
- if (true || itemstack1.getCount() < itemstack.getCount()) { // Spigot
|
|
+ if (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 eba534697ad6a2e68947e97883a15ed8ba96622e..7fc53776dbe0c57b2639a52f117f33a7cc2f5471 100644
|
|
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
@@ -159,11 +159,13 @@ public class LeafConfig {
|
|
public static boolean tpsCatchup = true;
|
|
public static boolean villagerLobotomizeEnabled = false;
|
|
public static int villagerLobotomizeCheckInterval = 100;
|
|
+ public static boolean useSpigotItemMergingMechanism = true;
|
|
private static void performance() {
|
|
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
|
tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
|
villagerLobotomizeEnabled = getBoolean("performance.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
|
villagerLobotomizeCheckInterval = getInt("performance.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
|
+ useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
|
}
|
|
|
|
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|