mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-31 04:46:38 +00:00
Originally vanilla logic is to use stream, and Mojang switched it to Guava's Collections2 since 1.21.4. It is much faster than using stream or manually adding to a new ArrayList. Manually adding to a new ArrayList requires allocating a new object array. However, the Collections2 lazy handles filter condition on iteration, so much better.
23 lines
1.1 KiB
Diff
23 lines
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: nostalfinals <yuu8583@proton.me>
|
|
Date: Mon, 29 Apr 2024 23:31:25 +0800
|
|
Subject: [PATCH] Don't save falling block entity
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
index 595dee03e3a7d98d703e48fb53d82d7f392a2b3d..c99ddedaf25a009f0d19f97d01e7545b0c59aee2 100644
|
|
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
@@ -390,4 +390,11 @@ public class FallingBlockEntity extends Entity {
|
|
this.forceTickAfterTeleportToDuplicate = entity != null && flag && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper
|
|
return entity;
|
|
}
|
|
+
|
|
+ // Leaf start - PMC - Don't save falling block entity
|
|
+ @Override
|
|
+ public boolean shouldBeSaved() {
|
|
+ return !org.dreeam.leaf.config.modules.opt.DontSaveEntity.dontSaveFallingBlock && super.shouldBeSaved();
|
|
+ }
|
|
+ // Leaf end - PMC - Don't save falling block entity
|
|
}
|