mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
rename packages from space to org
This commit is contained in:
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -4,5 +4,5 @@ contact_links:
|
|||||||
url: https://discord.gg/PrKTKfR579
|
url: https://discord.gg/PrKTKfR579
|
||||||
about: If you are having issues, come ask us on our Discord server!
|
about: If you are having issues, come ask us on our Discord server!
|
||||||
- name: DivineMC Docs
|
- name: DivineMC Docs
|
||||||
url: https://docs.bx-team.space/divinemc
|
url: https://docs.bxteam.org/documentation/divinemc/about
|
||||||
about: You can find some info at our docs
|
about: You can find some info at our docs
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -36,7 +36,7 @@ All other files are licensed under MIT.
|
|||||||
[](https://bstats.org/plugin/server-implementation/DivineMC)
|
[](https://bstats.org/plugin/server-implementation/DivineMC)
|
||||||
|
|
||||||
## API
|
## API
|
||||||
### [Javadoc](https://repo.bx-team.space/javadoc/snapshots/space/bxteam/divinemc/divinemc-api/1.21.4-R0.1-SNAPSHOT)
|
### [Javadoc](https://repo.bxteam.org/javadoc/snapshots/org/bxteam/divinemc/divinemc-api/1.21.4-R0.1-SNAPSHOT)
|
||||||
|
|
||||||
### Dependency Information
|
### Dependency Information
|
||||||
|
|
||||||
@@ -44,12 +44,12 @@ All other files are licensed under MIT.
|
|||||||
```xml
|
```xml
|
||||||
<repository>
|
<repository>
|
||||||
<id>bx-team</id>
|
<id>bx-team</id>
|
||||||
<url>https://repo.bx-team.space/snapshots</url>
|
<url>https://repo.bxteam.org/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
```
|
```
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>space.bxteam.divinemc</groupId>
|
<groupId>org.bxteam.divinemc</groupId>
|
||||||
<artifactId>divinemc-api</artifactId>
|
<artifactId>divinemc-api</artifactId>
|
||||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
@@ -59,12 +59,12 @@ All other files are licensed under MIT.
|
|||||||
#### Gradle
|
#### Gradle
|
||||||
```groovy
|
```groovy
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://repo.bx-team.space/snapshots")
|
maven("https://repo.bxteam.org/snapshots")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("space.bxteam.divinemc:divinemc-api:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.bxteam.divinemc:divinemc-api:1.21.4-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ First, clone this repository (do not download it) and the run the following comm
|
|||||||
After that, project is ready to use and editing it.
|
After that, project is ready to use and editing it.
|
||||||
|
|
||||||
### Creating a patch
|
### Creating a patch
|
||||||
Patches are effectively just commits in either `paper-api`, `paper-server`, `purpur-api`, `purpur-server` or `divinemc-server`. If you want to learn how to work with patch system, you can read our [contributing documentation](https://docs.bx-team.space/documentation/divinemc/development/contributing).
|
Patches are effectively just commits in either `paper-api`, `paper-server`, `purpur-api`, `purpur-server` or `divinemc-server`. If you want to learn how to work with patch system, you can read our [contributing documentation](https://docs.bxteam.org/documentation/divinemc/development/contributing).
|
||||||
|
|
||||||
### Compiling
|
### Compiling
|
||||||
Use the command `./gradlew build` to build the API and server. Compiled JARs will be placed under `divinemc-api/build/libs` and `divinemc-server/build/libs`. **These JARs are not used to start a server**.
|
Use the command `./gradlew build` to build the API and server. Compiled JARs will be placed under `divinemc-api/build/libs` and `divinemc-server/build/libs`. **These JARs are not used to start a server**.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] DivineMC Configuration
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index db82329935145ec12fa47eef730613ee9c7666ee..7362e0244cdeca7c59cb0ee855bb83e08006dd57 100644
|
index db82329935145ec12fa47eef730613ee9c7666ee..0eecc41b02f205022a717691a18114d5c091bc3d 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -243,6 +243,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -243,6 +243,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -15,26 +15,26 @@ index db82329935145ec12fa47eef730613ee9c7666ee..7362e0244cdeca7c59cb0ee855bb83e0
|
|||||||
+
|
+
|
||||||
+ // DivineMC start - DivineMC configuration
|
+ // DivineMC start - DivineMC configuration
|
||||||
+ try {
|
+ try {
|
||||||
+ space.bxteam.divinemc.configuration.DivineConfig.init((java.io.File) options.valueOf("divinemc-settings"));
|
+ org.bxteam.divinemc.configuration.DivineConfig.init((java.io.File) options.valueOf("divinemc-settings"));
|
||||||
+ } catch (Exception e) {
|
+ } catch (Exception e) {
|
||||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ space.bxteam.divinemc.command.DivineCommands.registerCommands(this); // DivineMC - register commands
|
+ org.bxteam.divinemc.command.DivineCommands.registerCommands(this); // DivineMC - register commands
|
||||||
+ // DivineMC end - DivineMC configuration
|
+ // DivineMC end - DivineMC configuration
|
||||||
+
|
+
|
||||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
|
|
||||||
this.setPvpAllowed(properties.pvp);
|
this.setPvpAllowed(properties.pvp);
|
||||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
index 6fd1f21802754edb27dd92afa09116f5076cabec..1234b40effb46509f49f1d5565cbcf3472312150 100644
|
index 66d1525eff7e23c49d0a2d4b217a58f88c2a3d6c..3ed76a5eabbe35f23d1809b669fc94dd63399764 100644
|
||||||
--- a/net/minecraft/world/level/Level.java
|
--- a/net/minecraft/world/level/Level.java
|
||||||
+++ b/net/minecraft/world/level/Level.java
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
@@ -171,6 +171,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -171,6 +171,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
|
||||||
public final io.papermc.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
public final io.papermc.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
|
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
|
||||||
+ public final space.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC - DivineMC config files
|
+ public final org.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC - DivineMC config files
|
||||||
public static BlockPos lastPhysicsProblem; // Spigot
|
public static BlockPos lastPhysicsProblem; // Spigot
|
||||||
private int tileTickPosition;
|
private int tileTickPosition;
|
||||||
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||||
@@ -42,7 +42,7 @@ index 6fd1f21802754edb27dd92afa09116f5076cabec..1234b40effb46509f49f1d5565cbcf34
|
|||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||||
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // Purpur - Purpur config files
|
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // Purpur - Purpur config files
|
||||||
+ this.divinemcConfig = new space.bxteam.divinemc.configuration.DivineWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // DivineMC - DivineMC configuration
|
+ this.divinemcConfig = new org.bxteam.divinemc.configuration.DivineWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // DivineMC - DivineMC configuration
|
||||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config
|
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config
|
||||||
this.generator = gen;
|
this.generator = gen;
|
||||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] No chat sign
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/commands/arguments/ArgumentSignatures.java b/net/minecraft/commands/arguments/ArgumentSignatures.java
|
diff --git a/net/minecraft/commands/arguments/ArgumentSignatures.java b/net/minecraft/commands/arguments/ArgumentSignatures.java
|
||||||
index 47cb25aa9c37bd84d156288c397321009f1d9ae2..259fd0401a4a0547cf83ba1793f2b3d2898a58fe 100644
|
index 47cb25aa9c37bd84d156288c397321009f1d9ae2..7837b1cc37f70949dd0931fb93d2399763e4705e 100644
|
||||||
--- a/net/minecraft/commands/arguments/ArgumentSignatures.java
|
--- a/net/minecraft/commands/arguments/ArgumentSignatures.java
|
||||||
+++ b/net/minecraft/commands/arguments/ArgumentSignatures.java
|
+++ b/net/minecraft/commands/arguments/ArgumentSignatures.java
|
||||||
@@ -14,9 +14,16 @@ public record ArgumentSignatures(List<ArgumentSignatures.Entry> entries) {
|
@@ -14,9 +14,16 @@ public record ArgumentSignatures(List<ArgumentSignatures.Entry> entries) {
|
||||||
@@ -19,7 +19,7 @@ index 47cb25aa9c37bd84d156288c397321009f1d9ae2..259fd0401a4a0547cf83ba1793f2b3d2
|
|||||||
+ // DivineMC start - No chat sign
|
+ // DivineMC start - No chat sign
|
||||||
+ private static List<ArgumentSignatures.Entry> readSign(FriendlyByteBuf buf) {
|
+ private static List<ArgumentSignatures.Entry> readSign(FriendlyByteBuf buf) {
|
||||||
+ var entries = buf.readCollection(FriendlyByteBuf.limitValue(ArrayList::new, 8), Entry::new);
|
+ var entries = buf.readCollection(FriendlyByteBuf.limitValue(ArrayList::new, 8), Entry::new);
|
||||||
+ return space.bxteam.divinemc.configuration.DivineConfig.noChatSign ? List.of() : entries;
|
+ return org.bxteam.divinemc.configuration.DivineConfig.noChatSign ? List.of() : entries;
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - No chat sign
|
+ // DivineMC end - No chat sign
|
||||||
+
|
+
|
||||||
@@ -27,7 +27,7 @@ index 47cb25aa9c37bd84d156288c397321009f1d9ae2..259fd0401a4a0547cf83ba1793f2b3d2
|
|||||||
buffer.writeCollection(this.entries, (buffer1, entry) -> entry.write(buffer1));
|
buffer.writeCollection(this.entries, (buffer1, entry) -> entry.write(buffer1));
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/network/FriendlyByteBuf.java b/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/net/minecraft/network/FriendlyByteBuf.java b/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index e5e5d9bc095ccd9fbf1c8aaa09e5c4ebb1d1c920..d8c98e596f938f103f8155269a2096a6d1b7ffbb 100644
|
index e5e5d9bc095ccd9fbf1c8aaa09e5c4ebb1d1c920..d1676b16db0b0d1b0a92e0279da54ae199c63324 100644
|
||||||
--- a/net/minecraft/network/FriendlyByteBuf.java
|
--- a/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -114,6 +114,17 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -114,6 +114,17 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
@@ -38,7 +38,7 @@ index e5e5d9bc095ccd9fbf1c8aaa09e5c4ebb1d1c920..d8c98e596f938f103f8155269a2096a6
|
|||||||
+ // DivineMC start - No chat sign
|
+ // DivineMC start - No chat sign
|
||||||
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC) {
|
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC) {
|
||||||
+ JsonElement element = dataResult.getOrThrow(string -> new EncoderException("Failed to encode: " + string + " " + value));
|
+ JsonElement element = dataResult.getOrThrow(string -> new EncoderException("Failed to encode: " + string + " " + value));
|
||||||
+ element.getAsJsonObject().addProperty("preventsChatReports", space.bxteam.divinemc.configuration.DivineConfig.noChatSign);
|
+ element.getAsJsonObject().addProperty("preventsChatReports", org.bxteam.divinemc.configuration.DivineConfig.noChatSign);
|
||||||
+
|
+
|
||||||
+ this.writeUtf(GSON.toJson(element));
|
+ this.writeUtf(GSON.toJson(element));
|
||||||
+ return;
|
+ return;
|
||||||
@@ -49,7 +49,7 @@ index e5e5d9bc095ccd9fbf1c8aaa09e5c4ebb1d1c920..d8c98e596f938f103f8155269a2096a6
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
diff --git a/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
index b5afc05924ae899e020c303c8b86398e1d4ab8a0..468ec7f1a9ee73c7748ca36850bf810a1811e372 100644
|
index b5afc05924ae899e020c303c8b86398e1d4ab8a0..6b22c80fdb4be44fc0c879edc1a82eba8f7dcca7 100644
|
||||||
--- a/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
--- a/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
+++ b/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
+++ b/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
@@ -16,7 +16,7 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
|
@@ -16,7 +16,7 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
|
||||||
@@ -69,7 +69,7 @@ index b5afc05924ae899e020c303c8b86398e1d4ab8a0..468ec7f1a9ee73c7748ca36850bf810a
|
|||||||
+ private static MessageSignature readSign(FriendlyByteBuf buf) {
|
+ private static MessageSignature readSign(FriendlyByteBuf buf) {
|
||||||
+ byte[] bs = new byte[256];
|
+ byte[] bs = new byte[256];
|
||||||
+ buf.readBytes(bs);
|
+ buf.readBytes(bs);
|
||||||
+ return space.bxteam.divinemc.configuration.DivineConfig.noChatSign ? null : new MessageSignature(bs);
|
+ return org.bxteam.divinemc.configuration.DivineConfig.noChatSign ? null : new MessageSignature(bs);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - No chat sign
|
+ // DivineMC end - No chat sign
|
||||||
+
|
+
|
||||||
@@ -77,7 +77,7 @@ index b5afc05924ae899e020c303c8b86398e1d4ab8a0..468ec7f1a9ee73c7748ca36850bf810a
|
|||||||
public PacketType<ServerboundChatPacket> type() {
|
public PacketType<ServerboundChatPacket> type() {
|
||||||
return GamePacketTypes.SERVERBOUND_CHAT;
|
return GamePacketTypes.SERVERBOUND_CHAT;
|
||||||
diff --git a/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
diff --git a/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
index 1df628ac0b414511aaed6e09d78f884c4170f730..2d674c7ef305469c0483f24720e673e04a8fd963 100644
|
index 1df628ac0b414511aaed6e09d78f884c4170f730..fc10d813e72322d185378453bc25546e68a21711 100644
|
||||||
--- a/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
--- a/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
+++ b/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
+++ b/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
@@ -26,6 +26,11 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess
|
@@ -26,6 +26,11 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess
|
||||||
@@ -85,7 +85,7 @@ index 1df628ac0b414511aaed6e09d78f884c4170f730..2d674c7ef305469c0483f24720e673e0
|
|||||||
@Override
|
@Override
|
||||||
public void handle(ServerGamePacketListener handler) {
|
public void handle(ServerGamePacketListener handler) {
|
||||||
+ // DivineMC start - No chat sign
|
+ // DivineMC start - No chat sign
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - No chat sign
|
+ // DivineMC end - No chat sign
|
||||||
@@ -93,7 +93,7 @@ index 1df628ac0b414511aaed6e09d78f884c4170f730..2d674c7ef305469c0483f24720e673e0
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index c85023893fbb227894f8f888244f1f53e25dff3f..0755bd59ab467da4a42cf5dae0f2e409d3132fea 100644
|
index 0eecc41b02f205022a717691a18114d5c091bc3d..481d56d6c43e04c0b180c7008329d8e8316b0d0c 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -668,7 +668,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -668,7 +668,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -101,12 +101,12 @@ index c85023893fbb227894f8f888244f1f53e25dff3f..0755bd59ab467da4a42cf5dae0f2e409
|
|||||||
return properties.enforceSecureProfile
|
return properties.enforceSecureProfile
|
||||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||||
- && this.services.canValidateProfileKeys();
|
- && this.services.canValidateProfileKeys();
|
||||||
+ && this.services.canValidateProfileKeys() && !space.bxteam.divinemc.configuration.DivineConfig.noChatSign; // DivineMC - No chat sign
|
+ && this.services.canValidateProfileKeys() && !org.bxteam.divinemc.configuration.DivineConfig.noChatSign; // DivineMC - No chat sign
|
||||||
// Paper end - Add setting for proxy online mode status
|
// Paper end - Add setting for proxy online mode status
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
index 398c1733824b689520170de0be94006731afa5cd..289d8d2420f6298a4fc10e0563e99cc13c18880a 100644
|
index 398c1733824b689520170de0be94006731afa5cd..4b5d729fd627fdf636ece5339fd0a1e7fe637d66 100644
|
||||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -312,10 +312,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -312,10 +312,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
@@ -114,7 +114,7 @@ index 398c1733824b689520170de0be94006731afa5cd..289d8d2420f6298a4fc10e0563e99cc1
|
|||||||
|
|
||||||
public void send(Packet<?> packet) {
|
public void send(Packet<?> packet) {
|
||||||
+ // DivineMC start - No chat sign
|
+ // DivineMC start - No chat sign
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
||||||
+ if (this instanceof ServerGamePacketListenerImpl && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat) {
|
+ if (this instanceof ServerGamePacketListenerImpl && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat) {
|
||||||
+ packet = new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(chat.chatType().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content())), false);
|
+ packet = new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(chat.chatType().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content())), false);
|
||||||
+ }
|
+ }
|
||||||
@@ -125,7 +125,7 @@ index 398c1733824b689520170de0be94006731afa5cd..289d8d2420f6298a4fc10e0563e99cc1
|
|||||||
|
|
||||||
public void send(Packet<?> packet, @Nullable PacketSendListener listener) {
|
public void send(Packet<?> packet, @Nullable PacketSendListener listener) {
|
||||||
+ // DivineMC start - No chat sign
|
+ // DivineMC start - No chat sign
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.noChatSign) {
|
||||||
+ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && listener != null) {
|
+ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && listener != null) {
|
||||||
+ listener = null;
|
+ listener = null;
|
||||||
+ }
|
+ }
|
||||||
@@ -135,7 +135,7 @@ index 398c1733824b689520170de0be94006731afa5cd..289d8d2420f6298a4fc10e0563e99cc1
|
|||||||
if (packet == null || this.processedDisconnect) { // Spigot
|
if (packet == null || this.processedDisconnect) { // Spigot
|
||||||
return;
|
return;
|
||||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
index 94abb9d8f6381aee000dbd0720477db8b7ca279c..cb43a189e286afd858738e2590f8e812c510c3d3 100644
|
index e8ff6e79ce7ba0ec8b2a90bcb81283f52106c535..94fbf2231752f12c4497fc868cd5b2d9c8bffe66 100644
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -1319,7 +1319,7 @@ public abstract class PlayerList {
|
@@ -1319,7 +1319,7 @@ public abstract class PlayerList {
|
||||||
@@ -143,7 +143,7 @@ index 94abb9d8f6381aee000dbd0720477db8b7ca279c..cb43a189e286afd858738e2590f8e812
|
|||||||
|
|
||||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||||
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||||
+ return space.bxteam.divinemc.configuration.DivineConfig.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // DivineMC - No chat sign
|
+ return org.bxteam.divinemc.configuration.DivineConfig.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // DivineMC - No chat sign
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ You can find the original code on https://github.com/Bloom-host/Petal
|
|||||||
Makes most pathfinding-related work happen asynchronously
|
Makes most pathfinding-related work happen asynchronously
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..3f4e42c6ee1a1aa14250de4f71ae61f324d335e9 100644
|
index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..31107c97cf0e98f7f51f28c394f3d3f0778a80e0 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
@@ -94,21 +94,54 @@ public class AcquirePoi {
|
@@ -94,21 +94,54 @@ public class AcquirePoi {
|
||||||
@@ -26,12 +26,12 @@ index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..3f4e42c6ee1a1aa14250de4f71ae61f3
|
|||||||
- map.clear();
|
- map.clear();
|
||||||
- DebugPackets.sendPoiTicketCountPacket(level, target);
|
- DebugPackets.sendPoiTicketCountPacket(level, target);
|
||||||
+ // DivineMC start - Async path processing
|
+ // DivineMC start - Async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ // await on path async
|
+ // await on path async
|
||||||
+ Path possiblePath = findPathToPois(mob, set);
|
+ Path possiblePath = findPathToPois(mob, set);
|
||||||
+
|
+
|
||||||
+ // wait on the path to be processed
|
+ // wait on the path to be processed
|
||||||
+ space.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
+ org.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
||||||
+ // read canReach check
|
+ // read canReach check
|
||||||
+ if (path == null || !path.canReach()) {
|
+ if (path == null || !path.canReach()) {
|
||||||
+ for (Pair<Holder<PoiType>, BlockPos> pair : set) {
|
+ for (Pair<Holder<PoiType>, BlockPos> pair : set) {
|
||||||
@@ -79,7 +79,7 @@ index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..3f4e42c6ee1a1aa14250de4f71ae61f3
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
diff --git a/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
||||||
index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6e46cdf07 100644
|
index 621ba76784f2b92790eca62be4d0688834335ab6..f650cda95e9a448149f7f40ba8b4e6ed43cbcead 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
--- a/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
+++ b/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
|
||||||
@@ -21,6 +21,7 @@ public class MoveToTargetSink extends Behavior<Mob> {
|
@@ -21,6 +21,7 @@ public class MoveToTargetSink extends Behavior<Mob> {
|
||||||
@@ -95,10 +95,10 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6
|
|||||||
WalkTarget walkTarget = brain.getMemory(MemoryModuleType.WALK_TARGET).get();
|
WalkTarget walkTarget = brain.getMemory(MemoryModuleType.WALK_TARGET).get();
|
||||||
boolean flag = this.reachedTarget(owner, walkTarget);
|
boolean flag = this.reachedTarget(owner, walkTarget);
|
||||||
- if (!flag && this.tryComputePath(owner, walkTarget, level.getGameTime())) {
|
- if (!flag && this.tryComputePath(owner, walkTarget, level.getGameTime())) {
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !flag && this.tryComputePath(owner, walkTarget, level.getGameTime())) { // DivineMC - async path processing
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !flag && this.tryComputePath(owner, walkTarget, level.getGameTime())) { // DivineMC - async path processing
|
||||||
this.lastTargetPos = walkTarget.getTarget().currentBlockPosition();
|
this.lastTargetPos = walkTarget.getTarget().currentBlockPosition();
|
||||||
return true;
|
return true;
|
||||||
+ } else if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !flag) { // DivineMC - async pathfinding
|
+ } else if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !flag) { // DivineMC - async pathfinding
|
||||||
+ return true;
|
+ return true;
|
||||||
} else {
|
} else {
|
||||||
brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
||||||
@@ -107,7 +107,7 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStillUse(ServerLevel level, Mob entity, long gameTime) {
|
protected boolean canStillUse(ServerLevel level, Mob entity, long gameTime) {
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !this.finishedProcessing) return true; // DivineMC - wait for processing
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding && !this.finishedProcessing) return true; // DivineMC - wait for processing
|
||||||
if (this.path != null && this.lastTargetPos != null) {
|
if (this.path != null && this.lastTargetPos != null) {
|
||||||
Optional<WalkTarget> memory = entity.getBrain().getMemory(MemoryModuleType.WALK_TARGET);
|
Optional<WalkTarget> memory = entity.getBrain().getMemory(MemoryModuleType.WALK_TARGET);
|
||||||
boolean flag = memory.map(MoveToTargetSink::isWalkTargetSpectator).orElse(false);
|
boolean flag = memory.map(MoveToTargetSink::isWalkTargetSpectator).orElse(false);
|
||||||
@@ -116,7 +116,7 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6
|
|||||||
@Override
|
@Override
|
||||||
protected void start(ServerLevel level, Mob entity, long gameTime) {
|
protected void start(ServerLevel level, Mob entity, long gameTime) {
|
||||||
+ // DivineMC start - start processing
|
+ // DivineMC start - start processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ Brain<?> brain = entity.getBrain();
|
+ Brain<?> brain = entity.getBrain();
|
||||||
+ WalkTarget walkTarget = brain.getMemory(MemoryModuleType.WALK_TARGET).get();
|
+ WalkTarget walkTarget = brain.getMemory(MemoryModuleType.WALK_TARGET).get();
|
||||||
+
|
+
|
||||||
@@ -139,7 +139,7 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6
|
|||||||
- brain.setMemory(MemoryModuleType.PATH, path);
|
- brain.setMemory(MemoryModuleType.PATH, path);
|
||||||
- }
|
- }
|
||||||
+ // DivineMC start - Async path processing
|
+ // DivineMC start - Async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ if (this.path != null && !this.path.isProcessed()) return; // wait for processing
|
+ if (this.path != null && !this.path.isProcessed()) return; // wait for processing
|
||||||
|
|
||||||
- if (path != null && this.lastTargetPos != null) {
|
- if (path != null && this.lastTargetPos != null) {
|
||||||
@@ -222,7 +222,7 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..11a124ad7df99b3ddfc92496a8950dc6
|
|||||||
private boolean tryComputePath(Mob mob, WalkTarget target, long time) {
|
private boolean tryComputePath(Mob mob, WalkTarget target, long time) {
|
||||||
BlockPos blockPos = target.getTarget().currentBlockPosition();
|
BlockPos blockPos = target.getTarget().currentBlockPosition();
|
||||||
diff --git a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
diff --git a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
||||||
index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..8308934ec65d1f49ea356e19c940407bae7041f2 100644
|
index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..0066ca68968f54ba9e27b13123bca908635cf923 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
--- a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
+++ b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
|
||||||
@@ -60,17 +60,38 @@ public class SetClosestHomeAsWalkTarget {
|
@@ -60,17 +60,38 @@ public class SetClosestHomeAsWalkTarget {
|
||||||
@@ -237,12 +237,12 @@ index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..8308934ec65d1f49ea356e19c940407b
|
|||||||
- walkTarget.set(new WalkTarget(target, speedModifier, 1));
|
- walkTarget.set(new WalkTarget(target, speedModifier, 1));
|
||||||
- DebugPackets.sendPoiTicketCountPacket(level, target);
|
- DebugPackets.sendPoiTicketCountPacket(level, target);
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ // await on path async
|
+ // await on path async
|
||||||
+ Path possiblePath = AcquirePoi.findPathToPois(mob, set);
|
+ Path possiblePath = AcquirePoi.findPathToPois(mob, set);
|
||||||
+
|
+
|
||||||
+ // wait on the path to be processed
|
+ // wait on the path to be processed
|
||||||
+ space.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
+ org.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
||||||
+ if (path == null || !path.canReach() || mutableInt.getValue() < 5) { // read canReach check
|
+ if (path == null || !path.canReach() || mutableInt.getValue() < 5) { // read canReach check
|
||||||
+ map.long2LongEntrySet().removeIf(entry -> entry.getLongValue() < mutableLong.getValue());
|
+ map.long2LongEntrySet().removeIf(entry -> entry.getLongValue() < mutableLong.getValue());
|
||||||
+ return;
|
+ return;
|
||||||
@@ -287,7 +287,7 @@ index d8f532c5e68ff4dff933556c4f981e9474c044e6..37f3d3888ea2a862d006cf2b201f9715
|
|||||||
Node node = path.getNode(i);
|
Node node = path.getNode(i);
|
||||||
this.doorPos = new BlockPos(node.x, node.y + 1, node.z);
|
this.doorPos = new BlockPos(node.x, node.y + 1, node.z);
|
||||||
diff --git a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
diff --git a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
||||||
index 66a02fe7594522ef391d67e09856bf3f70fe597d..d560bbfb1272f8fd9b0d9b7af80f748afa61246c 100644
|
index 66a02fe7594522ef391d67e09856bf3f70fe597d..182bdef3be7bb17339fdc80f5e321d78cd8a398a 100644
|
||||||
--- a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
--- a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
||||||
+++ b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
+++ b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
|
||||||
@@ -12,9 +12,25 @@ public class AmphibiousPathNavigation extends PathNavigation {
|
@@ -12,9 +12,25 @@ public class AmphibiousPathNavigation extends PathNavigation {
|
||||||
@@ -295,7 +295,7 @@ index 66a02fe7594522ef391d67e09856bf3f70fe597d..d560bbfb1272f8fd9b0d9b7af80f748a
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ private static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ private static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ AmphibiousNodeEvaluator nodeEvaluator = new AmphibiousNodeEvaluator(false);
|
+ AmphibiousNodeEvaluator nodeEvaluator = new AmphibiousNodeEvaluator(false);
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -309,7 +309,7 @@ index 66a02fe7594522ef391d67e09856bf3f70fe597d..d560bbfb1272f8fd9b0d9b7af80f748a
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new AmphibiousNodeEvaluator(false);
|
this.nodeEvaluator = new AmphibiousNodeEvaluator(false);
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
@@ -317,7 +317,7 @@ index 66a02fe7594522ef391d67e09856bf3f70fe597d..d560bbfb1272f8fd9b0d9b7af80f748a
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
diff --git a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||||
index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..da804d3feef49555677ab6485d7aa6b1114b9d7f 100644
|
index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..991e203e47285c3b3f3788410b0cd950909a73e8 100644
|
||||||
--- a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
--- a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||||
+++ b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
+++ b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||||
@@ -16,9 +16,25 @@ public class FlyingPathNavigation extends PathNavigation {
|
@@ -16,9 +16,25 @@ public class FlyingPathNavigation extends PathNavigation {
|
||||||
@@ -325,7 +325,7 @@ index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..da804d3feef49555677ab6485d7aa6b1
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ private static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ private static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ FlyNodeEvaluator nodeEvaluator = new FlyNodeEvaluator();
|
+ FlyNodeEvaluator nodeEvaluator = new FlyNodeEvaluator();
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -339,7 +339,7 @@ index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..da804d3feef49555677ab6485d7aa6b1
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new FlyNodeEvaluator();
|
this.nodeEvaluator = new FlyNodeEvaluator();
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
@@ -355,7 +355,7 @@ index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..da804d3feef49555677ab6485d7aa6b1
|
|||||||
if (!this.isDone()) {
|
if (!this.isDone()) {
|
||||||
if (this.canUpdatePath()) {
|
if (this.canUpdatePath()) {
|
||||||
diff --git a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
diff --git a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||||
index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..fc02c7ca984dd2bcfca47002d7353427a1a70264 100644
|
index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..cfe00ac1d65523a811a66fa75a4348a9fe700ace 100644
|
||||||
--- a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
--- a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||||
+++ b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
+++ b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||||
@@ -24,9 +24,25 @@ public class GroundPathNavigation extends PathNavigation {
|
@@ -24,9 +24,25 @@ public class GroundPathNavigation extends PathNavigation {
|
||||||
@@ -363,7 +363,7 @@ index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..fc02c7ca984dd2bcfca47002d7353427
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ protected static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ protected static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
|
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -377,7 +377,7 @@ index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..fc02c7ca984dd2bcfca47002d7353427
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new WalkNodeEvaluator();
|
this.nodeEvaluator = new WalkNodeEvaluator();
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
@@ -385,7 +385,7 @@ index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..fc02c7ca984dd2bcfca47002d7353427
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
index b44f2c49509d847817a78e9c4fb1499fb378054b..aaa4e1d36d486baa767d427be51390b013214905 100644
|
index b44f2c49509d847817a78e9c4fb1499fb378054b..f6141289024f1d42648dafcffe1212e4651edcca 100644
|
||||||
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
@@ -169,6 +169,10 @@ public abstract class PathNavigation {
|
@@ -169,6 +169,10 @@ public abstract class PathNavigation {
|
||||||
@@ -393,7 +393,7 @@ index b44f2c49509d847817a78e9c4fb1499fb378054b..aaa4e1d36d486baa767d427be51390b0
|
|||||||
} else if (!this.canUpdatePath()) {
|
} else if (!this.canUpdatePath()) {
|
||||||
return null;
|
return null;
|
||||||
+ // DivineMC start - catch early if it's still processing these positions let it keep processing
|
+ // DivineMC start - catch early if it's still processing these positions let it keep processing
|
||||||
+ } else if (this.path instanceof space.bxteam.divinemc.pathfinding.AsyncPath asyncPath && !asyncPath.isProcessed() && asyncPath.hasSameProcessingPositions(targets)) {
|
+ } else if (this.path instanceof org.bxteam.divinemc.pathfinding.AsyncPath asyncPath && !asyncPath.isProcessed() && asyncPath.hasSameProcessingPositions(targets)) {
|
||||||
+ return this.path;
|
+ return this.path;
|
||||||
+ // DivineMC end - catch early if it's still processing these positions let it keep processing
|
+ // DivineMC end - catch early if it's still processing these positions let it keep processing
|
||||||
} else if (this.path != null && !this.path.isDone() && targets.contains(this.targetPos)) {
|
} else if (this.path != null && !this.path.isDone() && targets.contains(this.targetPos)) {
|
||||||
@@ -409,11 +409,11 @@ index b44f2c49509d847817a78e9c4fb1499fb378054b..aaa4e1d36d486baa767d427be51390b0
|
|||||||
- this.reachRange = accuracy;
|
- this.reachRange = accuracy;
|
||||||
- this.resetStuckTimeout();
|
- this.resetStuckTimeout();
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ // assign early a target position. most calls will only have 1 position
|
+ // assign early a target position. most calls will only have 1 position
|
||||||
+ if (!targets.isEmpty()) this.targetPos = targets.iterator().next();
|
+ if (!targets.isEmpty()) this.targetPos = targets.iterator().next();
|
||||||
+
|
+
|
||||||
+ space.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(path, processedPath -> {
|
+ org.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(path, processedPath -> {
|
||||||
+ // check that processing didn't take so long that we calculated a new path
|
+ // check that processing didn't take so long that we calculated a new path
|
||||||
+ if (processedPath != this.path) return;
|
+ if (processedPath != this.path) return;
|
||||||
+
|
+
|
||||||
@@ -472,7 +472,7 @@ index b44f2c49509d847817a78e9c4fb1499fb378054b..aaa4e1d36d486baa767d427be51390b0
|
|||||||
Vec3 vec3 = new Vec3((endNode.x + this.mob.getX()) / 2.0, (endNode.y + this.mob.getY()) / 2.0, (endNode.z + this.mob.getZ()) / 2.0);
|
Vec3 vec3 = new Vec3((endNode.x + this.mob.getX()) / 2.0, (endNode.y + this.mob.getY()) / 2.0, (endNode.z + this.mob.getZ()) / 2.0);
|
||||||
return pos.closerToCenterThan(vec3, this.path.getNodeCount() - this.path.getNextNodeIndex());
|
return pos.closerToCenterThan(vec3, this.path.getNodeCount() - this.path.getNextNodeIndex());
|
||||||
diff --git a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
diff --git a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
||||||
index 2979846853898d78a2df19df2287da16dbe4ae71..fbecca6fa274bcc6d07b9d300c31873fdb64c773 100644
|
index 2979846853898d78a2df19df2287da16dbe4ae71..26cbc17f9727d8494b6b49904df24d7db44d1e6a 100644
|
||||||
--- a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
--- a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
||||||
+++ b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
+++ b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
|
||||||
@@ -15,11 +15,27 @@ public class WaterBoundPathNavigation extends PathNavigation {
|
@@ -15,11 +15,27 @@ public class WaterBoundPathNavigation extends PathNavigation {
|
||||||
@@ -480,7 +480,7 @@ index 2979846853898d78a2df19df2287da16dbe4ae71..fbecca6fa274bcc6d07b9d300c31873f
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ private static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ private static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ SwimNodeEvaluator nodeEvaluator = new SwimNodeEvaluator(nodeEvaluatorFeatures.allowBreaching());
|
+ SwimNodeEvaluator nodeEvaluator = new SwimNodeEvaluator(nodeEvaluatorFeatures.allowBreaching());
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -496,7 +496,7 @@ index 2979846853898d78a2df19df2287da16dbe4ae71..fbecca6fa274bcc6d07b9d300c31873f
|
|||||||
this.nodeEvaluator = new SwimNodeEvaluator(this.allowBreaching);
|
this.nodeEvaluator = new SwimNodeEvaluator(this.allowBreaching);
|
||||||
this.nodeEvaluator.setCanPassDoors(false);
|
this.nodeEvaluator.setCanPassDoors(false);
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
@@ -504,7 +504,7 @@ index 2979846853898d78a2df19df2287da16dbe4ae71..fbecca6fa274bcc6d07b9d300c31873f
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
diff --git a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..cc202eb0848a2faecd556fa279565717be11b382 100644
|
index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..089f5e560440f384c347cd8b85da67bba61d3363 100644
|
||||||
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
@@ -57,17 +57,37 @@ public class NearestBedSensor extends Sensor<Mob> {
|
@@ -57,17 +57,37 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||||
@@ -519,9 +519,9 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..cc202eb0848a2faecd556fa279565717
|
|||||||
- if (type.isPresent()) {
|
- if (type.isPresent()) {
|
||||||
- entity.getBrain().setMemory(MemoryModuleType.NEAREST_BED, target);
|
- entity.getBrain().setMemory(MemoryModuleType.NEAREST_BED, target);
|
||||||
+ // DivineMC start - async pathfinding
|
+ // DivineMC start - async pathfinding
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ Path possiblePath = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
+ Path possiblePath = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||||
+ space.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
+ org.bxteam.divinemc.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
|
||||||
+ // read canReach check
|
+ // read canReach check
|
||||||
+ if ((path == null || !path.canReach()) && this.triedCount < 5) {
|
+ if ((path == null || !path.canReach()) && this.triedCount < 5) {
|
||||||
+ this.batchCache.long2LongEntrySet().removeIf(entry -> entry.getLongValue() < this.lastUpdate);
|
+ this.batchCache.long2LongEntrySet().removeIf(entry -> entry.getLongValue() < this.lastUpdate);
|
||||||
@@ -576,7 +576,7 @@ index d5727999eb67ff30dbf47865d59452483338e170..ddbee0f0f42fae0a26321bb324d22f5e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
index 87d21e142c3f1522a60bc3e8a0ff3b4954cf5ec9..d71437ec950af094059969537687c27892d01202 100644
|
index 87d21e142c3f1522a60bc3e8a0ff3b4954cf5ec9..32a994ccd220927e2523e7b4a5b242248bafa5e2 100644
|
||||||
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
@@ -497,6 +497,17 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
@@ -497,6 +497,17 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||||
@@ -584,7 +584,7 @@ index 87d21e142c3f1522a60bc3e8a0ff3b4954cf5ec9..d71437ec950af094059969537687c278
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ private static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ private static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ Frog.FrogNodeEvaluator nodeEvaluator = new Frog.FrogNodeEvaluator(true);
|
+ Frog.FrogNodeEvaluator nodeEvaluator = new Frog.FrogNodeEvaluator(true);
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -602,7 +602,7 @@ index 87d21e142c3f1522a60bc3e8a0ff3b4954cf5ec9..d71437ec950af094059969537687c278
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new Frog.FrogNodeEvaluator(true);
|
this.nodeEvaluator = new Frog.FrogNodeEvaluator(true);
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
@@ -623,7 +623,7 @@ index 6c73245b8d04f194e72165aa0000ca79a95db59d..2686df57d9d48db1438278d0d053bdbd
|
|||||||
if (target != null) {
|
if (target != null) {
|
||||||
double d = this.distanceToSqr(target.getX(), target.getY(), target.getZ());
|
double d = this.distanceToSqr(target.getX(), target.getY(), target.getZ());
|
||||||
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
||||||
index 241526239bdbd5d9276f85e7fca46a7051f46a25..026ec71bff3e4e0c2098e331f6a2bd9ba5955ccb 100644
|
index 241526239bdbd5d9276f85e7fca46a7051f46a25..9ed3076747556aaae2ada4b5cfa2591dec0881c6 100644
|
||||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||||
@@ -579,9 +579,25 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
@@ -579,9 +579,25 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||||
@@ -631,7 +631,7 @@ index 241526239bdbd5d9276f85e7fca46a7051f46a25..026ec71bff3e4e0c2098e331f6a2bd9b
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ private static final space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (space.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
+ private static final org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
|
||||||
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
|
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
|
||||||
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
|
||||||
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
|
||||||
@@ -645,7 +645,7 @@ index 241526239bdbd5d9276f85e7fca46a7051f46a25..026ec71bff3e4e0c2098e331f6a2bd9b
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new WalkNodeEvaluator();
|
this.nodeEvaluator = new WalkNodeEvaluator();
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, nodeEvaluatorGenerator);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end
|
+ // DivineMC end
|
||||||
@@ -653,7 +653,7 @@ index 241526239bdbd5d9276f85e7fca46a7051f46a25..026ec71bff3e4e0c2098e331f6a2bd9b
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
|
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
index f74c784906208034f51b31bd9aba45733c3ebebe..a1fa17eaef088e36284fc79d6afd4c43b8a0a1a9 100644
|
index f74c784906208034f51b31bd9aba45733c3ebebe..48e3e16ee711533e9f9c7007aa97ccf740135ff0 100644
|
||||||
--- a/net/minecraft/world/entity/monster/warden/Warden.java
|
--- a/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
|
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
@@ -619,6 +619,16 @@ public class Warden extends Monster implements VibrationSystem {
|
@@ -619,6 +619,16 @@ public class Warden extends Monster implements VibrationSystem {
|
||||||
@@ -661,7 +661,7 @@ index f74c784906208034f51b31bd9aba45733c3ebebe..a1fa17eaef088e36284fc79d6afd4c43
|
|||||||
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
protected PathFinder createPathFinder(int maxVisitedNodes) {
|
||||||
this.nodeEvaluator = new WalkNodeEvaluator();
|
this.nodeEvaluator = new WalkNodeEvaluator();
|
||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding) {
|
||||||
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, GroundPathNavigation.nodeEvaluatorGenerator) {
|
+ return new PathFinder(this.nodeEvaluator, maxVisitedNodes, GroundPathNavigation.nodeEvaluatorGenerator) {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ protected float distance(Node first, Node second) {
|
+ protected float distance(Node first, Node second) {
|
||||||
@@ -704,18 +704,18 @@ index d6d3c8f5e5dd4a8cab0d3fcc131c3a59f06130c6..839653a997f1e10970fa2956fadaf493
|
|||||||
return false;
|
return false;
|
||||||
} else if (pathentity.nodes.size() != this.nodes.size()) {
|
} else if (pathentity.nodes.size() != this.nodes.size()) {
|
||||||
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..4b8182414ca9aa22e096babb25a32f2b5ba60312 100644
|
index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..710009b887109f3d25ec310a4fe738536ece43b1 100644
|
||||||
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
@@ -25,11 +25,19 @@ public class PathFinder {
|
@@ -25,11 +25,19 @@ public class PathFinder {
|
||||||
public final NodeEvaluator nodeEvaluator;
|
public final NodeEvaluator nodeEvaluator;
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
private final BinaryHeap openSet = new BinaryHeap();
|
private final BinaryHeap openSet = new BinaryHeap();
|
||||||
+ private final @Nullable space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator; // DivineMC - we use this later to generate an evaluator
|
+ private final @Nullable org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator; // DivineMC - we use this later to generate an evaluator
|
||||||
|
|
||||||
- public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes) {
|
- public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes) {
|
||||||
+ // DivineMC start - support nodeEvaluatorgenerators
|
+ // DivineMC start - support nodeEvaluatorgenerators
|
||||||
+ public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes, @Nullable space.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator) { // DivineMC - add nodeEvaluatorGenerator
|
+ public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes, @Nullable org.bxteam.divinemc.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator) { // DivineMC - add nodeEvaluatorGenerator
|
||||||
this.nodeEvaluator = nodeEvaluator;
|
this.nodeEvaluator = nodeEvaluator;
|
||||||
this.maxVisitedNodes = maxVisitedNodes;
|
this.maxVisitedNodes = maxVisitedNodes;
|
||||||
+ this.nodeEvaluatorGenerator = nodeEvaluatorGenerator;
|
+ this.nodeEvaluatorGenerator = nodeEvaluatorGenerator;
|
||||||
@@ -736,16 +736,16 @@ index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..4b8182414ca9aa22e096babb25a32f2b
|
|||||||
- this.nodeEvaluator.prepare(region, mob);
|
- this.nodeEvaluator.prepare(region, mob);
|
||||||
- Node start = this.nodeEvaluator.getStart();
|
- Node start = this.nodeEvaluator.getStart();
|
||||||
+ // DivineMC start - use a generated evaluator if we have one otherwise run sync
|
+ // DivineMC start - use a generated evaluator if we have one otherwise run sync
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding)
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.asyncPathfinding)
|
||||||
+ this.openSet.clear(); // it's always cleared in processPath
|
+ this.openSet.clear(); // it's always cleared in processPath
|
||||||
+ NodeEvaluator nodeEvaluator = this.nodeEvaluatorGenerator == null
|
+ NodeEvaluator nodeEvaluator = this.nodeEvaluatorGenerator == null
|
||||||
+ ? this.nodeEvaluator
|
+ ? this.nodeEvaluator
|
||||||
+ : space.bxteam.divinemc.pathfinding.NodeEvaluatorCache.takeNodeEvaluator(this.nodeEvaluatorGenerator, this.nodeEvaluator);
|
+ : org.bxteam.divinemc.pathfinding.NodeEvaluatorCache.takeNodeEvaluator(this.nodeEvaluatorGenerator, this.nodeEvaluator);
|
||||||
+ nodeEvaluator.prepare(region, mob);
|
+ nodeEvaluator.prepare(region, mob);
|
||||||
+ Node start = nodeEvaluator.getStart();
|
+ Node start = nodeEvaluator.getStart();
|
||||||
+ // DivineMC end - use a generated evaluator if we have one otherwise run sync
|
+ // DivineMC end - use a generated evaluator if we have one otherwise run sync
|
||||||
if (start == null) {
|
if (start == null) {
|
||||||
+ space.bxteam.divinemc.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator); // DivineMC - handle nodeEvaluatorGenerator
|
+ org.bxteam.divinemc.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator); // DivineMC - handle nodeEvaluatorGenerator
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
// Paper start - Perf: remove streams and optimize collection
|
// Paper start - Perf: remove streams and optimize collection
|
||||||
@@ -761,11 +761,11 @@ index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..4b8182414ca9aa22e096babb25a32f2b
|
|||||||
+ // DivineMC start - async path processing
|
+ // DivineMC start - async path processing
|
||||||
+ if (this.nodeEvaluatorGenerator == null) {
|
+ if (this.nodeEvaluatorGenerator == null) {
|
||||||
+ // run sync :(
|
+ // run sync :(
|
||||||
+ space.bxteam.divinemc.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator);
|
+ org.bxteam.divinemc.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator);
|
||||||
+ return this.findPath(start, map, maxRange, accuracy, searchDepthMultiplier);
|
+ return this.findPath(start, map, maxRange, accuracy, searchDepthMultiplier);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return new space.bxteam.divinemc.pathfinding.AsyncPath(Lists.newArrayList(), targetPositions, () -> {
|
+ return new org.bxteam.divinemc.pathfinding.AsyncPath(Lists.newArrayList(), targetPositions, () -> {
|
||||||
+ try {
|
+ try {
|
||||||
+ return this.processPath(nodeEvaluator, start, map, maxRange, accuracy, searchDepthMultiplier);
|
+ return this.processPath(nodeEvaluator, start, map, maxRange, accuracy, searchDepthMultiplier);
|
||||||
+ } catch (Exception e) {
|
+ } catch (Exception e) {
|
||||||
@@ -773,7 +773,7 @@ index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..4b8182414ca9aa22e096babb25a32f2b
|
|||||||
+ return null;
|
+ return null;
|
||||||
+ } finally {
|
+ } finally {
|
||||||
+ nodeEvaluator.done();
|
+ nodeEvaluator.done();
|
||||||
+ space.bxteam.divinemc.pathfinding.NodeEvaluatorCache.returnNodeEvaluator(nodeEvaluator);
|
+ org.bxteam.divinemc.pathfinding.NodeEvaluatorCache.returnNodeEvaluator(nodeEvaluator);
|
||||||
+ }
|
+ }
|
||||||
+ });
|
+ });
|
||||||
+ // DivineMC end - async path processing
|
+ // DivineMC end - async path processing
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Original license: GPLv3
|
|||||||
Original project: https://github.com/plasmoapp/matter
|
Original project: https://github.com/plasmoapp/matter
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
|
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
|
||||||
index a65affc41a4fc299bc2281f0f53f2e075633899d..2ba3b8150bb753eebd5694275917c2ca8464b12e 100644
|
index a65affc41a4fc299bc2281f0f53f2e075633899d..610bf730709351183bc3ccabfd9dd8d73a60e363 100644
|
||||||
--- a/net/minecraft/server/commands/SeedCommand.java
|
--- a/net/minecraft/server/commands/SeedCommand.java
|
||||||
+++ b/net/minecraft/server/commands/SeedCommand.java
|
+++ b/net/minecraft/server/commands/SeedCommand.java
|
||||||
@@ -12,6 +12,17 @@ public class SeedCommand {
|
@@ -12,6 +12,17 @@ public class SeedCommand {
|
||||||
@@ -16,9 +16,9 @@ index a65affc41a4fc299bc2281f0f53f2e075633899d..2ba3b8150bb753eebd5694275917c2ca
|
|||||||
context.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
|
context.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
|
||||||
+
|
+
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ space.bxteam.divinemc.seed.Globals.setupGlobals(context.getSource().getLevel());
|
+ org.bxteam.divinemc.seed.Globals.setupGlobals(context.getSource().getLevel());
|
||||||
+ String seedStr = space.bxteam.divinemc.seed.Globals.seedToString(space.bxteam.divinemc.seed.Globals.worldSeed);
|
+ String seedStr = org.bxteam.divinemc.seed.Globals.seedToString(org.bxteam.divinemc.seed.Globals.worldSeed);
|
||||||
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
|
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
|
||||||
+
|
+
|
||||||
+ context.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
|
+ context.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
|
||||||
@@ -29,7 +29,7 @@ index a65affc41a4fc299bc2281f0f53f2e075633899d..2ba3b8150bb753eebd5694275917c2ca
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
index 5748658abf0b90812005ae9d426df92daf5532f0..f4af49555bcf69cfaf7467f1fa7d4292a5652fa5 100644
|
index 5748658abf0b90812005ae9d426df92daf5532f0..6dca8112f74c924a9ec57ca5c80993e440b3a840 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
@@ -114,7 +114,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
@@ -114,7 +114,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||||
@@ -38,10 +38,10 @@ index 5748658abf0b90812005ae9d426df92daf5532f0..f4af49555bcf69cfaf7467f1fa7d4292
|
|||||||
long l = WorldOptions.parseSeed(string).orElse(WorldOptions.randomSeed());
|
long l = WorldOptions.parseSeed(string).orElse(WorldOptions.randomSeed());
|
||||||
- this.worldOptions = new WorldOptions(l, flag, false);
|
- this.worldOptions = new WorldOptions(l, flag, false);
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ String featureSeedStr = this.get("feature-level-seed", "");
|
+ String featureSeedStr = this.get("feature-level-seed", "");
|
||||||
+ long[] featureSeed = space.bxteam.divinemc.seed.Globals.parseSeed(featureSeedStr)
|
+ long[] featureSeed = org.bxteam.divinemc.seed.Globals.parseSeed(featureSeedStr)
|
||||||
+ .orElse(space.bxteam.divinemc.seed.Globals.createRandomWorldSeed());
|
+ .orElse(org.bxteam.divinemc.seed.Globals.createRandomWorldSeed());
|
||||||
+
|
+
|
||||||
+ this.worldOptions = new WorldOptions(l, featureSeed, flag, false);
|
+ this.worldOptions = new WorldOptions(l, featureSeed, flag, false);
|
||||||
+ } else {
|
+ } else {
|
||||||
@@ -52,31 +52,31 @@ index 5748658abf0b90812005ae9d426df92daf5532f0..f4af49555bcf69cfaf7467f1fa7d4292
|
|||||||
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
|
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
|
||||||
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
|
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
|
||||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 6540b2d6a1062d883811ce240c49d30d1925b291..bceaf150f7e9b5c4a08be6102571d8fef68a2fc2 100644
|
index 6540b2d6a1062d883811ce240c49d30d1925b291..ba81e47190aebe3f90642fe12d447464d150abf9 100644
|
||||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -652,6 +652,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
@@ -652,6 +652,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkGenerator getGenerator() {
|
public ChunkGenerator getGenerator() {
|
||||||
+ space.bxteam.divinemc.seed.Globals.setupGlobals(level); // DivineMC - Implement Secure Seed
|
+ org.bxteam.divinemc.seed.Globals.setupGlobals(level); // DivineMC - Implement Secure Seed
|
||||||
return this.chunkMap.generator();
|
return this.chunkMap.generator();
|
||||||
}
|
}
|
||||||
|
|
||||||
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 3770dc90d9412c6378c0bd57a651b9c3e62b9a72..8127a71fd7d45541525be75e6699c2a5bae95f5f 100644
|
index 3770dc90d9412c6378c0bd57a651b9c3e62b9a72..28f84d1200ba75d72ea94f831178b9d4e1fc61d2 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
|
||||||
@@ -634,6 +634,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -634,6 +634,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
|
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
+ space.bxteam.divinemc.seed.Globals.setupGlobals(this); // DivineMC - Implement Secure Seed
|
+ org.bxteam.divinemc.seed.Globals.setupGlobals(this); // DivineMC - Implement Secure Seed
|
||||||
boolean flag = server.forceSynchronousWrites();
|
boolean flag = server.forceSynchronousWrites();
|
||||||
DataFixer fixerUpper = server.getFixerUpper();
|
DataFixer fixerUpper = server.getFixerUpper();
|
||||||
// Paper - rewrite chunk system
|
// Paper - rewrite chunk system
|
||||||
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
|
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
|
||||||
index 240a54b210e23d5b79e6bcaf3806aa454668135d..f8cf35cf6837b810a28b64e834d810fc92bdb9d3 100644
|
index 240a54b210e23d5b79e6bcaf3806aa454668135d..c4d77ac76f057fd11f514ee3e2a562ca830c551a 100644
|
||||||
--- a/net/minecraft/world/entity/monster/Slime.java
|
--- a/net/minecraft/world/entity/monster/Slime.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Slime.java
|
+++ b/net/minecraft/world/entity/monster/Slime.java
|
||||||
@@ -423,8 +423,13 @@ public class Slime extends Mob implements Enemy {
|
@@ -423,8 +423,13 @@ public class Slime extends Mob implements Enemy {
|
||||||
@@ -87,7 +87,7 @@ index 240a54b210e23d5b79e6bcaf3806aa454668135d..f8cf35cf6837b810a28b64e834d810fc
|
|||||||
- boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
- boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
||||||
+ ChunkPos chunkPos = new ChunkPos(pos);
|
+ ChunkPos chunkPos = new ChunkPos(pos);
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ boolean isSlimeChunk = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ boolean isSlimeChunk = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? level.getChunk(chunkPos.x, chunkPos.z).isSlimeChunk()
|
+ ? level.getChunk(chunkPos.x, chunkPos.z).isSlimeChunk()
|
||||||
+ : WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
+ : WorldgenRandom.seedSlimeChunk(chunkPos.x, chunkPos.z, ((WorldGenLevel) level).getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
||||||
+ boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
|
+ boolean flag = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
|
||||||
@@ -96,7 +96,7 @@ index 240a54b210e23d5b79e6bcaf3806aa454668135d..f8cf35cf6837b810a28b64e834d810fc
|
|||||||
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
|
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
|
||||||
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
|
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
|
||||||
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..7c3321b43e9eb1e6d15a571a8292853be4930448 100644
|
index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..80c8834a2f0e92268e8c8037be5246ebca1b168c 100644
|
||||||
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
@@ -82,6 +82,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
@@ -82,6 +82,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||||
@@ -118,7 +118,7 @@ index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..7c3321b43e9eb1e6d15a571a8292853b
|
|||||||
+ public boolean isSlimeChunk() {
|
+ public boolean isSlimeChunk() {
|
||||||
+ if (!hasComputedSlimeChunk) {
|
+ if (!hasComputedSlimeChunk) {
|
||||||
+ hasComputedSlimeChunk = true;
|
+ hasComputedSlimeChunk = true;
|
||||||
+ slimeChunk = space.bxteam.divinemc.seed.WorldgenCryptoRandom.seedSlimeChunk(chunkPos.x, chunkPos.z).nextInt(10) == 0;
|
+ slimeChunk = org.bxteam.divinemc.seed.WorldgenCryptoRandom.seedSlimeChunk(chunkPos.x, chunkPos.z).nextInt(10) == 0;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return slimeChunk;
|
+ return slimeChunk;
|
||||||
@@ -129,7 +129,7 @@ index 6d565b52552534ce9cacfc35ad1bf4adcb69eac3..7c3321b43e9eb1e6d15a571a8292853b
|
|||||||
@Nullable
|
@Nullable
|
||||||
public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving);
|
public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving);
|
||||||
diff --git a/net/minecraft/world/level/chunk/ChunkGenerator.java b/net/minecraft/world/level/chunk/ChunkGenerator.java
|
diff --git a/net/minecraft/world/level/chunk/ChunkGenerator.java b/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..a565b61cd0919fa874d9ab8d00e879b860d3dab5 100644
|
index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..6f365c7ba147445026327df14e3109178e575d33 100644
|
||||||
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
|
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
|
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
@@ -343,7 +343,11 @@ public abstract class ChunkGenerator {
|
@@ -343,7 +343,11 @@ public abstract class ChunkGenerator {
|
||||||
@@ -138,8 +138,8 @@ index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..a565b61cd0919fa874d9ab8d00e879b8
|
|||||||
List<FeatureSorter.StepFeatureData> list = this.featuresPerStep.get();
|
List<FeatureSorter.StepFeatureData> list = this.featuresPerStep.get();
|
||||||
- WorldgenRandom worldgenRandom = new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
|
- WorldgenRandom worldgenRandom = new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ WorldgenRandom worldgenRandom = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? new space.bxteam.divinemc.seed.WorldgenCryptoRandom(blockPos.getX(), blockPos.getZ(), space.bxteam.divinemc.seed.Globals.Salt.UNDEFINED, 0)
|
+ ? new org.bxteam.divinemc.seed.WorldgenCryptoRandom(blockPos.getX(), blockPos.getZ(), org.bxteam.divinemc.seed.Globals.Salt.UNDEFINED, 0)
|
||||||
+ : new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
|
+ : new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
long l = worldgenRandom.setDecorationSeed(level.getSeed(), blockPos.getX(), blockPos.getZ());
|
long l = worldgenRandom.setDecorationSeed(level.getSeed(), blockPos.getX(), blockPos.getZ());
|
||||||
@@ -153,9 +153,9 @@ index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..a565b61cd0919fa874d9ab8d00e879b8
|
|||||||
- worldgenRandom.setLargeFeatureSeed(structureState.getLevelSeed(), pos.x, pos.z);
|
- worldgenRandom.setLargeFeatureSeed(structureState.getLevelSeed(), pos.x, pos.z);
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom;
|
+ WorldgenRandom worldgenRandom;
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ worldgenRandom = new space.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
+ worldgenRandom = new org.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
||||||
+ pos.x, pos.z, space.bxteam.divinemc.seed.Globals.Salt.GENERATE_FEATURE, 0
|
+ pos.x, pos.z, org.bxteam.divinemc.seed.Globals.Salt.GENERATE_FEATURE, 0
|
||||||
+ );
|
+ );
|
||||||
+ } else {
|
+ } else {
|
||||||
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
||||||
@@ -167,7 +167,7 @@ index 6ed51cf42b5864194d671b5b56f5b9bdf0291dc0..a565b61cd0919fa874d9ab8d00e879b8
|
|||||||
|
|
||||||
for (StructureSet.StructureSelectionEntry structureSelectionEntry1 : list1) {
|
for (StructureSet.StructureSelectionEntry structureSelectionEntry1 : list1) {
|
||||||
diff --git a/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
diff --git a/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
index 619b98e42e254c0c260c171a26a2472ddf59b885..797d0c8e836150b17dedb8ee00e0f245aff434ee 100644
|
index 619b98e42e254c0c260c171a26a2472ddf59b885..e9a1fd3ef36355d71254f5a86da7a4430c4b3150 100644
|
||||||
--- a/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
--- a/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
+++ b/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
+++ b/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
@@ -205,14 +205,21 @@ public class ChunkGeneratorStructureState {
|
@@ -205,14 +205,21 @@ public class ChunkGeneratorStructureState {
|
||||||
@@ -183,11 +183,11 @@ index 619b98e42e254c0c260c171a26a2472ddf59b885..797d0c8e836150b17dedb8ee00e0f245
|
|||||||
- randomSource.setSeed(this.concentricRingsSeed);
|
- randomSource.setSeed(this.concentricRingsSeed);
|
||||||
- } // Paper - Add missing structure set seed configs
|
- } // Paper - Add missing structure set seed configs
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ RandomSource randomSource = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ RandomSource randomSource = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? new space.bxteam.divinemc.seed.WorldgenCryptoRandom(0, 0, space.bxteam.divinemc.seed.Globals.Salt.STRONGHOLDS, 0)
|
+ ? new org.bxteam.divinemc.seed.WorldgenCryptoRandom(0, 0, org.bxteam.divinemc.seed.Globals.Salt.STRONGHOLDS, 0)
|
||||||
+ : RandomSource.create();
|
+ : RandomSource.create();
|
||||||
+
|
+
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ // Paper start - Add missing structure set seed configs
|
+ // Paper start - Add missing structure set seed configs
|
||||||
+ if (this.conf.strongholdSeed != null && structureSet.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
|
+ if (this.conf.strongholdSeed != null && structureSet.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
|
||||||
+ randomSource.setSeed(this.conf.strongholdSeed);
|
+ randomSource.setSeed(this.conf.strongholdSeed);
|
||||||
@@ -201,19 +201,19 @@ index 619b98e42e254c0c260c171a26a2472ddf59b885..797d0c8e836150b17dedb8ee00e0f245
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int i1 = 0;
|
int i1 = 0;
|
||||||
diff --git a/net/minecraft/world/level/chunk/status/ChunkStep.java b/net/minecraft/world/level/chunk/status/ChunkStep.java
|
diff --git a/net/minecraft/world/level/chunk/status/ChunkStep.java b/net/minecraft/world/level/chunk/status/ChunkStep.java
|
||||||
index b8348976e80578d9eff64eea68c04c603fed49ad..d84099c67704881a99d371ff79177257faa1abfc 100644
|
index b8348976e80578d9eff64eea68c04c603fed49ad..9225701f05f583809541ced2c676b9da05ed1a3b 100644
|
||||||
--- a/net/minecraft/world/level/chunk/status/ChunkStep.java
|
--- a/net/minecraft/world/level/chunk/status/ChunkStep.java
|
||||||
+++ b/net/minecraft/world/level/chunk/status/ChunkStep.java
|
+++ b/net/minecraft/world/level/chunk/status/ChunkStep.java
|
||||||
@@ -60,6 +60,7 @@ public final class ChunkStep implements ca.spottedleaf.moonrise.patches.chunk_sy
|
@@ -60,6 +60,7 @@ public final class ChunkStep implements ca.spottedleaf.moonrise.patches.chunk_sy
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<ChunkAccess> apply(WorldGenContext worldGenContext, StaticCache2D<GenerationChunkHolder> cache, ChunkAccess chunk) {
|
public CompletableFuture<ChunkAccess> apply(WorldGenContext worldGenContext, StaticCache2D<GenerationChunkHolder> cache, ChunkAccess chunk) {
|
||||||
+ space.bxteam.divinemc.seed.Globals.setupGlobals(worldGenContext.level()); // DivineMC - Implement Secure Seed
|
+ org.bxteam.divinemc.seed.Globals.setupGlobals(worldGenContext.level()); // DivineMC - Implement Secure Seed
|
||||||
if (chunk.getPersistedStatus().isBefore(this.targetStatus)) {
|
if (chunk.getPersistedStatus().isBefore(this.targetStatus)) {
|
||||||
ProfiledDuration profiledDuration = JvmProfiler.INSTANCE
|
ProfiledDuration profiledDuration = JvmProfiler.INSTANCE
|
||||||
.onChunkGenerate(chunk.getPos(), worldGenContext.level().dimension(), this.targetStatus.getName());
|
.onChunkGenerate(chunk.getPos(), worldGenContext.level().dimension(), this.targetStatus.getName());
|
||||||
diff --git a/net/minecraft/world/level/levelgen/WorldOptions.java b/net/minecraft/world/level/levelgen/WorldOptions.java
|
diff --git a/net/minecraft/world/level/levelgen/WorldOptions.java b/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff44734e3a38af 100644
|
index c92508741439a8d0d833ea02d0104416adb83c92..1acd5946064cafdec498cdf7f876cc2c33f872b4 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/WorldOptions.java
|
--- a/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/WorldOptions.java
|
+++ b/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
@@ -9,17 +9,28 @@ import net.minecraft.util.RandomSource;
|
@@ -9,17 +9,28 @@ import net.minecraft.util.RandomSource;
|
||||||
@@ -221,7 +221,7 @@ index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff4473
|
|||||||
|
|
||||||
public class WorldOptions {
|
public class WorldOptions {
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ private static final boolean isSecureSeedEnabled = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed;
|
+ private static final boolean isSecureSeedEnabled = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed;
|
||||||
public static final MapCodec<WorldOptions> CODEC = RecordCodecBuilder.mapCodec(
|
public static final MapCodec<WorldOptions> CODEC = RecordCodecBuilder.mapCodec(
|
||||||
- instance -> instance.group(
|
- instance -> instance.group(
|
||||||
+ instance -> isSecureSeedEnabled
|
+ instance -> isSecureSeedEnabled
|
||||||
@@ -242,11 +242,11 @@ index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff4473
|
|||||||
);
|
);
|
||||||
- public static final WorldOptions DEMO_OPTIONS = new WorldOptions("North Carolina".hashCode(), true, true);
|
- public static final WorldOptions DEMO_OPTIONS = new WorldOptions("North Carolina".hashCode(), true, true);
|
||||||
+ public static final WorldOptions DEMO_OPTIONS = isSecureSeedEnabled
|
+ public static final WorldOptions DEMO_OPTIONS = isSecureSeedEnabled
|
||||||
+ ? new WorldOptions("North Carolina".hashCode(), space.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), true, true)
|
+ ? new WorldOptions("North Carolina".hashCode(), org.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), true, true)
|
||||||
+ : new WorldOptions("North Carolina".hashCode(), true, true);
|
+ : new WorldOptions("North Carolina".hashCode(), true, true);
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
private final long seed;
|
private final long seed;
|
||||||
+ private long[] featureSeed = space.bxteam.divinemc.seed.Globals.createRandomWorldSeed(); // DivineMC - Implement Secure Seed
|
+ private long[] featureSeed = org.bxteam.divinemc.seed.Globals.createRandomWorldSeed(); // DivineMC - Implement Secure Seed
|
||||||
private final boolean generateStructures;
|
private final boolean generateStructures;
|
||||||
private final boolean generateBonusChest;
|
private final boolean generateBonusChest;
|
||||||
private final Optional<String> legacyCustomOptions;
|
private final Optional<String> legacyCustomOptions;
|
||||||
@@ -262,7 +262,7 @@ index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff4473
|
|||||||
public static WorldOptions defaultWithRandomSeed() {
|
public static WorldOptions defaultWithRandomSeed() {
|
||||||
- return new WorldOptions(randomSeed(), true, false);
|
- return new WorldOptions(randomSeed(), true, false);
|
||||||
+ return isSecureSeedEnabled
|
+ return isSecureSeedEnabled
|
||||||
+ ? new WorldOptions(randomSeed(), space.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), true, false)
|
+ ? new WorldOptions(randomSeed(), org.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), true, false)
|
||||||
+ : new WorldOptions(randomSeed(), true, false);
|
+ : new WorldOptions(randomSeed(), true, false);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -323,7 +323,7 @@ index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff4473
|
|||||||
public WorldOptions withSeed(OptionalLong seed) {
|
public WorldOptions withSeed(OptionalLong seed) {
|
||||||
- return new WorldOptions(seed.orElse(randomSeed()), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions);
|
- return new WorldOptions(seed.orElse(randomSeed()), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions);
|
||||||
+ return isSecureSeedEnabled
|
+ return isSecureSeedEnabled
|
||||||
+ ? new WorldOptions(seed.orElse(randomSeed()), space.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions)
|
+ ? new WorldOptions(seed.orElse(randomSeed()), org.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions)
|
||||||
+ : new WorldOptions(seed.orElse(randomSeed()), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions);
|
+ : new WorldOptions(seed.orElse(randomSeed()), this.generateStructures, this.generateBonusChest, this.legacyCustomOptions);
|
||||||
}
|
}
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
@@ -331,7 +331,7 @@ index c92508741439a8d0d833ea02d0104416adb83c92..05a2c2e7830fda9d7c22904ee3ff4473
|
|||||||
public static OptionalLong parseSeed(String seed) {
|
public static OptionalLong parseSeed(String seed) {
|
||||||
seed = seed.trim();
|
seed = seed.trim();
|
||||||
diff --git a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
diff --git a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
||||||
index 38475f6975533909924c8d54f438cf43cdfe31a3..528a69cf7c1f0f31988cc3902f41559826c4d27d 100644
|
index 38475f6975533909924c8d54f438cf43cdfe31a3..bd486c5d1899ffd1c7ec68cfe1498e9d89f80261 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
--- a/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
+++ b/net/minecraft/world/level/levelgen/feature/GeodeFeature.java
|
||||||
@@ -41,7 +41,11 @@ public class GeodeFeature extends Feature<GeodeConfiguration> {
|
@@ -41,7 +41,11 @@ public class GeodeFeature extends Feature<GeodeConfiguration> {
|
||||||
@@ -340,15 +340,15 @@ index 38475f6975533909924c8d54f438cf43cdfe31a3..528a69cf7c1f0f31988cc3902f415598
|
|||||||
int i2 = geodeConfiguration.distributionPoints.sample(randomSource);
|
int i2 = geodeConfiguration.distributionPoints.sample(randomSource);
|
||||||
- WorldgenRandom worldgenRandom = new WorldgenRandom(new LegacyRandomSource(worldGenLevel.getSeed()));
|
- WorldgenRandom worldgenRandom = new WorldgenRandom(new LegacyRandomSource(worldGenLevel.getSeed()));
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ WorldgenRandom worldgenRandom = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? new space.bxteam.divinemc.seed.WorldgenCryptoRandom(0, 0, space.bxteam.divinemc.seed.Globals.Salt.GEODE_FEATURE, 0)
|
+ ? new org.bxteam.divinemc.seed.WorldgenCryptoRandom(0, 0, org.bxteam.divinemc.seed.Globals.Salt.GEODE_FEATURE, 0)
|
||||||
+ : new WorldgenRandom(new LegacyRandomSource(worldGenLevel.getSeed()));
|
+ : new WorldgenRandom(new LegacyRandomSource(worldGenLevel.getSeed()));
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
NormalNoise normalNoise = NormalNoise.create(worldgenRandom, -4, 1.0);
|
NormalNoise normalNoise = NormalNoise.create(worldgenRandom, -4, 1.0);
|
||||||
List<BlockPos> list1 = Lists.newLinkedList();
|
List<BlockPos> list1 = Lists.newLinkedList();
|
||||||
double d = (double)i2 / geodeConfiguration.outerWallDistance.getMaxValue();
|
double d = (double)i2 / geodeConfiguration.outerWallDistance.getMaxValue();
|
||||||
diff --git a/net/minecraft/world/level/levelgen/structure/Structure.java b/net/minecraft/world/level/levelgen/structure/Structure.java
|
diff --git a/net/minecraft/world/level/levelgen/structure/Structure.java b/net/minecraft/world/level/levelgen/structure/Structure.java
|
||||||
index 8328e864c72b7a358d6bb1f33459b8c4df2ecb1a..c8bf9b3c08903b95dd92c5eb7135d3426580c004 100644
|
index 8328e864c72b7a358d6bb1f33459b8c4df2ecb1a..43b89a497e3e204169ff5ebd4893b4ba1aab45f6 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/structure/Structure.java
|
--- a/net/minecraft/world/level/levelgen/structure/Structure.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/structure/Structure.java
|
+++ b/net/minecraft/world/level/levelgen/structure/Structure.java
|
||||||
@@ -249,6 +249,14 @@ public abstract class Structure {
|
@@ -249,6 +249,14 @@ public abstract class Structure {
|
||||||
@@ -356,9 +356,9 @@ index 8328e864c72b7a358d6bb1f33459b8c4df2ecb1a..c8bf9b3c08903b95dd92c5eb7135d342
|
|||||||
|
|
||||||
private static WorldgenRandom makeRandom(long seed, ChunkPos chunkPos) {
|
private static WorldgenRandom makeRandom(long seed, ChunkPos chunkPos) {
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ return new space.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
+ return new org.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
||||||
+ chunkPos.x, chunkPos.z, space.bxteam.divinemc.seed.Globals.Salt.GENERATE_FEATURE, seed
|
+ chunkPos.x, chunkPos.z, org.bxteam.divinemc.seed.Globals.Salt.GENERATE_FEATURE, seed
|
||||||
+ );
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
@@ -367,7 +367,7 @@ index 8328e864c72b7a358d6bb1f33459b8c4df2ecb1a..c8bf9b3c08903b95dd92c5eb7135d342
|
|||||||
worldgenRandom.setLargeFeatureSeed(seed, chunkPos.x, chunkPos.z);
|
worldgenRandom.setLargeFeatureSeed(seed, chunkPos.x, chunkPos.z);
|
||||||
return worldgenRandom;
|
return worldgenRandom;
|
||||||
diff --git a/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java b/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
diff --git a/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java b/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
||||||
index ee0d9dddb36b6879fa113299e24f1aa3b2b151cc..3859e80ef432a27df09fe89ef25e0a401cf970b5 100644
|
index ee0d9dddb36b6879fa113299e24f1aa3b2b151cc..c1a4227698b40d75b4dba1f677eef00194327f98 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
--- a/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
+++ b/net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement.java
|
||||||
@@ -67,8 +67,17 @@ public class RandomSpreadStructurePlacement extends StructurePlacement {
|
@@ -67,8 +67,17 @@ public class RandomSpreadStructurePlacement extends StructurePlacement {
|
||||||
@@ -378,9 +378,9 @@ index ee0d9dddb36b6879fa113299e24f1aa3b2b151cc..3859e80ef432a27df09fe89ef25e0a40
|
|||||||
- worldgenRandom.setLargeFeatureWithSalt(seed, i, i1, this.salt());
|
- worldgenRandom.setLargeFeatureWithSalt(seed, i, i1, this.salt());
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom;
|
+ WorldgenRandom worldgenRandom;
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ worldgenRandom = new space.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
+ worldgenRandom = new org.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
||||||
+ i, i1, space.bxteam.divinemc.seed.Globals.Salt.POTENTIONAL_FEATURE, this.salt
|
+ i, i1, org.bxteam.divinemc.seed.Globals.Salt.POTENTIONAL_FEATURE, this.salt
|
||||||
+ );
|
+ );
|
||||||
+ } else {
|
+ } else {
|
||||||
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
||||||
@@ -391,7 +391,7 @@ index ee0d9dddb36b6879fa113299e24f1aa3b2b151cc..3859e80ef432a27df09fe89ef25e0a40
|
|||||||
int i3 = this.spreadType.evaluate(worldgenRandom, i2);
|
int i3 = this.spreadType.evaluate(worldgenRandom, i2);
|
||||||
int i4 = this.spreadType.evaluate(worldgenRandom, i2);
|
int i4 = this.spreadType.evaluate(worldgenRandom, i2);
|
||||||
diff --git a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
diff --git a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
||||||
index 670335a7bbfbc9da64c389977498c22dfcd03251..7b49200486e59a6546aa50d098492280e51d5873 100644
|
index 670335a7bbfbc9da64c389977498c22dfcd03251..b6d64950dc865eb0e315947902bac22162fd3a30 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
--- a/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
+++ b/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java
|
||||||
@@ -118,8 +118,17 @@ public abstract class StructurePlacement {
|
@@ -118,8 +118,17 @@ public abstract class StructurePlacement {
|
||||||
@@ -402,9 +402,9 @@ index 670335a7bbfbc9da64c389977498c22dfcd03251..7b49200486e59a6546aa50d098492280
|
|||||||
- worldgenRandom.setLargeFeatureWithSalt(levelSeed, regionX, regionZ, salt);
|
- worldgenRandom.setLargeFeatureWithSalt(levelSeed, regionX, regionZ, salt);
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom;
|
+ WorldgenRandom worldgenRandom;
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) {
|
||||||
+ worldgenRandom = new space.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
+ worldgenRandom = new org.bxteam.divinemc.seed.WorldgenCryptoRandom(
|
||||||
+ regionX, regionZ, space.bxteam.divinemc.seed.Globals.Salt.UNDEFINED, salt
|
+ regionX, regionZ, org.bxteam.divinemc.seed.Globals.Salt.UNDEFINED, salt
|
||||||
+ );
|
+ );
|
||||||
+ } else {
|
+ } else {
|
||||||
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
+ worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
|
||||||
@@ -415,7 +415,7 @@ index 670335a7bbfbc9da64c389977498c22dfcd03251..7b49200486e59a6546aa50d098492280
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
diff --git a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
||||||
index eb85edaa3b7fab4f11545b0fa8bfea882dedb67d..b9b15705ee20175451cfcac5795939d787ce0cef 100644
|
index eb85edaa3b7fab4f11545b0fa8bfea882dedb67d..a0695a3fa1004c6fddfafe3b89f90cc3efc584e8 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
--- a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
+++ b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
|
||||||
@@ -64,7 +64,11 @@ public class JigsawPlacement {
|
@@ -64,7 +64,11 @@ public class JigsawPlacement {
|
||||||
@@ -424,8 +424,8 @@ index eb85edaa3b7fab4f11545b0fa8bfea882dedb67d..b9b15705ee20175451cfcac5795939d7
|
|||||||
LevelHeightAccessor levelHeightAccessor = context.heightAccessor();
|
LevelHeightAccessor levelHeightAccessor = context.heightAccessor();
|
||||||
- WorldgenRandom worldgenRandom = context.random();
|
- WorldgenRandom worldgenRandom = context.random();
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldgenRandom worldgenRandom = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ WorldgenRandom worldgenRandom = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? new space.bxteam.divinemc.seed.WorldgenCryptoRandom(context.chunkPos().x, context.chunkPos().z, space.bxteam.divinemc.seed.Globals.Salt.JIGSAW_PLACEMENT, 0)
|
+ ? new org.bxteam.divinemc.seed.WorldgenCryptoRandom(context.chunkPos().x, context.chunkPos().z, org.bxteam.divinemc.seed.Globals.Salt.JIGSAW_PLACEMENT, 0)
|
||||||
+ : context.random();
|
+ : context.random();
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
Registry<StructureTemplatePool> registry = registryAccess.lookupOrThrow(Registries.TEMPLATE_POOL);
|
Registry<StructureTemplatePool> registry = registryAccess.lookupOrThrow(Registries.TEMPLATE_POOL);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Multithreaded Tracker
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
||||||
index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94bad96a2d5f 100644
|
index 94da5ce57b27047443859503f6dcc01d0493021a..c29b476916c3c0a0d8ed97ac432e545f3ecfdaaf 100644
|
||||||
--- a/net/minecraft/server/level/ChunkMap.java
|
--- a/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
+++ b/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -250,9 +250,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -250,9 +250,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@@ -15,7 +15,7 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
- for (int i = 0, len = inRange.size(); i < len; i++) {
|
- for (int i = 0, len = inRange.size(); i < len; i++) {
|
||||||
- ++(backingSet[i].mobCounts[index]);
|
- ++(backingSet[i].mobCounts[index]);
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||||
+ for (int i = 0, len = inRange.size(); i < len; i++) {
|
+ for (int i = 0, len = inRange.size(); i < len; i++) {
|
||||||
+ final ServerPlayer player = backingSet[i];
|
+ final ServerPlayer player = backingSet[i];
|
||||||
+ if (player == null) continue;
|
+ if (player == null) continue;
|
||||||
@@ -57,9 +57,9 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
|
|
||||||
protected void tick() {
|
protected void tick() {
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||||
+ final ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel level = this.level;
|
+ final ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel level = this.level;
|
||||||
+ space.bxteam.divinemc.tracker.MultithreadedTracker.tick(level);
|
+ org.bxteam.divinemc.tracker.MultithreadedTracker.tick(level);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - Multithreaded tracker
|
+ // DivineMC end - Multithreaded tracker
|
||||||
@@ -72,7 +72,7 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
SectionPos lastSectionPos;
|
SectionPos lastSectionPos;
|
||||||
- public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
- public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ public final Set<ServerPlayerConnection> seenBy = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
+ public final Set<ServerPlayerConnection> seenBy = org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
||||||
+ ? com.google.common.collect.Sets.newConcurrentHashSet()
|
+ ? com.google.common.collect.Sets.newConcurrentHashSet()
|
||||||
+ : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
+ : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||||
+ // DivineMC end - Multithreaded tracker
|
+ // DivineMC end - Multithreaded tracker
|
||||||
@@ -86,7 +86,7 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
+ final int playersLen = players.size(); // Ensure length won't change in the future tasks
|
+ final int playersLen = players.size(); // Ensure length won't change in the future tasks
|
||||||
+
|
+
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && space.bxteam.divinemc.configuration.DivineConfig.multithreadedCompatModeEnabled) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && org.bxteam.divinemc.configuration.DivineConfig.multithreadedCompatModeEnabled) {
|
||||||
+ final boolean isServerPlayer = this.entity instanceof ServerPlayer;
|
+ final boolean isServerPlayer = this.entity instanceof ServerPlayer;
|
||||||
+ final boolean isRealPlayer = isServerPlayer && ((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer) this.entity).moonrise$isRealPlayer();
|
+ final boolean isRealPlayer = isServerPlayer && ((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer) this.entity).moonrise$isRealPlayer();
|
||||||
+ Runnable updatePlayerTasks = () -> {
|
+ Runnable updatePlayerTasks = () -> {
|
||||||
@@ -115,7 +115,7 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
+ // To prevent visible issue with player type NPCs
|
+ // To prevent visible issue with player type NPCs
|
||||||
+ // btw, still recommend to use packet based NPC plugins, like ZNPC Plus, Adyeshach, Fancy NPC, etc.
|
+ // btw, still recommend to use packet based NPC plugins, like ZNPC Plus, Adyeshach, Fancy NPC, etc.
|
||||||
+ if (isRealPlayer || !isServerPlayer) {
|
+ if (isRealPlayer || !isServerPlayer) {
|
||||||
+ space.bxteam.divinemc.tracker.MultithreadedTracker.getTrackerExecutor().execute(updatePlayerTasks);
|
+ org.bxteam.divinemc.tracker.MultithreadedTracker.getTrackerExecutor().execute(updatePlayerTasks);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ updatePlayerTasks.run();
|
+ updatePlayerTasks.run();
|
||||||
+ }
|
+ }
|
||||||
@@ -178,12 +178,12 @@ index 94da5ce57b27047443859503f6dcc01d0493021a..15a5e2d95260bfb33f286853c04e94ba
|
|||||||
- org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
- org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
||||||
+ //org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // DivineMC - Multithreaded tracker - we don't need this
|
+ //org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // DivineMC - Multithreaded tracker - we don't need this
|
||||||
if (player != this.entity) {
|
if (player != this.entity) {
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && player == null) return; // DivineMC - Multithreaded tracker
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && player == null) return; // DivineMC - Multithreaded tracker
|
||||||
// Paper start - remove allocation of Vec3D here
|
// Paper start - remove allocation of Vec3D here
|
||||||
// Vec3 vec3 = player.position().subtract(this.entity.position());
|
// Vec3 vec3 = player.position().subtract(this.entity.position());
|
||||||
double vec3_dx = player.getX() - this.entity.getX();
|
double vec3_dx = player.getX() - this.entity.getX();
|
||||||
diff --git a/net/minecraft/server/level/ServerBossEvent.java b/net/minecraft/server/level/ServerBossEvent.java
|
diff --git a/net/minecraft/server/level/ServerBossEvent.java b/net/minecraft/server/level/ServerBossEvent.java
|
||||||
index f106373ef3ac4a8685c2939c9e8361688a285913..7b0663caa87fa91c6eba3b88dfe9fe83a1cf5cbf 100644
|
index f106373ef3ac4a8685c2939c9e8361688a285913..b9f3414da5337c3675d9564f132497d311c0ca9c 100644
|
||||||
--- a/net/minecraft/server/level/ServerBossEvent.java
|
--- a/net/minecraft/server/level/ServerBossEvent.java
|
||||||
+++ b/net/minecraft/server/level/ServerBossEvent.java
|
+++ b/net/minecraft/server/level/ServerBossEvent.java
|
||||||
@@ -13,7 +13,11 @@ import net.minecraft.util.Mth;
|
@@ -13,7 +13,11 @@ import net.minecraft.util.Mth;
|
||||||
@@ -192,7 +192,7 @@ index f106373ef3ac4a8685c2939c9e8361688a285913..7b0663caa87fa91c6eba3b88dfe9fe83
|
|||||||
public class ServerBossEvent extends BossEvent {
|
public class ServerBossEvent extends BossEvent {
|
||||||
- private final Set<ServerPlayer> players = Sets.newHashSet();
|
- private final Set<ServerPlayer> players = Sets.newHashSet();
|
||||||
+ // DivineMC start - Multithreaded tracker - players can be removed in async tracking
|
+ // DivineMC start - Multithreaded tracker - players can be removed in async tracking
|
||||||
+ private final Set<ServerPlayer> players = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
+ private final Set<ServerPlayer> players = org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
||||||
+ ? Sets.newConcurrentHashSet()
|
+ ? Sets.newConcurrentHashSet()
|
||||||
+ : Sets.newHashSet();
|
+ : Sets.newHashSet();
|
||||||
+ // DivineMC end - Multithreaded tracker
|
+ // DivineMC end - Multithreaded tracker
|
||||||
@@ -200,7 +200,7 @@ index f106373ef3ac4a8685c2939c9e8361688a285913..7b0663caa87fa91c6eba3b88dfe9fe83
|
|||||||
public boolean visible = true;
|
public boolean visible = true;
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
index 6d2c892207c2299c64f59630fb7740d6407e76a7..50195569421527faf7d3a65cb6be3b559936af07 100644
|
index 6d2c892207c2299c64f59630fb7740d6407e76a7..2d40583089b5b627cf5ed9570469398590931ccc 100644
|
||||||
--- a/net/minecraft/server/level/ServerEntity.java
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/net/minecraft/server/level/ServerEntity.java
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -110,8 +110,13 @@ public class ServerEntity {
|
@@ -110,8 +110,13 @@ public class ServerEntity {
|
||||||
@@ -210,7 +210,7 @@ index 6d2c892207c2299c64f59630fb7740d6407e76a7..50195569421527faf7d3a65cb6be3b55
|
|||||||
- serverPlayer1.connection
|
- serverPlayer1.connection
|
||||||
- .teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
|
- .teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && Thread.currentThread() instanceof space.bxteam.divinemc.tracker.MultithreadedTracker.MultithreadedTrackerThread) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && Thread.currentThread() instanceof org.bxteam.divinemc.tracker.MultithreadedTracker.MultithreadedTrackerThread) {
|
||||||
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> serverPlayer1.connection.teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot()));
|
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> serverPlayer1.connection.teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot()));
|
||||||
+ } else {
|
+ } else {
|
||||||
+ serverPlayer1.connection.teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
|
+ serverPlayer1.connection.teleport(serverPlayer1.getX(), serverPlayer1.getY(), serverPlayer1.getZ(), serverPlayer1.getYRot(), serverPlayer1.getXRot());
|
||||||
@@ -270,7 +270,7 @@ index 6d2c892207c2299c64f59630fb7740d6407e76a7..50195569421527faf7d3a65cb6be3b55
|
|||||||
|
|
||||||
attributes.clear();
|
attributes.clear();
|
||||||
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 8127a71fd7d45541525be75e6699c2a5bae95f5f..e6a55f6fa9f4b827d14ae29c82cb7e30cfa5d56a 100644
|
index 28f84d1200ba75d72ea94f831178b9d4e1fc61d2..1931965c6d071b0872e3bc41ab8433ba72812813 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
|
||||||
@@ -2512,7 +2512,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2512,7 +2512,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@@ -283,7 +283,7 @@ index 8127a71fd7d45541525be75e6699c2a5bae95f5f..e6a55f6fa9f4b827d14ae29c82cb7e30
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
index c20d9cf66641a70a724c93599d668eb7b16bbb42..f4f47bb6ad9a5ae981b0de3fbc1405ea1e8a3947 100644
|
index 2fcdb3c21b4d5fdba3df1bc6dac49f809f626fbb..0ce344ff7e7a06facdfc7a28fe905f1b99a6c8cb 100644
|
||||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1813,7 +1813,7 @@ public class ServerGamePacketListenerImpl
|
@@ -1813,7 +1813,7 @@ public class ServerGamePacketListenerImpl
|
||||||
@@ -296,7 +296,7 @@ index c20d9cf66641a70a724c93599d668eb7b16bbb42..f4f47bb6ad9a5ae981b0de3fbc1405ea
|
|||||||
if (this.player.isRemoved()) {
|
if (this.player.isRemoved()) {
|
||||||
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
|
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
|
||||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||||
index 8013594bb4844e7a8abf28123958e7f632d39341..55a2777ed76baef8fa6ed899e96028db0d4682f8 100644
|
index 8013594bb4844e7a8abf28123958e7f632d39341..61ea771f6a63d9f773451775736539d9c6da9623 100644
|
||||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||||
@@ -24,8 +24,11 @@ public class AttributeInstance {
|
@@ -24,8 +24,11 @@ public class AttributeInstance {
|
||||||
@@ -306,7 +306,7 @@ index 8013594bb4844e7a8abf28123958e7f632d39341..55a2777ed76baef8fa6ed899e96028db
|
|||||||
- private final Map<ResourceLocation, AttributeModifier> modifierById = new Object2ObjectArrayMap<>();
|
- private final Map<ResourceLocation, AttributeModifier> modifierById = new Object2ObjectArrayMap<>();
|
||||||
- private final Map<ResourceLocation, AttributeModifier> permanentModifiers = new Object2ObjectArrayMap<>();
|
- private final Map<ResourceLocation, AttributeModifier> permanentModifiers = new Object2ObjectArrayMap<>();
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ private final boolean multiThreadedTrackingEnabled = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
+ private final boolean multiThreadedTrackingEnabled = org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
||||||
+ private final Map<ResourceLocation, AttributeModifier> modifierById = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
+ private final Map<ResourceLocation, AttributeModifier> modifierById = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
||||||
+ private final Map<ResourceLocation, AttributeModifier> permanentModifiers = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
+ private final Map<ResourceLocation, AttributeModifier> permanentModifiers = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
||||||
+ // DivineMC end - Multithreaded tracker
|
+ // DivineMC end - Multithreaded tracker
|
||||||
@@ -314,7 +314,7 @@ index 8013594bb4844e7a8abf28123958e7f632d39341..55a2777ed76baef8fa6ed899e96028db
|
|||||||
private boolean dirty = true;
|
private boolean dirty = true;
|
||||||
private double cachedValue;
|
private double cachedValue;
|
||||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
index a25d74592e89e3d6339479c6dc2b6f45d1932cfc..328474691eb42505cd535494c04fab0bdeb0a953 100644
|
index a25d74592e89e3d6339479c6dc2b6f45d1932cfc..16ff02f17904c64276cbd64e8891ac64b51c3bc6 100644
|
||||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
@@ -19,9 +19,12 @@ import org.slf4j.Logger;
|
@@ -19,9 +19,12 @@ import org.slf4j.Logger;
|
||||||
@@ -325,7 +325,7 @@ index a25d74592e89e3d6339479c6dc2b6f45d1932cfc..328474691eb42505cd535494c04fab0b
|
|||||||
- private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
- private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||||
- private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
- private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ private final boolean multiThreadedTrackingEnabled = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
+ private final boolean multiThreadedTrackingEnabled = org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
||||||
+ private final Map<Holder<Attribute>, AttributeInstance> attributes = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(0);
|
+ private final Map<Holder<Attribute>, AttributeInstance> attributes = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(0);
|
||||||
+ private final Set<AttributeInstance> attributesToSync = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
+ private final Set<AttributeInstance> attributesToSync = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
||||||
+ private final Set<AttributeInstance> attributesToUpdate = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
+ private final Set<AttributeInstance> attributesToUpdate = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Linear is a region file format that uses ZSTD compression instead of ZLIB. This
|
|||||||
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
|
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||||
index a814512fcfb85312474ae2c2c21443843bf57831..c2bc8464cf3f1722394d55d91f638f576ee47f49 100644
|
index a814512fcfb85312474ae2c2c21443843bf57831..f2a1b0f703c08bcea85a8e946ff4ebbb0ee59e01 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||||
@@ -8,9 +8,9 @@ public interface ChunkSystemRegionFileStorage {
|
@@ -8,9 +8,9 @@ public interface ChunkSystemRegionFileStorage {
|
||||||
@@ -15,15 +15,15 @@ index a814512fcfb85312474ae2c2c21443843bf57831..c2bc8464cf3f1722394d55d91f638f57
|
|||||||
public boolean moonrise$doesRegionFileNotExistNoIO(final int chunkX, final int chunkZ);
|
public boolean moonrise$doesRegionFileNotExistNoIO(final int chunkX, final int chunkZ);
|
||||||
|
|
||||||
- public RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ);
|
- public RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ);
|
||||||
+ public space.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // DivineMC - linear region format
|
+ public org.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // DivineMC - linear region format
|
||||||
|
|
||||||
- public RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException;
|
- public RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException;
|
||||||
+ public space.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // DivineMC - linear region format
|
+ public org.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // DivineMC - linear region format
|
||||||
|
|
||||||
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
|
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
|
||||||
final int chunkX, final int chunkZ, final CompoundTag compound
|
final int chunkX, final int chunkZ, final CompoundTag compound
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
index 98fbc5c8044bd945d64569f13412a6e7e49a4e7f..25e205654ef0450f61c57e16c52d7aa559d83ec3 100644
|
index 98fbc5c8044bd945d64569f13412a6e7e49a4e7f..60a08ca6aac19b3f205ae7543afc342b17425ec1 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
@@ -1260,7 +1260,7 @@ public final class MoonriseRegionFileIO {
|
@@ -1260,7 +1260,7 @@ public final class MoonriseRegionFileIO {
|
||||||
@@ -31,7 +31,7 @@ index 98fbc5c8044bd945d64569f13412a6e7e49a4e7f..25e205654ef0450f61c57e16c52d7aa5
|
|||||||
// Paper start - flush regionfiles on save
|
// Paper start - flush regionfiles on save
|
||||||
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
|
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
|
||||||
- final RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ);
|
- final RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ);
|
||||||
+ final space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // DivineMC - linear region format
|
+ final org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // DivineMC - linear region format
|
||||||
if (regionFile != null) {
|
if (regionFile != null) {
|
||||||
regionFile.flush();
|
regionFile.flush();
|
||||||
} // else: evicted from cache, which should have called flush
|
} // else: evicted from cache, which should have called flush
|
||||||
@@ -40,12 +40,12 @@ index 98fbc5c8044bd945d64569f13412a6e7e49a4e7f..25e205654ef0450f61c57e16c52d7aa5
|
|||||||
public static interface IORunnable {
|
public static interface IORunnable {
|
||||||
|
|
||||||
- public void run(final RegionFile regionFile) throws IOException;
|
- public void run(final RegionFile regionFile) throws IOException;
|
||||||
+ public void run(final space.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException; // DivineMC - linear region format
|
+ public void run(final org.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException; // DivineMC - linear region format
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||||
index 51c126735ace8fdde89ad97b5cab62f244212db0..cf497c3919a1d5114a18474f04ccce182a6b7e0b 100644
|
index 51c126735ace8fdde89ad97b5cab62f244212db0..cea71a1de9ac2d391e67407e7f479e877f00ccc9 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||||
@@ -8,5 +8,5 @@ public interface ChunkSystemChunkBuffer {
|
@@ -8,5 +8,5 @@ public interface ChunkSystemChunkBuffer {
|
||||||
@@ -53,7 +53,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..cf497c3919a1d5114a18474f04ccce18
|
|||||||
public void moonrise$setWriteOnClose(final boolean value);
|
public void moonrise$setWriteOnClose(final boolean value);
|
||||||
|
|
||||||
- public void moonrise$write(final RegionFile regionFile) throws IOException;
|
- public void moonrise$write(final RegionFile regionFile) throws IOException;
|
||||||
+ public void moonrise$write(final space.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException; // DivineMC - linear region format
|
+ public void moonrise$write(final org.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException; // DivineMC - linear region format
|
||||||
}
|
}
|
||||||
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 989be9b9ea224efecb1bb5998fdf6ceeed2850ae..836224638eca453cd7c83f393c08f3fc86c3da2b 100644
|
index 989be9b9ea224efecb1bb5998fdf6ceeed2850ae..836224638eca453cd7c83f393c08f3fc86c3da2b 100644
|
||||||
@@ -73,7 +73,7 @@ index 989be9b9ea224efecb1bb5998fdf6ceeed2850ae..836224638eca453cd7c83f393c08f3fc
|
|||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
diff --git a/net/minecraft/util/worldupdate/WorldUpgrader.java b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
diff --git a/net/minecraft/util/worldupdate/WorldUpgrader.java b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
index e0bcda2ddea0d6633445a7440fbf0d18e50a7653..6509662ee5de204f7ecf58f533d8d2cb38f67e97 100644
|
index e0bcda2ddea0d6633445a7440fbf0d18e50a7653..7daa1fbdad6ed24dd874cf7b62a86d7e1a9636ea 100644
|
||||||
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
@@ -72,7 +72,7 @@ public class WorldUpgrader implements AutoCloseable {
|
@@ -72,7 +72,7 @@ public class WorldUpgrader implements AutoCloseable {
|
||||||
@@ -99,7 +99,7 @@ index e0bcda2ddea0d6633445a7440fbf0d18e50a7653..6509662ee5de204f7ecf58f533d8d2cb
|
|||||||
List<ChunkPos> list1 = Lists.newArrayList();
|
List<ChunkPos> list1 = Lists.newArrayList();
|
||||||
|
|
||||||
- try (RegionFile regionFile = new RegionFile(regionStorageInfo, file.toPath(), path, true)) {
|
- try (RegionFile regionFile = new RegionFile(regionStorageInfo, file.toPath(), path, true)) {
|
||||||
+ try (space.bxteam.divinemc.region.AbstractRegionFile regionFile = space.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(regionStorageInfo, file.toPath(), path, true)) { // DivineMC - linear region format
|
+ try (org.bxteam.divinemc.region.AbstractRegionFile regionFile = org.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(regionStorageInfo, file.toPath(), path, true)) { // DivineMC - linear region format
|
||||||
for (int i2 = 0; i2 < 32; i2++) {
|
for (int i2 = 0; i2 < 32; i2++) {
|
||||||
for (int i3 = 0; i3 < 32; i3++) {
|
for (int i3 = 0; i3 < 32; i3++) {
|
||||||
ChunkPos chunkPos = new ChunkPos(i2 + i, i3 + i1);
|
ChunkPos chunkPos = new ChunkPos(i2 + i, i3 + i1);
|
||||||
@@ -108,7 +108,7 @@ index e0bcda2ddea0d6633445a7440fbf0d18e50a7653..6509662ee5de204f7ecf58f533d8d2cb
|
|||||||
protected abstract boolean tryProcessOnePosition(T chunkStorage, ChunkPos chunkPos, ResourceKey<Level> dimension);
|
protected abstract boolean tryProcessOnePosition(T chunkStorage, ChunkPos chunkPos, ResourceKey<Level> dimension);
|
||||||
|
|
||||||
- private void onFileFinished(RegionFile regionFile) {
|
- private void onFileFinished(RegionFile regionFile) {
|
||||||
+ private void onFileFinished(space.bxteam.divinemc.region.AbstractRegionFile regionFile) { // DivineMC - linear region format
|
+ private void onFileFinished(org.bxteam.divinemc.region.AbstractRegionFile regionFile) { // DivineMC - linear region format
|
||||||
if (WorldUpgrader.this.recreateRegionFiles) {
|
if (WorldUpgrader.this.recreateRegionFiles) {
|
||||||
if (this.previousWriteFuture != null) {
|
if (this.previousWriteFuture != null) {
|
||||||
this.previousWriteFuture.join();
|
this.previousWriteFuture.join();
|
||||||
@@ -117,12 +117,12 @@ index e0bcda2ddea0d6633445a7440fbf0d18e50a7653..6509662ee5de204f7ecf58f533d8d2cb
|
|||||||
}
|
}
|
||||||
|
|
||||||
- record FileToUpgrade(RegionFile file, List<ChunkPos> chunksToUpgrade) {
|
- record FileToUpgrade(RegionFile file, List<ChunkPos> chunksToUpgrade) {
|
||||||
+ record FileToUpgrade(space.bxteam.divinemc.region.AbstractRegionFile file, List<ChunkPos> chunksToUpgrade) { // DivineMC - linear region format
|
+ record FileToUpgrade(org.bxteam.divinemc.region.AbstractRegionFile file, List<ChunkPos> chunksToUpgrade) { // DivineMC - linear region format
|
||||||
}
|
}
|
||||||
|
|
||||||
class PoiUpgrader extends WorldUpgrader.SimpleRegionStorageUpgrader {
|
class PoiUpgrader extends WorldUpgrader.SimpleRegionStorageUpgrader {
|
||||||
diff --git a/net/minecraft/world/level/chunk/storage/RegionFile.java b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/net/minecraft/world/level/chunk/storage/RegionFile.java b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index c72494e757a9dc50e053dbc873f7b30e83d5cb8c..236035219dd2442592bb94994a44fab712b5ca9d 100644
|
index c72494e757a9dc50e053dbc873f7b30e83d5cb8c..7bfe510a8cd94b130abb674a606c1ae578e3b0e8 100644
|
||||||
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -22,7 +22,7 @@ import net.minecraft.util.profiling.jfr.JvmProfiler;
|
@@ -22,7 +22,7 @@ import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||||
@@ -130,7 +130,7 @@ index c72494e757a9dc50e053dbc873f7b30e83d5cb8c..236035219dd2442592bb94994a44fab7
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
-public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile { // Paper - rewrite chunk system
|
-public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile { // Paper - rewrite chunk system
|
||||||
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile, space.bxteam.divinemc.region.AbstractRegionFile { // Paper - rewrite chunk system // DivineMC - linear region format
|
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile, org.bxteam.divinemc.region.AbstractRegionFile { // Paper - rewrite chunk system // DivineMC - linear region format
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
public static final int MAX_CHUNK_SIZE = 500 * 1024 * 1024; // Paper - don't write garbage data to disk if writing serialization fails
|
public static final int MAX_CHUNK_SIZE = 500 * 1024 * 1024; // Paper - don't write garbage data to disk if writing serialization fails
|
||||||
private static final int SECTOR_BYTES = 4096;
|
private static final int SECTOR_BYTES = 4096;
|
||||||
@@ -139,12 +139,12 @@ index c72494e757a9dc50e053dbc873f7b30e83d5cb8c..236035219dd2442592bb94994a44fab7
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
- public final void moonrise$write(final RegionFile regionFile) throws IOException {
|
- public final void moonrise$write(final RegionFile regionFile) throws IOException {
|
||||||
+ public final void moonrise$write(final space.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException { // DivineMC - linear region format
|
+ public final void moonrise$write(final org.bxteam.divinemc.region.AbstractRegionFile regionFile) throws IOException { // DivineMC - linear region format
|
||||||
regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count));
|
regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count));
|
||||||
}
|
}
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e08592f35d835 100644
|
index 6ebd1300c2561116b83cb2472ac7939ead36d576..ca288e45e039ce06ddfda358f32fa843508e614a 100644
|
||||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -18,7 +18,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
@@ -18,7 +18,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||||
@@ -152,7 +152,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
public static final String ANVIL_EXTENSION = ".mca";
|
public static final String ANVIL_EXTENSION = ".mca";
|
||||||
private static final int MAX_CACHE_SIZE = 256;
|
private static final int MAX_CACHE_SIZE = 256;
|
||||||
- public final Long2ObjectLinkedOpenHashMap<RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>();
|
- public final Long2ObjectLinkedOpenHashMap<RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>();
|
||||||
+ public final Long2ObjectLinkedOpenHashMap<space.bxteam.divinemc.region.AbstractRegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // DivineMC - linear region format
|
+ public final Long2ObjectLinkedOpenHashMap<org.bxteam.divinemc.region.AbstractRegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // DivineMC - linear region format
|
||||||
private final RegionStorageInfo info;
|
private final RegionStorageInfo info;
|
||||||
private final Path folder;
|
private final Path folder;
|
||||||
private final boolean sync;
|
private final boolean sync;
|
||||||
@@ -172,7 +172,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
- private static String getRegionFileName(final int chunkX, final int chunkZ) {
|
- private static String getRegionFileName(final int chunkX, final int chunkZ) {
|
||||||
+ // DivineMC start - Linear region format
|
+ // DivineMC start - Linear region format
|
||||||
+ private static String getRegionFileName(final RegionStorageInfo info, final int chunkX, final int chunkZ) {
|
+ private static String getRegionFileName(final RegionStorageInfo info, final int chunkX, final int chunkZ) {
|
||||||
+ if (info.regionFormat().equals(space.bxteam.divinemc.region.RegionFileFormat.LINEAR)) {
|
+ if (info.regionFormat().equals(org.bxteam.divinemc.region.RegionFileFormat.LINEAR)) {
|
||||||
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".linear";
|
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".linear";
|
||||||
+ }
|
+ }
|
||||||
return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".mca";
|
return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".mca";
|
||||||
@@ -186,17 +186,17 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
- public synchronized final RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) {
|
- public synchronized final RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) {
|
||||||
+ public synchronized final space.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // DivineMC - linear region format
|
+ public synchronized final org.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // DivineMC - linear region format
|
||||||
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT));
|
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
- public synchronized final RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException {
|
- public synchronized final RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException {
|
||||||
+ public synchronized final space.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // DivineMC - linear region format
|
+ public synchronized final org.bxteam.divinemc.region.AbstractRegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // DivineMC - linear region format
|
||||||
final long key = ChunkPos.asLong(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT);
|
final long key = ChunkPos.asLong(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT);
|
||||||
|
|
||||||
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
||||||
+ space.bxteam.divinemc.region.AbstractRegionFile ret = this.regionCache.getAndMoveToFirst(key); // DivineMC - linear region format
|
+ org.bxteam.divinemc.region.AbstractRegionFile ret = this.regionCache.getAndMoveToFirst(key); // DivineMC - linear region format
|
||||||
if (ret != null) {
|
if (ret != null) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
FileUtil.createDirectoriesSafe(this.folder);
|
FileUtil.createDirectoriesSafe(this.folder);
|
||||||
|
|
||||||
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
||||||
+ ret = space.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(this.info, regionPath, this.folder, this.sync); // DivineMC - linear region format
|
+ ret = org.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(this.info, regionPath, this.folder, this.sync); // DivineMC - linear region format
|
||||||
|
|
||||||
this.regionCache.putAndMoveToFirst(key, ret);
|
this.regionCache.putAndMoveToFirst(key, ret);
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
|
|
||||||
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
||||||
- final RegionFile regionFile = this.getRegionFile(pos);
|
- final RegionFile regionFile = this.getRegionFile(pos);
|
||||||
+ final space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(pos); // DivineMC - linear region format
|
+ final org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(pos); // DivineMC - linear region format
|
||||||
|
|
||||||
// note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input
|
// note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input
|
||||||
// (and, the regionfile parameter is unused for writing until the write call)
|
// (and, the regionfile parameter is unused for writing until the write call)
|
||||||
@@ -237,7 +237,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
||||||
if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) {
|
if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) {
|
||||||
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
||||||
+ final space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // DivineMC - linear region format
|
+ final org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // DivineMC - linear region format
|
||||||
if (regionFile != null) {
|
if (regionFile != null) {
|
||||||
regionFile.clear(pos);
|
regionFile.clear(pos);
|
||||||
} // else: didn't exist
|
} // else: didn't exist
|
||||||
@@ -246,7 +246,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
final int chunkX, final int chunkZ
|
final int chunkX, final int chunkZ
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
||||||
+ final space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // DivineMC - linear region format
|
+ final org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // DivineMC - linear region format
|
||||||
|
|
||||||
final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ));
|
final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ));
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
- public RegionFile getRegionFile(ChunkPos chunkcoordintpair) throws IOException {
|
- public RegionFile getRegionFile(ChunkPos chunkcoordintpair) throws IOException {
|
||||||
+ public space.bxteam.divinemc.region.AbstractRegionFile getRegionFile(ChunkPos chunkcoordintpair) throws IOException { // DivineMC - linear region format
|
+ public org.bxteam.divinemc.region.AbstractRegionFile getRegionFile(ChunkPos chunkcoordintpair) throws IOException { // DivineMC - linear region format
|
||||||
return this.getRegionFile(chunkcoordintpair, false);
|
return this.getRegionFile(chunkcoordintpair, false);
|
||||||
}
|
}
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
@@ -264,7 +264,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
}
|
}
|
||||||
|
|
||||||
- @org.jetbrains.annotations.Contract("_, false -> !null") @Nullable private RegionFile getRegionFile(ChunkPos chunkPos, boolean existingOnly) throws IOException { // CraftBukkit
|
- @org.jetbrains.annotations.Contract("_, false -> !null") @Nullable private RegionFile getRegionFile(ChunkPos chunkPos, boolean existingOnly) throws IOException { // CraftBukkit
|
||||||
+ @org.jetbrains.annotations.Contract("_, false -> !null") @Nullable private space.bxteam.divinemc.region.AbstractRegionFile getRegionFile(ChunkPos chunkPos, boolean existingOnly) throws IOException { // CraftBukkit // DivineMC - linear region format
|
+ @org.jetbrains.annotations.Contract("_, false -> !null") @Nullable private org.bxteam.divinemc.region.AbstractRegionFile getRegionFile(ChunkPos chunkPos, boolean existingOnly) throws IOException { // CraftBukkit // DivineMC - linear region format
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
if (existingOnly) {
|
if (existingOnly) {
|
||||||
return this.moonrise$getRegionFileIfExists(chunkPos.x, chunkPos.z);
|
return this.moonrise$getRegionFileIfExists(chunkPos.x, chunkPos.z);
|
||||||
@@ -273,7 +273,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
final long key = ChunkPos.asLong(chunkPos.x >> REGION_SHIFT, chunkPos.z >> REGION_SHIFT);
|
final long key = ChunkPos.asLong(chunkPos.x >> REGION_SHIFT, chunkPos.z >> REGION_SHIFT);
|
||||||
|
|
||||||
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
||||||
+ space.bxteam.divinemc.region.AbstractRegionFile ret = this.regionCache.getAndMoveToFirst(key); // DivineMC - linear region format
|
+ org.bxteam.divinemc.region.AbstractRegionFile ret = this.regionCache.getAndMoveToFirst(key); // DivineMC - linear region format
|
||||||
if (ret != null) {
|
if (ret != null) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
FileUtil.createDirectoriesSafe(this.folder);
|
FileUtil.createDirectoriesSafe(this.folder);
|
||||||
|
|
||||||
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
||||||
+ ret = space.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(this.info, regionPath, this.folder, this.sync); // DivineMC - linear region format
|
+ ret = org.bxteam.divinemc.region.AbstractRegionFileFactory.getAbstractRegionFile(this.info, regionPath, this.folder, this.sync); // DivineMC - linear region format
|
||||||
|
|
||||||
this.regionCache.putAndMoveToFirst(key, ret);
|
this.regionCache.putAndMoveToFirst(key, ret);
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
}
|
}
|
||||||
|
|
||||||
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||||
+ private static CompoundTag readOversizedChunk(space.bxteam.divinemc.region.AbstractRegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
+ private static CompoundTag readOversizedChunk(org.bxteam.divinemc.region.AbstractRegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||||
synchronized (regionfile) {
|
synchronized (regionfile) {
|
||||||
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||||
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||||
@@ -307,7 +307,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
public CompoundTag read(ChunkPos chunkPos) throws IOException {
|
public CompoundTag read(ChunkPos chunkPos) throws IOException {
|
||||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||||
- RegionFile regionFile = this.getRegionFile(chunkPos, true);
|
- RegionFile regionFile = this.getRegionFile(chunkPos, true);
|
||||||
+ space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, true); // DivineMC - linear region format
|
+ org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, true); // DivineMC - linear region format
|
||||||
if (regionFile == null) {
|
if (regionFile == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -316,7 +316,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
public void scanChunk(ChunkPos chunkPos, StreamTagVisitor visitor) throws IOException {
|
public void scanChunk(ChunkPos chunkPos, StreamTagVisitor visitor) throws IOException {
|
||||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||||
- RegionFile regionFile = this.getRegionFile(chunkPos, true);
|
- RegionFile regionFile = this.getRegionFile(chunkPos, true);
|
||||||
+ space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, true); // DivineMC - linear region format
|
+ org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, true); // DivineMC - linear region format
|
||||||
if (regionFile == null) {
|
if (regionFile == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
|
|
||||||
public void write(ChunkPos chunkPos, @Nullable CompoundTag chunkData) throws IOException { // Paper - rewrite chunk system - public
|
public void write(ChunkPos chunkPos, @Nullable CompoundTag chunkData) throws IOException { // Paper - rewrite chunk system - public
|
||||||
- RegionFile regionFile = this.getRegionFile(chunkPos, chunkData == null); // CraftBukkit // Paper - rewrite chunk system
|
- RegionFile regionFile = this.getRegionFile(chunkPos, chunkData == null); // CraftBukkit // Paper - rewrite chunk system
|
||||||
+ space.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, chunkData == null); // CraftBukkit // Paper - rewrite chunk system // DivineMC - linear region format
|
+ org.bxteam.divinemc.region.AbstractRegionFile regionFile = this.getRegionFile(chunkPos, chunkData == null); // CraftBukkit // Paper - rewrite chunk system // DivineMC - linear region format
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
if (regionFile == null) {
|
if (regionFile == null) {
|
||||||
// if the RegionFile doesn't exist, no point in deleting from it
|
// if the RegionFile doesn't exist, no point in deleting from it
|
||||||
@@ -334,7 +334,7 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
||||||
- for (final RegionFile regionFile : this.regionCache.values()) {
|
- for (final RegionFile regionFile : this.regionCache.values()) {
|
||||||
+ for (final space.bxteam.divinemc.region.AbstractRegionFile regionFile : this.regionCache.values()) { // DivineMC - linear region format
|
+ for (final org.bxteam.divinemc.region.AbstractRegionFile regionFile : this.regionCache.values()) { // DivineMC - linear region format
|
||||||
try {
|
try {
|
||||||
regionFile.close();
|
regionFile.close();
|
||||||
} catch (final IOException ex) {
|
} catch (final IOException ex) {
|
||||||
@@ -343,12 +343,12 @@ index 6ebd1300c2561116b83cb2472ac7939ead36d576..6da756cb0a406a76151a5b2f624e0859
|
|||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
||||||
- for (final RegionFile regionFile : this.regionCache.values()) {
|
- for (final RegionFile regionFile : this.regionCache.values()) {
|
||||||
+ for (final space.bxteam.divinemc.region.AbstractRegionFile regionFile : this.regionCache.values()) { // DivineMC - linear region format
|
+ for (final org.bxteam.divinemc.region.AbstractRegionFile regionFile : this.regionCache.values()) { // DivineMC - linear region format
|
||||||
try {
|
try {
|
||||||
regionFile.flush();
|
regionFile.flush();
|
||||||
} catch (final IOException ex) {
|
} catch (final IOException ex) {
|
||||||
diff --git a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java b/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
diff --git a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java b/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
||||||
index 6111631c6673948b266286894603cc5e30451b02..b49781472b34176503505e2cf2fbfd99f1d24e48 100644
|
index 6111631c6673948b266286894603cc5e30451b02..e843c568d99cb1a65cb584f12c1f86542c4c6eaf 100644
|
||||||
--- a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
--- a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
||||||
+++ b/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
+++ b/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
|
||||||
@@ -7,4 +7,20 @@ public record RegionStorageInfo(String level, ResourceKey<Level> dimension, Stri
|
@@ -7,4 +7,20 @@ public record RegionStorageInfo(String level, ResourceKey<Level> dimension, Stri
|
||||||
@@ -357,7 +357,7 @@ index 6111631c6673948b266286894603cc5e30451b02..b49781472b34176503505e2cf2fbfd99
|
|||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // DivineMC start - Linear Region format
|
+ // DivineMC start - Linear Region format
|
||||||
+ public space.bxteam.divinemc.region.RegionFileFormat regionFormat() {
|
+ public org.bxteam.divinemc.region.RegionFileFormat regionFormat() {
|
||||||
+ return ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(level))
|
+ return ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(level))
|
||||||
+ .getHandle()
|
+ .getHandle()
|
||||||
+ .divinemcConfig
|
+ .divinemcConfig
|
||||||
|
|||||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Lag Compensation
|
|||||||
|
|
||||||
|
|
||||||
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 836224638eca453cd7c83f393c08f3fc86c3da2b..e7491104c5510dcd2d9732ac3809d80b53c3a9e8 100644
|
index 836224638eca453cd7c83f393c08f3fc86c3da2b..ded121ea23494874f75f2720a967b94a79dcc136 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
|
||||||
@@ -1571,6 +1571,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1571,6 +1571,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
this.server.spark.tickStart(); // Paper - spark
|
this.server.spark.tickStart(); // Paper - spark
|
||||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled) space.bxteam.divinemc.util.LagCompensation.TPSCalculator.onTick(); // DivineMC - Lag Compensation
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled) org.bxteam.divinemc.util.LagCompensation.TPSCalculator.onTick(); // DivineMC - Lag Compensation
|
||||||
this.tickCount++;
|
this.tickCount++;
|
||||||
this.tickRateManager.tick();
|
this.tickRateManager.tick();
|
||||||
this.tickChildren(hasTimeLeft);
|
this.tickChildren(hasTimeLeft);
|
||||||
diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java
|
diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java
|
||||||
index 85629a43f5469a89dd6078d879f475e8212438ec..06cb57207182ca279abe769e3e7017eddb6ae199 100644
|
index 85629a43f5469a89dd6078d879f475e8212438ec..5e3d508b0ef80b20782ee6ed87389105031d42ea 100644
|
||||||
--- a/net/minecraft/world/level/material/LavaFluid.java
|
--- a/net/minecraft/world/level/material/LavaFluid.java
|
||||||
+++ b/net/minecraft/world/level/material/LavaFluid.java
|
+++ b/net/minecraft/world/level/material/LavaFluid.java
|
||||||
@@ -177,7 +177,13 @@ public abstract class LavaFluid extends FlowingFluid {
|
@@ -177,7 +177,13 @@ public abstract class LavaFluid extends FlowingFluid {
|
||||||
@@ -26,8 +26,8 @@ index 85629a43f5469a89dd6078d879f475e8212438ec..06cb57207182ca279abe769e3e7017ed
|
|||||||
public int getTickDelay(LevelReader level) {
|
public int getTickDelay(LevelReader level) {
|
||||||
- return level.dimensionType().ultraWarm() ? level.getWorldBorder().world.purpurConfig.lavaSpeedNether : level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur - Make lava flow speed configurable
|
- return level.dimensionType().ultraWarm() ? level.getWorldBorder().world.purpurConfig.lavaSpeedNether : level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur - Make lava flow speed configurable
|
||||||
+ // DivineMC start - Lag Compensation
|
+ // DivineMC start - Lag Compensation
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled && space.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnableForLava) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled && org.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnableForLava) {
|
||||||
+ return level.dimensionType().ultraWarm() ? space.bxteam.divinemc.util.LagCompensation.tt20(level.getWorldBorder().world.purpurConfig.lavaSpeedNether, true) : space.bxteam.divinemc.util.LagCompensation.tt20(level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether, true); // Purpur - Make lava flow speed configurable
|
+ return level.dimensionType().ultraWarm() ? org.bxteam.divinemc.util.LagCompensation.tt20(level.getWorldBorder().world.purpurConfig.lavaSpeedNether, true) : org.bxteam.divinemc.util.LagCompensation.tt20(level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether, true); // Purpur - Make lava flow speed configurable
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return level.dimensionType().ultraWarm() ? level.getWorldBorder().world.purpurConfig.lavaSpeedNether : level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur - Make lava flow speed configurable
|
+ return level.dimensionType().ultraWarm() ? level.getWorldBorder().world.purpurConfig.lavaSpeedNether : level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur - Make lava flow speed configurable
|
||||||
+ }
|
+ }
|
||||||
@@ -36,7 +36,7 @@ index 85629a43f5469a89dd6078d879f475e8212438ec..06cb57207182ca279abe769e3e7017ed
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/level/material/WaterFluid.java b/net/minecraft/world/level/material/WaterFluid.java
|
diff --git a/net/minecraft/world/level/material/WaterFluid.java b/net/minecraft/world/level/material/WaterFluid.java
|
||||||
index 2e4fed7c27910b6c886f710f33b0841c2a175837..e5886e35026690f6fcbaad18d7ca3c21c58b23d1 100644
|
index 2e4fed7c27910b6c886f710f33b0841c2a175837..22c205a11c6ec0e3c40bdb93235b70932c78b9be 100644
|
||||||
--- a/net/minecraft/world/level/material/WaterFluid.java
|
--- a/net/minecraft/world/level/material/WaterFluid.java
|
||||||
+++ b/net/minecraft/world/level/material/WaterFluid.java
|
+++ b/net/minecraft/world/level/material/WaterFluid.java
|
||||||
@@ -115,7 +115,13 @@ public abstract class WaterFluid extends FlowingFluid {
|
@@ -115,7 +115,13 @@ public abstract class WaterFluid extends FlowingFluid {
|
||||||
@@ -45,8 +45,8 @@ index 2e4fed7c27910b6c886f710f33b0841c2a175837..e5886e35026690f6fcbaad18d7ca3c21
|
|||||||
public int getTickDelay(LevelReader level) {
|
public int getTickDelay(LevelReader level) {
|
||||||
- return 5;
|
- return 5;
|
||||||
+ // DivineMC start - Lag Compensation
|
+ // DivineMC start - Lag Compensation
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled && space.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnableForWater) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnabled && org.bxteam.divinemc.configuration.DivineConfig.lagCompensationEnableForWater) {
|
||||||
+ return space.bxteam.divinemc.util.LagCompensation.tt20(5, true);
|
+ return org.bxteam.divinemc.util.LagCompensation.tt20(5, true);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return 5;
|
+ return 5;
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Async data saving
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java
|
diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||||
index de43e54698125ce9f319d4889dd49f7029fe95e0..38a36da1d6e064b538b7b95c46994772d079a9ca 100644
|
index de43e54698125ce9f319d4889dd49f7029fe95e0..cdc5ad5ba3a3c4d48609fe80bbe657da90da29fd 100644
|
||||||
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
|
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||||
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
|
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||||
@@ -514,7 +514,10 @@ public class LevelStorageSource {
|
@@ -514,7 +514,10 @@ public class LevelStorageSource {
|
||||||
@@ -15,7 +15,7 @@ index de43e54698125ce9f319d4889dd49f7029fe95e0..38a36da1d6e064b538b7b95c46994772
|
|||||||
- this.saveLevelData(compoundTag1);
|
- this.saveLevelData(compoundTag1);
|
||||||
+ // DivineMC start - Async data saving
|
+ // DivineMC start - Async data saving
|
||||||
+ Runnable runnable = () -> this.saveLevelData(compoundTag1);
|
+ Runnable runnable = () -> this.saveLevelData(compoundTag1);
|
||||||
+ space.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
+ org.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
||||||
+ // DivineMC end - Async data saving
|
+ // DivineMC end - Async data saving
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,13 +27,13 @@ index de43e54698125ce9f319d4889dd49f7029fe95e0..38a36da1d6e064b538b7b95c46994772
|
|||||||
- this.saveLevelData(levelDataTagRaw);
|
- this.saveLevelData(levelDataTagRaw);
|
||||||
+ // DivineMC start - Async data saving
|
+ // DivineMC start - Async data saving
|
||||||
+ Runnable runnable = () -> this.saveLevelData(levelDataTagRaw);
|
+ Runnable runnable = () -> this.saveLevelData(levelDataTagRaw);
|
||||||
+ space.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
+ org.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
||||||
+ // DivineMC end - Async data saving
|
+ // DivineMC end - Async data saving
|
||||||
}
|
}
|
||||||
|
|
||||||
public long makeWorldBackup() throws IOException {
|
public long makeWorldBackup() throws IOException {
|
||||||
diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
index c44110b123ba5912af18faf0065e9ded780da9b7..339efaaf92fbec457759235f91e9a03d5d5d2e4f 100644
|
index c44110b123ba5912af18faf0065e9ded780da9b7..c8dd87faf9a2bdc9fe7c0b9f2076dbed4a339021 100644
|
||||||
--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
|
--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
@@ -32,7 +32,14 @@ public class PlayerDataStorage {
|
@@ -32,7 +32,14 @@ public class PlayerDataStorage {
|
||||||
@@ -43,7 +43,7 @@ index c44110b123ba5912af18faf0065e9ded780da9b7..339efaaf92fbec457759235f91e9a03d
|
|||||||
+ // DivineMC start - Async playerdata save
|
+ // DivineMC start - Async playerdata save
|
||||||
public void save(Player player) {
|
public void save(Player player) {
|
||||||
+ Runnable runnable = () -> saveInternal(player);
|
+ Runnable runnable = () -> saveInternal(player);
|
||||||
+ space.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
+ org.bxteam.divinemc.util.AsyncDataSaving.saveAsync(runnable);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private void saveInternal(Player player) {
|
+ private void saveInternal(Player player) {
|
||||||
|
|||||||
@@ -5,15 +5,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // DivineMC start - lithium: cached iterate outwards
|
+ // DivineMC start - lithium: cached iterate outwards
|
||||||
+ private static final space.bxteam.divinemc.util.lithium.IterateOutwardsCache ITERATE_OUTWARDS_CACHE = new space.bxteam.divinemc.util.lithium.IterateOutwardsCache(50);
|
+ private static final org.bxteam.divinemc.util.lithium.IterateOutwardsCache ITERATE_OUTWARDS_CACHE = new org.bxteam.divinemc.util.lithium.IterateOutwardsCache(50);
|
||||||
+ private static final it.unimi.dsi.fastutil.longs.LongList HOGLIN_PIGLIN_CACHE = ITERATE_OUTWARDS_CACHE.getOrCompute(8, 4, 8);
|
+ private static final it.unimi.dsi.fastutil.longs.LongList HOGLIN_PIGLIN_CACHE = ITERATE_OUTWARDS_CACHE.getOrCompute(8, 4, 8);
|
||||||
+ // DivineMC end - lithium: cached iterate outwards
|
+ // DivineMC end - lithium: cached iterate outwards
|
||||||
+
|
+
|
||||||
public static Iterable<BlockPos> withinManhattan(BlockPos pos, int xSize, int ySize, int zSize) {
|
public static Iterable<BlockPos> withinManhattan(BlockPos pos, int xSize, int ySize, int zSize) {
|
||||||
+ // DivineMC start - lithium: cached iterate outwards
|
+ // DivineMC start - lithium: cached iterate outwards
|
||||||
+ if (pos != space.bxteam.divinemc.util.lithium.IterateOutwardsCache.POS_ZERO) {
|
+ if (pos != org.bxteam.divinemc.util.lithium.IterateOutwardsCache.POS_ZERO) {
|
||||||
+ final it.unimi.dsi.fastutil.longs.LongList positions = xSize == 8 && ySize == 4 && zSize == 8 ? HOGLIN_PIGLIN_CACHE : ITERATE_OUTWARDS_CACHE.getOrCompute(xSize, ySize, zSize);
|
+ final it.unimi.dsi.fastutil.longs.LongList positions = xSize == 8 && ySize == 4 && zSize == 8 ? HOGLIN_PIGLIN_CACHE : ITERATE_OUTWARDS_CACHE.getOrCompute(xSize, ySize, zSize);
|
||||||
+ return new space.bxteam.divinemc.util.lithium.LongList2BlockPosMutableIterable(pos, positions);
|
+ return new org.bxteam.divinemc.util.lithium.LongList2BlockPosMutableIterable(pos, positions);
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - lithium: cached iterate outwards
|
+ // DivineMC end - lithium: cached iterate outwards
|
||||||
int i = xSize + ySize + zSize;
|
int i = xSize + ySize + zSize;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
}
|
}
|
||||||
// Paper end - Prevent moving into unloaded chunks
|
// Paper end - Prevent moving into unloaded chunks
|
||||||
- if (d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
- if (d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // DivineMC - Option to disable moved wrongly threshold
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // DivineMC - Option to disable moved wrongly threshold
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||||
boolean flag2 = false;
|
boolean flag2 = false;
|
||||||
- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // DivineMC - Option to disable moved wrongly threshold
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // DivineMC - Option to disable moved wrongly threshold
|
||||||
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
||||||
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet");
|
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet");
|
||||||
// Paper start - Validate usernames
|
// Paper start - Validate usernames
|
||||||
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck // DivineMC - Remove vanilla username check
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck // DivineMC - Remove vanilla username check
|
||||||
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
|
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
|
||||||
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
|
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
public static float sin(float value) {
|
public static float sin(float value) {
|
||||||
- return SIN[(int)(value * 10430.378F) & 65535];
|
- return SIN[(int)(value * 10430.378F) & 65535];
|
||||||
+ return space.bxteam.divinemc.util.lithium.CompactSineLUT.sin(value); // DivineMC - lithium: math.sine_lut
|
+ return org.bxteam.divinemc.util.lithium.CompactSineLUT.sin(value); // DivineMC - lithium: math.sine_lut
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float cos(float value) {
|
public static float cos(float value) {
|
||||||
- return SIN[(int)(value * 10430.378F + 16384.0F) & 65535];
|
- return SIN[(int)(value * 10430.378F + 16384.0F) & 65535];
|
||||||
+ return space.bxteam.divinemc.util.lithium.CompactSineLUT.cos(value); // DivineMC - lithium: math.sine_lut
|
+ return org.bxteam.divinemc.util.lithium.CompactSineLUT.cos(value); // DivineMC - lithium: math.sine_lut
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float sqrt(float value) {
|
public static float sqrt(float value) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
|
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
|
||||||
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
|
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
|
||||||
- public final List<TickingBlockEntity> blockEntityTickers = Lists.newArrayList(); // Paper - public
|
- public final List<TickingBlockEntity> blockEntityTickers = Lists.newArrayList(); // Paper - public
|
||||||
+ public final space.bxteam.divinemc.util.BlockEntityTickersList blockEntityTickers = new space.bxteam.divinemc.util.BlockEntityTickersList(); // DivineMC - optimize block entity removal
|
+ public final org.bxteam.divinemc.util.BlockEntityTickersList blockEntityTickers = new org.bxteam.divinemc.util.BlockEntityTickersList(); // DivineMC - optimize block entity removal
|
||||||
protected final NeighborUpdater neighborUpdater;
|
protected final NeighborUpdater neighborUpdater;
|
||||||
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
||||||
private boolean tickingBlockEntities;
|
private boolean tickingBlockEntities;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
|
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
|
||||||
} else {
|
} else {
|
||||||
- LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
|
- LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
|
||||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableNonEditableSignWarning) LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // DivineMC - Option to disable warning
|
+ if (!org.bxteam.divinemc.configuration.DivineConfig.disableNonEditableSignWarning) LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // DivineMC - Option to disable warning
|
||||||
if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < Mth.square(32)) // Paper - Don't send far away sign update
|
if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < Mth.square(32)) // Paper - Don't send far away sign update
|
||||||
((net.minecraft.server.level.ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
|
((net.minecraft.server.level.ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
+
|
+
|
||||||
@Nullable
|
@Nullable
|
||||||
public BlockPattern.BlockPatternMatch findExitPortal() {
|
public BlockPattern.BlockPatternMatch findExitPortal() {
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.optimizedDragonRespawn) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.optimizedDragonRespawn) {
|
||||||
+ int i, j;
|
+ int i, j;
|
||||||
+ for (i = cachePortalChunkIteratorX; i <= 8; ++i) {
|
+ for (i = cachePortalChunkIteratorX; i <= 8; ++i) {
|
||||||
+ for (j = cachePortalChunkIteratorZ; j <= 8; ++j) {
|
+ for (j = cachePortalChunkIteratorZ; j <= 8; ++j) {
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
+ for (j = i; j >= 0; --j) {
|
+ for (j = i; j >= 0; --j) {
|
||||||
+ BlockPattern.BlockPatternMatch result2 = null;
|
+ BlockPattern.BlockPatternMatch result2 = null;
|
||||||
+ if (notFirstSearch) {
|
+ if (notFirstSearch) {
|
||||||
+ result2 = space.bxteam.divinemc.util.carpetams.BlockPatternHelper.partialSearchAround(this.exitPortalPattern, this.level, new BlockPos(EndPodiumFeature.getLocation(BlockPos.ZERO).getY(), j, EndPodiumFeature.getLocation(BlockPos.ZERO).getZ()));
|
+ result2 = org.bxteam.divinemc.util.carpetams.BlockPatternHelper.partialSearchAround(this.exitPortalPattern, this.level, new BlockPos(EndPodiumFeature.getLocation(BlockPos.ZERO).getY(), j, EndPodiumFeature.getLocation(BlockPos.ZERO).getZ()));
|
||||||
+ } else {
|
+ } else {
|
||||||
+ result2 = this.exitPortalPattern.find(this.level, new BlockPos(EndPodiumFeature.getLocation(BlockPos.ZERO).getX(), j, EndPodiumFeature.getLocation(BlockPos.ZERO).getZ()));
|
+ result2 = this.exitPortalPattern.find(this.level, new BlockPos(EndPodiumFeature.getLocation(BlockPos.ZERO).getX(), j, EndPodiumFeature.getLocation(BlockPos.ZERO).getZ()));
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
) {
|
) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
- BitSet bitSet = new BitSet(width * height * width);
|
- BitSet bitSet = new BitSet(width * height * width);
|
||||||
+ BitSet bitSet = space.bxteam.divinemc.util.c2me.ObjectCachingUtils.getCachedOrNewBitSet(width * height * width); // DivineMC - C2ME: reduce_allocs
|
+ BitSet bitSet = org.bxteam.divinemc.util.c2me.ObjectCachingUtils.getCachedOrNewBitSet(width * height * width); // DivineMC - C2ME: reduce_allocs
|
||||||
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||||
int i1 = config.size;
|
int i1 = config.size;
|
||||||
double[] doubles = new double[i1 * 4];
|
double[] doubles = new double[i1 * 4];
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ index 2e7c3d4befeb6256ce81ecaa9ed4e8fbcb21651e..7f3d6dc1c37ffce387ddd04bdd7328e0
|
|||||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
index 99eb04643fce44c37fd96c99756837ccafe7b559..7f5678aa5c6d6d4365ea219c7c78ff234c554499 100644
|
index 99eb04643fce44c37fd96c99756837ccafe7b559..4aef151bd162c4c99a3eaec1854b54639980a630 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||||
@@ -166,7 +166,7 @@ index 99eb04643fce44c37fd96c99756837ccafe7b559..7f5678aa5c6d6d4365ea219c7c78ff23
|
|||||||
String result = "Unknown-Version";
|
String result = "Unknown-Version";
|
||||||
|
|
||||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur - Rebrand
|
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur - Rebrand
|
||||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/space.bxteam.divinemc/divinemc-api/pom.properties"); // DivineMC - Rebrand
|
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.bxteam.divinemc/divinemc-api/pom.properties"); // DivineMC - Rebrand
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ Subject: [PATCH] DivineMC Configuration
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index d429c5d34fb4b91749705b6a17c4b12d1a5220e1..87af0d7b87caca4a3828359388ac3eeda7b3d76f 100644
|
index d429c5d34fb4b91749705b6a17c4b12d1a5220e1..54da9c08a3e78fd53fa4c0311c0d662180262d4b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1103,6 +1103,7 @@ public final class CraftServer implements Server {
|
@@ -1103,6 +1103,7 @@ public final class CraftServer implements Server {
|
||||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
|
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
|
||||||
+ space.bxteam.divinemc.configuration.DivineConfig.init((File) console.options.valueOf("divinemc-settings")); // DivineMC - DivineMC config files
|
+ org.bxteam.divinemc.configuration.DivineConfig.init((File) console.options.valueOf("divinemc-settings")); // DivineMC - DivineMC config files
|
||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||||
@@ -31,7 +31,7 @@ index d429c5d34fb4b91749705b6a17c4b12d1a5220e1..87af0d7b87caca4a3828359388ac3eed
|
|||||||
+ // DivineMC start - DivineMC configuration
|
+ // DivineMC start - DivineMC configuration
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public YamlConfiguration getDivineConfig() {
|
+ public YamlConfiguration getDivineConfig() {
|
||||||
+ return space.bxteam.divinemc.configuration.DivineConfig.config;
|
+ return org.bxteam.divinemc.configuration.DivineConfig.config;
|
||||||
+ }
|
+ }
|
||||||
+ // DivineMC end - DivineMC configuration
|
+ // DivineMC end - DivineMC configuration
|
||||||
+
|
+
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Original license: GPLv3
|
|||||||
Original project: https://github.com/plasmoapp/matter
|
Original project: https://github.com/plasmoapp/matter
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||||
index de8b9048c8395c05b8688bc9d984b8ad680f15b3..287fd2f3931ab776203f322fb05dfa236d94c59b 100644
|
index de8b9048c8395c05b8688bc9d984b8ad680f15b3..c245a30f8bef4dc9ac980bdc0b39b5e0344a524b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||||
@@ -206,7 +206,12 @@ public class CraftChunk implements Chunk {
|
@@ -206,7 +206,12 @@ public class CraftChunk implements Chunk {
|
||||||
@@ -16,7 +16,7 @@ index de8b9048c8395c05b8688bc9d984b8ad680f15b3..287fd2f3931ab776203f322fb05dfa23
|
|||||||
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk
|
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk
|
||||||
- return this.worldServer.paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
|
- return this.worldServer.paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ boolean isSlimeChunk = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ boolean isSlimeChunk = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? worldServer.getChunk(this.getX(), this.getZ()).isSlimeChunk()
|
+ ? worldServer.getChunk(this.getX(), this.getZ()).isSlimeChunk()
|
||||||
+ : WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
|
+ : WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
|
||||||
+ return this.worldServer.paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
|
+ return this.worldServer.paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
|
||||||
@@ -25,7 +25,7 @@ index de8b9048c8395c05b8688bc9d984b8ad680f15b3..287fd2f3931ab776203f322fb05dfa23
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 55f9267c83427dbe4ab28580ec515539565f3bdb..bfcf494a34fad26f282b705270725b724d5719a7 100644
|
index 54da9c08a3e78fd53fa4c0311c0d662180262d4b..55556a038e09d6fb92d4b9696f291ccac34347cb 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1404,7 +1404,11 @@ public final class CraftServer implements Server {
|
@@ -1404,7 +1404,11 @@ public final class CraftServer implements Server {
|
||||||
@@ -34,8 +34,8 @@ index 55f9267c83427dbe4ab28580ec515539565f3bdb..bfcf494a34fad26f282b705270725b72
|
|||||||
LevelSettings levelSettings;
|
LevelSettings levelSettings;
|
||||||
- WorldOptions worldOptions = new WorldOptions(creator.seed(), creator.generateStructures(), false);
|
- WorldOptions worldOptions = new WorldOptions(creator.seed(), creator.generateStructures(), false);
|
||||||
+ // DivineMC start - Implement Secure Seed
|
+ // DivineMC start - Implement Secure Seed
|
||||||
+ WorldOptions worldOptions = space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
+ WorldOptions worldOptions = org.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed
|
||||||
+ ? new WorldOptions(creator.seed(), space.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), creator.generateStructures(), false)
|
+ ? new WorldOptions(creator.seed(), org.bxteam.divinemc.seed.Globals.createRandomWorldSeed(), creator.generateStructures(), false)
|
||||||
+ : new WorldOptions(creator.seed(), creator.generateStructures(), false);
|
+ : new WorldOptions(creator.seed(), creator.generateStructures(), false);
|
||||||
+ // DivineMC end - Implement Secure Seed
|
+ // DivineMC end - Implement Secure Seed
|
||||||
WorldDimensions worldDimensions;
|
WorldDimensions worldDimensions;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
private static GameProfile createAuthLibProfile(UUID uniqueId, String name) {
|
private static GameProfile createAuthLibProfile(UUID uniqueId, String name) {
|
||||||
Preconditions.checkArgument(name == null || name.length() <= 16, "Name cannot be longer than 16 characters");
|
Preconditions.checkArgument(name == null || name.length() <= 16, "Name cannot be longer than 16 characters");
|
||||||
- Preconditions.checkArgument(name == null || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name);
|
- Preconditions.checkArgument(name == null || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name);
|
||||||
+ Preconditions.checkArgument(name == null || space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // DivineMC - Remove vanilla username check
|
+ Preconditions.checkArgument(name == null || org.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // DivineMC - Remove vanilla username check
|
||||||
return new GameProfile(
|
return new GameProfile(
|
||||||
uniqueId != null ? uniqueId : Util.NIL_UUID,
|
uniqueId != null ? uniqueId : Util.NIL_UUID,
|
||||||
name != null ? name : ""
|
name != null ? name : ""
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
|
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
|
||||||
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
|
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
|
||||||
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
|
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
|
||||||
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) || space.bxteam.divinemc.configuration.DivineConfig.noChatSign ? null : "Not Secure"); // DivineMC - No chat sign
|
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) || org.bxteam.divinemc.configuration.DivineConfig.noChatSign ? null : "Not Secure"); // DivineMC - No chat sign
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||||
+ // DivineMC start - Multithreaded tracker
|
+ // DivineMC start - Multithreaded tracker
|
||||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
+ if (org.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||||
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
|
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command;
|
package org.bxteam.divinemc.command;
|
||||||
|
|
||||||
import io.papermc.paper.command.CommandUtil;
|
import io.papermc.paper.command.CommandUtil;
|
||||||
import it.unimi.dsi.fastutil.Pair;
|
import it.unimi.dsi.fastutil.Pair;
|
||||||
@@ -10,8 +10,9 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
|
import org.bxteam.divinemc.command.subcommands.ReloadCommand;
|
||||||
|
import org.bxteam.divinemc.command.subcommands.VersionCommand;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import space.bxteam.divinemc.command.subcommands.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command;
|
package org.bxteam.divinemc.command;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command;
|
package org.bxteam.divinemc.command;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command;
|
package org.bxteam.divinemc.command;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command.subcommands;
|
package org.bxteam.divinemc.command.subcommands;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
@@ -6,9 +6,9 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
import space.bxteam.divinemc.command.DivineCommand;
|
import org.bxteam.divinemc.command.DivineCommand;
|
||||||
import space.bxteam.divinemc.command.DivineSubCommandPermission;
|
import org.bxteam.divinemc.command.DivineSubCommandPermission;
|
||||||
import space.bxteam.divinemc.configuration.DivineConfig;
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.command.subcommands;
|
package org.bxteam.divinemc.command.subcommands;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@@ -7,8 +7,8 @@ import org.bukkit.permissions.PermissionDefault;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import space.bxteam.divinemc.command.DivineCommand;
|
import org.bxteam.divinemc.command.DivineCommand;
|
||||||
import space.bxteam.divinemc.command.DivineSubCommandPermission;
|
import org.bxteam.divinemc.command.DivineSubCommandPermission;
|
||||||
|
|
||||||
@DefaultQualifier(NonNull.class)
|
@DefaultQualifier(NonNull.class)
|
||||||
public final class VersionCommand extends DivineSubCommandPermission {
|
public final class VersionCommand extends DivineSubCommandPermission {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.configuration;
|
package org.bxteam.divinemc.configuration;
|
||||||
|
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
@@ -26,7 +26,7 @@ public class DivineConfig {
|
|||||||
+ "join us in our Discord server.\n"
|
+ "join us in our Discord server.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Discord: https://discord.gg/p7cxhw7E2M \n"
|
+ "Discord: https://discord.gg/p7cxhw7E2M \n"
|
||||||
+ "Docs: https://docs.bx-team.space/documentation/divinemc/about \n"
|
+ "Docs: https://docs.bxteam.org/documentation/divinemc/about \n"
|
||||||
+ "New builds: https://github.com/DivineMC/DivineMC/releases/latest";
|
+ "New builds: https://github.com/DivineMC/DivineMC/releases/latest";
|
||||||
private static File CONFIG_FILE;
|
private static File CONFIG_FILE;
|
||||||
public static YamlConfiguration config;
|
public static YamlConfiguration config;
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package space.bxteam.divinemc.configuration;
|
package org.bxteam.divinemc.configuration;
|
||||||
|
|
||||||
import org.apache.commons.lang.BooleanUtils;
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import space.bxteam.divinemc.region.RegionFileFormat;
|
import org.bxteam.divinemc.region.RegionFileFormat;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import static space.bxteam.divinemc.configuration.DivineConfig.log;
|
import static org.bxteam.divinemc.configuration.DivineConfig.log;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class DivineWorldConfig {
|
public class DivineWorldConfig {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.world.level.pathfinder.Path;
|
import net.minecraft.world.level.pathfinder.Path;
|
||||||
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -15,8 +16,8 @@ import java.util.function.Consumer;
|
|||||||
public class AsyncPathProcessor {
|
public class AsyncPathProcessor {
|
||||||
private static final Executor pathProcessingExecutor = new ThreadPoolExecutor(
|
private static final Executor pathProcessingExecutor = new ThreadPoolExecutor(
|
||||||
1,
|
1,
|
||||||
space.bxteam.divinemc.configuration.DivineConfig.asyncPathfindingMaxThreads,
|
DivineConfig.asyncPathfindingMaxThreads,
|
||||||
space.bxteam.divinemc.configuration.DivineConfig.asyncPathfindingKeepalive, TimeUnit.SECONDS,
|
DivineConfig.asyncPathfindingKeepalive, TimeUnit.SECONDS,
|
||||||
new LinkedBlockingQueue<>(),
|
new LinkedBlockingQueue<>(),
|
||||||
new ThreadFactoryBuilder()
|
new ThreadFactoryBuilder()
|
||||||
.setNameFormat("DivineMC Async Pathfinding Thread - %d")
|
.setNameFormat("DivineMC Async Pathfinding Thread - %d")
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
||||||
import net.minecraft.world.level.pathfinder.SwimNodeEvaluator;
|
import net.minecraft.world.level.pathfinder.SwimNodeEvaluator;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
import net.minecraft.world.level.pathfinder.NodeEvaluator;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.world.level.pathfinder.*;
|
import net.minecraft.world.level.pathfinder.*;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.pathfinding;
|
package org.bxteam.divinemc.pathfinding;
|
||||||
|
|
||||||
public enum PathProcessState {
|
public enum PathProcessState {
|
||||||
WAITING,
|
WAITING,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.region;
|
package org.bxteam.divinemc.region;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.region;
|
package org.bxteam.divinemc.region;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -7,7 +7,7 @@ import net.minecraft.world.level.chunk.storage.RegionFileVersion;
|
|||||||
import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
|
import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import space.bxteam.divinemc.configuration.DivineConfig;
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
|
|
||||||
public class AbstractRegionFileFactory {
|
public class AbstractRegionFileFactory {
|
||||||
@Contract("_, _, _, _ -> new")
|
@Contract("_, _, _, _ -> new")
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.region;
|
package org.bxteam.divinemc.region;
|
||||||
|
|
||||||
import ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO;
|
import ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO;
|
||||||
import com.github.luben.zstd.ZstdInputStream;
|
import com.github.luben.zstd.ZstdInputStream;
|
||||||
@@ -30,7 +30,7 @@ import net.jpountz.lz4.LZ4FastDecompressor;
|
|||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.level.ChunkPos;
|
import net.minecraft.world.level.ChunkPos;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import space.bxteam.divinemc.configuration.DivineConfig;
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
|
|
||||||
public class LinearRegionFile implements AbstractRegionFile {
|
public class LinearRegionFile implements AbstractRegionFile {
|
||||||
private static final long SUPERBLOCK = -4323716122432332390L;
|
private static final long SUPERBLOCK = -4323716122432332390L;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.region;
|
package org.bxteam.divinemc.region;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package space.bxteam.divinemc.seed;
|
package org.bxteam.divinemc.seed;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
@@ -36,7 +37,7 @@ public class Globals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setupGlobals(ServerLevel world) {
|
public static void setupGlobals(ServerLevel world) {
|
||||||
if (!space.bxteam.divinemc.configuration.DivineConfig.enableSecureSeed) return;
|
if (!DivineConfig.enableSecureSeed) return;
|
||||||
|
|
||||||
long[] seed = world.getServer().getWorldData().worldGenOptions().featureSeed();
|
long[] seed = world.getServer().getWorldData().worldGenOptions().featureSeed();
|
||||||
System.arraycopy(seed, 0, worldSeed, 0, WORLD_SEED_LONGS);
|
System.arraycopy(seed, 0, worldSeed, 0, WORLD_SEED_LONGS);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.seed;
|
package org.bxteam.divinemc.seed;
|
||||||
|
|
||||||
public class Hashing {
|
public class Hashing {
|
||||||
// https://en.wikipedia.org/wiki/BLAKE_(hash_function)
|
// https://en.wikipedia.org/wiki/BLAKE_(hash_function)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.seed;
|
package org.bxteam.divinemc.seed;
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.util.RandomSource;
|
import net.minecraft.util.RandomSource;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.tracker;
|
package org.bxteam.divinemc.tracker;
|
||||||
|
|
||||||
import ca.spottedleaf.moonrise.common.list.ReferenceList;
|
import ca.spottedleaf.moonrise.common.list.ReferenceList;
|
||||||
import ca.spottedleaf.moonrise.common.misc.NearbyPlayers;
|
import ca.spottedleaf.moonrise.common.misc.NearbyPlayers;
|
||||||
@@ -13,6 +13,7 @@ import net.minecraft.server.level.ServerLevel;
|
|||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
@@ -31,8 +32,8 @@ public class MultithreadedTracker {
|
|||||||
|
|
||||||
private static final Executor trackerExecutor = new ThreadPoolExecutor(
|
private static final Executor trackerExecutor = new ThreadPoolExecutor(
|
||||||
1,
|
1,
|
||||||
space.bxteam.divinemc.configuration.DivineConfig.asyncEntityTrackerMaxThreads,
|
DivineConfig.asyncEntityTrackerMaxThreads,
|
||||||
space.bxteam.divinemc.configuration.DivineConfig.asyncEntityTrackerKeepalive, TimeUnit.SECONDS,
|
DivineConfig.asyncEntityTrackerKeepalive, TimeUnit.SECONDS,
|
||||||
new LinkedBlockingQueue<>(),
|
new LinkedBlockingQueue<>(),
|
||||||
new ThreadFactoryBuilder()
|
new ThreadFactoryBuilder()
|
||||||
.setThreadFactory(
|
.setThreadFactory(
|
||||||
@@ -55,7 +56,7 @@ public class MultithreadedTracker {
|
|||||||
|
|
||||||
public static void tick(ChunkSystemServerLevel level) {
|
public static void tick(ChunkSystemServerLevel level) {
|
||||||
try {
|
try {
|
||||||
if (!space.bxteam.divinemc.configuration.DivineConfig.multithreadedCompatModeEnabled) {
|
if (!DivineConfig.multithreadedCompatModeEnabled) {
|
||||||
tickAsync(level);
|
tickAsync(level);
|
||||||
} else {
|
} else {
|
||||||
tickAsyncWithCompatMode(level);
|
tickAsyncWithCompatMode(level);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package space.bxteam.divinemc.util;
|
package org.bxteam.divinemc.util;
|
||||||
|
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import space.bxteam.divinemc.configuration.DivineConfig;
|
import org.bxteam.divinemc.configuration.DivineConfig;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util;
|
package org.bxteam.divinemc.util;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util;
|
package org.bxteam.divinemc.util;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
|
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util.c2me;
|
package org.bxteam.divinemc.util.c2me;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util.carpetams;
|
package org.bxteam.divinemc.util.carpetams;
|
||||||
|
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util.lithium;
|
package org.bxteam.divinemc.util.lithium;
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util.lithium;
|
package org.bxteam.divinemc.util.lithium;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.longs.LongArrayList;
|
import it.unimi.dsi.fastutil.longs.LongArrayList;
|
||||||
import it.unimi.dsi.fastutil.longs.LongList;
|
import it.unimi.dsi.fastutil.longs.LongList;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package space.bxteam.divinemc.util.lithium;
|
package org.bxteam.divinemc.util.lithium;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.longs.LongIterator;
|
import it.unimi.dsi.fastutil.longs.LongIterator;
|
||||||
import it.unimi.dsi.fastutil.longs.LongList;
|
import it.unimi.dsi.fastutil.longs.LongList;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
group = space.bxteam.divinemc
|
group = org.bxteam.divinemc
|
||||||
|
|
||||||
mcVersion=1.21.4
|
mcVersion=1.21.4
|
||||||
version=1.21.4-R0.1-SNAPSHOT
|
version=1.21.4-R0.1-SNAPSHOT
|
||||||
|
|||||||
Reference in New Issue
Block a user