Push forward

This commit is contained in:
2026-07-14 12:22:17 +08:00
parent 576a9a44c8
commit 969cd5c5f8
135 changed files with 551 additions and 551 deletions
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.api.config;
package io.nanachiyo0721.shiroha.api.config;
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.api.config;
package io.nanachiyo0721.shiroha.api.config;
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.api.config;
package io.nanachiyo0721.shiroha.api.config;
import org.jspecify.annotations.Nullable;
@@ -12,7 +12,7 @@ index a4d608d64b7d3477c9144d93547fd3b4f39a1b02..8cb1cfefa0deb78c1773ba9913138f31
JvmProfiler.INSTANCE.start(Environment.SERVER);
}
+ moe.monnairealms.camellia.config.ConfigManager.initConfigs(); // Shiroha - Config system framework - pre load config file
+ io.nanachiyo0721.shiroha.config.ConfigManager.initConfigs(); // Shiroha - Config system framework - pre load config file
io.papermc.paper.plugin.PluginInitializerManager.load(options); // Paper
Bootstrap.bootStrap();
Bootstrap.validate();
@@ -24,7 +24,7 @@ index c6a4d52f76e10fcc57b2c49b07fbc2ef9bb90822..e305fd5850d333eb1a30572076b6475e
ca.spottedleaf.moonrise.common.util.MoonriseCommon.haltExecutors();
}
// Paper end - rewrite chunk system
+ moe.monnairealms.camellia.config.ConfigManager.saveConfigs(false); // Shiroha - Config system framework - save config file
+ io.nanachiyo0721.shiroha.config.ConfigManager.saveConfigs(false); // Shiroha - Config system framework - save config file
// Paper start - Improved watchdog support - move final shutdown items here
Util.shutdownExecutors();
this.onServerExit();
@@ -36,7 +36,7 @@ index cd5551c0221ad2a7b5c7d452d8d91ffc9711c3ee..17244a82d7591004a43c013748f3db05
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
// Paper end - initialize global and world-defaults configuration
+ moe.monnairealms.camellia.config.ConfigManager.loadConfigFiles(); // Shiroha - Config system framework - load config file
+ io.nanachiyo0721.shiroha.config.ConfigManager.loadConfigFiles(); // Shiroha - Config system framework - load config file
this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
@@ -13,10 +13,10 @@ index a814512fcfb85312474ae2c2c21443843bf57831..5734af81b1f88fde952f498059c79116
public boolean moonrise$doesRegionFileNotExistNoIO(final int chunkX, final int chunkZ);
- public RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ);
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // Shiroha - Configurable region file format
+ public io.nanachiyo0721.shiroha.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // Shiroha - Configurable region file format
- public RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException;
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // Shiroha - Configurable region file format
+ public io.nanachiyo0721.shiroha.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // Shiroha - Configurable region file format
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
final int chunkX, final int chunkZ, final CompoundTag compound
@@ -29,7 +29,7 @@ index 3bb9b58ee97464687e348e23b99159226415c267..b6d4d9fac961aa4672ef2f4a19e2ae18
// Paper start - flush regionfiles on save
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
- final RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // Shiroha - Configurable region file format
+ final io.nanachiyo0721.shiroha.data.RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // Shiroha - Configurable region file format
if (regionFile != null) {
regionFile.flush();
} // else: evicted from cache, which should have called flush
@@ -38,7 +38,7 @@ index 3bb9b58ee97464687e348e23b99159226415c267..b6d4d9fac961aa4672ef2f4a19e2ae18
public static interface IORunnable {
- public void run(final RegionFile regionFile) throws IOException;
+ public void run(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
+ public void run(final io.nanachiyo0721.shiroha.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
}
}
@@ -51,7 +51,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..084b64dbaa2807fa29e4ae787144fce2
public void moonrise$setWriteOnClose(final boolean value);
- public void moonrise$write(final RegionFile regionFile) throws IOException;
+ public void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
+ public void moonrise$write(final io.nanachiyo0721.shiroha.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index e305fd5850d333eb1a30572076b6475e4428f7a7..78e9cf21fb5487e5eeec04e589c2a84c1e6b06af 100644
@@ -79,7 +79,7 @@ index a7f2cfa9277c898038f6b9e0a3401db51012b64c..d6151f308e2e5864b6525409761aa6d9
import net.minecraft.world.level.chunk.storage.RegionFile;
-public record FileToUpgrade(RegionFile file, List<ChunkPos> chunksToUpgrade) {
+public record FileToUpgrade(moe.monnairealms.camellia.data.RegionFile file, List<ChunkPos> chunksToUpgrade) { // Shiroha - Configurable region file format
+public record FileToUpgrade(io.nanachiyo0721.shiroha.data.RegionFile file, List<ChunkPos> chunksToUpgrade) { // Shiroha - Configurable region file format
}
diff --git a/net/minecraft/util/worldupdate/RegionStorageUpgrader.java b/net/minecraft/util/worldupdate/RegionStorageUpgrader.java
index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3c6a7b31b 100644
@@ -90,7 +90,7 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
private static final Logger LOGGER = LogUtils.getLogger();
private static final String NEW_DIRECTORY_PREFIX = "new_";
- private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
+ private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\." + moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getArgument() + "$"); // Shiroha - Configurable region file format
+ private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\." + io.nanachiyo0721.shiroha.config.modules.function.RegionFormatConfig.regionFormat.getArgument() + "$"); // Shiroha - Configurable region file format
private final DataFixer dataFixer;
private final UpgradeProgress upgradeProgress;
private final String type;
@@ -99,8 +99,8 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
List<ChunkPos> chunkPositions = Lists.newArrayList();
- try (RegionFile regionSource = new RegionFile(info, regionFile.toPath(), regionFolder, true)) {
+ var regionFileInfo = new moe.monnairealms.camellia.utils.RegionCreatorInfo(info, regionFile.toPath(), regionFolder, true); // Shiroha - Configurable region file format
+ try (moe.monnairealms.camellia.data.RegionFile regionSource = moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getCreator().newFile(regionFileInfo)) { // Shiroha - Configurable region file format
+ var regionFileInfo = new io.nanachiyo0721.shiroha.utils.RegionCreatorInfo(info, regionFile.toPath(), regionFolder, true); // Shiroha - Configurable region file format
+ try (io.nanachiyo0721.shiroha.data.RegionFile regionSource = io.nanachiyo0721.shiroha.config.modules.function.RegionFormatConfig.regionFormat.getCreator().newFile(regionFileInfo)) { // Shiroha - Configurable region file format
for (int x = 0; x < 32; x++) {
for (int z = 0; z < 32; z++) {
ChunkPos pos = new ChunkPos(x + xOffset, z + zOffset);
@@ -109,7 +109,7 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
}
- private void onFileFinished(final RegionFile regionFile) {
+ private void onFileFinished(final moe.monnairealms.camellia.data.RegionFile regionFile) { // Shiroha - Configurable region file format
+ private void onFileFinished(final io.nanachiyo0721.shiroha.data.RegionFile regionFile) { // Shiroha - Configurable region file format
if (this.recreateRegionFiles) {
if (this.previousWriteFuture != null) {
this.previousWriteFuture.join();
@@ -122,7 +122,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
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 , moe.monnairealms.camellia.data.RegionFile{ // Paper - rewrite chunk system // Shiroha - Configurable region file format
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile , io.nanachiyo0721.shiroha.data.RegionFile{ // Paper - rewrite chunk system // Shiroha - Configurable region file format
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
private static final int SECTOR_BYTES = 4096;
@@ -149,7 +149,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
@Override
- public final void moonrise$write(final RegionFile regionFile) throws IOException {
+ public final void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException { // Shiroha - Configurable region file format
+ public final void moonrise$write(final io.nanachiyo0721.shiroha.data.RegionFile regionFile) throws IOException { // Shiroha - Configurable region file format
regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count));
}
// Paper end - rewrite chunk system
@@ -185,7 +185,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public static final String ANVIL_EXTENSION = ".mca";
private static final int MAX_CACHE_SIZE = 256;
- private final Long2ObjectLinkedOpenHashMap<RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>();
+ private final Long2ObjectLinkedOpenHashMap<moe.monnairealms.camellia.data.RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // Shiroha - Configurable region file format
+ private final Long2ObjectLinkedOpenHashMap<io.nanachiyo0721.shiroha.data.RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // Shiroha - Configurable region file format
private final RegionStorageInfo info;
private final Path folder;
private final boolean sync;
@@ -206,8 +206,8 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + getExtensionName(); // Shiroha - Configurable region file format
}
+ // Shiroha start - Configurable region file format
+ public static moe.monnairealms.camellia.data.RegionFile createNew(RegionStorageInfo info, Path filePath, Path folder, boolean sync) throws IOException{
+ final moe.monnairealms.camellia.enums.EnumRegionFormat regionFormat = moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat;
+ public static io.nanachiyo0721.shiroha.data.RegionFile createNew(RegionStorageInfo info, Path filePath, Path folder, boolean sync) throws IOException{
+ final io.nanachiyo0721.shiroha.enums.EnumRegionFormat regionFormat = io.nanachiyo0721.shiroha.config.modules.function.RegionFormatConfig.regionFormat;
+ final String fullFileName = filePath.getFileName().toString();
+ final String[] fullNameSplit = fullFileName.split("\\.");
+ final String extensionName = fullNameSplit[fullNameSplit.length - 1];
@@ -222,11 +222,11 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
+ throw new IOException("Invalid region file format: " + extensionName + " expected " + regionFormat.getArgument());
+ }
+
+ return regionFormat.getCreator().newFile(new moe.monnairealms.camellia.utils.RegionCreatorInfo(info, filePath, folder, sync));
+ return regionFormat.getCreator().newFile(new io.nanachiyo0721.shiroha.utils.RegionCreatorInfo(info, filePath, folder, sync));
+ }
+
+ public static String getExtensionName() {
+ return "." + moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getArgument();
+ return "." + io.nanachiyo0721.shiroha.config.modules.function.RegionFormatConfig.regionFormat.getArgument();
+ }
+ // Shiroha end
@@ -237,17 +237,17 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
@Override
- public synchronized final RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) {
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // Shiroha - Configurable region file format
+ public synchronized final io.nanachiyo0721.shiroha.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // Shiroha - Configurable region file format
return this.regionCache.getAndMoveToFirst(ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT));
}
@Override
- public synchronized final RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException {
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // Shiroha - Configurable region file format
+ public synchronized final io.nanachiyo0721.shiroha.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // Shiroha - Configurable region file format
final long key = ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT);
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
+ io.nanachiyo0721.shiroha.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
if (ret != null) {
return ret;
}
@@ -265,7 +265,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
- final RegionFile regionFile = this.getRegionFile(pos);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
+ final io.nanachiyo0721.shiroha.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
// 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)
@@ -274,7 +274,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) {
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
+ final io.nanachiyo0721.shiroha.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
if (regionFile != null) {
regionFile.clear(pos);
} // else: didn't exist
@@ -283,7 +283,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final int chunkX, final int chunkZ
) throws IOException {
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
+ final io.nanachiyo0721.shiroha.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ));
@@ -292,7 +292,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
final ChunkPos headerChunkPos = SerializableChunkData.getChunkCoordinate(ret);
- final RegionFile regionFile = this.getRegionFile(pos);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
+ final io.nanachiyo0721.shiroha.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
if (regionFile.getRecalculateCount() != readData.recalculateCount()) {
return null;
@@ -301,7 +301,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
// Paper end - rewrite chunk system
// Paper start - rewrite chunk system
- public RegionFile getRegionFile(ChunkPos pos) throws IOException {
+ public moe.monnairealms.camellia.data.RegionFile getRegionFile(ChunkPos pos) throws IOException { // Shiroha - Configurable region file format
+ public io.nanachiyo0721.shiroha.data.RegionFile getRegionFile(ChunkPos pos) throws IOException { // Shiroha - Configurable region file format
return this.getRegionFile(pos, false);
}
// Paper end - rewrite chunk system
@@ -310,7 +310,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
}
- @org.jetbrains.annotations.Contract("_, false -> !null") private @Nullable RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit
+ @org.jetbrains.annotations.Contract("_, false -> !null") private moe.monnairealms.camellia.data.RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit // Shiroha - Configurable region file format
+ @org.jetbrains.annotations.Contract("_, false -> !null") private io.nanachiyo0721.shiroha.data.RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit // Shiroha - Configurable region file format
// Paper start - rewrite chunk system
if (existingOnly) {
return this.moonrise$getRegionFileIfExists(pos.x(), pos.z());
@@ -319,7 +319,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final long key = ChunkPos.pack(pos.x() >> REGION_SHIFT, pos.z() >> REGION_SHIFT);
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
+ io.nanachiyo0721.shiroha.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
if (ret != null) {
return ret;
}
@@ -337,7 +337,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
}
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
+ private static CompoundTag readOversizedChunk(moe.monnairealms.camellia.data.RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // Shiroha - Configurable region file format
+ private static CompoundTag readOversizedChunk(io.nanachiyo0721.shiroha.data.RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // Shiroha - Configurable region file format
synchronized (regionfile) {
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x(), chunkCoordinate.z());
@@ -346,7 +346,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public @Nullable CompoundTag read(final ChunkPos pos) throws IOException {
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
- RegionFile region = this.getRegionFile(pos, true);
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
+ io.nanachiyo0721.shiroha.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
if (region == null) {
return null;
}
@@ -355,7 +355,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public void scanChunk(final ChunkPos pos, final StreamTagVisitor scanner) throws IOException {
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
- RegionFile region = this.getRegionFile(pos, true);
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
+ io.nanachiyo0721.shiroha.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
if (region == null) {
return;
}
@@ -364,7 +364,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public void write(final ChunkPos pos, final @Nullable CompoundTag value) throws IOException {
if (!SharedConstants.DEBUG_DONT_SAVE_WORLD) {
- RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system // Shiroha - Configurable region file format
+ io.nanachiyo0721.shiroha.data.RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system // Shiroha - Configurable region file format
// Paper start - rewrite chunk system
if (region == null) {
// if the RegionFile doesn't exist, no point in deleting from it
@@ -373,7 +373,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
synchronized (this) {
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
- for (final RegionFile regionFile : this.regionCache.values()) {
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
+ for (final io.nanachiyo0721.shiroha.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
try {
regionFile.close();
} catch (final IOException ex) {
@@ -382,7 +382,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
synchronized (this) {
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
- for (final RegionFile regionFile : this.regionCache.values()) {
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
+ for (final io.nanachiyo0721.shiroha.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
try {
regionFile.flush();
} catch (final IOException ex) {
@@ -22,7 +22,7 @@ index 53131c1b8d5562f9a1b45dfab4fdbdd37b655139..f4c171c06ac2a3d45c91365781d0789e
+ // we don't care if we should clear the memory of JOB_SITE
+ // as it will be automatically removed in SetWalkTargetFromBlockMemory
+ // so simply break down if it's not loaded
+ var poiChunk = moe.monnairealms.camellia.config.modules.fixes.POIRangeFixes.doNotCompetePOIIfUnloaded ? poiManager.get(sectionPosOfJobSite) : poiManager.getOrLoad(sectionPosOfJobSite);
+ var poiChunk = io.nanachiyo0721.shiroha.config.modules.fixes.POIRangeFixes.doNotCompetePOIIfUnloaded ? poiManager.get(sectionPosOfJobSite) : poiManager.getOrLoad(sectionPosOfJobSite);
+ poiChunk.flatMap(poiSection -> poiSection.getType(blockPosOfJobSite))
+ // Shiroha end - Do not load too far poi chunk in poi compete scan
+ /*level.getPoiManager() // Shiroha - Do not load too far poi chunk in poi compete scan
@@ -162,14 +162,14 @@ index 88a89b4c72cc99dc89d3f3cc928b2dfda4125759..af210abbe1d4b75e1c6828cb25181c4c
+ final net.minecraft.world.level.Level ownerLevel = owner.level();
+
+ // type: entity
+ if (moe.monnairealms.camellia.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForEntity && this.value instanceof net.minecraft.world.entity.Entity entity) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForEntity && this.value instanceof net.minecraft.world.entity.Entity entity) {
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
+ this.clear();
+ }
+ }
+
+ // type: block_pos
+ if (moe.monnairealms.camellia.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForBlockPos && this.value instanceof net.minecraft.core.BlockPos blockPos) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForBlockPos && this.value instanceof net.minecraft.core.BlockPos blockPos) {
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ownerLevel, blockPos)) {
+ this.clear();
+ }
@@ -177,7 +177,7 @@ index 88a89b4c72cc99dc89d3f3cc928b2dfda4125759..af210abbe1d4b75e1c6828cb25181c4c
+
+
+ //type: position_tracker and walk_target
+ if (moe.monnairealms.camellia.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForPositionTracker) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForPositionTracker) {
+ net.minecraft.world.entity.ai.behavior.PositionTracker tracker = null;
+
+ if (value instanceof net.minecraft.world.entity.ai.behavior.PositionTracker positionTracker) {
@@ -205,7 +205,7 @@ index e44814cfb6afb594456b8215bd13a92e93de2c85..e0ca242da89d06005da692172a65a373
if (!this.isDone()) {
Vec3 target = this.path.getNextEntityPos(this.mob);
+ // Shiroha - Fix region threading with entity ai data access
+ if (moe.monnairealms.camellia.config.modules.fixes.PathfindingFixesConfig.breakDownPathfindingWhenOutOfRegion) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.PathfindingFixesConfig.breakDownPathfindingWhenOutOfRegion) {
+ // we assume that:
+ // 1. The code above doesn't touch the 'main thread context' with the position from 'this.path'
+ // 2. The pathfinder could correctly recompute or discard the incorrect target position and this situation is happening rarely
@@ -227,7 +227,7 @@ index 2ea1ec39a37899ae1510d0036aa670e758077537..18069d0b38ee08d798edc434875f6b5c
}
// Paper end - EntityPathfindEvent
+ // Shiroha start - Fix region threading with entity ai data access
+ if (moe.monnairealms.camellia.config.modules.fixes.PathfindingFixesConfig.doNotPathfindToNotOwnedTargets) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.PathfindingFixesConfig.doNotPathfindToNotOwnedTargets) {
+ // filter the targets not owned by current region
+ targets = new java.util.HashSet<>(targets); // well no idea about how to determine if this should be copied to a modifiable one
+ targets.removeIf(pos -> !ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.mob.level(), pos));
@@ -17,13 +17,13 @@ index c5a9d380f318f176a2bf5d30a10a6d528d23bb92..5f7dad51fdca3b85f8ae164b1f58241e
}
+ // Shiroha start - Fix high velocity moving issue
+ // Filter the threads as it may be called by the chunk system worker thread
+ if (moe.monnairealms.camellia.config.modules.fixes.FoliaEntityMovingFixConfig.enabled && ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()){
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.FoliaEntityMovingFixConfig.enabled && ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()){
+ var finalPosition = delta.add(this.position);
+ // not NaN (Prevent incorrect checks under NaN minecarts)
+ if (!Double.isNaN(finalPosition.x) && !Double.isNaN(finalPosition.y) && !Double.isNaN(finalPosition.z)) {
+ // kill tick passively if it's moving out of region and we'll catch this exception
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level,finalPosition)) {
+ throw new moe.monnairealms.camellia.utils.entity.EntityMoveOutOfRegionException(this, delta, moverType);
+ throw new io.nanachiyo0721.shiroha.utils.entity.EntityMoveOutOfRegionException(this, delta, moverType);
+ }
+ }
+ }
@@ -39,13 +39,13 @@ index a0eb1f608a99301e0197ab1d1a6fbbb0a0be4ce0..52bcb87e96f7b5997559bd532481f548
public <T extends Entity> void guardEntityTick(final Consumer<T> tick, final T entity) {
try {
tick.accept(entity);
+ } catch (moe.monnairealms.camellia.utils.entity.EntityMoveOutOfRegionException moveOutOfRegionException) { // Shiroha - Fix high velocity moving issue
+ } catch (io.nanachiyo0721.shiroha.utils.entity.EntityMoveOutOfRegionException moveOutOfRegionException) { // Shiroha - Fix high velocity moving issue
+ // Shiroha start - Fix high velocity moving issue
+ final Entity ent = moveOutOfRegionException.getEntity();
+ var currPosition = ent.position();
+ var toPosition = moveOutOfRegionException.getMovement().add(currPosition);
+
+ if (moe.monnairealms.camellia.config.modules.fixes.FoliaEntityMovingFixConfig.warnOnDetected) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.FoliaEntityMovingFixConfig.warnOnDetected) {
+ MinecraftServer.LOGGER.warn("Entity {} with entityId {} has tried moving to another region!",ent, ent.getId());
+ }
+
@@ -81,7 +81,7 @@ index 17244a82d7591004a43c013748f3db0507e73d7e..4d4a1475b315dd3cb855443ecd1fa75f
@@ -239,7 +239,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
// Paper end - initialize global and world-defaults configuration
moe.monnairealms.camellia.config.ConfigManager.loadConfigFiles(); // Shiroha - Config system framework - load config file
io.nanachiyo0721.shiroha.config.ConfigManager.loadConfigFiles(); // Shiroha - Config system framework - load config file
- this.server.spark.enableEarlyIfRequested(); // Paper - spark
+ if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Shiroha - Force disable builtin spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
@@ -157,7 +157,7 @@ index efcf294b523ca6b039eb2544546bf863ba717749..343c98fb35eb4cb736d26f67a11c00ef
}
+ // Shiroha start - Async protocol switch
+ };
+ if (!moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ this.connection.setupOutboundProtocol(GameProtocols.CLIENTBOUND_TEMPLATE.bind(RegistryFriendlyByteBuf.decorator(this.server.registryAccess())));
+ afterSwitch.run(); // directly run callback as we won't process any packet this time
+ } else {
@@ -178,7 +178,7 @@ index eda7e765c7c2ffee305edc81e0c7a6b1e5bfa18d..4c9ea818be83ed3c4dacc762f4d0e8c0
} // Folia end - rewrite login process - move connection ownership to global region
this.waitingForSwitchToConfig = true; // Folia - rewrite login process - fix bad ordering of this field write - moved down
this.send(ClientboundStartConfigurationPacket.INSTANCE);
+ if (!moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
+ // Shiroha start - Async protcol switch
+ } else {
@@ -192,7 +192,7 @@ index eda7e765c7c2ffee305edc81e0c7a6b1e5bfa18d..4c9ea818be83ed3c4dacc762f4d0e8c0
}
final ServerConfigurationPacketListenerImpl listener = new ServerConfigurationPacketListenerImpl(this.server, this.connection, this.createCookie(this.player.clientInformation())); // Paper
+ if (!moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch
this.connection
.setupInboundProtocol(
ConfigurationProtocols.SERVERBOUND,
@@ -238,7 +238,7 @@ index f2329d1a9d9d4bf4c9d771e25e54f2f9ef65a76c..7de3bbecea2f11e4e1cb65408729f346
+
+ Runnable afterSwitch = () -> io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(configPacketListener::startConfiguration); // push back to main thread
+
+ if (!moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
+ this.connection.setupInboundProtocol(ConfigurationProtocols.SERVERBOUND, configPacketListener);
+ afterSwitch.run();
@@ -260,7 +260,7 @@ index e7579a9873362317dd82b63306cf650af9472574..9e90197b96fcac958c5073ca8f560e77
// only after setting the connection listener to game type, add the connection to this regions list
level.getCurrentWorldData().connections.add(connection);
// Folia end - rewrite login process
+ if (!moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch // we will run async switch once these main thread logics became done
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) { // Shiroha - Async protocol switch // we will run async switch once these main thread logics became done
connection.setupInboundProtocol(
GameProtocols.SERVERBOUND_TEMPLATE.bind(RegistryFriendlyByteBuf.decorator(this.server.registryAccess()), playerConnection), playerConnection
);
@@ -273,7 +273,7 @@ index e7579a9873362317dd82b63306cf650af9472574..9e90197b96fcac958c5073ca8f560e77
}
// Paper end - Send empty chunk
+ // Shiroha start - Async protocol switch
+ if (moe.monnairealms.camellia.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.AsyncProtocolChangeConfig.enabled) {
+ // auto read will be enabled once the async switch is done
+ connection.setupInboundProtocolAsync(
+ GameProtocols.SERVERBOUND_TEMPLATE.bind(RegistryFriendlyByteBuf.decorator(this.server.registryAccess()), playerConnection),
@@ -15,7 +15,7 @@ index 491af2413a4e793a121fec368259ff8211ed031e..f9076b71f22b016a117a1eeb9cc4b880
private ServerboundChatCommandPacket(final FriendlyByteBuf input) {
- this(input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs
+ this(moe.monnairealms.camellia.config.modules.fixes.LongCommandSupportConfig.enabled ? input.readUtf() : input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs // Shiroha - Add config to support for long command inputs
+ this(io.nanachiyo0721.shiroha.config.modules.fixes.LongCommandSupportConfig.enabled ? input.readUtf() : input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs // Shiroha - Add config to support for long command inputs
}
private void write(final FriendlyByteBuf output) {
@@ -13,7 +13,7 @@ index b01e00de94d8fa45359d3d14a8481287276adb68..cdb1647146f526dc80b15a09d3a936b5
public String getServerModName() {
- return io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper
+ return moe.monnairealms.camellia.config.modules.misc.ServerModNameConfig.fakeVanilla ? "vanilla" : moe.monnairealms.camellia.config.modules.misc.ServerModNameConfig.serverModName; // Paper // Shiroha - Add config for server mod name
+ return io.nanachiyo0721.shiroha.config.modules.misc.ServerModNameConfig.fakeVanilla ? "vanilla" : io.nanachiyo0721.shiroha.config.modules.misc.ServerModNameConfig.serverModName; // Paper // Shiroha - Add config for server mod name
}
public ServerClockManager clockManager() {
@@ -13,7 +13,7 @@ index 5a72fa0d72bfdb927293abe921c57f6ae964a6ec..913161732b0affa70fb114dd4087a610
@Override
public Thread newThread(final Runnable run) {
- final Thread ret = new TickThreadRunner(this.threadGroup, run, "Folia Region Scheduler Thread #" + this.idGenerator.getAndIncrement());
+ final Thread ret = new TickThreadRunner(this.threadGroup, moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForTickRegion(run), "Folia Region Scheduler Thread #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
+ final Thread ret = new TickThreadRunner(this.threadGroup, io.nanachiyo0721.shiroha.config.modules.optimizations.CpuAffinityConfig.wrapForTickRegion(run), "Folia Region Scheduler Thread #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
ret.setUncaughtExceptionHandler(TickRegionScheduler.this::uncaughtException);
return ret;
}
@@ -27,7 +27,7 @@ index 9544eaee7e02d00226d957ea0b79cd1a1fb0c4d0..4e138fe36aa0bc519482990b60543b17
private ThreadFactory createThreadFactory() {
- return new ThreadFactoryBuilder().setNameFormat("Netty " + this.type + " IO #%d").setDaemon(true).setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build(); // Paper
+ var origin = new ThreadFactoryBuilder().setNameFormat("Netty " + this.type + " IO #%d").setDaemon(true).setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build(); // Paper // Shiroha - Add config for cpu affinity
+ return run -> origin.newThread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForNettyIo(run)); // Shiroha - Add config for cpu affinity
+ return run -> origin.newThread(io.nanachiyo0721.shiroha.config.modules.optimizations.CpuAffinityConfig.wrapForNettyIo(run)); // Shiroha - Add config for cpu affinity
}
protected abstract IoHandlerFactory ioHandlerFactory();
@@ -13,7 +13,7 @@ index 480b6b2405706fd4d7158d0e160adafd84099887..ca8207f7bf6a71ae283c6c9739563e9d
public float fallDamagePerDistance = 0.0F;
public @Nullable CompoundTag blockData;
- public boolean forceTickAfterTeleportToDuplicate;
+ public boolean forceTickAfterTeleportToDuplicate = moe.monnairealms.camellia.config.modules.fixes.UnsafeTeleportationConfig.enabled; // Shiroha - Add config for unsafe teleportation
+ public boolean forceTickAfterTeleportToDuplicate = io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled; // Shiroha - Add config for unsafe teleportation
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
public boolean autoExpire = true; // Paper - Expand FallingBlock API
@@ -22,7 +22,7 @@ index 480b6b2405706fd4d7158d0e160adafd84099887..ca8207f7bf6a71ae283c6c9739563e9d
boolean fromOrToEnd = (oldDimension == Level.END || newDimension == Level.END) && oldDimension != newDimension;
Entity newEntity = super.teleport(transition);
- this.forceTickAfterTeleportToDuplicate = newEntity != null && fromOrToEnd && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper
+ this.forceTickAfterTeleportToDuplicate = newEntity != null && fromOrToEnd && (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation || moe.monnairealms.camellia.config.modules.fixes.UnsafeTeleportationConfig.enabled); // Paper // Shiroha - Add config for unsafe teleportation
+ this.forceTickAfterTeleportToDuplicate = newEntity != null && fromOrToEnd && (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation || io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled); // Paper // Shiroha - Add config for unsafe teleportation
return newEntity;
}
}
@@ -35,7 +35,7 @@ index d42bb2a1721e4ab8c9956e18c3ca418b8d648c59..1bb9e32fd0f112deeec936976da0899d
player.showEndCredits();
} else {
+ // Shiroha start - Add config for unsafe teleportation
+ if (moe.monnairealms.camellia.config.modules.fixes.UnsafeTeleportationConfig.enabled && !(entity instanceof net.minecraft.world.entity.player.Player)) {
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled && !(entity instanceof net.minecraft.world.entity.player.Player)) {
+ entity.endPortalLogicAsync(pos);
+ return;
+ }
@@ -13,7 +13,7 @@ index e9ca1a15049b0211d10401cb78e953b93afaf6c7..56c0cac6e6e4c86a1db3c27a2c850d65
for (final RunningTick tick : ticks) {
final long elapsed = now - tick.lastPrint;
- if (elapsed <= TimeUnit.SECONDS.toNanos(5L)) {
+ if (elapsed <= TimeUnit.MILLISECONDS.toNanos(moe.monnairealms.camellia.config.modules.misc.FoliaWatchogConfig.tickRegionTimeOutMs)) { // Shiroha - Add config for watchdog timeout
+ if (elapsed <= TimeUnit.MILLISECONDS.toNanos(io.nanachiyo0721.shiroha.config.modules.misc.FoliaWatchogConfig.tickRegionTimeOutMs)) { // Shiroha - Add config for watchdog timeout
continue;
}
tick.lastPrint = now;
@@ -12,7 +12,7 @@ index 52bcb87e96f7b5997559bd532481f548be03e6da..41b84a84a2ae24555a065d0779957b7b
));
// Shiroha end
} catch (Throwable t) {
+ if (moe.monnairealms.camellia.config.modules.experiment.DisableEntityCatchConfig.enabled) throw t; // Shiroha - Add config to disable entity tick catchers
+ if (io.nanachiyo0721.shiroha.config.modules.experiment.DisableEntityCatchConfig.enabled) throw t; // Shiroha - Add config to disable entity tick catchers
// Paper start - Prevent block entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", io.papermc.paper.util.MCUtil.getLevelName(entity.level()), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, t);
@@ -12,7 +12,7 @@ index dffa0d4859ecd7e21a9345f946083c56205145a3..8f2e4fa566cefc2089fb6f306a37939f
if (rawData.length == data.length) {
System.arraycopy(data, 0, rawData, 0, data.length);
} else {
+ if (!moe.monnairealms.camellia.config.modules.misc.DisableWarningConfig.disableHeightmapWarning) // Shiroha - Add config for heightmap warning
+ if (!io.nanachiyo0721.shiroha.config.modules.misc.DisableWarningConfig.disableHeightmapWarning) // Shiroha - Add config for heightmap warning
LOGGER.warn("Ignoring heightmap data for chunk {}, size does not match; expected: {}, got: {}", chunk.getPos(), rawData.length, data.length);
primeHeightmaps(chunk, EnumSet.of(type));
}
@@ -13,7 +13,7 @@ index bc9f6cc286536b87513de81855ad0b61cf787c84..6b91eab354d8e7c93bf148bfc1f5a611
//CloneCommands.register(this.dispatcher, context); // Folia - region threading - TODO
DamageCommand.register(this.dispatcher, context);
- //DataCommands.register(this.dispatcher); // Folia - region threading - TODO
+ if(moe.monnairealms.camellia.config.modules.experiment.CommandConfig.data) { // Shiroha - Add force the data command to be enabled config
+ if(io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.data) { // Shiroha - Add force the data command to be enabled config
+ DataCommands.register(this.dispatcher); // Folia - region threading - TODO // Shiroha - Add force the data command to be enabled config
+ } // Shiroha - Add force the data command to be enabled config
//DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO
@@ -13,7 +13,7 @@ index 31f1583f29eebe5e13b5a7ac5116fdafc3592e5c..bc567e04791128cc0b78a234c496cf99
public boolean performCommand(final ServerLevel level) {
- if (true) return false; // Folia - region threading
+ if (!moe.monnairealms.camellia.config.modules.experiment.CommandConfig.commandBlock) return false; // Folia - region threading // Shiroha - Add experimental config for command block command execution
+ if (!io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.commandBlock) return false; // Folia - region threading // Shiroha - Add experimental config for command block command execution
if (level.getGameTime() == this.lastExecution) {
return false;
}
@@ -16,7 +16,7 @@ index 8bcc8b6f83ab4d5a472741185511b5d84f4974be..7e78e67c32f5b577518fe735eaba4ce2
- if (testPosState.is(Blocks.TRIPWIRE) || testPosState.is(Blocks.TRIPWIRE_HOOK)) {
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !testPosState.is(Blocks.TRIPWIRE)) level.setBlock(testPos, wireData.trySetValue(ATTACHED, attached), Block.UPDATE_ALL); // Paper - prevent tripwire from updating
+ // Shiroha start - tripwire and tripwireHook dupe
+ if (moe.monnairealms.camellia.config.modules.function.TripwireBehaviorConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.TripwireBehaviorConfig.enabled) {
+ level.setBlock(testPos, wireData.trySetValue(ATTACHED, attached), 3);
+ level.getBlockState(testPos);
+ } else {
@@ -41,7 +41,7 @@ index b67f5f7b76037ab77548c37a83e4d0918915223a..4407333785e8e76d08bb8b18510e6db9
+ // Shiroha start - tripwire behavior modifier
+ java.util.List<BlockPos> blockList1 = new java.util.ArrayList<>();
+ java.util.List<BlockPos> blockList2 = new java.util.ArrayList<>();
+ boolean flag21 = moe.monnairealms.camellia.config.modules.function.TripwireBehaviorConfig.behaviorMode == moe.monnairealms.camellia.enums.EnumTripwireBehavior.VANILLA21; for (int dz = -2; dz <= 2; dz++) {
+ boolean flag21 = io.nanachiyo0721.shiroha.config.modules.function.TripwireBehaviorConfig.behaviorMode == io.nanachiyo0721.shiroha.enums.EnumTripwireBehavior.VANILLA21; for (int dz = -2; dz <= 2; dz++) {
for (int dx = -2; dx <= 2; dx++) {
for (int dy = -1; dy < 3; dy++) {
BlockPos blockPos = pos.set(origin).move(dx, dy, dz);
@@ -50,12 +50,12 @@ index b67f5f7b76037ab77548c37a83e4d0918915223a..4407333785e8e76d08bb8b18510e6db9
if (dropResources) {
- blockList.destroyBlock(blockPos, true, null); // CraftBukkit
+ boolean flag = false;
+ if (moe.monnairealms.camellia.config.modules.function.TripwireBehaviorConfig.enabled) {
+ switch (moe.monnairealms.camellia.config.modules.function.TripwireBehaviorConfig.behaviorMode) {
+ case moe.monnairealms.camellia.enums.EnumTripwireBehavior.VANILLA20: {
+ if (io.nanachiyo0721.shiroha.config.modules.function.TripwireBehaviorConfig.enabled) {
+ switch (io.nanachiyo0721.shiroha.config.modules.function.TripwireBehaviorConfig.behaviorMode) {
+ case io.nanachiyo0721.shiroha.enums.EnumTripwireBehavior.VANILLA20: {
+ flag = true;
+ }
+ case moe.monnairealms.camellia.enums.EnumTripwireBehavior.MIXED: {
+ case io.nanachiyo0721.shiroha.enums.EnumTripwireBehavior.MIXED: {
+ net.minecraft.world.level.block.state.BlockState state = newLevel.getBlockState(blockPos);
+ if (state.is(Blocks.TRIPWIRE)) {
+ if (state.getValue(net.minecraft.world.level.block.TripWireBlock.DISARMED)) {
@@ -84,7 +84,7 @@ index b67f5f7b76037ab77548c37a83e4d0918915223a..4407333785e8e76d08bb8b18510e6db9
- if (dropResources) {
- blockList.placeBlocks(state -> newLevel.destroyBlock(state.getPosition(), true, null));
+ // Shiroha start - prevent tripwire dupe in end platform generate
+ if (flag21 || !moe.monnairealms.camellia.config.modules.function.TripwireBehaviorConfig.enabled) {
+ if (flag21 || !io.nanachiyo0721.shiroha.config.modules.function.TripwireBehaviorConfig.enabled) {
+ if (dropResources) {
+ blockList.placeBlocks(state -> newLevel.destroyBlock(state.getPosition(), true, null));
+ } else {
@@ -15,7 +15,7 @@ index 4c9ea818be83ed3c4dacc762f4d0e8c0f177cd19..9fe5ee1c5578be6f6c5ad9a58e10669a
this.player.sendSpawnProtectionMessage(pos);
} else if (this.awaitingPositionFromClient == null && (level.mayInteract(this.player, pos) || passthroughSignInteraction)) {
// Paper end - Allow using signs inside spawn protection
+ if (!moe.monnairealms.camellia.config.modules.fixes.ItemMultitaskConfig.enabled) { // Shiroha - Add config for item multitask
+ if (!io.nanachiyo0721.shiroha.config.modules.fixes.ItemMultitaskConfig.enabled) { // Shiroha - Add config for item multitask
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
+ } // Shiroha - Add config for item multitask
InteractionResult interactionResult = this.player.gameMode.useItemOn(this.player, level, itemStack, hand, blockHit);
@@ -28,7 +28,7 @@ index 4c9ea818be83ed3c4dacc762f4d0e8c0f177cd19..9fe5ee1c5578be6f6c5ad9a58e10669a
- if (this.player.getInventory().getSelectedSlot() != packet.getSlot() && this.player.getUsedItemHand() == InteractionHand.MAIN_HAND) {
- this.player.stopUsingItem();
+ // Shiroha start - Add item multitask config
+ if (!moe.monnairealms.camellia.config.modules.fixes.ItemMultitaskConfig.enabled) {
+ if (!io.nanachiyo0721.shiroha.config.modules.fixes.ItemMultitaskConfig.enabled) {
+ if (this.player.getInventory().getSelectedSlot() != packet.getSlot() && this.player.getUsedItemHand() == InteractionHand.MAIN_HAND) {
+ this.player.stopUsingItem();
+ }
@@ -14,7 +14,7 @@ index aa575f3b76ef70ffb9f0410e7e5cfe7af384bfbd..a00b086962b68d6f86cfb55eee6f61af
private void globalTick(final long tickCount) {
++this.tickCount;
+ // Shiroha start - Add a config to enable tick command
+ if (moe.monnairealms.camellia.config.modules.experiment.CommandConfig.tick) {
+ if (io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.tick) {
+ MinecraftServer.getServer().tickRateManager().tick();
+ }
+ // Shiroha end - Add a config to enable tick command
@@ -26,7 +26,7 @@ index aa575f3b76ef70ffb9f0410e7e5cfe7af384bfbd..a00b086962b68d6f86cfb55eee6f61af
private void tickTime(final ServerLevel world, final long tickCount) {
- if (world.tickTime) {
+ if ((!moe.monnairealms.camellia.config.modules.experiment.CommandConfig.tick || world.tickRateManager().runsNormally()) && world.tickTime) { // Shiroha - Add a config to enable tick command
+ if ((!io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.tick || world.tickRateManager().runsNormally()) && world.tickTime) { // Shiroha - Add a config to enable tick command
world.serverLevelData.setGameTime(world.serverLevelData.getGameTime() + tickCount);
}
}
@@ -39,7 +39,7 @@ index 913161732b0affa70fb114dd4087a6102b611cba..ccd86db7b384d99d290869a155792b49
// next start isn't updated until the end of this tick
this.tickRegion(tickCount, tickStart, scheduledEnd);
+ // Shiroha start - Add a config to enable tick command
+ if (moe.monnairealms.camellia.config.modules.experiment.CommandConfig.tick) {
+ if (io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.tick) {
+ MinecraftServer.getServer().tickRateManager().endTickWork();
+ }
+ // Shiroha end - Add a config to enable tick command
@@ -56,7 +56,7 @@ index 6b91eab354d8e7c93bf148bfc1f5a611f8ffcf86..d971cc9669aca1005c026133e7e7e7f9
//TestCommand.register(this.dispatcher, context); // Folia - region threading
- //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
+ // Shiroha start - Add a config to enable tick command
+ if (moe.monnairealms.camellia.config.modules.experiment.CommandConfig.tick) {
+ if (io.nanachiyo0721.shiroha.config.modules.experiment.CommandConfig.tick) {
+ TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
+ }
+ // Shiroha end - Add a config to enable tick command
@@ -13,7 +13,7 @@ index 7e612e03087d63f9b500f7e9f3442b1931bae7ee..9d46c1bc0629faca4ca9e0a2f830912b
public static final TicketType PLAYER_SIMULATION = register("player_simulation", NO_TIMEOUT, FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
public static final TicketType FORCED = register("forced", NO_TIMEOUT, FLAG_PERSIST | FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
- public static final TicketType PORTAL = register("portal", 300L, FLAG_PERSIST | FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
+ public static final TicketType PORTAL = register("portal", 300L, moe.monnairealms.camellia.config.modules.misc.SavePortalTicketsConfig.doSave ? FLAG_PERSIST | FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE : FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE); // Shiroha - Add config for whether to save portal tickets
+ public static final TicketType PORTAL = register("portal", 300L, io.nanachiyo0721.shiroha.config.modules.misc.SavePortalTicketsConfig.doSave ? FLAG_PERSIST | FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE : FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE); // Shiroha - Add config for whether to save portal tickets
public static final TicketType ENDER_PEARL = register("ender_pearl", 40L, FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
public static final TicketType UNKNOWN = register("unknown", 1L, FLAG_CAN_EXPIRE_IF_UNLOADED | FLAG_LOADING);
public static final TicketType PLUGIN = register("plugin", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // CraftBukkit
@@ -37,20 +37,20 @@ index f32d118e1e925b2155cef3fcdcb1e194c541e242..fe17157c4c6fc9ec745c5c11f6837e71
}
+ // Shiroha start - Add portal rate limiter
+ public final moe.monnairealms.camellia.utils.RateThrottler portalRateThrottler = new moe.monnairealms.camellia.utils.RateThrottler();
+ public final net.objecthunter.exp4j.Expression portalRateCapExpression = moe.monnairealms.camellia.config.modules.function.PortalRateLimiterConfig.getExpressionIfConfigured();
+ public final io.nanachiyo0721.shiroha.utils.RateThrottler portalRateThrottler = new io.nanachiyo0721.shiroha.utils.RateThrottler();
+ public final net.objecthunter.exp4j.Expression portalRateCapExpression = io.nanachiyo0721.shiroha.config.modules.function.PortalRateLimiterConfig.getExpressionIfConfigured();
+
+ private int computePortalRateCap() {
+ // expression mode is disabled
+ if (this.portalRateCapExpression == null) {
+ return moe.monnairealms.camellia.config.modules.function.PortalRateLimiterConfig.maxPortalTeleportsPerTick;
+ return io.nanachiyo0721.shiroha.config.modules.function.PortalRateLimiterConfig.maxPortalTeleportsPerTick;
+ }
+
+ final int tickingEntityCount = this.entityTickList.size();
+ final int tickingChunkCount = this.tickingChunks.size();
+ final int playerCount = this.localPlayers.size();
+
+ return moe.monnairealms.camellia.config.modules.function.PortalRateLimiterConfig.computeExpression(
+ return io.nanachiyo0721.shiroha.config.modules.function.PortalRateLimiterConfig.computeExpression(
+ this.portalRateCapExpression,
+ tickingEntityCount,
+ tickingChunkCount,
@@ -58,7 +58,7 @@ index f32d118e1e925b2155cef3fcdcb1e194c541e242..fe17157c4c6fc9ec745c5c11f6837e71
+ );
+ }
+ public boolean isPortalTeleportationOutOfRate() {
+ if (!moe.monnairealms.camellia.config.modules.function.PortalRateLimiterConfig.enabled) {
+ if (!io.nanachiyo0721.shiroha.config.modules.function.PortalRateLimiterConfig.enabled) {
+ return false;
+ }
+
@@ -253,7 +253,7 @@ index 2eb5fc819e2e17c69de87f8aa1a99e02bc5a62d5..ab0f42c6ed9ba4f920eefba4d1449ded
private ItemStack lastItemInMainHand = ItemStack.EMPTY;
private final ItemCooldowns cooldowns = this.createItemCooldowns();
private Optional<GlobalPos> lastDeathLocation = Optional.empty();
+ public moe.monnairealms.camellia.functions.bars.TickableStatusBarList statusBarList = new moe.monnairealms.camellia.functions.bars.TickableStatusBarList(this); // Shiroha - Add status bars
+ public io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList statusBarList = new io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList(this); // Shiroha - Add status bars
public @Nullable FishingHook fishing;
public float hurtDir;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
@@ -187,7 +187,7 @@ index 08ea8107fc8cbec3742278ab5cf03ef9048720f9..e59250af5d769076578017fb880e9168
}
private void ensureMapOwnership() {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.copyOnWrite && this.subscriber != null) this.subscriber.lithium$notify((PatchedDataComponentMap) (Object) this, 0); // Leaves - Lithium Sleeping Block Entity (only notify when actually copying, matches Lithium mixin semantics)
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.copyOnWrite && this.subscriber != null) this.subscriber.lithium$notify((PatchedDataComponentMap) (Object) this, 0); // Leaves - Lithium Sleeping Block Entity (only notify when actually copying, matches Lithium mixin semantics)
if (this.copyOnWrite) {
this.patch = new Reference2ObjectArrayMap<>(this.patch);
this.copyOnWrite = false;
@@ -222,7 +222,7 @@ index f2c5a6ce769d8a5fdb4b836eae6a61a4da91cb3f..968cdfa8a153b892963428967fd35c61
try (ProblemReporter.ScopedCollector reporter = new ProblemReporter.ScopedCollector(this.entity.problemPath(), LOGGER)) {
this.entity.load(TagValueInput.create(reporter, this.entity.registryAccess(), tag));
this.entity.setUUID(uuid);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.entity instanceof net.minecraft.world.entity.item.ItemEntity itemEntity) itemEntity.levelCallback.onMove(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.entity instanceof net.minecraft.world.entity.item.ItemEntity itemEntity) itemEntity.levelCallback.onMove(); // Leaves - Lithium Sleeping Block Entity
}
}
@@ -276,7 +276,7 @@ index 18e0572fe28461e57edb13e6ed6f5a0b6b3604c9..83914a091cc8fd6ef726f2732238b164
+ // Shiroha start - Region threading for lithium sleeping block entity
+ private void notifyLithiumTrackerIfNeeded() {
+ // Leaves start - Lithium Sleeping Block Entity
+ if (!moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) return;
+ if (!io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) return;
+ var currentWorldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData();
+ if (currentWorldData == null || currentWorldData.world != this.level) return;
+ if (this instanceof ItemEntity) {
@@ -319,7 +319,7 @@ index 9a75c6b38f1cabd4415067d781f6ad49f4d8ebc8..1606bb148203d4bf7bdacb58acf1144c
public void setItem(final ItemStack itemStack) {
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.subscriber != null) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.subscriber != null) {
+ ItemStack oldStack = this.getItem();
+ if (oldStack != itemStack) {
+ if (!oldStack.isEmpty()) {
@@ -454,7 +454,7 @@ index 136e018d83c5be90894358a97b23f5fcfa6c0d38..93c94a059873993b2e3e03a47c61f90d
float totalPercent = 0.0F;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && container instanceof org.leavesmc.leaves.lithium.api.inventory.LithiumInventory optimizedInventory) return org.leavesmc.leaves.lithium.common.hopper.InventoryHelper.getLithiumStackList(optimizedInventory).getSignalStrength(container); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && container instanceof org.leavesmc.leaves.lithium.api.inventory.LithiumInventory optimizedInventory) return org.leavesmc.leaves.lithium.common.hopper.InventoryHelper.getLithiumStackList(optimizedInventory).getSignalStrength(container); // Leaves - Lithium Sleeping Block Entity
for (int i = 0; i < container.getContainerSize(); i++) {
ItemStack itemStack = container.getItem(i);
if (!itemStack.isEmpty()) {
@@ -480,7 +480,7 @@ index dc1e9acce122f3ebd7bf2b03150b4045db9493df..0bd2f2da669aa1a59d0af65aea3b305d
// CraftBukkit end
public <T> @Nullable T set(final DataComponentType<T> type, final @Nullable T value) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && type == DataComponents.ENCHANTMENTS && this.subscriber instanceof ChangeSubscriber.EnchantmentSubscriber<ItemStack> enchantmentSubscriber) enchantmentSubscriber.lithium$notifyAfterEnchantmentChange(this, this.subscriberData); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && type == DataComponents.ENCHANTMENTS && this.subscriber instanceof ChangeSubscriber.EnchantmentSubscriber<ItemStack> enchantmentSubscriber) enchantmentSubscriber.lithium$notifyAfterEnchantmentChange(this, this.subscriberData); // Leaves - Lithium Sleeping Block Entity
return this.components.set(type, value);
}
@@ -489,7 +489,7 @@ index dc1e9acce122f3ebd7bf2b03150b4045db9493df..0bd2f2da669aa1a59d0af65aea3b305d
public void setCount(final int count) {
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && count != this.count) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && count != this.count) {
+ if (this.subscriber instanceof ChangeSubscriber.CountChangeSubscriber<ItemStack> countChangeSubscriber) {
+ countChangeSubscriber.lithium$notifyCount(this, this.subscriberData, count);
+ }
@@ -666,7 +666,7 @@ index 69e3969242ad52168e947af209e6fa72f36178ae..82f041a6c72eb09d365b5f83dd473146
}
// Paper end - Add CompostItemEvent and EntityCompostItemEvent
this.level.levelEvent(LevelEvent.COMPOSTER_FILL, this.pos, newState != this.state ? 1 : 0);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.changed = false; // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.changed = false; // Leaves - Lithium Sleeping Block Entity
this.removeItemNoUpdate(0);
}
}
@@ -685,7 +685,7 @@ index 2339099e05af80b234e64778822b012cc6318157..d828f2535a4860d96f3ca6c95a54e00b
@Override
protected void onPlace(final BlockState state, final Level level, final BlockPos pos, final BlockState oldState, final boolean movedByPiston) {
this.updateNeighborsInFront(level, pos, state);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this instanceof ComparatorBlock && !oldState.is(Blocks.COMPARATOR)) org.leavesmc.leaves.lithium.common.block.entity.inventory_comparator_tracking.ComparatorTracking.notifyNearbyBlockEntitiesAboutNewComparator(level, pos); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this instanceof ComparatorBlock && !oldState.is(Blocks.COMPARATOR)) org.leavesmc.leaves.lithium.common.block.entity.inventory_comparator_tracking.ComparatorTracking.notifyNearbyBlockEntitiesAboutNewComparator(level, pos); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -708,7 +708,7 @@ index 3932da81757ea0ab7a41617165f5b64dc44ea3eb..2ccabd98f9fa7f2a228c7ee320d0f8c9
this.checkPoweredState(level, pos, state);
+ // Leaves start - Lithium Sleeping Block Entity
+ //invalidate caches of nearby hoppers when placing an update suppressed hopper
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && level.getBlockState(pos) != state) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && level.getBlockState(pos) != state) {
+ for (Direction direction : UPDATE_SHAPE_ORDER) {
+ BlockEntity hopper = level.lithium$getLoadedExistingBlockEntity(pos.relative(direction));
+ if (hopper instanceof org.leavesmc.leaves.lithium.common.hopper.UpdateReceiver updateReceiver) {
@@ -724,7 +724,7 @@ index 3932da81757ea0ab7a41617165f5b64dc44ea3eb..2ccabd98f9fa7f2a228c7ee320d0f8c9
protected void neighborChanged(
final BlockState state, final Level level, final BlockPos pos, final Block block, final @Nullable Orientation orientation, final boolean movedByPiston
) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && level.lithium$getLoadedExistingBlockEntity(pos) instanceof org.leavesmc.leaves.lithium.common.hopper.UpdateReceiver updateReceiver) updateReceiver.lithium$invalidateCacheOnUndirectedNeighborUpdate(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && level.lithium$getLoadedExistingBlockEntity(pos) instanceof org.leavesmc.leaves.lithium.common.hopper.UpdateReceiver updateReceiver) updateReceiver.lithium$invalidateCacheOnUndirectedNeighborUpdate(); // Leaves - Lithium Sleeping Block Entity
this.checkPoweredState(level, pos, state);
}
@@ -771,7 +771,7 @@ index 78dbdf43ac9095eb3cf0b0653bab2603d5527ff4..601471d7578b93f30d8033bfab4d4050
this.recipesUsed.clear();
this.recipesUsed.putAll(input.read("RecipesUsed", RECIPES_USED_CODEC).orElse(Map.of()));
this.cookSpeedMultiplier = input.getDoubleOr("Paper.CookSpeedMultiplier", 1); // Paper - cook speed multiplier API
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -779,7 +779,7 @@ index 78dbdf43ac9095eb3cf0b0653bab2603d5527ff4..601471d7578b93f30d8033bfab4d4050
if (changed) {
setChanged(level, pos, state);
}
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(state); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(state); // Leaves - Lithium Sleeping Block Entity
}
private static void consumeFuel(final NonNullList<ItemStack> items, final ItemStack fuel) {
@@ -854,7 +854,7 @@ index 118af4e35eec652e7eb8a484a44652cfabc1bab5..fd2c62a4c9a9dbd81c3c4d1410694e5c
@Override
protected void setItems(final NonNullList<ItemStack> items) {
this.items = items;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -904,7 +904,7 @@ index 0e594121b60aa5a01b5bbe94b80350f2fc698b1a..f100d51275522748664592453c9c51cb
super.loadAdditional(input);
this.lockKey = LockCode.fromTag(input);
this.name = parseCustomNameSafe(input, "CustomName");
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this instanceof InventoryChangeTracker inventoryChangeTracker) inventoryChangeTracker.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this instanceof InventoryChangeTracker inventoryChangeTracker) inventoryChangeTracker.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1042,7 +1042,7 @@ index 2887cbaa954771d0fe357d8ec8df75073e9afa91..69227ca2534a3abe3be3d5c704335bc5
if (this.level != null) {
if (IGNORE_TILE_UPDATES.get().booleanValue()) return; // Paper - Perf: Optimize Hoppers // Folia - region threading
setChanged(this.level, this.worldPosition, this.blockState);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) lithium$handleSetChanged(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) lithium$handleSetChanged(); // Leaves - Lithium Sleeping Block Entity
}
}
@@ -1052,7 +1052,7 @@ index 2887cbaa954771d0fe357d8ec8df75073e9afa91..69227ca2534a3abe3be3d5c704335bc5
public void setRemoved() {
+ this.hasComparators = UNKNOWN; // Leaves - Lithium Sleeping Block Entity
this.remove = true;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.level != null && !this.level.isClientSide() && this instanceof InventoryChangeTracker inventoryChangeTracker) inventoryChangeTracker.lithium$emitRemoved(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.level != null && !this.level.isClientSide() && this instanceof InventoryChangeTracker inventoryChangeTracker) inventoryChangeTracker.lithium$emitRemoved(); // Leaves - Lithium Sleeping Block Entity
}
public void clearRemoved() {
@@ -1060,7 +1060,7 @@ index 2887cbaa954771d0fe357d8ec8df75073e9afa91..69227ca2534a3abe3be3d5c704335bc5
public void setBlockState(final BlockState blockState) {
this.validateBlockState(blockState);
this.blockState = blockState;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$handleSetBlockState(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$handleSetBlockState(); // Leaves - Lithium Sleeping Block Entity
}
protected void applyImplicitComponents(final DataComponentGetter components) {
@@ -1114,7 +1114,7 @@ index 5d26efb1feb1fd7d0f3bcc0fd7678b303518312a..bd320bcaa7964bf5532c6cb9634a5227
}
public static void serverTick(final Level level, final BlockPos pos, final BlockState selfState, final BrewingStandBlockEntity entity) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(selfState); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(selfState); // Leaves - Lithium Sleeping Block Entity
ItemStack fuel = entity.items.get(4);
if (entity.fuel <= 0 && fuel.is(ItemTags.BREWING_FUEL)) {
// CraftBukkit start
@@ -1122,7 +1122,7 @@ index 5d26efb1feb1fd7d0f3bcc0fd7678b303518312a..bd320bcaa7964bf5532c6cb9634a5227
fuel.shrink(1);
}
// CraftBukkit end
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
setChanged(level, pos, selfState);
}
@@ -1131,7 +1131,7 @@ index 5d26efb1feb1fd7d0f3bcc0fd7678b303518312a..bd320bcaa7964bf5532c6cb9634a5227
entity.brewTime = 0;
}
-
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
setChanged(level, pos, selfState);
} else if (brewable && entity.fuel > 0) {
entity.fuel--;
@@ -1139,7 +1139,7 @@ index 5d26efb1feb1fd7d0f3bcc0fd7678b303518312a..bd320bcaa7964bf5532c6cb9634a5227
entity.brewTime = event.getBrewingTime(); // 400 -> event.getTotalBrewTime() // Paper - use brewing time from event
// CraftBukkit end
entity.ingredient = ingredient.getItem();
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
setChanged(level, pos, selfState);
}
@@ -1147,7 +1147,7 @@ index 5d26efb1feb1fd7d0f3bcc0fd7678b303518312a..bd320bcaa7964bf5532c6cb9634a5227
}
this.fuel = input.getByteOr("Fuel", (byte)0);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1223,7 +1223,7 @@ index 64d0d60d9025de2b5eb16b31c6437372d4c20c5e..54070ae70b1d4a6ed4fd51ba758dead4
if (changed) {
setChanged(level, pos, state);
- }
+ } else if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
+ } else if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
}
public static void cooldownTick(final Level level, final BlockPos pos, final BlockState state, final CampfireBlockEntity entity) {
@@ -1232,7 +1232,7 @@ index 64d0d60d9025de2b5eb16b31c6437372d4c20c5e..54070ae70b1d4a6ed4fd51ba758dead4
if (changed) {
setChanged(level, pos, state);
- }
+ } else if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
+ } else if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
}
public static void particleTick(final Level level, final BlockPos pos, final BlockState state, final CampfireBlockEntity entity) {
@@ -1240,7 +1240,7 @@ index 64d0d60d9025de2b5eb16b31c6437372d4c20c5e..54070ae70b1d4a6ed4fd51ba758dead4
System.arraycopy(cookingState, 0, this.stopCooking, 0, Math.min(this.stopCooking.length, bytes.capacity()));
});
// Paper end - Add more Campfire API
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1248,7 +1248,7 @@ index 64d0d60d9025de2b5eb16b31c6437372d4c20c5e..54070ae70b1d4a6ed4fd51ba758dead4
this.cookingTime[slot] = event.getTotalCookTime(); // recipe.get().value().cookingTime() -> event.getTotalCookTime()
// CraftBukkit end
this.cookingProgress[slot] = 0;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
this.items.set(slot, placeItem.consumeAndReturn(1, sourceEntity));
serverLevel.gameEvent(GameEvent.BLOCK_CHANGE, this.getBlockPos(), GameEvent.Context.of(sourceEntity, this.getBlockState()));
this.markUpdated();
@@ -1300,7 +1300,7 @@ index a9273aebb5c8efe78e88158f11e1ee2af0dff3f1..c0d636ebe2fd9f2c63c1b9cb62ba257b
public static void lidAnimateTick(final Level level, final BlockPos pos, final BlockState state, final ChestBlockEntity entity) {
entity.chestLidController.tickLid();
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
}
public static void playSound(final Level level, final BlockPos worldPosition, final BlockState blockState, final SoundEvent event) {
@@ -1308,7 +1308,7 @@ index a9273aebb5c8efe78e88158f11e1ee2af0dff3f1..c0d636ebe2fd9f2c63c1b9cb62ba257b
@Override
public boolean triggerEvent(final int b0, final int b1) {
if (b0 == EVENT_SET_OPEN_COUNT) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
this.chestLidController.shouldBeOpen(b1 > 0);
return true;
} else {
@@ -1316,7 +1316,7 @@ index a9273aebb5c8efe78e88158f11e1ee2af0dff3f1..c0d636ebe2fd9f2c63c1b9cb62ba257b
@Override
protected void setItems(final NonNullList<ItemStack> items) {
this.items = items;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1410,7 +1410,7 @@ index 02d86d0675de22546a225dd6eaac5875eba0ce54..d3aff67c70b7c69daf6c6674325b26a4
}
});
this.containerData.set(9, input.getIntOr("triggered", 0));
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1418,12 +1418,12 @@ index 02d86d0675de22546a225dd6eaac5875eba0ce54..d3aff67c70b7c69daf6c6674325b26a4
level.setBlock(blockPos, blockState.setValue(CrafterBlock.CRAFTING, false), Block.UPDATE_ALL);
}
}
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && craftingTicksRemaining < 0) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && craftingTicksRemaining < 0) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
}
public void setCraftingTicksRemaining(final int maxCraftingTicks) {
this.craftingTicksRemaining = maxCraftingTicks;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.isSleeping() && this.level != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
}
public int getRedstoneSignal() {
@@ -1488,7 +1488,7 @@ index 736f5fd76f4a86ab16740904b5c0823413d65cd2..8995d91aed44b8c7933eaf0111332d83
@Override
protected void setItems(final NonNullList<ItemStack> items) {
this.items = items;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -1525,13 +1525,13 @@ index 6109d8da984b398bb1eb6cd6ab9a55f0511a615c..4b92beb60cb56dc35107dd2c2e7cc6a2
public static void lidAnimateTick(final Level level, final BlockPos pos, final BlockState state, final EnderChestBlockEntity entity) {
entity.chestLidController.tickLid();
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleep(); // Leaves - Lithium Sleeping Block Entity
}
@Override
public boolean triggerEvent(final int b0, final int b1) {
if (b0 == ChestBlock.EVENT_SET_OPEN_COUNT) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
this.chestLidController.shouldBeOpen(b1 > 0);
return true;
} else {
@@ -1633,7 +1633,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
@Override
public void setBlockState(final BlockState blockState) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.level != null && !this.level.isClientSide() && blockState.getValue(HopperBlock.FACING) != this.getBlockState().getValue(HopperBlock.FACING)) this.invalidateCachedData(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.level != null && !this.level.isClientSide() && blockState.getValue(HopperBlock.FACING) != this.getBlockState().getValue(HopperBlock.FACING)) this.invalidateCachedData(); // Leaves - Lithium Sleeping Block Entity
super.setBlockState(blockState);
this.facing = blockState.getValue(HopperBlock.FACING);
}
@@ -1641,7 +1641,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
entity.setCooldown(0);
// Spigot start
boolean result = tryMoveItems(level, pos, state, entity, () -> suckInItems(level, entity));
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleepingConditions(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) entity.checkSleepingConditions(); // Leaves - Lithium Sleeping Block Entity
if (!result && entity.level.spigotConfig.hopperCheck > 1) {
entity.setCooldown(entity.level.spigotConfig.hopperCheck);
}
@@ -1650,7 +1650,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
entity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
setChanged(level, pos, state);
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled
+ && !entity.isOnCooldown()
+ && !entity.isSleeping()
+ && !state.getValue(HopperBlock.ENABLED)) {
@@ -1673,14 +1673,14 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
private static boolean ejectItems(final Level level, final BlockPos blockPos, final HopperBlockEntity self) {
- Container container = getAttachedContainer(level, blockPos, self);
+ Container container = moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? self.getInsertInventory(level) : getAttachedContainer(level, blockPos, self); // Leaves - Lithium Sleeping Block Entity
+ Container container = io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? self.getInsertInventory(level) : getAttachedContainer(level, blockPos, self); // Leaves - Lithium Sleeping Block Entity
if (container == null) {
return false;
}
Direction direction = self.facing.getOpposite();
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ Boolean res = lithiumInsert(level, blockPos, self, container);
+ if (res != null) {
+ return res;
@@ -1696,12 +1696,12 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
BlockState blockState = level.getBlockState(blockPos);
- Container container = getSourceContainer(level, hopper, blockPos, blockState);
- if (container != null) {
+ Container sourceContainer = moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? getExtractInventory(level, hopper, blockPos, blockState) : getSourceContainer(level, hopper, blockPos, blockState); // Leaves - Lithium Sleeping Block Entity
+ Container sourceContainer = io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? getExtractInventory(level, hopper, blockPos, blockState) : getSourceContainer(level, hopper, blockPos, blockState); // Leaves - Lithium Sleeping Block Entity
+ if (sourceContainer != null) {
Direction direction = Direction.DOWN;
worldData.skipPullModeEventFire = worldData.skipHopperEvents; // Paper - Perf: Optimize Hoppers // Folia - region threading
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ Boolean res = lithiumExtract(level, hopper, sourceContainer);
+ if (res != null) {
+ return res;
@@ -1721,7 +1721,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
&& !blockState.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
if (!isBlocked) {
- for (ItemEntity entity : getItemsAtAndAbove(level, hopper)) {
+ for (ItemEntity entity : moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? lithiumGetInputItemEntities(level, hopper) : getItemsAtAndAbove(level, hopper)) { // Leaves - Lithium Sleeping Block Entity
+ for (ItemEntity entity : io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled ? lithiumGetInputItemEntities(level, hopper) : getItemsAtAndAbove(level, hopper)) { // Leaves - Lithium Sleeping Block Entity
if (addItem(hopper, entity)) {
return true;
}
@@ -1739,7 +1739,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
public void setCooldown(final int time) {
+ // Leaves start - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) {
+ if (time == 7) {
+ if (this.tickedGameTime == Long.MAX_VALUE) {
+ this.sleepOnlyCurrentTick();
@@ -1758,7 +1758,7 @@ index 4c9d0bcd8820b250b51c06fff4531021ab57d408..fa34778b1ce7a34385c192182e521b00
@Override
protected void setItems(final NonNullList<ItemStack> items) {
this.items = items;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
public static void entityInside(final Level level, final BlockPos pos, final BlockState blockState, final Entity entity, final HopperBlockEntity hopper) {
@@ -2538,7 +2538,7 @@ index 174e39fb109bef3dd27ebc14aa13f6faabb10547..e898171acd7c4ef83d630e25c71222f4
doNeighborUpdates(level, pos, blockState);
}
}
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.animationStatus == ShulkerBoxBlockEntity.AnimationStatus.CLOSED && this.progressOld == 0.0f && this.progress == 0.0f) this.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.animationStatus == ShulkerBoxBlockEntity.AnimationStatus.CLOSED && this.progressOld == 0.0f && this.progress == 0.0f) this.lithium$startSleeping(); // Leaves - Lithium Sleeping Block Entity
}
public ShulkerBoxBlockEntity.AnimationStatus getAnimationStatus() {
@@ -2546,7 +2546,7 @@ index 174e39fb109bef3dd27ebc14aa13f6faabb10547..e898171acd7c4ef83d630e25c71222f4
@Override
public boolean triggerEvent(final int b0, final int b1) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && this.sleepingTicker != null) this.wakeUpNow(); // Leaves - Lithium Sleeping Block Entity
if (b0 == EVENT_SET_OPEN_COUNT) {
this.openCount = b1;
if (b1 == 0) {
@@ -2554,7 +2554,7 @@ index 174e39fb109bef3dd27ebc14aa13f6faabb10547..e898171acd7c4ef83d630e25c71222f4
@Override
protected void setItems(final NonNullList<ItemStack> items) {
this.itemStacks = items;
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$emitStackListReplaced(); // Leaves - Lithium Sleeping Block Entity
}
@Override
@@ -2628,7 +2628,7 @@ index c78d77089e34c4bb559f173b449bfb7d91b05d5c..f4cce42ddd319cfd11cc43d68044f51b
final BlockState neighbourState,
final RandomSource random
) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$handleShapeUpdate(level, state, pos, neighbourPos, neighbourState); // Leaves - Lithium Sleeping Block Entity /* Triggers when a shape update (= update that observers can detect) is sent */
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) this.lithium$handleShapeUpdate(level, state, pos, neighbourPos, neighbourState); // Leaves - Lithium Sleeping Block Entity /* Triggers when a shape update (= update that observers can detect) is sent */
return state;
}
@@ -2669,14 +2669,14 @@ index 0e84b695a677e71f443a29c78fc5025eec7ae7f4..3cb6c24a21538569d73b95803dde7e4a
this.tickersInLevel.compute(blockEntity.getBlockPos(), (blockPos, existingTicker) -> {
TickingBlockEntity actualTicker = this.createTicker(blockEntity, ticker);
if (existingTicker != null) {
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && blockEntity instanceof org.leavesmc.leaves.lithium.common.block.entity.SleepingBlockEntity sleepingBlockEntity) sleepingBlockEntity.lithium$setTickWrapper(existingTicker); // Leaves - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) existingTicker.createdBy = blockEntity; // Shiroha - Region threading for lithium sleeping block entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && blockEntity instanceof org.leavesmc.leaves.lithium.common.block.entity.SleepingBlockEntity sleepingBlockEntity) sleepingBlockEntity.lithium$setTickWrapper(existingTicker); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) existingTicker.createdBy = blockEntity; // Shiroha - Region threading for lithium sleeping block entity
existingTicker.rebind(actualTicker);
return (LevelChunk.RebindableTickingBlockEntityWrapper)existingTicker;
} else if (this.isInLevel()) {
LevelChunk.RebindableTickingBlockEntityWrapper result = new LevelChunk.RebindableTickingBlockEntityWrapper(actualTicker);
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && blockEntity instanceof org.leavesmc.leaves.lithium.common.block.entity.SleepingBlockEntity sleepingBlockEntity) sleepingBlockEntity.lithium$setTickWrapper(result); // Leaves - Lithium Sleeping Block Entity
+ if (moe.monnairealms.camellia.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) result.createdBy = blockEntity; // Shiroha - Region threading for lithium sleeping block entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled && blockEntity instanceof org.leavesmc.leaves.lithium.common.block.entity.SleepingBlockEntity sleepingBlockEntity) sleepingBlockEntity.lithium$setTickWrapper(result); // Leaves - Lithium Sleeping Block Entity
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LeavesSleepingBlockEntityConfig.enabled) result.createdBy = blockEntity; // Shiroha - Region threading for lithium sleeping block entity
this.level.addBlockEntityTicker(result);
return result;
} else {
@@ -19,7 +19,7 @@ index 3c59325cb82a66a74d6605b51db83ff63e59e089..cab6061af551352a27e623af2ced3f49
ProfilerFiller profiler = Profiler.get();
profiler.push("sensing");
- this.sensing.tick();
+ if (idBasedTickCount % moe.monnairealms.camellia.config.modules.optimizations.PetalReduceSensorWorkConfig.delayTicks == 0 || !moe.monnairealms.camellia.config.modules.optimizations.PetalReduceSensorWorkConfig.enabled) this.sensing.tick(); // Shiroha - Petal - Reduce sensor work
+ if (idBasedTickCount % io.nanachiyo0721.shiroha.config.modules.optimizations.PetalReduceSensorWorkConfig.delayTicks == 0 || !io.nanachiyo0721.shiroha.config.modules.optimizations.PetalReduceSensorWorkConfig.enabled) this.sensing.tick(); // Shiroha - Petal - Reduce sensor work
profiler.pop();
- int idBasedTickCount = this.tickCount + this.getId();
+ //int idBasedTickCount = this.tickCount + this.getId(); // Shiroha - Petal - Move up
@@ -20,8 +20,8 @@ index f649c46cc9a34e646f8da3244866c6e011d30aa3..b0b017f61f1c7832068d2ba7b10efc72
+ private int notLobotomizedCount = 0; // Purpur
+
+ private boolean checkLobotomized() {
+ int interval = moe.monnairealms.camellia.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeCheckInterval;
+ boolean shouldCheckForTradeLocked = moe.monnairealms.camellia.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeWaitUntilTradeLocked;
+ int interval = io.nanachiyo0721.shiroha.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeCheckInterval;
+ boolean shouldCheckForTradeLocked = io.nanachiyo0721.shiroha.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeWaitUntilTradeLocked;
+ if (this.notLobotomizedCount > 3) {
+ // check half as often if not lobotomized for the last 3+ consecutive checks
+ interval *= 2;
@@ -75,7 +75,7 @@ index f649c46cc9a34e646f8da3244866c6e011d30aa3..b0b017f61f1c7832068d2ba7b10efc72
ProfilerFiller profiler = Profiler.get();
profiler.push("villagerBrain");
+ // Purpur start
+ if (moe.monnairealms.camellia.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeEnabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.LobotomizeVillageConfig.villagerLobotomizeEnabled) {
+ // treat as inactive if lobotomized
+ inactive = inactive || checkLobotomized();
+ } else {
@@ -50,8 +50,8 @@ index 721e3b083846fd363a31311196bc4c681969215c..9f49f0b801e23a82492e6b2865ba6049
+ if (previousX != newX || previousZ != newZ) {
+ boolean isLoaded = ((net.minecraft.server.level.ServerChunkCache) this.level().getChunkSource()).getChunkAtIfLoadedImmediately(newX, newZ) != null;
+ if (!isLoaded) {
+ if (currRegionData.pufferfish$loadedThisTick > moe.monnairealms.camellia.config.modules.optimizations.ProjectileChunkReduceConfig.maxProjectileLoadsPerTick) {
+ if (++this.loadedLifetime > moe.monnairealms.camellia.config.modules.optimizations.ProjectileChunkReduceConfig.maxProjectileLoadsPerProjectile) {
+ if (currRegionData.pufferfish$loadedThisTick > io.nanachiyo0721.shiroha.config.modules.optimizations.ProjectileChunkReduceConfig.maxProjectileLoadsPerTick) {
+ if (++this.loadedLifetime > io.nanachiyo0721.shiroha.config.modules.optimizations.ProjectileChunkReduceConfig.maxProjectileLoadsPerProjectile) {
+ this.discard();
+ }
+ return;
@@ -23,7 +23,7 @@ index cab6061af551352a27e623af2ced3f497c5af2b3..e87af051432e0118fc4c16d7ac321b30
super.inactiveTick();
if (!this.aware) return; // Paper - Do not tick AI for inactive unaware mobs
- if (this.goalSelector.inactiveTick()) {
+ boolean isThrottled = moe.monnairealms.camellia.config.modules.optimizations.EntityGoalSelectorInactiveTickConfig.enabled && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
+ boolean isThrottled = io.nanachiyo0721.shiroha.config.modules.optimizations.EntityGoalSelectorInactiveTickConfig.enabled && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
+ if (this.goalSelector.inactiveTick() && !isThrottled) { // Pufferfish
this.goalSelector.tick();
}
@@ -16,7 +16,7 @@ index 86ee3b3ae028597576b9549bc4954dfcbaa6732c..65121d2b17432f0ec5e8ec106cd20539
Component seedText = ComponentUtils.copyOnClickText(String.valueOf(seed));
c.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", seedText), false);
+ // Leaf start - Matter - SecureSeed Command
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ su.plo.matter.Globals.setupGlobals(c.getSource().getLevel());
+ String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed);
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
@@ -37,7 +37,7 @@ index 639a5400499266f83cf8b7c1251483cd8fb699a4..24e355b71c196cb0ea7958ef7d33fb49
long seed = WorldOptions.parseSeed(levelSeed).orElse(WorldOptions.randomSeed());
- this.worldOptions = new WorldOptions(seed, generateStructures, false);
+ // Leaf start - Matter - Secure Seed
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ String featureSeedStr = this.get("feature-level-seed", "");
+ long[] featureSeed = su.plo.matter.Globals.parseSeed(featureSeedStr)
+ .orElse(su.plo.matter.Globals.createRandomWorldSeed());
@@ -84,7 +84,7 @@ index 984ec15bdebcb541cd6ee9014a654ea58988f6f1..582fcd553e85ff6e2437c117dc0a655c
ChunkPos chunkPos = ChunkPos.containing(pos);
- boolean slimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkPos.x(), chunkPos.z(), worldGenLevel.getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
+ // Leaf start - Matter - Secure Seed
+ boolean isSlimeChunk = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ boolean isSlimeChunk = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? level.getChunk(chunkPos.x(), chunkPos.z()).isSlimeChunk()
+ : WorldgenRandom.seedSlimeChunk(chunkPos.x(), chunkPos.z(), worldGenLevel.getSeed(), level.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
+ boolean slimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
@@ -135,7 +135,7 @@ index b7325170369299a74be35ecc66a6446c301605b8..e3a57d7fc2ad9244594870ffac7c6625
List<FeatureSorter.StepFeatureData> featureList = this.featuresPerStep.get();
- WorldgenRandom random = new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ WorldgenRandom random = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? new su.plo.matter.WorldgenCryptoRandom(origin.getX(), origin.getZ(), su.plo.matter.Globals.Salt.UNDEFINED, 0)
+ : new WorldgenRandom(new XoroshiroRandomSource(RandomSupport.generateUniqueSeed()));
+ // Leaf end - Matter - Secure Seed
@@ -150,7 +150,7 @@ index b7325170369299a74be35ecc66a6446c301605b8..e3a57d7fc2ad9244594870ffac7c6625
- random.setLargeFeatureSeed(state.getLevelSeed(), sourceChunkPos.x(), sourceChunkPos.z());
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random;
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ random = new su.plo.matter.WorldgenCryptoRandom(sourceChunkPos.x(), sourceChunkPos.z(), su.plo.matter.Globals.Salt.GENERATE_FEATURE, 0);
+ } else {
+ random = new WorldgenRandom(new LegacyRandomSource(0L));
@@ -171,11 +171,11 @@ index 8b4ea2b16da45bcefe743990866e43c94e121825..144bf28dac810c7009ec3ce06b4f08e9
- RandomSource random = RandomSource.create();
- // Paper start - Add missing structure set seed configs
+ // Leaf start - Matter - Secure Seed
+ RandomSource random = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ RandomSource random = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? new su.plo.matter.WorldgenCryptoRandom(0, 0, su.plo.matter.Globals.Salt.STRONGHOLDS, 0)
+ :RandomSource.create();
+ // Leaf end - Matter - Secure Seed
+ if (!moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (!io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ //Paper start - Add missing structure set seed configs
if (this.conf.strongholdSeed != null && structureSet.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
random.setSeed(this.conf.strongholdSeed);
@@ -209,7 +209,7 @@ index 4ad94af024d81b7dfe910dcee2a6ec7a9b200d56..075bffa587e7ca394421a3a4d03b7eb1
public class WorldOptions {
+ // Leaf start - Matter - Secure Seed
+ private static final com.google.gson.Gson gson = new com.google.gson.Gson();
+ private static final boolean isSecureSeedEnabled = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled;
+ private static final boolean isSecureSeedEnabled = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled;
public static final MapCodec<WorldOptions> CODEC = RecordCodecBuilder.mapCodec(
- i -> i.group(
+ // Leaf start - Matter - Secure Seed
@@ -336,7 +336,7 @@ index baed0479a4552676844989868ee4c37ffa344def..bcda97e7439945d2a559e45e33f55ccf
int numPoints = config.distributionPoints().sample(random);
- WorldgenRandom random1 = new WorldgenRandom(new LegacyRandomSource(level.getSeed()));
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random1 = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ WorldgenRandom random1 = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? new su.plo.matter.WorldgenCryptoRandom(0, 0, su.plo.matter.Globals.Salt.GEODE_FEATURE, 0)
+ : new WorldgenRandom(new LegacyRandomSource(level.getSeed()));
+ // Leaf end - Matter - Secure Seed
@@ -352,7 +352,7 @@ index f1e13ede1f7345089ece8d8ef391f7fd5e55c445..2bfc339e3301deb0d46a92b1c138ff1a
private static WorldgenRandom makeRandom(final long seed, final ChunkPos chunkPos) {
+ // Leaf start - Matter - Secure Seed
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ return new su.plo.matter.WorldgenCryptoRandom(chunkPos.x(), chunkPos.z(), su.plo.matter.Globals.Salt.GENERATE_FEATURE, seed);
+ }
+ // Leaf end - Matter - Secure Seed
@@ -371,7 +371,7 @@ index 1310b2ca994b8f6d3d92bdc676fe44de3619cc09..ae55fd5d4b08f00557b384671412ee31
- random.setLargeFeatureWithSalt(seed, spacedGridX, spacedGridZ, this.salt());
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random;
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ random = new su.plo.matter.WorldgenCryptoRandom(spacedGridX, spacedGridZ, su.plo.matter.Globals.Salt.POTENTIONAL_FEATURE, this.salt);
+ } else {
+ random = new WorldgenRandom(new LegacyRandomSource(0L));
@@ -393,7 +393,7 @@ index 646df0237a5a2863f75e6c5f9dfe9ddf512c540f..3fddb11c1bd0277d878d90d0dae8e5ed
- random.setLargeFeatureWithSalt(seed, sourceX, sourceZ, saltOverride != null ? saltOverride : HIGHLY_ARBITRARY_RANDOM_SALT); // Paper - Add missing structure set seed configs
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random;
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled) {
+ random = new su.plo.matter.WorldgenCryptoRandom(sourceX, sourceZ, su.plo.matter.Globals.Salt.UNDEFINED, saltOverride != null ? saltOverride : HIGHLY_ARBITRARY_RANDOM_SALT);
+ } else {
+ random = new WorldgenRandom(new LegacyRandomSource(0L));
@@ -414,7 +414,7 @@ index b92da7acae0789d955a9f71072b95ed030b879e2..2c81e8e7dd0380233b0f17e3d83ff704
LevelHeightAccessor heightAccessor = context.heightAccessor();
- WorldgenRandom random = context.random();
+ // Leaf start - Matter - Secure Seed
+ WorldgenRandom random = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ WorldgenRandom random = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? new su.plo.matter.WorldgenCryptoRandom(context.chunkPos().x(), context.chunkPos().z(), su.plo.matter.Globals.Salt.JIGSAW_PLACEMENT, 0)
+ : context.random();
+ // Leaf end - Matter - Secure Seed
@@ -15,17 +15,17 @@ index 7b74440fbbe79c018ad59d24b99da0c6d4a9d007..20536f4ed6d19ec2cc6a54aa9c5c980d
- this.random = settings.getRandomSource().newInstance(seed).forkPositional();
+ // this.random = settings.getRandomSource().newInstance(seed).forkPositional(); // Shiroha - Add secure seed V2 with Blake3
+ // Shiroha start - Add secure seed V2 with Blake3
+ final long[] secureWorldSeed = (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2)
+ final long[] secureWorldSeed = (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2)
+ ? su.plo.matter.HashingV2.expandLevelSeedTo1024Bits(seed)
+ : null;
+
+ long terrainSeed = (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2)
+ long terrainSeed = (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2)
+ ? su.plo.matter.HashingV2.getTerrainSeed(secureWorldSeed, su.plo.matter.HashingV2.TerrainType.BASE_TERRAIN)
+ : seed;
+ long aquiferSeed = (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2)
+ long aquiferSeed = (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2)
+ ? su.plo.matter.HashingV2.getTerrainSeed(secureWorldSeed, su.plo.matter.HashingV2.TerrainType.AQUIFER)
+ : seed;
+ long oreSeed = (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2)
+ long oreSeed = (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2)
+ ? su.plo.matter.HashingV2.getTerrainSeed(secureWorldSeed, su.plo.matter.HashingV2.TerrainType.ORE)
+ : seed;
+ // Shiroha end
@@ -45,7 +45,7 @@ index 7b74440fbbe79c018ad59d24b99da0c6d4a9d007..20536f4ed6d19ec2cc6a54aa9c5c980d
private RandomSource newLegacyInstance(final long seedOffset) {
+ // Shiroha start - Add secure seed V2 with Blake3
+ if (moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2) {
+ if (io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2) {
+ long climateSeed = su.plo.matter.HashingV2.getTerrainSeed(secureWorldSeed, su.plo.matter.HashingV2.TerrainType.CLIMATE);
+ return new su.plo.matter.WorldgenCryptoRandom(0, 0, su.plo.matter.Globals.Salt.UNDEFINED, climateSeed + seed);
+ }
@@ -60,7 +60,7 @@ index 7b74440fbbe79c018ad59d24b99da0c6d4a9d007..20536f4ed6d19ec2cc6a54aa9c5c980d
- return function instanceof DensityFunctions.EndIslandDensityFunction ? new DensityFunctions.EndIslandDensityFunction(seed) : function;
+ return function instanceof DensityFunctions.EndIslandDensityFunction //? new DensityFunctions.EndIslandDensityFunction(seed)// Shiroha - Add secure seed V2 with Blake3
+ // Shiroha start - Add secure seed V2 with Blake3
+ ? new DensityFunctions.EndIslandDensityFunction((moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled && moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.version == 2)
+ ? new DensityFunctions.EndIslandDensityFunction((io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled && io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.version == 2)
+ ? su.plo.matter.HashingV2.getTerrainSeed(secureWorldSeed, su.plo.matter.HashingV2.TerrainType.SURFACE)
+ : seed)
+ // Shiroha end
@@ -31,13 +31,13 @@ index 7de3bbecea2f11e4e1cb65408729f346760dc9b8..b72b81849c7fedad8efc5c7b112e89eb
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
+ // Leaf start - Configurable vanilla username check
+ boolean allPrevChecksPassed;
+ if (moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.enabled
+ if (io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.enabled
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
- Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username");
+ allPrevChecksPassed = true;
+ if (!moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) {
+ if (!io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) {
+ Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username");
+ }
+ } else {
@@ -52,7 +52,7 @@ index 7de3bbecea2f11e4e1cb65408729f346760dc9b8..b72b81849c7fedad8efc5c7b112e89eb
try {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.createOfflineProfile(ServerLoginPacketListenerImpl.this.requestedUsername); // Spigot
+ // Leaf start - Configurable vanilla username check
+ if (moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) {
+ if (io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) {
+ if (server.playerDataStorage.load(new net.minecraft.server.players.NameAndId(gameprofile)).orElse(null) != null) {
+ server.getPlayerList().playedPlayers.add(packet.name());
+ } else if (allPrevChecksPassed) {
@@ -101,7 +101,7 @@ index 134d74d8ed2c61b28cda0bd5107dea88bc114f51..0392962ed409e3f970904de05926c356
player.getAdvancements().clearTriggers();
this.players.remove(player);
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
+ if (moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) this.playedPlayers.remove(player.getGameProfile().name()); // Leaf - Configurable vanilla username check
+ if (io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) this.playedPlayers.remove(player.getGameProfile().name()); // Leaf - Configurable vanilla username check
this.server.getCustomBossEvents().onPlayerDisconnect(player);
UUID uuid = player.getUUID();
ServerPlayer serverPlayer = this.playersByUUID.get(uuid);
@@ -114,7 +114,7 @@ index 7957e0cfc43909c5268698a11c4933d20b4d9155..1cee7f26a5cd55b146b89da5912952d1
public static boolean isValidPlayerName(final String name) {
+ // Leaf start - Configurable vanilla username check
+ return isValidPlayerName(name, moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.shouldSkipNonPlayerNameCheck());
+ return isValidPlayerName(name, io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.shouldSkipNonPlayerNameCheck());
+ }
+ public static boolean isValidPlayerNameVanilla(final String name) {
+ return name.length() <= 16 && name.chars().filter(i -> i <= 32 || i >= 127).findAny().isEmpty();
@@ -130,9 +130,9 @@ index 7957e0cfc43909c5268698a11c4933d20b4d9155..1cee7f26a5cd55b146b89da5912952d1
// Paper start - Username validation
public static boolean isReasonablePlayerName(final String name) {
+ // Leaf start - Configurable vanilla username check
+ if (moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin && net.minecraft.server.MinecraftServer.getServer().getPlayerList().playedPlayers.contains(name)) return true;
+ if (moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.useCustomUsernameRegex()) {
+ return moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.usernameRegex.matcher(name).matches() && name.length() <= 16; // Leaf - Configurable username check
+ if (io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin && net.minecraft.server.MinecraftServer.getServer().getPlayerList().playedPlayers.contains(name)) return true;
+ if (io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.useCustomUsernameRegex()) {
+ return io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.usernameRegex.matcher(name).matches() && name.length() <= 16; // Leaf - Configurable username check
+ }
+ // Leaf end - Configurable vanilla username check
if (name.isEmpty() || name.length() > 16) {
@@ -151,14 +151,14 @@ index f1b62a6e0d8176d8ba1875e78cc730ee55b1b0c1..c0329b8304cce7ecfe53b102027f73bf
+ if (nameOrId.left().isEmpty()) {
+ return nameOrId;
+ }
+ return moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(nameOrId.left().get()) ? Either.left("INVALID_OWNER") : nameOrId;
+ return io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(nameOrId.left().get()) ? Either.left("INVALID_OWNER") : nameOrId;
+ }
+
+ private static Optional<String> sanitizePartialPlayerName(final Optional<String> name) {
+ if (name.isEmpty()) {
+ return name;
+ }
+ return moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(name.get()) ? Optional.of("INVALID_OWNER") : name;
+ return io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(name.get()) ? Optional.of("INVALID_OWNER") : name;
+ }
+
+ private static Either<GameProfile, ResolvableProfile.Partial> sanitizeStaticPlayerName(final Either<GameProfile, ResolvableProfile.Partial> contents) {
@@ -166,7 +166,7 @@ index f1b62a6e0d8176d8ba1875e78cc730ee55b1b0c1..c0329b8304cce7ecfe53b102027f73bf
+ return contents;
+ }
+ GameProfile gameProfile = contents.left().get();
+ return moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(gameProfile.name()) ? Either.left(new GameProfile(gameProfile.id(), "INVALID_OWNER", gameProfile.properties())) : contents;
+ return io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.enforceSkullValidation && !net.minecraft.util.StringUtil.isValidPlayerNameVanilla(gameProfile.name()) ? Either.left(new GameProfile(gameProfile.id(), "INVALID_OWNER", gameProfile.properties())) : contents;
+ }
+ // Leaf end - Configurable vanilla username check - Enforce skull validation
+
@@ -15,7 +15,7 @@ index d0dff5850717bd083b7a29104a61754ce1b2f822..d0809790e3b3526622af4f7a7eca6c52
}
- if (this.allPacketCounts != null ||
- io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.overrides.containsKey(packet.getClass())) {
+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && (this.allPacketCounts != null || // Shiroha - Add config to force disable the packet limiter of Paper
+ if (!io.nanachiyo0721.shiroha.config.modules.misc.PaperPacketLimiterConfig.forceDisable && (this.allPacketCounts != null || // Shiroha - Add config to force disable the packet limiter of Paper
+ io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.overrides.containsKey(packet.getClass()))) { // Shiroha - Add config to force disable the packet limiter of Paper
long time = System.nanoTime();
synchronized (PACKET_LIMIT_LOCK) {
@@ -29,7 +29,7 @@ index 9fe5ee1c5578be6f6c5ad9a58e10669a4b7ac75a..ee4b6d293c32c00e6173cf8efe8aecce
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); // Paper - AsyncTabCompleteEvent; run this async
// CraftBukkit start
- if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.nameAndId()) && !this.server.isSingleplayerOwner(this.player.nameAndId())) { // Paper - configurable tab spam limits
+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.nameAndId()) && !this.server.isSingleplayerOwner(this.player.nameAndId())) { // Paper - configurable tab spam limits // Leaves - can disable
+ if (!io.nanachiyo0721.shiroha.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.nameAndId()) && !this.server.isSingleplayerOwner(this.player.nameAndId())) { // Paper - configurable tab spam limits // Leaves - can disable
this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
return;
}
@@ -37,7 +37,7 @@ index 9fe5ee1c5578be6f6c5ad9a58e10669a4b7ac75a..ee4b6d293c32c00e6173cf8efe8aecce
private long lastLimitedPacket = -1;
private boolean checkLimit(long timestamp) {
+ if (moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return true; // Leaves - disable
+ if (io.nanachiyo0721.shiroha.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return true; // Leaves - disable
if (!io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold.enabled()) {
return true;
}
@@ -45,7 +45,7 @@ index 9fe5ee1c5578be6f6c5ad9a58e10669a4b7ac75a..ee4b6d293c32c00e6173cf8efe8aecce
// Spigot start - spam exclusions
private void detectRateSpam(final TickThrottler throttler, final String message) {
+ if (moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return; // Leaves - disable
+ if (io.nanachiyo0721.shiroha.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return; // Leaves - disable
+ // CraftBukkit start - replaced with thread safe throttle
if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
@@ -55,7 +55,7 @@ index 9fe5ee1c5578be6f6c5ad9a58e10669a4b7ac75a..ee4b6d293c32c00e6173cf8efe8aecce
public void handlePlaceRecipe(final ServerboundPlaceRecipePacket packet) {
// Paper start - auto recipe limit
- if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !org.bukkit.Bukkit.isPrimaryThread()) { // Leaves - can disable
+ if (!io.nanachiyo0721.shiroha.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !org.bukkit.Bukkit.isPrimaryThread()) { // Leaves - can disable
if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
return;
@@ -42,9 +42,9 @@ index 8d2518600ad518999b75124f0a87db9efe541f2e..c2c4a83ac4fb787402400d490ecc94be
+ // Leaves start - Configurable collision behavior
+ private static boolean shouldSkip(AABB aabb, VoxelShape blockCollision, AABB singleAABB) {
+ boolean isBlockShape = blockCollision == Shapes.block();
+ return switch (moe.monnairealms.camellia.config.modules.fixes.CollisionBehaviorConfig.behaviorMode) {
+ case moe.monnairealms.camellia.enums.EnumCollisionBehaviorMode.VANILLA -> !voxelShapeIntersectVanilla(aabb, singleAABB);
+ case moe.monnairealms.camellia.enums.EnumCollisionBehaviorMode.PAPER -> !voxelShapeIntersect(aabb, singleAABB);
+ return switch (io.nanachiyo0721.shiroha.config.modules.fixes.CollisionBehaviorConfig.behaviorMode) {
+ case io.nanachiyo0721.shiroha.enums.EnumCollisionBehaviorMode.VANILLA -> !voxelShapeIntersectVanilla(aabb, singleAABB);
+ case io.nanachiyo0721.shiroha.enums.EnumCollisionBehaviorMode.PAPER -> !voxelShapeIntersect(aabb, singleAABB);
+ default -> isBlockShape && !voxelShapeIntersectVanilla(aabb, singleAABB) || !isBlockShape && !voxelShapeIntersect(aabb, singleAABB);
+ // All other value as BLOCK_SHAPE_VANILLA to process
+ };
@@ -21,7 +21,7 @@ index 824ef3f458505569fe5b8efb2055ecea7ba6cc56..64a2fc0e49a6fc50773f6e0c40c2535a
+ private int cachePortalOriginIteratorY = -1;
+
public BlockPattern.@Nullable BlockPatternMatch findExitPortal() {
+ if (moe.monnairealms.camellia.config.modules.optimizations.OptimizedDragonRespawnConfig.optimizedRespawn) {
+ if (io.nanachiyo0721.shiroha.config.modules.optimizations.OptimizedDragonRespawnConfig.optimizedRespawn) {
+ int i, j;
+ for (i = cachePortalChunkIteratorX; i <= 8; ++i) {
+ for (j = cachePortalChunkIteratorZ; j <= 8; ++j) {
@@ -44,7 +44,7 @@ index b4f9f41a56bbc40e90217c0344c070ebdd08c119..33cab0d9d144a37d144f18c6fff31afc
+ private static final java.util.concurrent.ThreadLocalRandom wakeUpDurationRandom = java.util.concurrent.ThreadLocalRandom.current();
+
+ private static int getWakeUpDurationWithVariance(Entity entity, int wakeUpDuration) {
+ double deviation = moe.monnairealms.camellia.config.modules.optimizations.GaleVariableEntityWakeupConfig.entityWakeUpDurationRatioStandardDeviation;
+ double deviation = io.nanachiyo0721.shiroha.config.modules.optimizations.GaleVariableEntityWakeupConfig.entityWakeUpDurationRatioStandardDeviation;
+ if (deviation <= 0) {
+ return wakeUpDuration;
+ }
@@ -13,7 +13,7 @@ index 13b03dab807c5d83e086993af705e1d9a2676b4d..83894904de29c01a4e105c1fae625f91
PaperServerListPingEventImpl(MinecraftServer server, StatusClient client, int protocolVersion, @Nullable CachedServerIcon icon) {
super(client, server.motd(), server.getPlayerCount(), server.getMaxPlayers(),
- server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon);
+ moe.monnairealms.camellia.config.modules.misc.ServerModNameConfig.fakeVanilla ? server.getServerVersion() : server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon); // Shiroha - Add config for server mod name
+ io.nanachiyo0721.shiroha.config.modules.misc.ServerModNameConfig.fakeVanilla ? server.getServerVersion() : server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon); // Shiroha - Add config for server mod name
this.server = server;
}
@@ -13,7 +13,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
@Deprecated
public static void ensureTickThread(final String reason) {
- if (!isTickThread()) {
+ if (!isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThread() && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
LOGGER.error("Thread failed main thread check: " + reason + ", context=" + getThreadContext(), new Throwable());
throw new IllegalStateException(reason);
}
@@ -21,7 +21,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final BlockPos pos, final String reason) {
- if (!isTickThreadFor(world, pos)) {
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + pos;
LOGGER.error(ex, new Throwable());
@@ -30,7 +30,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final BlockPos pos, final int blockRadius, final String reason) {
- if (!isTickThreadFor(world, pos, blockRadius)) {
+ if (!isTickThreadFor(world, pos, blockRadius) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos, blockRadius) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + pos + ", block_radius=" + blockRadius;
LOGGER.error(ex, new Throwable());
@@ -39,7 +39,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final ChunkPos pos, final String reason) {
- if (!isTickThreadFor(world, pos)) {
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", chunk_pos=" + pos;
LOGGER.error(ex, new Throwable());
@@ -48,7 +48,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final int chunkX, final int chunkZ, final String reason) {
- if (!isTickThreadFor(world, chunkX, chunkZ)) {
+ if (!isTickThreadFor(world, chunkX, chunkZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, chunkX, chunkZ) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", chunk_pos=" + new ChunkPos(chunkX, chunkZ);
LOGGER.error(ex, new Throwable());
@@ -57,7 +57,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Entity entity, final String reason) {
- if (!isTickThreadFor(entity)) {
+ if (!isTickThreadFor(entity) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(entity) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", entity=" + EntityUtil.dumpEntity(entity);
LOGGER.error(ex, new Throwable());
@@ -66,7 +66,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final AABB aabb, final String reason) {
- if (!isTickThreadFor(world, aabb)) {
+ if (!isTickThreadFor(world, aabb) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, aabb) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", aabb=" + aabb;
LOGGER.error(ex, new Throwable());
@@ -75,7 +75,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final double blockX, final double blockZ, final String reason) {
- if (!isTickThreadFor(world, blockX, blockZ)) {
+ if (!isTickThreadFor(world, blockX, blockZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
+ if (!isTickThreadFor(world, blockX, blockZ) && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + new Vec3(blockX, 0.0, blockZ);
LOGGER.error(ex, new Throwable());
@@ -88,7 +88,7 @@ index 7e7a0ed944961af5ab7a49bc659da2862d2e2c82..1dc664a97442744d0a9364805cc6d6c5
public static void catchOp(String reason) {
- if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) { // Paper - chunk system
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Paper - chunk system // Shiroha - Add config to disable async catchers
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() && !io.nanachiyo0721.shiroha.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Paper - chunk system // Shiroha - Add config to disable async catchers
MinecraftServer.LOGGER.error("Thread {} failed main thread check: {}", Thread.currentThread().getName(), reason, new Throwable()); // Paper
throw new IllegalStateException("Asynchronous " + reason + "!");
}
@@ -16,7 +16,7 @@ index 6369b13e1fcdbdb25dd9d6e4d3bffdedbee4f739..ea27ce9d08b3b8bbb0cd4918dbf51fd8
public PaperPluginParent build(JarFile file, PaperPluginMeta configuration, Path source) {
// Folia start - block plugins not marked as supported
- if (!configuration.isFoliaSupported()) {
+ if (!configuration.isFoliaSupported() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
+ if (!configuration.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new RuntimeException("Could not load plugin '" + configuration.getDisplayName() + "' as it is not marked as supporting Folia!");
}
// Folia end - block plugins not marked as supported
@@ -29,7 +29,7 @@ index 6ef0042a355c65262bdb89dcf151bd644653216d..7da13c7a2c5303d8f3bee2db4b5b76a1
public SpigotPluginProvider build(JarFile file, PluginDescriptionFile configuration, Path source) throws InvalidDescriptionException {
// Folia start - block plugins not marked as supported
- if (!configuration.isFoliaSupported()) {
+ if (!configuration.isFoliaSupported() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
+ if (!configuration.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new RuntimeException("Could not load plugin '" + configuration.getDisplayName() + "' as it is not marked as supporting Folia!");
}
// Folia end - block plugins not marked as supported
@@ -42,7 +42,7 @@ index 55a095e00bfe15321d8a1d69beb232e9956b0df7..844d6211ae34b3136806b8513e30d48c
// Folia start - block plugins not marked as supported
- if (!descriptionFile.isFoliaSupported()) {
+ if (!descriptionFile.isFoliaSupported() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
+ if (!descriptionFile.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new InvalidPluginException("Plugin " + descriptionFile.getFullName() + " is not marked as supporting regionised multithreading");
}
// Folia end - block plugins not marked as supported
@@ -13,7 +13,7 @@ index b9f788693b0c4be48e8a923a3dec50555d135e7e..1ce8304688ff3751d2de3ada14539842
@Override
public Thread newThread(final Runnable run) {
- final Thread thread = new Thread(run, PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement());
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemWorker(run), PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
+ final Thread thread = new Thread(io.nanachiyo0721.shiroha.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemWorker(run), PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@@ -22,7 +22,7 @@ index b9f788693b0c4be48e8a923a3dec50555d135e7e..1ce8304688ff3751d2de3ada14539842
@Override
public Thread newThread(final Runnable run) {
- final Thread thread = new Thread(run, PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement());
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemIo(run), PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
+ final Thread thread = new Thread(io.nanachiyo0721.shiroha.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemIo(run), PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@@ -16,7 +16,7 @@ index 10b351d8bd6b0e117ecbe961ae2f101686a38fe4..7a93251c575870235a0aabf2fad84635
// 987234911L is taken from Slime when seeing if a slime can spawn in a chunk
- return this.level.paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), level.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
+ // Leaf start - Matter - Secure Seed
+ boolean isSlimeChunk = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ boolean isSlimeChunk = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? level.getChunk(this.getX(), this.getZ()).isSlimeChunk()
+ : WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), level.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
+ return this.level.paperConfig().entities.spawning.allChunksAreSlimeChunks || isSlimeChunk;
@@ -34,7 +34,7 @@ index 3c46e2cc23ac57df52996e3d2c5ae416a9633a67..e0b1a7c8bc4e69afe5f78638e8fddbe8
if (worldGenSettings == null) {
- WorldOptions worldOptions = new WorldOptions(creator.seed(), creator.generateStructures(), creator.bonusChest());
+ // Leaf start - Matter - Secure Seed
+ WorldOptions worldOptions = moe.monnairealms.camellia.config.modules.function.SecureSeedConfig.enabled
+ WorldOptions worldOptions = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled
+ ? new WorldOptions(creator.seed(), su.plo.matter.Globals.createRandomWorldSeed(), creator.generateStructures(), false)
+ : new WorldOptions(creator.seed(), creator.generateStructures(), creator.bonusChest());
+ // Leaf end - Matter - Secure Seed
@@ -32,7 +32,7 @@ index ceaf63c76272b2a11b92f877b9828e93ec79d47f..be8319e3548eeac6cc7a333e95ec9a0b
+ // Leaf start - Configurable vanilla username check
+ public CraftPlayerProfile cloneCustom() {
+ CraftPlayerProfile clone = new CraftPlayerProfile(this.getId(), this.getName(), moe.monnairealms.camellia.config.modules.misc.UsernameCheckConfig.useCustomUsernameRegex());
+ CraftPlayerProfile clone = new CraftPlayerProfile(this.getId(), this.getName(), io.nanachiyo0721.shiroha.config.modules.misc.UsernameCheckConfig.useCustomUsernameRegex());
+ clone.setProperties(getProperties());
+ return clone;
+ }
@@ -4,7 +4,7 @@ import ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO;
import com.github.luben.zstd.ZstdInputStream;
import com.github.luben.zstd.ZstdOutputStream;
import com.mojang.logging.LogUtils;
import moe.monnairealms.camellia.data.RegionFile;
import io.nanachiyo0721.shiroha.data.RegionFile;
import net.jpountz.lz4.LZ4Compressor;
import net.jpountz.lz4.LZ4Factory;
import net.jpountz.lz4.LZ4FastDecompressor;
@@ -1,6 +1,6 @@
package moe.monnairealms.camellia.commands;
package io.nanachiyo0721.shiroha.commands;
import moe.monnairealms.camellia.commands.bar.BarCommand;
import io.nanachiyo0721.shiroha.commands.bar.BarCommand;
public class CommandRegister {
/**
@@ -1,7 +1,7 @@
package moe.monnairealms.camellia.commands.bar;
package io.nanachiyo0721.shiroha.commands.bar;
import moe.monnairealms.camellia.commands.bar.sub.ToggleCommand;
import moe.monnairealms.camellia.enums.EnumBarType;
import io.nanachiyo0721.shiroha.commands.bar.sub.ToggleCommand;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.command.RootNode;
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.commands.bar;
package io.nanachiyo0721.shiroha.commands.bar;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import moe.monnairealms.camellia.commands.bar.sub.ConfigEditCommand;
import moe.monnairealms.camellia.commands.bar.sub.ToggleCommand;
import moe.monnairealms.camellia.enums.EnumBarType;
import io.nanachiyo0721.shiroha.commands.bar.sub.ConfigEditCommand;
import io.nanachiyo0721.shiroha.commands.bar.sub.ToggleCommand;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.command.CommandNode;
@@ -1,13 +1,13 @@
package moe.monnairealms.camellia.commands.bar.sub;
package io.nanachiyo0721.shiroha.commands.bar.sub;
import com.mojang.brigadier.arguments.BoolArgumentType;
import moe.monnairealms.camellia.api.config.CamelliaConfigsInstance;
import moe.monnairealms.camellia.config.ConfigManager;
import moe.monnairealms.camellia.config.modules.function.MembarConfig;
import moe.monnairealms.camellia.config.modules.function.RegionBarConfig;
import moe.monnairealms.camellia.config.modules.function.TpsBarConfig;
import moe.monnairealms.camellia.enums.EnumBarType;
import moe.monnairealms.camellia.functions.bars.TickableStatusBarList;
import io.nanachiyo0721.shiroha.api.config.CamelliaConfigsInstance;
import io.nanachiyo0721.shiroha.config.ConfigManager;
import io.nanachiyo0721.shiroha.config.modules.function.MembarConfig;
import io.nanachiyo0721.shiroha.config.modules.function.RegionBarConfig;
import io.nanachiyo0721.shiroha.config.modules.function.TpsBarConfig;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.Contract;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.commands.bar.sub;
package io.nanachiyo0721.shiroha.commands.bar.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.ArgumentBuilder;
@@ -9,9 +9,9 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.command.brigadier.Commands;
import io.papermc.paper.command.brigadier.PaperCommands;
import moe.monnairealms.camellia.commands.bar.BarCommand;
import moe.monnairealms.camellia.enums.EnumBarType;
import moe.monnairealms.camellia.functions.bars.TickableStatusBarList;
import io.nanachiyo0721.shiroha.commands.bar.BarCommand;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Bukkit;
@@ -1,7 +1,7 @@
package moe.monnairealms.camellia.commands.config;
package io.nanachiyo0721.shiroha.commands.config;
import moe.monnairealms.camellia.commands.config.sub.*;
import moe.monnairealms.camellia.config.ConfigsInstance;
import io.nanachiyo0721.shiroha.commands.config.sub.*;
import io.nanachiyo0721.shiroha.config.ConfigsInstance;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.command.RootNode;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.commands.config;
package io.nanachiyo0721.shiroha.commands.config;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import org.bukkit.command.CommandSender;
@@ -1,11 +1,11 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
@@ -1,12 +1,12 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import moe.monnairealms.camellia.utils.dialog.ConfigCommandDialog;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.utils.dialog.ConfigCommandDialog;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import net.minecraft.world.entity.player.Player;
@@ -1,8 +1,8 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
@@ -1,11 +1,11 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.commands.config.sub;
package io.nanachiyo0721.shiroha.commands.config.sub;
import com.mojang.brigadier.arguments.StringArgumentType;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.commands.config.ConfigSubcommand;
import moe.monnairealms.camellia.utils.dialog.ConfigCommandDialog;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.commands.config.ConfigSubcommand;
import io.nanachiyo0721.shiroha.utils.dialog.ConfigCommandDialog;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.command.ArgumentNode;
import org.leavesmc.leaves.command.CommandContext;
@@ -1,8 +1,8 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import moe.monnairealms.camellia.commands.CommandRegister;
import moe.monnairealms.camellia.config.flags.TransformedConfig;
import io.nanachiyo0721.shiroha.commands.CommandRegister;
import io.nanachiyo0721.shiroha.config.flags.TransformedConfig;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
@@ -24,7 +24,7 @@ public class ConfigManager {
// 3 -> target full path
public static void initConfigs() {
registerConfig("camellia", builder.of("camellia", "moe.monnairealms.camellia.config.modules"));
registerConfig("shiroha", builder.of("shiroha", "io.nanachiyo0721.shiroha.config.modules"));
preLoad();
}
@@ -1,15 +1,15 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
import com.electronwill.nightconfig.core.UnmodifiableConfig;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.mojang.logging.LogUtils;
import io.nanachiyo0721.shiroha.config.flags.*;
import io.papermc.paper.threadedregions.RegionizedServer;
import moe.monnairealms.camellia.api.config.CamelliaConfigsInstance;
import moe.monnairealms.camellia.api.config.ConfigDataPair;
import moe.monnairealms.camellia.commands.config.ConfigCommand;
import moe.monnairealms.camellia.config.flags.*;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.utils.ClassLoadUtil;
import io.nanachiyo0721.shiroha.api.config.CamelliaConfigsInstance;
import io.nanachiyo0721.shiroha.api.config.ConfigDataPair;
import io.nanachiyo0721.shiroha.commands.config.ConfigCommand;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.utils.ClassLoadUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
@@ -1,6 +1,6 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
import moe.monnairealms.camellia.api.config.CamelliaConfigBuilder;
import io.nanachiyo0721.shiroha.api.config.CamelliaConfigBuilder;
import net.minecraft.server.MinecraftServer;
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
public class DefaultTransformLogic {
public Object transform(Object obj) {
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config;
package io.nanachiyo0721.shiroha.config;
import java.util.IllegalFormatConversionException;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1,6 +1,6 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1,4 +1,4 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1,6 +1,6 @@
package moe.monnairealms.camellia.config.flags;
package io.nanachiyo0721.shiroha.config.flags;
import moe.monnairealms.camellia.config.DefaultTransformLogic;
import io.nanachiyo0721.shiroha.config.DefaultTransformLogic;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.experiment;
package io.nanachiyo0721.shiroha.config.modules.experiment;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "command")
public class CommandConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.experiment;
package io.nanachiyo0721.shiroha.config.modules.experiment;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "disable_async_catchers")
public class DisableAsyncCatcherConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.experiment;
package io.nanachiyo0721.shiroha.config.modules.experiment;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "disable_entity_exception_catchers")
public class DisableEntityCatchConfig implements IConfigModule {
@@ -1,11 +1,11 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.CommandSuggestions;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumCollisionBehaviorMode;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.CommandSuggestions;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumCollisionBehaviorMode;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "collision_behavior")
public class CollisionBehaviorConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "fix_high_velocity_issue")
public class FoliaEntityMovingFixConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "force_cleanup_drop_non_owned_entity_memory_module", comments = "This config is a temporary fix for those incorrect owned data in the memory of each mob, for more you can see https://github.com/PaperMC/Folia/issues/203")
public class ForceCleanupEntityBrainMemoryConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "item_multitask")
public class ItemMultitaskConfig implements IConfigModule {
@@ -1,8 +1,8 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "long_command_support")
public class LongCommandSupportConfig {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(name = "poi_range_fixes", category = EnumConfigCategory.FIXES)
public class POIRangeFixes implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "pathfinding_fixes")
public class PathfindingFixesConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.fixes;
package io.nanachiyo0721.shiroha.config.modules.fixes;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "allow_unsafe_teleportation")
public class UnsafeTeleportationConfig implements IConfigModule {
@@ -1,14 +1,14 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.enums.EnumBarType;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.enums.EnumStatusBarDisplay;
import moe.monnairealms.camellia.functions.bars.TickableStatusBarList;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumStatusBarDisplay;
import io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList;
import net.kyori.adventure.bossbar.BossBar;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.Nullable;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import net.objecthunter.exp4j.Expression;
import net.objecthunter.exp4j.ExpressionBuilder;
import org.jetbrains.annotations.NotNull;
@@ -1,14 +1,14 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.enums.EnumBarType;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.enums.EnumStatusBarDisplay;
import moe.monnairealms.camellia.functions.bars.TickableStatusBarList;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumStatusBarDisplay;
import io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList;
import net.kyori.adventure.bossbar.BossBar;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.Nullable;
@@ -1,16 +1,16 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import abomination.LinearRegionFile;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.IllegalFormatConversionExceptionWithOrigin;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.enums.EnumRegionFormat;
import moe.monnairealms.camellia.utils.BufferedLinearRegionFileFlusher;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.IllegalFormatConversionExceptionWithOrigin;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumRegionFormat;
import io.nanachiyo0721.shiroha.utils.BufferedLinearRegionFileFlusher;
import net.minecraft.server.MinecraftServer;
import org.jetbrains.annotations.Nullable;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import java.security.SecureRandom;
import java.util.Base64;
@@ -1,14 +1,14 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.enums.EnumBarType;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.enums.EnumStatusBarDisplay;
import moe.monnairealms.camellia.functions.bars.TickableStatusBarList;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.enums.EnumBarType;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumStatusBarDisplay;
import io.nanachiyo0721.shiroha.functions.bars.TickableStatusBarList;
import net.kyori.adventure.bossbar.BossBar;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.Nullable;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.function;
package io.nanachiyo0721.shiroha.config.modules.function;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.enums.EnumTripwireBehavior;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.enums.EnumTripwireBehavior;
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "tripwire_dupe")
public class TripwireBehaviorConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "disable_warning")
public class DisableWarningConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "folia_watchdog")
public class FoliaWatchogConfig implements IConfigModule {
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "force_disable_packet_limiter_of_paper", comments =
"Force and fully disable all packet limiters of Paper, which is used to prevent from kicking by using some quick crafting mods but \n" +
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "save_portal_tickets")
public class SavePortalTicketsConfig implements IConfigModule {
@@ -1,14 +1,14 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "server_mod_name")
public class ServerModNameConfig implements IConfigModule {
@ConfigInfo(name = "name", comments = "Decides the server mod name shown in your F3 debug screen.")
public static String serverModName = "Camellia";
public static String serverModName = "Shiroha";
@ConfigInfo(name = "vanilla_spoof", comments = "Ignore any plugin's modification and server mod name set in this config block, only force sending brand name of vanilla")
public static boolean fakeVanilla = false;
@@ -1,12 +1,12 @@
package moe.monnairealms.camellia.config.modules.misc;
package io.nanachiyo0721.shiroha.config.modules.misc;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.mojang.logging.LogUtils;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "use_async_protocol_switching")
public class AsyncProtocolChangeConfig implements IConfigModule {
@@ -1,14 +1,14 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.mojang.logging.LogUtils;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.DoNotLoad;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import moe.monnairealms.camellia.utils.AffinityRunnableWrapper;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.utils.AffinityRunnableWrapper;
import net.openhft.affinity.Affinity;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NonNull;
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "throttle_goal_selector_tick_in_inactive_tick", comments =
"Throttles the AI goal selector in entity inactive ticks. \n" +
@@ -1,9 +1,9 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "variable_entity_waking_up")
public class GaleVariableEntityWakeupConfig implements IConfigModule {
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import dev.kaiijumc.kaiiju.KaiijuEntityLimits;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
@@ -1,10 +1,10 @@
package moe.monnairealms.camellia.config.modules.optimizations;
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import moe.monnairealms.camellia.config.IConfigModule;
import moe.monnairealms.camellia.config.flags.ConfigClassInfo;
import moe.monnairealms.camellia.config.flags.ConfigInfo;
import moe.monnairealms.camellia.config.flags.HotReloadUnsupported;
import moe.monnairealms.camellia.enums.EnumConfigCategory;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.HotReloadUnsupported;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "lithium_sleeping_block_entity")
public class LeavesSleepingBlockEntityConfig implements IConfigModule {

Some files were not shown because too many files have changed in this diff Show More