mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
* DivineMC - Lithium: Early checks for LivingEntity#updateSwingTime and updateFallFlying * C2ME-Reduce-Allocations * Lithium-fast-util * Lithium-CompactSineLUT * Compact-SineLUT * some lithium patches * Create 0141-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch * Fix tick function & Better inline world height * improve the clamp logic by 1.2x * Remove imports on IterateOutwardsCache * Remove imports from 141 * Rename getCachedOrNewBits to CachedOrNewBitsGetter * Remove thread instanceof checks --------- Co-authored-by: kidofcubes <kidofcubes@gmail.com>
48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Tue, 7 Nov 2017 00:01:04 -0500
|
|
Subject: [PATCH] EMC: Don't use snapshots for TileEntity::getOwner
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/starlis/empirecraft
|
|
|
|
Also see EMC-Default-don-t-use-blockstate-snapshots.patch
|
|
|
|
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 73c9f91457683e8e6bd8293b4393ccbd984eddb7..7b38835bdac33dce9ed7ca1c0b3d43fdc2224d0c 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
@@ -398,7 +398,7 @@ public abstract class BlockEntity {
|
|
// CraftBukkit start - add method
|
|
public InventoryHolder getOwner() {
|
|
// Paper start
|
|
- return getOwner(true);
|
|
+ return getOwner(org.dreeam.leaf.config.modules.opt.TileEntitySnapshotCreation.enabled); // Leaf - EMC - don't use snapshots
|
|
}
|
|
public InventoryHolder getOwner(boolean useSnapshot) {
|
|
// Paper end
|
|
diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/TileEntitySnapshotCreation.java b/src/main/java/org/dreeam/leaf/config/modules/opt/TileEntitySnapshotCreation.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..1c0d34c15c12f9587f518de17e3a3d5289e21f9c
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/TileEntitySnapshotCreation.java
|
|
@@ -0,0 +1,18 @@
|
|
+package org.dreeam.leaf.config.modules.opt;
|
|
+
|
|
+import org.dreeam.leaf.config.ConfigModules;
|
|
+import org.dreeam.leaf.config.EnumConfigCategory;
|
|
+
|
|
+public class TileEntitySnapshotCreation extends ConfigModules {
|
|
+
|
|
+ public String getBasePath() {
|
|
+ return EnumConfigCategory.PERF.getBaseKeyName();
|
|
+ }
|
|
+
|
|
+ public static boolean enabled = true;
|
|
+
|
|
+ @Override
|
|
+ public void onLoaded() {
|
|
+ enabled = config.getBoolean(getBasePath() + ".create-snapshot-on-retrieving-blockstate", enabled);
|
|
+ }
|
|
+}
|