diff --git a/api/src/main/java/net/momirealms/customcrops/api/util/TagUtils.java b/api/src/main/java/net/momirealms/customcrops/api/util/TagUtils.java index 04c0aed..6df2894 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/util/TagUtils.java +++ b/api/src/main/java/net/momirealms/customcrops/api/util/TagUtils.java @@ -25,9 +25,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; public class TagUtils { diff --git a/compatibility-asp-r1/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/asp_r1/SlimeWorldAdaptorR1.java b/compatibility-asp-r1/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/asp_r1/SlimeWorldAdaptorR1.java index d2388c4..7ec63aa 100644 --- a/compatibility-asp-r1/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/asp_r1/SlimeWorldAdaptorR1.java +++ b/compatibility-asp-r1/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/asp_r1/SlimeWorldAdaptorR1.java @@ -187,8 +187,9 @@ public class SlimeWorldAdaptorR1 extends AbstractWorldAdaptor { @SuppressWarnings("all") private CustomCropsChunk tagToChunk(CustomCropsWorld world, CompoundTag tag) { CompoundMap map = tag.getValue(); - int version = map.get("version").getAsIntTag().orElse(new IntTag("version", 1)).getValue(); - Function keyFunction = version < 2 ? + IntTag version = (IntTag) map.getOrDefault("version", new IntTag("version", 1)); + int versionNumber = version.getValue(); + Function keyFunction = versionNumber < 2 ? (s) -> { return Key.key("customcrops", StringUtils.toLowerCase(s)); } : s -> { diff --git a/plugin/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/BukkitWorldAdaptor.java b/plugin/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/BukkitWorldAdaptor.java index 9e80463..82501ac 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/BukkitWorldAdaptor.java +++ b/plugin/src/main/java/net/momirealms/customcrops/bukkit/integration/adaptor/BukkitWorldAdaptor.java @@ -410,7 +410,7 @@ public class BukkitWorldAdaptor extends AbstractWorldAdaptor { DataInputStream sectionData = new DataInputStream(new ByteArrayInputStream(sectionBytes)); int blockAmount = sectionData.readInt(); // read blocks - for (int j = 0; j < blockAmount; j++){ + for (int j = 0; j < blockAmount; j++) { byte[] blockData = new byte[sectionData.readInt()]; sectionData.read(blockData); CompoundTag tag = readCompound(blockData); diff --git a/plugin/src/main/java/net/momirealms/customcrops/bukkit/world/BukkitWorldManager.java b/plugin/src/main/java/net/momirealms/customcrops/bukkit/world/BukkitWorldManager.java index 8dc63f0..6c830b5 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/bukkit/world/BukkitWorldManager.java +++ b/plugin/src/main/java/net/momirealms/customcrops/bukkit/world/BukkitWorldManager.java @@ -57,10 +57,12 @@ public class BukkitWorldManager implements WorldManager, Listener { try { Class.forName("com.infernalsuite.aswm.api.SlimePlugin"); adaptors.add(new SlimeWorldAdaptorR1(1)); + plugin.getPluginLogger().info("SlimeWorldManager support enabled"); } catch (ClassNotFoundException ignored) { } if (Bukkit.getPluginManager().isPluginEnabled("SlimeWorldPlugin")) { adaptors.add(new SlimeWorldAdaptorR1(2)); + plugin.getPluginLogger().info("AdvancedSlimePaper support enabled"); } this.adaptors.add(new BukkitWorldAdaptor()); this.seasonProvider = new SeasonProvider() { diff --git a/plugin/src/main/resources/config.yml b/plugin/src/main/resources/config.yml index 86659b7..6ab7125 100644 --- a/plugin/src/main/resources/config.yml +++ b/plugin/src/main/resources/config.yml @@ -35,12 +35,12 @@ worlds: # This is different from the vanilla RandomTickSpeed. # "Random tick" here means randomly selecting n blocks within a 16x16x16 section every second for ticking, unlike Minecraft's per-tick approach. # Therefore, CustomCrops' random ticks have minimal impact on the server and run on multiple threads. - random-tick-speed: 20 + random-tick-speed: 30 # The minimum tick interval in seconds when using scheduled tick mode - # A value of 180s means a crop is guaranteed to tick at least once every 180 seconds + # A value of 200s means a crop is guaranteed to tick at least once every 180 seconds # For crops, growth rates are nearly uniform under the same conditions # Sprinklers and pots operate periodically within this interval. - min-tick-unit: 180 + min-tick-unit: 200 # Settings for ticking while the world is offline # Allows crops to grow even if the world is unloaded or the server is down # This might cause issues with time-dependent conditions like seasons @@ -62,6 +62,8 @@ worlds: # [SCHEDULED_TICK] # Scheduled tick mode provides more predictable growth management, # ensuring crops grow at nearly the same rate + # [ALL] + # Run RANDOM_TICK and SCHEDULED_TICK at the same time mode: RANDOM_TICK # Tick interval determines how many times a block is ticked before its logic is executed tick-interval: 1 @@ -69,13 +71,13 @@ worlds: max-per-chunk: -1 # Pot settings pot: - # RANDOM_TICK or SCHEDULED_TICK + # RANDOM_TICK / SCHEDULED_TICK / ALL mode: SCHEDULED_TICK tick-interval: 3 max-per-chunk: -1 # Sprinkler settings sprinkler: - # RANDOM_TICK or SCHEDULED_TICK + # RANDOM_TICK / SCHEDULED_TICK / ALL mode: SCHEDULED_TICK tick-interval: 2 max-per-chunk: -1 diff --git a/plugin/src/main/resources/plugin.yml b/plugin/src/main/resources/plugin.yml index 80d0445..4432501 100644 --- a/plugin/src/main/resources/plugin.yml +++ b/plugin/src/main/resources/plugin.yml @@ -16,5 +16,6 @@ softdepend: - RealisticSeasons - AdvancedSeasons - SlimeWorldManager + - SlimeWorldPlugin - MythicMobs - WorldEdit \ No newline at end of file