mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
Remove, and opt config and config command
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Sat, 22 Jul 2023 12:00:59 +0800
|
||||
Subject: [PATCH] Fix villagers dont release memory
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 39c80b858b6bb94949fb7d2fb8347a7a628cb65f..2d97fc7b51f89c323dd893f2407125b1e8bd79fb 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4032,7 +4032,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this;
|
||||
}
|
||||
|
||||
- private Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition teleportTransition) {
|
||||
+ protected Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition teleportTransition) { // Leaves - private -> protected
|
||||
List<Entity> passengers = this.getPassengers();
|
||||
List<Entity> list = new ArrayList<>(passengers.size());
|
||||
this.ejectPassengers();
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index e1e2bdb35866a8f32a41f6efd24ad77cf916b2e9..22ef2d7bc8f514bf5a7a1f2fdb9a05a256378c5e 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -1033,4 +1033,19 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
return super.applyImplicitComponent(component, value);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Leaves start - fixes a memory leak when villagers get moved to another world
|
||||
+ @Override
|
||||
+ public Entity teleportCrossDimension(ServerLevel oldWorld, ServerLevel newWorld, net.minecraft.world.level.portal.TeleportTransition transition) {
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.performance.villagersDontReleaseMemoryFix) {
|
||||
+ this.releaseAllPois();
|
||||
+ this.getBrain().eraseMemory(MemoryModuleType.HOME);
|
||||
+ this.getBrain().eraseMemory(MemoryModuleType.JOB_SITE);
|
||||
+ this.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||
+ this.getBrain().eraseMemory(MemoryModuleType.MEETING_POINT);
|
||||
+ this.refreshBrain(transition.newLevel());
|
||||
+ }
|
||||
+ return super.teleportCrossDimension(oldWorld, newWorld, transition);
|
||||
+ }
|
||||
+ // Leaves end - fixes a memory leak when villagers get moved to another world
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Bow infinity fix
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index 0abdf0e520d1a0672917d60b79f467df4399e256..1ba438f338d53c24f9c85353adacab5699c19aae 100644
|
||||
index eca523fe027d3570eb549756d825678e17e74152..799e30efa861b6094617dcec0ba23eda49d1519a 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -2187,8 +2187,10 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -74,7 +74,7 @@ index 38572ecba568072b132b9e7fc12e6c0c38edd2e2..c3bec7a52f167a5169f96da709bcf926
|
||||
+ // Leaves end - force void trade
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 2330415f8e3bc021e43facff4c99177cc0c9fc5c..cab1ef5547d6de724c4d9341ecad0bff25c84c5b 100644
|
||||
index e1e2bdb35866a8f32a41f6efd24ad77cf916b2e9..27812825f74903715eef560e576136b52b8cf778 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -383,6 +383,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Make Item tick vanilla
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 7040d2212f20bb2cd83198b6886074a6f430ee71..351a5fbc4b73098c321ad63119d0515de2271dd9 100644
|
||||
index af0467f60e5a873eeed7b741717c327272746a9a..fc8d3e56771998a04d5e0b35ad7638a44def8c77 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -138,6 +138,9 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Crafter 1 gt delay
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
index 33e24f2c3b63b2d3b55dfae2f2e55869abeed055..3ce56a24e131c3ea4c6d568e3f7bd2de8076ac60 100644
|
||||
index caf31218a1aff84367da126ee1dc46b8c8a1e5d1..a073188275456ee2eee776b149a14f68e4557f4a 100644
|
||||
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
@@ -75,7 +75,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
@@ -54,7 +54,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..a6573e327ace16b7ea320eb1440ffcbc
|
||||
+ public void moonrise$write(final org.leavesmc.leaves.region.IRegionFile regionFile) throws IOException; // Leaves - more region format
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 57b0ec8336722197dae868d92d8733330f0b0722..d2f98398492b74de6a03dbd2cc8f431ddb90867b 100644
|
||||
index 25087f470db918dbca3ec582581d02822e5ff17d..7813085bec9f4b3a88ed2394ddc781ad7cf72439 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -944,10 +944,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Placing locked hopper no longer send NC updates
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index 590252ca203124f0b720a73f174c92fbe49bc685..f847d6c9ce70c66fc36733d8b5aa002e40be4cac 100644
|
||||
index 1bca7c6ca429ae3d58b802991464f62568a4d430..f31a48530e965f01507c335f50d898ed72767e3c 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1210,7 +1210,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix falling block's block location
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 2d97fc7b51f89c323dd893f2407125b1e8bd79fb..7039619c240a582be1ade95f495042134d6acf68 100644
|
||||
index c9787c36f083a5d8fdff033f02b9596c8b2cc866..5d13f47936069ce1577ef0eb2627d5ef6492dcd6 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -5020,6 +5020,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Bytebuf API
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index de411c04a010d8d2b091b9060d42d4074a6712c8..1d370d5fc9f69bcf2f7087373e9b53fbac792821 100644
|
||||
index 95cb24f44412e2aad5f15f8256e3506366c1412d..d4eb10d3734930a43b8270cdc7eb78bf40907c94 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -384,6 +384,13 @@ public abstract class PlayerList {
|
||||
@@ -38,7 +38,7 @@ index 99f109e2653eff10c011f380694bd77a76381cee..3d7ea706747a6bcd8db8dd6213998966
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 863b9ab56304a58e8ecbe43657857b95a19cea87..5e0cd62bd693de025fb4cc70b8f31972f5fe531a 100644
|
||||
index 47963968763cbee60016853d617f159c0761d282..c1ca84cf0dbb4fd091cfab517721c87e0f9074a0 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -607,7 +607,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -147,7 +147,7 @@ index 63d6a43dab067aa4c8fb67095c455130196eef9f..561acadcf81dc219d88e8ec8bdbd4f5f
|
||||
this.setChanged();
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 1a4326df24188918542349ba7c812578e78723ee..a900cde0d7e6ddd6faf961e7861c3cc499164d7a 100644
|
||||
index f6df4c049ed3460eb437a4637c122a5880f2bdbc..d8eede6272ee712c81ed9429539837fdbd27bfcd 100644
|
||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -113,6 +113,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable MC-67
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 7039619c240a582be1ade95f495042134d6acf68..9302371893eab9d8b02716502cb0fd1019e00a98 100644
|
||||
index 5d13f47936069ce1577ef0eb2627d5ef6492dcd6..05ca8e944645d8184576b3eb577d2a981e0b10f9 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4194,6 +4194,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Can disable LivingEntity aiStep alive check
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 305c099d32f1472a6e8909cdf2a53cec8a31afb5..0fca2df8899d285bd09e5a4ebcc09c05f222f13a 100644
|
||||
index 67e63375db357a95e3854c8e77e0de15d925dfea..2cc5c081a75997be637fe753ccdd222e862170c0 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3285,7 +3285,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
@@ -246,7 +246,7 @@ index eb315a50a83dc7230d7ad66f4daeb0d632679941..7bccf15310f6851875bfd77d4c66f4ce
|
||||
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) {
|
||||
Containers.updateNeighboursAfterDestroy(state, level, pos);
|
||||
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
index 3ce56a24e131c3ea4c6d568e3f7bd2de8076ac60..d9688878de652cd47f5ffa427fad13615683648e 100644
|
||||
index a073188275456ee2eee776b149a14f68e4557f4a..89e69eb87d43d35002a352bdb187f503033f6630 100644
|
||||
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
@@ -129,6 +129,14 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix EntityPortalExitEvent logic
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 9302371893eab9d8b02716502cb0fd1019e00a98..61765061064cff706280b25dbbfbd160fc6c3966 100644
|
||||
index 05ca8e944645d8184576b3eb577d2a981e0b10f9..87767c14cf6bed351a7ef9fe578be34a3643fea2 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -3984,19 +3984,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Skip negligible planar movement multiplication
|
||||
This patch is Powered by Gale(https://github.com/Dreeam-qwq/Gale)
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index d158471bd95f3e4f810ba41ea07ee6b4d341d42f..47b9ddcecd0853927a4a41264bda15a935b55671 100644
|
||||
index 87767c14cf6bed351a7ef9fe578be34a3643fea2..a556618dd51927a15c309bc3a2367c9a05a8e3af 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1234,8 +1234,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla player display name
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 7cbd70c17369f3578f1a50c553dd25bfb189af11..70b35fa479bdfcda2f404b3b86547552f7d6da8e 100644
|
||||
index e9e98636f4e8665fb83d726a701e5d99ba3b992d..b10ae364db96856007ca2fdd37124c77a1f3df14 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -476,7 +476,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix SculkCatalyst exp skip
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 70b35fa479bdfcda2f404b3b86547552f7d6da8e..eb391c3ef663ea0267c90a8e46a658e4390040d4 100644
|
||||
index b10ae364db96856007ca2fdd37124c77a1f3df14..3852dd5c6e14f88e143549776451ae0d0a312032 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1105,7 +1105,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla portal handle
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index f5ed9965394eb075faf92515181c2446981e24a2..0a29cf071cefe14f1862d4bd5ddcacff42fe9f15 100644
|
||||
index a556618dd51927a15c309bc3a2367c9a05a8e3af..fadce8b3073dc67534a4830b40fc2e84fdbd687b 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -836,6 +836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Spawn invulnerable time
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index eb391c3ef663ea0267c90a8e46a658e4390040d4..0002efa90e736c48fbfcd365eb0c0c78d7e1def1 100644
|
||||
index 3852dd5c6e14f88e143549776451ae0d0a312032..e6f32e656b7a2039831cbfed514c2f61d3d58c51 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -232,6 +232,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla Fluid Pushing
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 0a29cf071cefe14f1862d4bd5ddcacff42fe9f15..05770bb17a37733c83464e1c90ce549d5e7771c5 100644
|
||||
index fadce8b3073dc67534a4830b40fc2e84fdbd687b..e5f1939c9f998e56a5b99ab8319315e3645535ea 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4729,8 +4729,82 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -26,7 +26,7 @@ This patch is Powered by CrystalCarpetAddition(https://github.com/Crystal0404/Cr
|
||||
*/
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 05770bb17a37733c83464e1c90ce549d5e7771c5..ca017f5e483a4ff5bc497ad453f4cf63a0bb97f5 100644
|
||||
index e5f1939c9f998e56a5b99ab8319315e3645535ea..0190dd033bd60ad03c025150ece23fbf2a86f954 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -185,7 +185,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -111,7 +111,7 @@ index 86cac164a2bf0e76528396e6aabbfd64cfc29559..da99b4bc7fe8460945070915073be141
|
||||
|
||||
int getContainerSize();
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index ca017f5e483a4ff5bc497ad453f4cf63a0bb97f5..880b2388d35ad5eedbd8d657f1726a8384b42548 100644
|
||||
index 0190dd033bd60ad03c025150ece23fbf2a86f954..0aa7fa66e74b5b1bc5e5db9910a812daa419d9d8 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -309,7 +309,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -306,7 +306,7 @@ index c1ca84cf0dbb4fd091cfab517721c87e0f9074a0..5f70277c3548a9cd423585d374978422
|
||||
ItemStack item = container.getItem(i);
|
||||
if (!item.isEmpty()) {
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index 1186cad641786aff2ea6f664724a53511aa1440e..4fc9d39382ed2f7c4423585473ee7b72039092cd 100644
|
||||
index 5dadbdb4bb4c0d3a2dcc33120ac725bfe3e6f65c..1f73b9c8119444cc0274edb0aa38c3f10362213a 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -93,8 +93,12 @@ import net.minecraft.world.level.block.state.pattern.BlockInWorld;
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.leavesmc.leaves;
|
||||
|
||||
import com.destroystokyo.paper.util.SneakyThrow;
|
||||
import io.papermc.paper.adventure.PaperAdventure;
|
||||
import io.papermc.paper.configuration.GlobalConfiguration;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -86,7 +85,6 @@ public final class LeavesConfig {
|
||||
config.load(file);
|
||||
} catch (final Exception ex) {
|
||||
LeavesLogger.LOGGER.severe("Failure to load leaves config", ex);
|
||||
SneakyThrow.sneaky(ex);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
@@ -107,7 +105,6 @@ public final class LeavesConfig {
|
||||
config.load(LeavesConfig.configFile);
|
||||
} catch (final Exception ex) {
|
||||
LeavesLogger.LOGGER.severe("Failure to reload leaves config", ex);
|
||||
SneakyThrow.sneaky(ex);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
@@ -430,7 +427,7 @@ public final class LeavesConfig {
|
||||
|
||||
@TransferConfig("redstone-shears-wrench")
|
||||
@GlobalConfig("redstone-shears-wrench")
|
||||
public boolean redstoneShearsWrench = true;
|
||||
public boolean redstoneShearsWrench = false;
|
||||
|
||||
@TransferConfig("budding-amethyst-can-push-by-piston")
|
||||
@TransferConfig("modify.budding-amethyst-can-push-by-piston")
|
||||
@@ -819,9 +816,6 @@ public final class LeavesConfig {
|
||||
@GlobalConfig("skip-negligible-planar-movement-multiplication")
|
||||
public boolean skipNegligiblePlanarMovementMultiplication = true;
|
||||
|
||||
@GlobalConfig("fix-villagers-dont-release-memory")
|
||||
public boolean villagersDontReleaseMemoryFix = false;
|
||||
|
||||
@GlobalConfig(value = "sleeping-block-entity", lock = true)
|
||||
public boolean sleepingBlockEntity = false;
|
||||
}
|
||||
@@ -1155,7 +1149,7 @@ public final class LeavesConfig {
|
||||
public boolean forceMinecraftCommand = false;
|
||||
|
||||
@GlobalConfig("leaves-packet-event")
|
||||
public boolean leavesPacketEvent = true;
|
||||
public boolean leavesPacketEvent = false;
|
||||
|
||||
@GlobalConfig("chat-command-max-length")
|
||||
public int chatCommandMaxLength = 32767;
|
||||
@@ -1238,7 +1232,7 @@ public final class LeavesConfig {
|
||||
}
|
||||
|
||||
@GlobalConfig("vanilla-portal-handle")
|
||||
public boolean vanillaPortalHandle = false;
|
||||
public boolean vanillaPortalHandle = true;
|
||||
|
||||
@GlobalConfig("vanilla-fluid-pushing")
|
||||
public boolean vanillaFluidPushing = true;
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.leavesmc.leaves.command.subcommands;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.JoinConfiguration;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -13,21 +14,23 @@ import org.leavesmc.leaves.command.LeavesSuggestionBuilder;
|
||||
import org.leavesmc.leaves.config.GlobalConfigManager;
|
||||
import org.leavesmc.leaves.config.VerifiedConfig;
|
||||
|
||||
import static net.kyori.adventure.text.Component.text;
|
||||
|
||||
public class ConfigCommand implements LeavesSubcommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String subCommand, String[] args) {
|
||||
if (args.length < 1) {
|
||||
sender.sendMessage(Component.text("Leaves Config", NamedTextColor.GRAY));
|
||||
sender.sendMessage(text("Leaves Config", NamedTextColor.GRAY));
|
||||
return;
|
||||
}
|
||||
|
||||
VerifiedConfig verifiedConfig = GlobalConfigManager.getVerifiedConfig(args[0]);
|
||||
if (verifiedConfig == null) {
|
||||
sender.sendMessage(Component.join(JoinConfiguration.noSeparators(),
|
||||
Component.text("Config ", NamedTextColor.GRAY),
|
||||
Component.text(args[0], NamedTextColor.RED),
|
||||
Component.text(" is Not Found.", NamedTextColor.GRAY)
|
||||
sender.sendMessage(Component.join(JoinConfiguration.spaces(),
|
||||
text("Config", NamedTextColor.GRAY),
|
||||
text(args[0], NamedTextColor.RED),
|
||||
text("is Not Found.", NamedTextColor.GRAY)
|
||||
));
|
||||
return;
|
||||
}
|
||||
@@ -35,26 +38,35 @@ public class ConfigCommand implements LeavesSubcommand {
|
||||
if (args.length > 1) {
|
||||
try {
|
||||
verifiedConfig.set(args[1]);
|
||||
sender.sendMessage(Component.join(JoinConfiguration.noSeparators(),
|
||||
Component.text("Config ", NamedTextColor.GRAY),
|
||||
Component.text(args[0], NamedTextColor.AQUA),
|
||||
Component.text(" changed to ", NamedTextColor.GRAY),
|
||||
Component.text(verifiedConfig.getString(), NamedTextColor.AQUA)
|
||||
sender.sendMessage(Component.join(JoinConfiguration.spaces(),
|
||||
text("Config", NamedTextColor.GRAY),
|
||||
text(args[0], NamedTextColor.AQUA),
|
||||
text("changed to", NamedTextColor.GRAY),
|
||||
text(verifiedConfig.getString(), NamedTextColor.AQUA)
|
||||
));
|
||||
Bukkit.getOnlinePlayers().stream().filter(player -> player.hasPermission("leaves.command.config.notify") && player != sender).forEach(
|
||||
player -> player.sendMessage(Component.join(JoinConfiguration.spaces(),
|
||||
text(sender.getName() + ":", NamedTextColor.GRAY),
|
||||
text("Config", NamedTextColor.GRAY),
|
||||
text(args[0], NamedTextColor.AQUA),
|
||||
text("changed to", NamedTextColor.GRAY),
|
||||
text(verifiedConfig.getString(), NamedTextColor.AQUA)
|
||||
))
|
||||
);
|
||||
} catch (IllegalArgumentException exception) {
|
||||
sender.sendMessage(Component.join(JoinConfiguration.noSeparators(),
|
||||
Component.text("Config ", NamedTextColor.GRAY),
|
||||
Component.text(args[0], NamedTextColor.RED),
|
||||
Component.text(" modify error by ", NamedTextColor.GRAY),
|
||||
Component.text(exception.getMessage(), NamedTextColor.RED)
|
||||
sender.sendMessage(Component.join(JoinConfiguration.spaces(),
|
||||
text("Config", NamedTextColor.GRAY),
|
||||
text(args[0], NamedTextColor.RED),
|
||||
text("modify error by", NamedTextColor.GRAY),
|
||||
text(exception.getMessage(), NamedTextColor.RED)
|
||||
));
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(Component.join(JoinConfiguration.noSeparators(),
|
||||
Component.text("Config ", NamedTextColor.GRAY),
|
||||
Component.text(args[0], NamedTextColor.AQUA),
|
||||
Component.text(" value is ", NamedTextColor.GRAY),
|
||||
Component.text(verifiedConfig.getString(), NamedTextColor.AQUA)
|
||||
sender.sendMessage(Component.join(JoinConfiguration.spaces(),
|
||||
text("Config", NamedTextColor.GRAY),
|
||||
text(args[0], NamedTextColor.AQUA),
|
||||
text("value is", NamedTextColor.GRAY),
|
||||
text(verifiedConfig.getString(), NamedTextColor.AQUA)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.leavesmc.leaves.command.subcommands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.leavesmc.leaves.LeavesConfig;
|
||||
import org.leavesmc.leaves.command.LeavesSubcommand;
|
||||
@@ -12,5 +13,8 @@ public class ReloadCommand implements LeavesSubcommand {
|
||||
public void execute(CommandSender sender, String subCommand, String[] args) {
|
||||
LeavesConfig.reload();
|
||||
sender.sendMessage(text("Leaves config reload complete.", GREEN));
|
||||
Bukkit.getOnlinePlayers().stream().filter(player -> player.hasPermission("leaves.command.config.notify") && player != sender).forEach(
|
||||
player -> player.sendMessage(text("Leaves config reload complete.", GREEN))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.config.annotations;
|
||||
|
||||
import org.leavesmc.leaves.config.api.impl.AutoConfigValidator;
|
||||
import org.leavesmc.leaves.config.api.ConfigValidator;
|
||||
import org.leavesmc.leaves.config.api.impl.AutoConfigValidator;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.config.annotations;
|
||||
|
||||
import org.leavesmc.leaves.config.api.impl.AutoConfigTransformer;
|
||||
import org.leavesmc.leaves.config.api.ConfigTransformer;
|
||||
import org.leavesmc.leaves.config.api.impl.AutoConfigTransformer;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
Reference in New Issue
Block a user