mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-27 10:59:16 +00:00
42 lines
2.5 KiB
Diff
42 lines
2.5 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 83fee46886a21349d652b6bc871bd03ffbac2a7d..fc3938c16c43277e22b7a322177fa2a9150f1ff8 100644
|
|
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
@@ -194,6 +194,7 @@ public class LeafConfig {
|
|
public static int activationDistanceMod = 8;
|
|
public static boolean throttleInactiveGoalSelectorTick = true;
|
|
public static Map<String, Integer> projectileTimeouts;
|
|
+ public static boolean useSpigotItemMergingMechanism = true;
|
|
private static void performance() {
|
|
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
|
"Whether or not asynchronous mob spawning should be enabled.",
|
|
@@ -242,6 +243,7 @@ public class LeafConfig {
|
|
String type = EntityType.getKey(entityType).getPath().toUpperCase(Locale.ROOT);
|
|
entityType.ttl = config.getInt("entity_timeouts." + type, -1);
|
|
}
|
|
+ useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
|
}
|
|
|
|
private static void network() {
|