9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 00:49:31 +00:00

Fix terminal color on Windows (#176)

* Fix terminal color on Windows

Windows doesn't have environment variables TERM and COLORTERM by default, but we assuming that it supports the `truecolor` for terminal.

* Add back revert to original java console on Java 22
This commit is contained in:
Dreeam
2024-11-30 20:01:54 -05:00
committed by GitHub
parent 714cb8a9cf
commit 0510b51ed3
81 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
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/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index b83be9bbb9f348da83c0fd1ecc7f65c8a58b45b9..5b3844f92caf2962be58e911f98a26e6992f8184 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -422,4 +422,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
}
diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
index 43c9fcc5a27d523d00656e058c46c34f36da8b63..28dc5e191a26a4783d9e8c18b2653b9ed3238a88 100644
--- a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
@@ -10,6 +10,7 @@ public class DontSaveEntity extends ConfigModules {
}
public static boolean dontSavePrimedTNT = false;
+ public static boolean dontSaveFallingBlock = false;
@Override
public void onLoaded() {
@@ -22,5 +23,6 @@ public class DontSaveEntity extends ConfigModules {
"""
区块卸载时不保存掉落的方块和激活的 TNT,
可以避免在玩家掉线时机器被炸毁."""));
+ dontSaveFallingBlock = config.getBoolean(getBasePath() + ".dont-save-falling-block", dontSaveFallingBlock);
}
}