Update Luminol
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ apiVersion=1.21.11
|
|||||||
release=2
|
release=2
|
||||||
# 0 for skip release, 1 for pre-release, 2 for release
|
# 0 for skip release, 1 for pre-release, 2 for release
|
||||||
|
|
||||||
luminolRef=1d7b3b1fa16a2561227863de57529a0a4c9efcbc
|
luminolRef=ecb27d3cc237e3dd827b80c3158c0d20c2fadfd4
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -49,9 +49,9 @@
|
|||||||
- implementation(project(":luminol-api")) // Luminol
|
- implementation(project(":luminol-api")) // Luminol
|
||||||
+ implementation(project(":lophine-api")) // Lophine
|
+ implementation(project(":lophine-api")) // Lophine
|
||||||
// Luminol start - Dependenices insert
|
// Luminol start - Dependenices insert
|
||||||
|
implementation("io.netty:netty-all:4.2.9.Final") // used for io_uring
|
||||||
implementation("com.electronwill.night-config:toml:3.8.3") // Night config
|
implementation("com.electronwill.night-config:toml:3.8.3") // Night config
|
||||||
implementation("com.github.luben:zstd-jni:1.5.4-1")
|
@@ -273,14 +_,14 @@
|
||||||
@@ -272,14 +_,14 @@
|
|
||||||
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
"Build-Number" to (build ?: ""),
|
"Build-Number" to (build ?: ""),
|
||||||
"Build-Time" to buildTime.toString(),
|
"Build-Time" to buildTime.toString(),
|
||||||
"Git-Branch" to gitBranch,
|
"Git-Branch" to gitBranch,
|
||||||
@@ -431,7 +_,7 @@
|
@@ -432,7 +_,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
fill {
|
fill {
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ index 0bebc2cc87fb9c1c526e4de4f3bc157552307a72..cb1657939b86c039fcfe6403d3f202c2
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||||
index df5d926fb4401dd93d658fe14ae4d9d58cff68f9..b6d84fea596cfa78032151ab2f206b6b3d5dd197 100644
|
index e4022494b050b68d54bac3cde87bdfc9e908859c..a4188ef831825764c0756b826651e2e7a9f99c5b 100644
|
||||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||||
@@ -8,7 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
@@ -8,7 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||||
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "server_mod_name")
|
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "server_mod_name")
|
||||||
public class ServerModNameConfig implements IConfigModule {
|
public class ServerModNameConfig implements IConfigModule {
|
||||||
@ConfigInfo(name = "name")
|
@ConfigInfo(name = "name", comments = "Decides the server mod name shown in your F3 debug screen.")
|
||||||
- public static String serverModName = "Luminol";
|
- public static String serverModName = "Luminol";
|
||||||
+ public static String serverModName = "Lophine";
|
+ public static String serverModName = "Lophine";
|
||||||
|
|
||||||
@ConfigInfo(name = "vanilla_spoof")
|
@ConfigInfo(name = "vanilla_spoof", comments = "Ignore any plugin's modification and server mod name set in this config block, only force sending brand name of vanilla")
|
||||||
public static boolean fakeVanilla = false;
|
public static boolean fakeVanilla = false;
|
||||||
|
|||||||
@@ -5,24 +5,34 @@ Subject: [PATCH] Transformed Configs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
||||||
index 4051384e82dba0416838c3c9889a6e368367b601..a5535b479cdcca870d0c8be6ed6fbcb32f266ac2 100644
|
index ad2ba680bedb2336de24146676e70a1f64fd9c5a..f81581782bf684bbcf4719e9b268efa3c6385325 100644
|
||||||
--- a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
--- a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
||||||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java
|
||||||
@@ -11,6 +11,7 @@ public class CommandConfig implements IConfigModule {
|
@@ -13,6 +13,7 @@ public class CommandConfig implements IConfigModule {
|
||||||
@TransformedConfig(name = "enable", directory = {"experiment", "force_the_data_command_to_be_enabled"})
|
|
||||||
@ConfigInfo(name = "enable_data_command")
|
@ConfigInfo(name = "enable_data_command")
|
||||||
|
@HotReloadUnsupported
|
||||||
public static boolean data = false;
|
public static boolean data = false;
|
||||||
+ @TransformedConfig(name = "command_block_enabled", directory = {"experiment", "command"}, originInstance = "lophine")
|
+ @TransformedConfig(name = "command_block_enabled", directory = {"experiment", "command"}, originInstance = "lophine")
|
||||||
@TransformedConfig(name = "enabled", directory = {"experiment", "force_enable_command_block_command_execution"})
|
@TransformedConfig(name = "enabled", directory = {"experiment", "force_enable_command_block_command_execution"})
|
||||||
@ConfigInfo(name = "enable_command_block", comments = """
|
@ConfigInfo(name = "enable_command_block", comments = """
|
||||||
Force to enable command blocks.
|
Force to enable command blocks.
|
||||||
|
@@ -20,6 +21,9 @@ public class CommandConfig implements IConfigModule {
|
||||||
|
DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
|
||||||
|
""")
|
||||||
|
public static boolean commandBlock = false;
|
||||||
|
+ @TransformedConfig(name = "enable-waypoint", directory = {"experiment", "waypoint bar"})
|
||||||
|
+ @TransformedConfig(name = "enable-waypoint", directory = {"experiment", "waypoint_bar"})
|
||||||
|
+ @TransformedConfig(name = "waypoint_command_enabled", directory = {"experiment", "command"})
|
||||||
|
@ConfigInfo(name = "enable_waypoints_and_waypoint_command", comments = """
|
||||||
|
Enable waypoint and waypoint command.
|
||||||
|
WARN: Still under testing
|
||||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
||||||
index 5c09f6e9265c51b52a1352bf65cdf24ffb7eb4f0..ac399e529ea1fed96cd6407142609aec50051786 100644
|
index ce190737de22438d5de86b0ee0e8158954fdca18..0a175e87f3cb5b23480abefd70ee2e84e876b0d4 100644
|
||||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
--- a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
||||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
|
||||||
@@ -8,6 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
@@ -11,6 +11,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||||
|
"has negative impacts on security"
|
||||||
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "force_disable_packet_limiter_of_paper")
|
)
|
||||||
public class PaperPacketLimiterConfig implements IConfigModule {
|
public class PaperPacketLimiterConfig implements IConfigModule {
|
||||||
+ @TransformedConfig(name = "unlimit-packet", directory = {"misc", "network"}, originInstance = "lophine")
|
+ @TransformedConfig(name = "unlimit-packet", directory = {"misc", "network"}, originInstance = "lophine")
|
||||||
@TransformedConfig(name = "force_disable", directory = {"optimizations", "force_disable_packet_limiter_of_paper"})
|
@TransformedConfig(name = "force_disable", directory = {"optimizations", "force_disable_packet_limiter_of_paper"})
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 18 Feb 2026 00:15:08 +0800
|
||||||
|
Subject: [PATCH] Leaves: Fakeplayer
|
||||||
|
|
||||||
|
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||||
|
As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java b/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||||
|
index 14cf379decfd46c4719bc192a1467bbbd6835417..20970844de2e64ca213384e53003e80020165770 100644
|
||||||
|
--- a/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||||
|
+++ b/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||||
|
@@ -38,6 +38,12 @@ public class FoliaServerWaypointManager implements WaypointManager<@NotNull Wayp
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - fakeplayer
|
||||||
|
+ if (waypoint instanceof org.leavesmc.leaves.bot.ServerBot bot && !bot.getConfigValue(org.leavesmc.leaves.bot.agent.Configs.ENABLE_LOCATOR_BAR)) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - fakeplayer
|
||||||
|
+
|
||||||
|
this.waypoints.add(waypoint);
|
||||||
|
|
||||||
|
for (ServerPlayer toCreateFor : this.trackingPlayers) {
|
||||||
|
@@ -91,6 +97,12 @@ public class FoliaServerWaypointManager implements WaypointManager<@NotNull Wayp
|
||||||
|
public void addPlayer(ServerPlayer player) {
|
||||||
|
this.trackingPlayers.add(player);
|
||||||
|
|
||||||
|
+ // Leaves start - fakeplayer
|
||||||
|
+ if (player instanceof org.leavesmc.leaves.bot.ServerBot) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - fakeplayer
|
||||||
|
+
|
||||||
|
for (WaypointTransmitter waypointTransmitter : this.waypoints) {
|
||||||
|
this.createConnection(player, waypointTransmitter);
|
||||||
|
}
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
Date: Sun, 3 Aug 2025 14:26:37 +0800
|
Date: Sun, 3 Aug 2025 14:26:37 +0800
|
||||||
Subject: [PATCH] Add configs to disable some check for operators
|
Subject: [PATCH] Add config to disable some check for operators
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+2
-2
@@ -18,7 +18,7 @@ index bca2c5410aa543d2bb421e53893e9163508b3568..fdccb06c918d387e46c29ede7337159d
|
|||||||
double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1);
|
double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1);
|
||||||
if (rangeY != -1) {
|
if (rangeY != -1) {
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index e62a8d23736de03f18c615c7622414aac3dc8aef..8043b5f24e09e2c96afe14b5ab6978c0b85d744c 100644
|
index b27e00437e5779c051e8ea2f350e4a264f2c5e7c..32299faedd89a848ca00288672ce85cad707dca0 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -152,7 +152,7 @@ import org.jetbrains.annotations.Contract;
|
@@ -152,7 +152,7 @@ import org.jetbrains.annotations.Contract;
|
||||||
@@ -30,7 +30,7 @@ index e62a8d23736de03f18c615c7622414aac3dc8aef..8043b5f24e09e2c96afe14b5ab6978c0
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private static final int CURRENT_LEVEL = 2;
|
private static final int CURRENT_LEVEL = 2;
|
||||||
static boolean isLevelAtLeast(ValueInput input, int level) {
|
static boolean isLevelAtLeast(ValueInput input, int level) {
|
||||||
@@ -6443,4 +6443,46 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
@@ -6426,4 +6426,46 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
// Paper end - Expose entity id counter
|
// Paper end - Expose entity id counter
|
||||||
|
|
||||||
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
||||||
|
|||||||
+3
-3
@@ -31,7 +31,7 @@ index 02c004bc7f9a0203523ce4b27cd766d6bdc478c0..3d86e21198f2888422330b6f7c27712f
|
|||||||
private final Reference2ReferenceOpenHashMap<RegionizedData<?>, Object> regionizedData = new Reference2ReferenceOpenHashMap<>();
|
private final Reference2ReferenceOpenHashMap<RegionizedData<?>, Object> regionizedData = new Reference2ReferenceOpenHashMap<>();
|
||||||
|
|
||||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||||
index b95d144dd479d339cc4b0f92cc4c3bade9af4927..097e5b6a14fd148c93ca3894295a4a6b1e9aa870 100644
|
index 6cb0d4daf0f275b95d5ca09275e40ab32258eb39..48628174299f8f18170198df1834d6174bd1fafa 100644
|
||||||
--- a/net/minecraft/commands/Commands.java
|
--- a/net/minecraft/commands/Commands.java
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
+++ b/net/minecraft/commands/Commands.java
|
||||||
@@ -294,7 +294,11 @@ public class Commands {
|
@@ -294,7 +294,11 @@ public class Commands {
|
||||||
@@ -48,10 +48,10 @@ index b95d144dd479d339cc4b0f92cc4c3bade9af4927..097e5b6a14fd148c93ca3894295a4a6b
|
|||||||
SaveOnCommand.register(this.dispatcher);
|
SaveOnCommand.register(this.dispatcher);
|
||||||
SetPlayerIdleTimeoutCommand.register(this.dispatcher);
|
SetPlayerIdleTimeoutCommand.register(this.dispatcher);
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 0d572803c663738a525922c02dd4c65ac61e4cce..76098a4f44f8d82bebf832fa5e240adf25fbe80a 100644
|
index 4be383909addfebc0ca3b007d4ef2ec30ed445f7..fa60388376e9dafc5e1b71b6e78550bb6cd4009b 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1661,6 +1661,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1656,6 +1656,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
public void tickServer(long startTime, long scheduledEnd, long targetBuffer,
|
public void tickServer(long startTime, long scheduledEnd, long targetBuffer,
|
||||||
io.papermc.paper.threadedregions.TickRegions.TickRegionData region) {
|
io.papermc.paper.threadedregions.TickRegions.TickRegionData region) {
|
||||||
|
|||||||
-177
@@ -1,177 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Mon, 7 Jul 2025 18:19:00 +0800
|
|
||||||
Subject: [PATCH] Add config to enable waypoint command & bar
|
|
||||||
|
|
||||||
use concurrent method to fix it (now, they are thread safe)
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
|
||||||
index 65f200381f486146ce8d893378f0591a82f6076b..8362b6a92b27e908024077e564b98d4b681cb2b0 100644
|
|
||||||
--- a/net/minecraft/commands/Commands.java
|
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
|
||||||
@@ -270,7 +270,11 @@ public class Commands {
|
|
||||||
TimeCommand.register(this.dispatcher);
|
|
||||||
TitleCommand.register(this.dispatcher, context);
|
|
||||||
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
|
||||||
- //WaypointCommand.register(this.dispatcher, context); // Folia - region threading - TODO later
|
|
||||||
+ // Lophine start - unsafe waypoint bar
|
|
||||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) {
|
|
||||||
+ WaypointCommand.register(this.dispatcher, context); // Folia - region threading - TODO later
|
|
||||||
+ }
|
|
||||||
+ // Lophine end - unsafe waypoint bar
|
|
||||||
WeatherCommand.register(this.dispatcher);
|
|
||||||
WorldBorderCommand.register(this.dispatcher);
|
|
||||||
if (JvmProfiler.INSTANCE.isAvailable()) {
|
|
||||||
diff --git a/net/minecraft/server/waypoints/ServerWaypointManager.java b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
index 1cbc46e480cc7d109c6128f109a1a9e38bf1a193..bd1d4a832eec4c89a7f8bdd5d066b6074f206d81 100644
|
|
||||||
--- a/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
+++ b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
@@ -16,22 +16,31 @@ import net.minecraft.world.waypoints.WaypointManager;
|
|
||||||
import net.minecraft.world.waypoints.WaypointTransmitter;
|
|
||||||
|
|
||||||
public class ServerWaypointManager implements WaypointManager<WaypointTransmitter> {
|
|
||||||
- private final Set<WaypointTransmitter> waypoints = new HashSet<>();
|
|
||||||
- private final Set<ServerPlayer> players = new HashSet<>();
|
|
||||||
- private final Table<ServerPlayer, WaypointTransmitter, WaypointTransmitter.Connection> connections = HashBasedTable.create();
|
|
||||||
+ private final Set<WaypointTransmitter> waypoints = new java.util.concurrent.CopyOnWriteArraySet<>(); // Lophine - concurrent
|
|
||||||
+ private final Set<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArraySet<>(); // Lophine - concurrent
|
|
||||||
+ private final fun.bm.lophine.utils.concurrent.AbstractConcurrentTable<ServerPlayer, WaypointTransmitter, WaypointTransmitter.Connection> connections = fun.bm.lophine.config.modules.optimizations.WayPointOptimizedTableConfig.optimizedTable ? new fun.bm.lophine.utils.concurrent.OptimizedConcurrentTable<>() : new fun.bm.lophine.utils.concurrent.ConcurrentTable<>(); // Lophine - concurrent
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void trackWaypoint(WaypointTransmitter waypoint) {
|
|
||||||
- // Folia - region threading
|
|
||||||
+ // Lophine start - unsafe waypoint bar
|
|
||||||
+ if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ this.waypoints.add(waypoint);
|
|
||||||
+
|
|
||||||
+ for (ServerPlayer serverPlayer : this.players) {
|
|
||||||
+ this.createConnection(serverPlayer, waypoint);
|
|
||||||
+ }
|
|
||||||
+ // Lophine end - unsafe waypoint bar
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateWaypoint(WaypointTransmitter waypoint) {
|
|
||||||
if (this.waypoints.contains(waypoint)) {
|
|
||||||
- Map<ServerPlayer, WaypointTransmitter.Connection> map = Tables.transpose(this.connections).row(waypoint);
|
|
||||||
- SetView<ServerPlayer> set = Sets.difference(this.players, map.keySet());
|
|
||||||
+ java.util.List<Entry<ServerPlayer, WaypointTransmitter.Connection>> map = this.connections.getXZ(waypoint); // Lophine - concurrent
|
|
||||||
+ Set<ServerPlayer> players1 = new HashSet<>(); // Lophine - concurrent
|
|
||||||
+ if (!map.isEmpty()) map.forEach((entry) -> players1.add(entry.getKey())); // Lophine - concurrent
|
|
||||||
+ SetView<ServerPlayer> set = Sets.difference(this.players, players1); // Lophine - concurrent
|
|
||||||
|
|
||||||
- for (Entry<ServerPlayer, WaypointTransmitter.Connection> entry : ImmutableSet.copyOf(map.entrySet())) {
|
|
||||||
+ for (Entry<ServerPlayer, WaypointTransmitter.Connection> entry : map) { // Lophine - concurrent
|
|
||||||
this.updateConnection(entry.getKey(), waypoint, entry.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -43,26 +52,65 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void untrackWaypoint(WaypointTransmitter waypoint) {
|
|
||||||
- this.connections.column(waypoint).forEach((serverPlayer, connection) -> connection.disconnect());
|
|
||||||
- Tables.transpose(this.connections).row(waypoint).clear();
|
|
||||||
+ this.connections.getXZ(waypoint).forEach((entry) -> {
|
|
||||||
+ entry.getValue().disconnect();
|
|
||||||
+ this.connections.remove(entry.getKey(), waypoint, entry.getValue());
|
|
||||||
+ }); // Lophine - concurrent
|
|
||||||
this.waypoints.remove(waypoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPlayer(ServerPlayer player) {
|
|
||||||
// Folia - region threading
|
|
||||||
+ // Lophine start - unsafe waypoint bar
|
|
||||||
+ if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ this.players.add(player);
|
|
||||||
+
|
|
||||||
+ for (WaypointTransmitter waypointTransmitter : this.waypoints) {
|
|
||||||
+ this.createConnection(player, waypointTransmitter);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (player.isTransmittingWaypoint()) {
|
|
||||||
+ this.trackWaypoint((WaypointTransmitter)player);
|
|
||||||
+ }
|
|
||||||
+ // Lophine end - unsafe waypoint bar
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePlayer(ServerPlayer player) {
|
|
||||||
// Folia - region threading
|
|
||||||
+ // Lophine start - unsafe waypoint bar
|
|
||||||
+ if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ java.util.List<Entry<WaypointTransmitter, WaypointTransmitter.Connection>> map = this.connections.getYZ(player); // Lophine - concurrent
|
|
||||||
+ Set<WaypointTransmitter> waypoints1 = new HashSet<>();// Lophine - concurrent
|
|
||||||
+ if (!map.isEmpty()) map.forEach((entry) -> waypoints1.add(entry.getKey()));// Lophine - concurrent
|
|
||||||
+ SetView<WaypointTransmitter> set = Sets.difference(this.waypoints, waypoints1); // Lophine - concurrent
|
|
||||||
+
|
|
||||||
+ for (Entry<WaypointTransmitter, WaypointTransmitter.Connection> entry : map) { // Lophine - concurrent
|
|
||||||
+ this.updateConnection(player, entry.getKey(), entry.getValue());
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (WaypointTransmitter waypointTransmitter : set) {
|
|
||||||
+ this.createConnection(player, waypointTransmitter);
|
|
||||||
+ }
|
|
||||||
+ // Lophine end - unsafe waypoint bar
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removePlayer(ServerPlayer player) {
|
|
||||||
// Folia - region threading
|
|
||||||
+ // Lophine start - unsafe waypoint bar
|
|
||||||
+ if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ this.connections.getYZ(player).forEach((entry) -> {
|
|
||||||
+ entry.getValue().disconnect();
|
|
||||||
+ this.connections.remove(player, entry.getKey(), entry.getValue());
|
|
||||||
+ }); // Lophine - concurrent
|
|
||||||
+ this.untrackWaypoint((WaypointTransmitter)player);
|
|
||||||
+ this.players.remove(player);
|
|
||||||
+ // Lophine end - unsafe waypoint bar
|
|
||||||
}
|
|
||||||
|
|
||||||
public void breakAllConnections() {
|
|
||||||
- this.connections.values().forEach(WaypointTransmitter.Connection::disconnect);
|
|
||||||
- this.connections.clear();
|
|
||||||
+ java.util.List<WaypointTransmitter.Connection> map = this.connections.getAllZ(); // Lophine - concurrent
|
|
||||||
+ if (!map.isEmpty()) map.forEach(WaypointTransmitter.Connection::disconnect); // Lophine - concurrent
|
|
||||||
+ this.connections.clearAll(); // Lophine - concurrent
|
|
||||||
}
|
|
||||||
|
|
||||||
public void remakeConnections(WaypointTransmitter waypoint) {
|
|
||||||
@@ -83,13 +131,19 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
|
||||||
if (player != waypoint) {
|
|
||||||
if (isLocatorBarEnabledFor(player)) {
|
|
||||||
waypoint.makeWaypointConnectionWith(player).ifPresentOrElse(connection -> {
|
|
||||||
- this.connections.put(player, waypoint, connection);
|
|
||||||
+ this.connections.putOrUpdate(player, waypoint, connection);
|
|
||||||
connection.connect();
|
|
||||||
}, () -> {
|
|
||||||
- WaypointTransmitter.Connection connection = this.connections.remove(player, waypoint);
|
|
||||||
- if (connection != null) {
|
|
||||||
- connection.disconnect();
|
|
||||||
- }
|
|
||||||
+ // Lophine start - concurrent
|
|
||||||
+ java.util.List<WaypointTransmitter.Connection> c = this.connections.getZ(player, waypoint);
|
|
||||||
+ if (c.isEmpty()) return; // Lophine - concurrent
|
|
||||||
+ c.forEach((connection) -> {
|
|
||||||
+ this.connections.remove(player, waypoint, connection);
|
|
||||||
+ if (connection != null) {
|
|
||||||
+ connection.disconnect();
|
|
||||||
+ }
|
|
||||||
+ });
|
|
||||||
+ // Lophine end - concurrent
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -103,10 +157,12 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
|
||||||
} else {
|
|
||||||
waypoint.makeWaypointConnectionWith(player).ifPresentOrElse(connection1 -> {
|
|
||||||
connection1.connect();
|
|
||||||
- this.connections.put(player, waypoint, connection1);
|
|
||||||
+ this.connections.putOrUpdate(player, waypoint, connection1);
|
|
||||||
}, () -> {
|
|
||||||
connection.disconnect();
|
|
||||||
- this.connections.remove(player, waypoint);
|
|
||||||
+ java.util.List<WaypointTransmitter.Connection> c = this.connections.getZ(player, waypoint); // Lophine - concurrent
|
|
||||||
+ if (c.isEmpty()) return; // Lophine - concurrent
|
|
||||||
+ c.forEach((connection1) -> this.connections.remove(player, waypoint, connection1)); // Lophine - concurrent
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-2
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix datapack command save function
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 644c49730fc08a7c680f8114136db00ee8f81378..2359c5b49e4457cc36239289f203df16767a4341 100644
|
index d7d22806c010636d8c1471f0fd1d64ef54e92c97..8d96d2130cf3383427047fee97fa49155164e337 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2436,6 +2436,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2431,6 +2431,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return this.reloadResources(selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
return this.reloadResources(selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 2c140e4b5c818cbaedcdd3110794e30dd94dd8b4..3a174defc1e8d0d13ae006dd6c52712ed9469240 100644
|
index d0b5bc9da450d881534abdbd8ff786e1fbc7d418..674450fb2e600236f99550febf276d093308b8d8 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -3030,7 +3030,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -3030,7 +3030,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
+1
-1
@@ -23,7 +23,7 @@ index 95f6b1cbd5e33151c326689bc72292ff38a48803..e1974bbebbd10b75ea02955d9ced198d
|
|||||||
+ // Leaves end - servux
|
+ // Leaves end - servux
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 3a174defc1e8d0d13ae006dd6c52712ed9469240..87bb2715eb4c2fd41537e020ba7fa8cce1591a0f 100644
|
index 674450fb2e600236f99550febf276d093308b8d8..f5bf8ed6e741823078ab93eac47636fcebcdfe2d 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -2463,6 +2463,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2463,6 +2463,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
+1
-1
@@ -5,7 +5,7 @@ Subject: [PATCH] LeavesHooks
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
index 3152b791354327867629b42cd9453f022a27b246..9404f98c7c09934f6ddae4f92d82aa1113d42322 100644
|
index faf62f8c9453f8e7a21b1e141577f1f4539cd2f9..4e5985a3e4969f466980558190324350019ba8af 100644
|
||||||
--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
@@ -29,7 +29,7 @@ import net.minecraft.world.phys.AABB;
|
@@ -29,7 +29,7 @@ import net.minecraft.world.phys.AABB;
|
||||||
+1
-1
@@ -6,7 +6,7 @@ Subject: [PATCH] Compatibility fix for Raid Revert and Cross Region Damage
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 88d532d11c29bd8cfe5b6b02847d960b07cf0a38..fa6ed83a69aafee57195f1b512481c401ade7b09 100644
|
index 5bae274f5ee869e540e4330e03af671b6b18313d..3fe9afe55b4d61db8030479d3d74b8656679cb10 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -1240,6 +1240,29 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -1240,6 +1240,29 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
+1
-1
@@ -26,7 +26,7 @@ index 7b9e2a1a208b46a69c16e6afd8b502259893574f..c300ae4363298fecef8fa9bf739f01c0
|
|||||||
loadFromJson(resourceAsStream, output);
|
loadFromJson(resourceAsStream, output);
|
||||||
} catch (JsonParseException | IOException var7) {
|
} catch (JsonParseException | IOException var7) {
|
||||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||||
index 2d5309cc9386ef1bddf0bd4e153269fea1e75d60..ffa479f3743571bd198b1e3694301d73953a4eaa 100644
|
index f41c70c6cb2e9fae43bad9dd66546417fe38f14a..0bb0877011cac3184b881bfa35f10ef83d7341de 100644
|
||||||
--- a/net/minecraft/server/Main.java
|
--- a/net/minecraft/server/Main.java
|
||||||
+++ b/net/minecraft/server/Main.java
|
+++ b/net/minecraft/server/Main.java
|
||||||
@@ -151,6 +151,8 @@ public class Main {
|
@@ -151,6 +151,8 @@ public class Main {
|
||||||
+1
-1
@@ -5,7 +5,7 @@ Subject: [PATCH] Old zombie reinforcement
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||||
index 67a77b253e7761873f35e0b2725df16ffc4db36c..d3b8433b0992057bb0bab3acc339b50b83a5820a 100644
|
index 7a9394d4555464312418964f1a7a5d2581496774..3fcd32cc77458ce196ce0e468c1a99f456a57604 100644
|
||||||
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||||
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||||
@@ -314,7 +314,7 @@ public class Zombie extends Monster {
|
@@ -314,7 +314,7 @@ public class Zombie extends Monster {
|
||||||
+1
-1
@@ -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
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index e311502c156076842c5dcd91c70a94e414312100..482ca8764c00838dfa8b555a7614d7f306f466db 100644
|
index ec34282744c71c881392ff278a8b03af90de8151..f0d45cb70af62b747c9235941f3fc45221b3b8e6 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -240,6 +240,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -240,6 +240,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
+11
-39
@@ -33,7 +33,7 @@ index 9f444988d40208a1bfa9f147ef80489f81115e93..ab2fa0b86564622501238305714fff01
|
|||||||
private boolean encrypted;
|
private boolean encrypted;
|
||||||
private final java.util.concurrent.atomic.AtomicBoolean disconnectionHandled = new java.util.concurrent.atomic.AtomicBoolean(false); // Folia - region threading - may be called concurrently during configuration stage
|
private final java.util.concurrent.atomic.AtomicBoolean disconnectionHandled = new java.util.concurrent.atomic.AtomicBoolean(false); // Folia - region threading - may be called concurrently during configuration stage
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 2359c5b49e4457cc36239289f203df16767a4341..68c3b0496738ed4fcb02204c5c882fd722397648 100644
|
index 8d96d2130cf3383427047fee97fa49155164e337..dfcf8eb7dc422a55d94d6eb9eb1451c7c14a1d56 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -425,6 +425,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -425,6 +425,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -57,7 +57,7 @@ index 2359c5b49e4457cc36239289f203df16767a4341..68c3b0496738ed4fcb02204c5c882fd7
|
|||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
// halt scheduler
|
// halt scheduler
|
||||||
// don't wait, we may be on a scheduler thread
|
// don't wait, we may be on a scheduler thread
|
||||||
@@ -1673,7 +1680,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1668,7 +1675,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
int i = this.pauseWhenEmptySeconds() * 20;
|
int i = this.pauseWhenEmptySeconds() * 20;
|
||||||
this.removeDisabledPluginsBlockingSleep(); // Paper - API to allow/disallow tick sleeping
|
this.removeDisabledPluginsBlockingSleep(); // Paper - API to allow/disallow tick sleeping
|
||||||
if (false && i > 0) { // Folia - region threading - this is complicated to implement, and even if done correctly is messy
|
if (false && i > 0) { // Folia - region threading - this is complicated to implement, and even if done correctly is messy
|
||||||
@@ -66,7 +66,7 @@ index 2359c5b49e4457cc36239289f203df16767a4341..68c3b0496738ed4fcb02204c5c882fd7
|
|||||||
this.emptyTicks++;
|
this.emptyTicks++;
|
||||||
} else {
|
} else {
|
||||||
this.emptyTicks = 0;
|
this.emptyTicks = 0;
|
||||||
@@ -1806,6 +1813,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1801,6 +1808,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.isSaving = true;
|
this.isSaving = true;
|
||||||
if (playerSaveInterval > 0) {
|
if (playerSaveInterval > 0) {
|
||||||
this.playerList.saveAll(playerSaveInterval);
|
this.playerList.saveAll(playerSaveInterval);
|
||||||
@@ -74,7 +74,7 @@ index 2359c5b49e4457cc36239289f203df16767a4341..68c3b0496738ed4fcb02204c5c882fd7
|
|||||||
}
|
}
|
||||||
for (final ServerLevel level : (region == null ? this.getAllLevels() : Arrays.asList(region.world))) { // Folia - region threading
|
for (final ServerLevel level : (region == null ? this.getAllLevels() : Arrays.asList(region.world))) { // Folia - region threading
|
||||||
if (level.paperConfig().chunks.autoSaveInterval.value() > 0) {
|
if (level.paperConfig().chunks.autoSaveInterval.value() > 0) {
|
||||||
@@ -2026,6 +2034,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2021,6 +2029,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
public void tickConnection() {
|
public void tickConnection() {
|
||||||
this.getConnection().tick();
|
this.getConnection().tick();
|
||||||
@@ -82,7 +82,7 @@ index 2359c5b49e4457cc36239289f203df16767a4341..68c3b0496738ed4fcb02204c5c882fd7
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void synchronizeTime(ServerLevel level) {
|
private void synchronizeTime(ServerLevel level) {
|
||||||
@@ -3160,6 +3169,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -3155,6 +3164,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return this.debugSubscribers;
|
return this.debugSubscribers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ index fdccb06c918d387e46c29ede7337159db8c5d9ca..4cd5c5659ac098c3b7ff95efb94b1987
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 87bb2715eb4c2fd41537e020ba7fa8cce1591a0f..1837ca833939b8c59b05c03313bec7b02bc85151 100644
|
index f5bf8ed6e741823078ab93eac47636fcebcdfe2d..14516c3ebd092e6f230804145a60dc851f34230b 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -220,6 +220,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -220,6 +220,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@@ -312,7 +312,7 @@ index 87bb2715eb4c2fd41537e020ba7fa8cce1591a0f..1837ca833939b8c59b05c03313bec7b0
|
|||||||
ServerLevel.this.updateSleepingPlayerList();
|
ServerLevel.this.updateSleepingPlayerList();
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 482ca8764c00838dfa8b555a7614d7f306f466db..c5d13b60029f27162df445b31b9db94e225ce894 100644
|
index f0d45cb70af62b747c9235941f3fc45221b3b8e6..132645758827ee4d332909e701dde24e69699beb 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -227,7 +227,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -227,7 +227,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -505,39 +505,11 @@ index 0d322ef4aa3e70c9edbb9fa8ba368bef916eb93d..3a5319739f0687fc6f09b2ac8ee31716
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ServerPlayer getPlayer(String name) {
|
public @Nullable ServerPlayer getPlayer(String name) {
|
||||||
diff --git a/net/minecraft/server/waypoints/ServerWaypointManager.java b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
index bd1d4a832eec4c89a7f8bdd5d066b6074f206d81..d7224c2297eb5d580349da3b2770895fba6c3e08 100644
|
|
||||||
--- a/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
+++ b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
|
||||||
@@ -24,6 +24,11 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
|
||||||
public void trackWaypoint(WaypointTransmitter waypoint) {
|
|
||||||
// Lophine start - unsafe waypoint bar
|
|
||||||
if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ // Leaves start - fakeplayer
|
|
||||||
+ if (waypoint instanceof org.leavesmc.leaves.bot.ServerBot bot && !bot.getConfigValue(org.leavesmc.leaves.bot.agent.Configs.ENABLE_LOCATOR_BAR)) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - fakeplayer
|
|
||||||
this.waypoints.add(waypoint);
|
|
||||||
|
|
||||||
for (ServerPlayer serverPlayer : this.players) {
|
|
||||||
@@ -63,6 +68,11 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
|
||||||
// Folia - region threading
|
|
||||||
// Lophine start - unsafe waypoint bar
|
|
||||||
if (!fun.bm.lophine.config.modules.experiment.CommandConfig.waypoint) return;
|
|
||||||
+ // Leaves start - fakeplayer
|
|
||||||
+ if (player instanceof org.leavesmc.leaves.bot.ServerBot) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - fakeplayer
|
|
||||||
this.players.add(player);
|
|
||||||
|
|
||||||
for (WaypointTransmitter waypointTransmitter : this.waypoints) {
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 8043b5f24e09e2c96afe14b5ab6978c0b85d744c..df4f5e724673edda7fe46a826a77d0365b40b1f7 100644
|
index 32299faedd89a848ca00288672ce85cad707dca0..3e44a61bd982dc822437f647a02a95affd988cdb 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1252,7 +1252,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
@@ -1235,7 +1235,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
|
|
||||||
BlockPos onPosLegacy = this.getOnPosLegacy();
|
BlockPos onPosLegacy = this.getOnPosLegacy();
|
||||||
BlockState blockState = this.level().getBlockState(onPosLegacy);
|
BlockState blockState = this.level().getBlockState(onPosLegacy);
|
||||||
@@ -546,7 +518,7 @@ index 8043b5f24e09e2c96afe14b5ab6978c0b85d744c..df4f5e724673edda7fe46a826a77d036
|
|||||||
this.checkFallDamage(vec3.y, this.onGround(), blockState, onPosLegacy);
|
this.checkFallDamage(vec3.y, this.onGround(), blockState, onPosLegacy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1587,7 +1587,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
@@ -1570,7 +1570,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
@@ -556,7 +528,7 @@ index 8043b5f24e09e2c96afe14b5ab6978c0b85d744c..df4f5e724673edda7fe46a826a77d036
|
|||||||
final boolean yZero = movement.y == 0.0;
|
final boolean yZero = movement.y == 0.0;
|
||||||
final boolean zZero = movement.z == 0.0;
|
final boolean zZero = movement.z == 0.0;
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index fa6ed83a69aafee57195f1b512481c401ade7b09..97b0f407306e978a506225684ac0a5aeef1d6b3f 100644
|
index 3fe9afe55b4d61db8030479d3d74b8656679cb10..c0ebd700caa950948c58846eaf164afc14f87f09 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3319,7 +3319,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -3319,7 +3319,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
+1
-1
@@ -9,7 +9,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index c5d13b60029f27162df445b31b9db94e225ce894..cdf0543014a92de7d5181bcc81f828e8b11037b1 100644
|
index 132645758827ee4d332909e701dde24e69699beb..3efce8ae3cba85019aea7453f97a72939baef7f6 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1451,7 +1451,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1451,7 +1451,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
+9
-9
@@ -84,10 +84,10 @@ index af71e0e1eb1c93745f3e4954ecc8fbd2ad4808a3..f3829564681faff3ae8971ed90b947b4
|
|||||||
players.add(serverPlayer1);
|
players.add(serverPlayer1);
|
||||||
if (players.size() >= resultLimit) {
|
if (players.size() >= resultLimit) {
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 68c3b0496738ed4fcb02204c5c882fd722397648..72824013c313b7ada8dc86d9f2ff55a296fb6ac8 100644
|
index dfcf8eb7dc422a55d94d6eb9eb1451c7c14a1d56..9130f1fbf15500f2149418b73ae2a374bba22eee 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1901,7 +1901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1896,7 +1896,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
private ServerStatus.Players buildPlayerStatus() {
|
private ServerStatus.Players buildPlayerStatus() {
|
||||||
@@ -96,7 +96,7 @@ index 68c3b0496738ed4fcb02204c5c882fd722397648..72824013c313b7ada8dc86d9f2ff55a2
|
|||||||
int maxPlayers = this.getMaxPlayers();
|
int maxPlayers = this.getMaxPlayers();
|
||||||
if (this.hidesOnlinePlayers()) {
|
if (this.hidesOnlinePlayers()) {
|
||||||
return new ServerStatus.Players(maxPlayers, players.size(), List.of());
|
return new ServerStatus.Players(maxPlayers, players.size(), List.of());
|
||||||
@@ -2110,7 +2110,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2105,7 +2105,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPlayerCount() {
|
public int getPlayerCount() {
|
||||||
@@ -105,7 +105,7 @@ index 68c3b0496738ed4fcb02204c5c882fd722397648..72824013c313b7ada8dc86d9f2ff55a2
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String[] getPlayerNames() {
|
public String[] getPlayerNames() {
|
||||||
@@ -2314,7 +2314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2309,7 +2309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
} else {
|
} else {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ index 68c3b0496738ed4fcb02204c5c882fd722397648..72824013c313b7ada8dc86d9f2ff55a2
|
|||||||
serverPlayer.getBukkitEntity().taskScheduler.schedule((ServerPlayer player) -> { // Folia - region threading
|
serverPlayer.getBukkitEntity().taskScheduler.schedule((ServerPlayer player) -> { // Folia - region threading
|
||||||
// Paper start - Expand PlayerGameModeChangeEvent
|
// Paper start - Expand PlayerGameModeChangeEvent
|
||||||
org.bukkit.event.player.PlayerGameModeChangeEvent event = player.setGameMode(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, null); // Folia - region threading
|
org.bukkit.event.player.PlayerGameModeChangeEvent event = player.setGameMode(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, null); // Folia - region threading
|
||||||
@@ -2499,7 +2499,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2494,7 +2494,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||||
// Paper start - we don't need to save everything, just advancements
|
// Paper start - we don't need to save everything, just advancements
|
||||||
// this.getPlayerList().saveAll();
|
// this.getPlayerList().saveAll();
|
||||||
@@ -123,7 +123,7 @@ index 68c3b0496738ed4fcb02204c5c882fd722397648..72824013c313b7ada8dc86d9f2ff55a2
|
|||||||
player.getAdvancements().save();
|
player.getAdvancements().save();
|
||||||
}
|
}
|
||||||
// Paper end - we don't need to save everything, just advancements
|
// Paper end - we don't need to save everything, just advancements
|
||||||
@@ -2637,7 +2637,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2632,7 +2632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
PlayerList playerList = this.getPlayerList();
|
PlayerList playerList = this.getPlayerList();
|
||||||
UserWhiteList whiteList = playerList.getWhiteList();
|
UserWhiteList whiteList = playerList.getWhiteList();
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ index 5a8cd3e6b448a4472092690cf589bca10b142126..158593b1a6384db635a1f224919b24c1
|
|||||||
|
|
||||||
this.setListData(list);
|
this.setListData(list);
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 1837ca833939b8c59b05c03313bec7b02bc85151..a1279303993ffed6ef5ba4ec86668ad845596318 100644
|
index 14516c3ebd092e6f230804145a60dc851f34230b..bd33a381490ec3f03af9d22c9337f5d686014d85 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -2972,7 +2972,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2972,7 +2972,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@@ -306,7 +306,7 @@ index 1837ca833939b8c59b05c03313bec7b02bc85151..a1279303993ffed6ef5ba4ec86668ad8
|
|||||||
}
|
}
|
||||||
// Leaves end - skip
|
// Leaves end - skip
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index cdf0543014a92de7d5181bcc81f828e8b11037b1..b28eaeec3204596b0b00c47241cb6fdaeb379af3 100644
|
index 3efce8ae3cba85019aea7453f97a72939baef7f6..0741dc695c0b22a6edd9a51a9dcdec0cdd545326 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -202,7 +202,7 @@ import org.jspecify.annotations.Nullable;
|
@@ -202,7 +202,7 @@ import org.jspecify.annotations.Nullable;
|
||||||
@@ -553,7 +553,7 @@ index 36cd1a0307ff1a734eb5f4f3cc013781692e7ad8..0c3e6c1f70289c63bfe424a49374602f
|
|||||||
// Leaves end - fakeplayer support
|
// Leaves end - fakeplayer support
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 97b0f407306e978a506225684ac0a5aeef1d6b3f..0e019e3b870c9a2fc1ed788d444c3e2be2a2b5f2 100644
|
index c0ebd700caa950948c58846eaf164afc14f87f09..e4ae4354e81f34f0db410333fc9b8e17383a5f41 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -262,7 +262,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -262,7 +262,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
+7
-7
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/network/PacketProcessor.java b/net/minecraft/network/PacketProcessor.java
|
diff --git a/net/minecraft/network/PacketProcessor.java b/net/minecraft/network/PacketProcessor.java
|
||||||
index e07e5eced7e32d1c3a0ac14e8639c1f19b0f641a..fe7483581e5c3f5cb523601b394750a94a178e10 100644
|
index cf162ec136309d05c5aa03042652ab3932935917..469ffd54eb5af980f49061bbec0a72f4e888f8a3 100644
|
||||||
--- a/net/minecraft/network/PacketProcessor.java
|
--- a/net/minecraft/network/PacketProcessor.java
|
||||||
+++ b/net/minecraft/network/PacketProcessor.java
|
+++ b/net/minecraft/network/PacketProcessor.java
|
||||||
@@ -107,7 +107,20 @@ public class PacketProcessor implements AutoCloseable {
|
@@ -107,7 +107,20 @@ public class PacketProcessor implements AutoCloseable {
|
||||||
@@ -46,10 +46,10 @@ index ab80a66646a7ebe2862221ac342b06c14fcfc734..7834f3da4d0ff4a5cdec46b023d73483
|
|||||||
fillCrashReport(reportedException.getReport(), packetListener, packet);
|
fillCrashReport(reportedException.getReport(), packetListener, packet);
|
||||||
return reportedException;
|
return reportedException;
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 72824013c313b7ada8dc86d9f2ff55a296fb6ac8..901b4095d09cca10f6df64103d09322b8fce773b 100644
|
index 9130f1fbf15500f2149418b73ae2a374bba22eee..eef40103bcec3b836ffb50154fb05926b9757723 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1980,11 +1980,27 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1975,11 +1975,27 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
try {
|
try {
|
||||||
profiler.startTimer(serverLevel.tickTimerId); try { // Folia - profiler
|
profiler.startTimer(serverLevel.tickTimerId); try { // Folia - profiler
|
||||||
serverLevel.tick(hasTimeLeft, region); // Folia - region threading
|
serverLevel.tick(hasTimeLeft, region); // Folia - region threading
|
||||||
@@ -81,7 +81,7 @@ index 72824013c313b7ada8dc86d9f2ff55a296fb6ac8..901b4095d09cca10f6df64103d09322b
|
|||||||
|
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index a1279303993ffed6ef5ba4ec86668ad845596318..387709d4475eda2195f409a9f6d76706059341bd 100644
|
index bd33a381490ec3f03af9d22c9337f5d686014d85..284bd9703b11804f51273ecfaa5cd44925726f5f 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -894,7 +894,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -894,7 +894,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@@ -107,7 +107,7 @@ index a1279303993ffed6ef5ba4ec86668ad845596318..387709d4475eda2195f409a9f6d76706
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index b28eaeec3204596b0b00c47241cb6fdaeb379af3..03ed32f9be1c7c1b5ed81a288fd40d267eddc038 100644
|
index 0741dc695c0b22a6edd9a51a9dcdec0cdd545326..3fc09529159d202ce6201626be535d791818fa4a 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1108,6 +1108,12 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1108,6 +1108,12 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -124,10 +124,10 @@ index b28eaeec3204596b0b00c47241cb6fdaeb379af3..03ed32f9be1c7c1b5ed81a288fd40d26
|
|||||||
CrashReport crashReport = CrashReport.forThrowable(var4, "Ticking player");
|
CrashReport crashReport = CrashReport.forThrowable(var4, "Ticking player");
|
||||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Player being ticked");
|
CrashReportCategory crashReportCategory = crashReport.addCategory("Player being ticked");
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index df4f5e724673edda7fe46a826a77d0365b40b1f7..90611f89bfd8e21e14e4b9095a0154a5f6972a4b 100644
|
index 3e44a61bd982dc822437f647a02a95affd988cdb..28ae21b08e42edcc031ace2404b9d213589c28e8 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1444,9 +1444,19 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
@@ -1427,9 +1427,19 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
this.walkingStepSound(pos, state);
|
this.walkingStepSound(pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -27,7 +27,7 @@ index 56e09b99c2901882483c5f2b3216bf0a11406e2e..1480bd04597001cd7c54e53ded46d7f7
|
|||||||
this.wireHandler = new alternate.current.wire.WireHandler(world);
|
this.wireHandler = new alternate.current.wire.WireHandler(world);
|
||||||
this.turbo = new io.papermc.paper.redstone.RedstoneWireTurbo((RedStoneWireBlock)Blocks.REDSTONE_WIRE);
|
this.turbo = new io.papermc.paper.redstone.RedstoneWireTurbo((RedStoneWireBlock)Blocks.REDSTONE_WIRE);
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 387709d4475eda2195f409a9f6d76706059341bd..1f1dfc897dd826c2d14a9cb9db99c27e884c37a8 100644
|
index 284bd9703b11804f51273ecfaa5cd44925726f5f..9756caff0b7403c212987e58c08a2da09bdeb962 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -927,12 +927,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -927,12 +927,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
+1
-1
@@ -97,7 +97,7 @@ index f4c9c551fc39bae38e283ccbbc3cd116f0536a64..db13211b24208d8addd3c210155bc244
|
|||||||
NaturalSpawner.spawnForChunk(this.level, chunk, spawnState, spawnCategories);
|
NaturalSpawner.spawnForChunk(this.level, chunk, spawnState, spawnCategories);
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 1f1dfc897dd826c2d14a9cb9db99c27e884c37a8..e9a995ce1d8835c29d6c1eb331efcb5123ac5c38 100644
|
index 9756caff0b7403c212987e58c08a2da09bdeb962..4acd4718628b160c482b04da6ba905687b61bbad 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -765,6 +765,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -765,6 +765,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
+1
-1
@@ -5,7 +5,7 @@ Subject: [PATCH] Add removed check before all checks start in addEffect
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 0e019e3b870c9a2fc1ed788d444c3e2be2a2b5f2..4f7cf7c51dc47acdd29d45f571636dc77c6c006f 100644
|
index e4ae4354e81f34f0db410333fc9b8e17383a5f41..fc8833655102ca98bb331782a624af79cbef414f 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -1186,6 +1186,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -1186,6 +1186,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
package fun.bm.lophine.config.modules.optimizations;
|
|
||||||
|
|
||||||
import me.earthme.luminol.config.IConfigModule;
|
|
||||||
import me.earthme.luminol.config.flags.ConfigClassInfo;
|
|
||||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
|
||||||
import me.earthme.luminol.config.flags.HotReloadUnsupported;
|
|
||||||
import me.earthme.luminol.enums.EnumConfigCategory;
|
|
||||||
|
|
||||||
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "waypoint")
|
|
||||||
public class WayPointOptimizedTableConfig implements IConfigModule {
|
|
||||||
@HotReloadUnsupported
|
|
||||||
@ConfigInfo(name = "optimizedTable", comments = """
|
|
||||||
Should use optimized table instead of normal concurrent table for waypoints.
|
|
||||||
May improve performance when there are many waypoints and players.
|
|
||||||
When enabled, more memory is needed to store data.""")
|
|
||||||
public static boolean optimizedTable = false;
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
|||||||
|
|
||||||
@ConfigClassInfo(category = EnumConfigCategory.REMOVED, name = "removed_config")
|
@ConfigClassInfo(category = EnumConfigCategory.REMOVED, name = "removed_config")
|
||||||
public class RemovedConfig implements IConfigModule {
|
public class RemovedConfig implements IConfigModule {
|
||||||
|
@TransformedConfig(name = "optimizedTable", directory = {"optimizations", "waypoint"}, transform = false)
|
||||||
@TransformedConfig(name = "enabled", directory = {"fixes", "end-void-ring"}, transform = false)
|
@TransformedConfig(name = "enabled", directory = {"fixes", "end-void-ring"}, transform = false)
|
||||||
@TransformedConfig(name = "enabled", directory = {"gameplay", "end_void_rings"}, transform = false)
|
@TransformedConfig(name = "enabled", directory = {"gameplay", "end_void_rings"}, transform = false)
|
||||||
@TransformedConfig(name = "datapack_command_enabled", directory = {"experiment", "command"}, transform = false)
|
@TransformedConfig(name = "datapack_command_enabled", directory = {"experiment", "command"}, transform = false)
|
||||||
|
|||||||
-38
@@ -1,38 +0,0 @@
|
|||||||
package fun.bm.lophine.utils.concurrent;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public abstract class AbstractConcurrentTable<X, Y, Z> {
|
|
||||||
public abstract void putOrUpdate(X x, Y y, Z z);
|
|
||||||
|
|
||||||
public abstract void put(X x, Y y, Z z);
|
|
||||||
|
|
||||||
public abstract void remove(X x, Y y, Z z);
|
|
||||||
|
|
||||||
public abstract List<Z> getZ(X x, Y y);
|
|
||||||
|
|
||||||
public abstract List<Y> getY(X x, Z z);
|
|
||||||
|
|
||||||
public abstract List<X> getX(Y y, Z z);
|
|
||||||
|
|
||||||
public abstract List<Map.Entry<X, Y>> getXY(Z z);
|
|
||||||
|
|
||||||
public abstract List<Map.Entry<Y, Z>> getYZ(X x);
|
|
||||||
|
|
||||||
public abstract List<Map.Entry<X, Z>> getXZ(Y y);
|
|
||||||
|
|
||||||
public abstract List<X> getAllX();
|
|
||||||
|
|
||||||
public abstract List<Y> getAllY();
|
|
||||||
|
|
||||||
public abstract List<Z> getAllZ();
|
|
||||||
|
|
||||||
public abstract void clearXY(Z z);
|
|
||||||
|
|
||||||
public abstract void clearYZ(X x);
|
|
||||||
|
|
||||||
public abstract void clearXZ(Y y);
|
|
||||||
|
|
||||||
public abstract void clearAll();
|
|
||||||
}
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
package fun.bm.lophine.utils.concurrent;
|
|
||||||
|
|
||||||
import java.util.AbstractMap;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class ConcurrentTable<X, Y, Z> extends AbstractConcurrentTable<X, Y, Z> {
|
|
||||||
protected final ConcurrentLinkedDeque<TableEntry<X, Y, Z>> data = new ConcurrentLinkedDeque<>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void putOrUpdate(X x, Y y, Z z) {
|
|
||||||
for (TableEntry<X, Y, Z> entry : data) {
|
|
||||||
if (entry.getX().equals(x) && entry.getY().equals(y)) {
|
|
||||||
entry.setZ(z);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.put(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void put(X x, Y y, Z z) {
|
|
||||||
data.add(new TableEntry<>(x, y, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void remove(X x, Y y, Z z) {
|
|
||||||
data.removeIf(entry -> entry.getX().equals(x) && entry.getY().equals(y) && entry.getZ().equals(z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Z> getZ(X x, Y y) {
|
|
||||||
return filterAndCollect(
|
|
||||||
entry -> entry.getX().equals(x) && entry.getY().equals(y),
|
|
||||||
TableEntry::getZ
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Y> getY(X x, Z z) {
|
|
||||||
return filterAndCollect(
|
|
||||||
entry -> entry.getX().equals(x) && entry.getZ().equals(z),
|
|
||||||
TableEntry::getY
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<X> getX(Y y, Z z) {
|
|
||||||
return filterAndCollect(
|
|
||||||
entry -> entry.getY().equals(y) && entry.getZ().equals(z),
|
|
||||||
TableEntry::getX
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<X, Y>> getXY(Z z) {
|
|
||||||
return filterAndMap(
|
|
||||||
entry -> entry.getZ().equals(z),
|
|
||||||
TableEntry::getX,
|
|
||||||
TableEntry::getY
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<Y, Z>> getYZ(X x) {
|
|
||||||
return filterAndMap(
|
|
||||||
entry -> entry.getX().equals(x),
|
|
||||||
TableEntry::getY,
|
|
||||||
TableEntry::getZ
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<X, Z>> getXZ(Y y) {
|
|
||||||
return filterAndMap(
|
|
||||||
entry -> entry.getY().equals(y),
|
|
||||||
TableEntry::getX,
|
|
||||||
TableEntry::getZ
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<X> getAllX() {
|
|
||||||
return collectAll(TableEntry::getX);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Y> getAllY() {
|
|
||||||
return collectAll(TableEntry::getY);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Z> getAllZ() {
|
|
||||||
return collectAll(TableEntry::getZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearXY(Z z) {
|
|
||||||
data.removeIf(entry -> entry.getZ().equals(z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearYZ(X x) {
|
|
||||||
data.removeIf(entry -> entry.getX().equals(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearXZ(Y y) {
|
|
||||||
data.removeIf(entry -> entry.getY().equals(y));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearAll() {
|
|
||||||
data.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> List<T> filterAndCollect(Predicate<TableEntry<X, Y, Z>> filter,
|
|
||||||
java.util.function.Function<TableEntry<X, Y, Z>, T> mapper) {
|
|
||||||
List<T> result = new ArrayList<>();
|
|
||||||
for (TableEntry<X, Y, Z> entry : data) {
|
|
||||||
if (filter.test(entry)) {
|
|
||||||
result.add(mapper.apply(entry));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private <K, V> List<Map.Entry<K, V>> filterAndMap(Predicate<TableEntry<X, Y, Z>> filter,
|
|
||||||
java.util.function.Function<TableEntry<X, Y, Z>, K> keyMapper,
|
|
||||||
java.util.function.Function<TableEntry<X, Y, Z>, V> valueMapper) {
|
|
||||||
List<Map.Entry<K, V>> list = new ArrayList<>();
|
|
||||||
for (TableEntry<X, Y, Z> entry : data) {
|
|
||||||
if (filter.test(entry)) {
|
|
||||||
list.add(new AbstractMap.SimpleEntry<>(keyMapper.apply(entry), valueMapper.apply(entry)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> List<T> collectAll(java.util.function.Function<TableEntry<X, Y, Z>, T> mapper) {
|
|
||||||
List<T> result = new ArrayList<>();
|
|
||||||
for (TableEntry<X, Y, Z> entry : data) {
|
|
||||||
result.add(mapper.apply(entry));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-197
@@ -1,197 +0,0 @@
|
|||||||
package fun.bm.lophine.utils.concurrent;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.function.BiFunction;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class OptimizedConcurrentTable<X, Y, Z> extends ConcurrentTable<X, Y, Z> {
|
|
||||||
private final ConcurrentHashMap<X, ConcurrentHashMap<Y, Set<Z>>> xyIndex = new ConcurrentHashMap<>();
|
|
||||||
private final ConcurrentHashMap<Y, ConcurrentHashMap<Z, Set<X>>> yzIndex = new ConcurrentHashMap<>();
|
|
||||||
private final ConcurrentHashMap<Z, ConcurrentHashMap<X, Set<Y>>> zxIndex = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void putOrUpdate(X x, Y y, Z z) {
|
|
||||||
boolean updated = false;
|
|
||||||
|
|
||||||
for (TableEntry<X, Y, Z> entry : data) {
|
|
||||||
if (entry.getX().equals(x) && entry.getY().equals(y)) {
|
|
||||||
removeFromIndex(xyIndex, entry.getX(), entry.getY(), entry.getZ());
|
|
||||||
removeFromIndex(yzIndex, entry.getY(), entry.getZ(), entry.getX());
|
|
||||||
removeFromIndex(zxIndex, entry.getZ(), entry.getX(), entry.getY());
|
|
||||||
|
|
||||||
entry.setZ(z);
|
|
||||||
|
|
||||||
putData(x, y, z);
|
|
||||||
|
|
||||||
updated = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!updated) {
|
|
||||||
this.put(x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void putData(X x, Y y, Z z) {
|
|
||||||
xyIndex.computeIfAbsent(x, k -> new ConcurrentHashMap<>())
|
|
||||||
.computeIfAbsent(y, k -> ConcurrentHashMap.newKeySet()).add(z);
|
|
||||||
yzIndex.computeIfAbsent(y, k -> new ConcurrentHashMap<>())
|
|
||||||
.computeIfAbsent(z, k -> ConcurrentHashMap.newKeySet()).add(x);
|
|
||||||
zxIndex.computeIfAbsent(z, k -> new ConcurrentHashMap<>())
|
|
||||||
.computeIfAbsent(x, k -> ConcurrentHashMap.newKeySet()).add(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void put(X x, Y y, Z z) {
|
|
||||||
super.put(x, y, z);
|
|
||||||
putData(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void remove(X x, Y y, Z z) {
|
|
||||||
super.remove(x, y, z);
|
|
||||||
removeFromIndex(xyIndex, x, y, z);
|
|
||||||
removeFromIndex(yzIndex, y, z, x);
|
|
||||||
removeFromIndex(zxIndex, z, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
private <K, V, T> void removeFromIndex(ConcurrentHashMap<K, ConcurrentHashMap<V, Set<T>>> index,
|
|
||||||
K key1, V key2, T value) {
|
|
||||||
index.computeIfPresent(key1, (k, map) -> {
|
|
||||||
map.computeIfPresent(key2, (k2, set) -> {
|
|
||||||
set.remove(value);
|
|
||||||
return set.isEmpty() ? null : set;
|
|
||||||
});
|
|
||||||
return map.isEmpty() ? null : map;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeAll(Predicate<TableEntry<X, Y, Z>> predicate) {
|
|
||||||
data.removeIf(entry -> {
|
|
||||||
boolean shouldRemove = predicate.test(entry);
|
|
||||||
if (shouldRemove) {
|
|
||||||
removeFromIndex(xyIndex, entry.getX(), entry.getY(), entry.getZ());
|
|
||||||
removeFromIndex(yzIndex, entry.getY(), entry.getZ(), entry.getX());
|
|
||||||
removeFromIndex(zxIndex, entry.getZ(), entry.getX(), entry.getY());
|
|
||||||
}
|
|
||||||
return shouldRemove;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean putIfAbsent(X x, Y y, Z z) {
|
|
||||||
if (data.stream().anyMatch(entry ->
|
|
||||||
Objects.equals(entry.getX(), x) &&
|
|
||||||
Objects.equals(entry.getY(), y) &&
|
|
||||||
Objects.equals(entry.getZ(), z))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
put(x, y, z);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Z> getZ(X x, Y y) {
|
|
||||||
Set<Z> result = xyIndex.getOrDefault(x, new ConcurrentHashMap<>()).get(y);
|
|
||||||
return result != null ? new ArrayList<>(result) : new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Y> getY(X x, Z z) {
|
|
||||||
Set<Y> result = zxIndex.getOrDefault(z, new ConcurrentHashMap<>()).get(x);
|
|
||||||
return result != null ? new ArrayList<>(result) : new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<X> getX(Y y, Z z) {
|
|
||||||
Set<X> result = yzIndex.getOrDefault(y, new ConcurrentHashMap<>()).get(z);
|
|
||||||
return result != null ? new ArrayList<>(result) : new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<X, Y>> getXY(Z z) {
|
|
||||||
return buildDataFromIndex(zxIndex.get(z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<Y, Z>> getYZ(X x) {
|
|
||||||
return buildDataFromIndex(xyIndex.get(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map.Entry<X, Z>> getXZ(Y y) {
|
|
||||||
return reverseDataFromIndex(yzIndex.get(y));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<X> getAllX() {
|
|
||||||
Set<X> resultSet = new HashSet<>(xyIndex.keySet());
|
|
||||||
return new ArrayList<>(resultSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Y> getAllY() {
|
|
||||||
Set<Y> resultSet = new HashSet<>(yzIndex.keySet());
|
|
||||||
return new ArrayList<>(resultSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Z> getAllZ() {
|
|
||||||
Set<Z> resultSet = new HashSet<>(zxIndex.keySet());
|
|
||||||
return new ArrayList<>(resultSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearXY(Z z) {
|
|
||||||
super.clearXY(z);
|
|
||||||
zxIndex.remove(z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearYZ(X x) {
|
|
||||||
super.clearYZ(x);
|
|
||||||
xyIndex.remove(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearXZ(Y y) {
|
|
||||||
super.clearXZ(y);
|
|
||||||
yzIndex.remove(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearAll() {
|
|
||||||
super.clearAll();
|
|
||||||
xyIndex.clear();
|
|
||||||
yzIndex.clear();
|
|
||||||
zxIndex.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private <K, V, R> List<R> buildEntriesFromIndex(ConcurrentHashMap<K, Set<V>> indexMap,
|
|
||||||
BiFunction<K, V, R> entryCreator) {
|
|
||||||
List<R> result = new ArrayList<>();
|
|
||||||
if (indexMap != null) {
|
|
||||||
for (Map.Entry<K, Set<V>> entry : indexMap.entrySet()) {
|
|
||||||
K key = entry.getKey();
|
|
||||||
Set<V> valueSet = entry.getValue();
|
|
||||||
if (valueSet != null && !valueSet.isEmpty()) {
|
|
||||||
for (V value : valueSet) {
|
|
||||||
result.add(entryCreator.apply(key, value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private <K, V> List<Map.Entry<K, V>> buildDataFromIndex(ConcurrentHashMap<K, Set<V>> indexMap) {
|
|
||||||
return buildEntriesFromIndex(indexMap, AbstractMap.SimpleEntry::new);
|
|
||||||
}
|
|
||||||
|
|
||||||
private <K, V> List<Map.Entry<V, K>> reverseDataFromIndex(ConcurrentHashMap<K, Set<V>> indexMap) {
|
|
||||||
return buildEntriesFromIndex(indexMap, (key, value) -> new AbstractMap.SimpleEntry<>(value, key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package fun.bm.lophine.utils.concurrent;
|
|
||||||
|
|
||||||
public class TableEntry<X, Y, Z> {
|
|
||||||
private final X x;
|
|
||||||
private final Y y;
|
|
||||||
private Z z;
|
|
||||||
|
|
||||||
public TableEntry(X x, Y y, Z z) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public X getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Y getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Z getZ() {
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setZ(Z z) {
|
|
||||||
this.z = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-1
@@ -21,6 +21,7 @@ import com.mojang.brigadier.arguments.BoolArgumentType;
|
|||||||
import fun.bm.lophine.LophineLogger;
|
import fun.bm.lophine.LophineLogger;
|
||||||
import fun.bm.lophine.config.modules.experiment.CommandConfig;
|
import fun.bm.lophine.config.modules.experiment.CommandConfig;
|
||||||
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
|
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
|
||||||
|
import me.earthme.luminol.utils.FoliaServerWaypointManager;
|
||||||
import me.earthme.luminol.utils.NullPlugin;
|
import me.earthme.luminol.utils.NullPlugin;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.server.waypoints.ServerWaypointManager;
|
import net.minecraft.server.waypoints.ServerWaypointManager;
|
||||||
@@ -53,7 +54,7 @@ public class LocatorBarConfig extends AbstractBotConfig<Boolean, LocatorBarConfi
|
|||||||
}
|
}
|
||||||
if (this.bot != null) {
|
if (this.bot != null) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
ServerWaypointManager manager = this.bot.level().getWaypointManager();
|
FoliaServerWaypointManager manager = this.bot.level().getWaypointManager(); // Lophine - waypoint for adapt of luminol ver
|
||||||
if (value) {
|
if (value) {
|
||||||
manager.trackWaypoint(this.bot);
|
manager.trackWaypoint(this.bot);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user