9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-31 04:46:36 +00:00

changed config keys

This commit is contained in:
XiaoMoMi
2024-04-03 19:08:33 +08:00
parent 024cb479d0
commit 8d8e311bfd
5 changed files with 10 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ public class WorldSetting implements Cloneable {
private final int tickCropInterval; private final int tickCropInterval;
private final int tickPotInterval; private final int tickPotInterval;
private final int tickSprinklerInterval; private final int tickSprinklerInterval;
private final boolean offlineGrow; private final boolean offlineTick;
private final boolean enableSeason; private final boolean enableSeason;
private final boolean autoSeasonChange; private final boolean autoSeasonChange;
private final int seasonDuration; private final int seasonDuration;
@@ -47,7 +47,7 @@ public class WorldSetting implements Cloneable {
int tickPotInterval, int tickPotInterval,
boolean tickSprinklerRandomly, boolean tickSprinklerRandomly,
int tickSprinklerInterval, int tickSprinklerInterval,
boolean offlineGrow, boolean offlineTick,
int maxOfflineTime, int maxOfflineTime,
boolean enableSeason, boolean enableSeason,
boolean autoSeasonChange, boolean autoSeasonChange,
@@ -62,7 +62,7 @@ public class WorldSetting implements Cloneable {
this.tickCropInterval = tickCropInterval; this.tickCropInterval = tickCropInterval;
this.tickPotInterval = tickPotInterval; this.tickPotInterval = tickPotInterval;
this.tickSprinklerInterval = tickSprinklerInterval; this.tickSprinklerInterval = tickSprinklerInterval;
this.offlineGrow = offlineGrow; this.offlineTick = offlineTick;
this.maxOfflineTime = maxOfflineTime; this.maxOfflineTime = maxOfflineTime;
this.enableSeason = enableSeason; this.enableSeason = enableSeason;
this.autoSeasonChange = autoSeasonChange; this.autoSeasonChange = autoSeasonChange;
@@ -137,8 +137,8 @@ public class WorldSetting implements Cloneable {
return tickSprinklerInterval; return tickSprinklerInterval;
} }
public boolean isOfflineGrow() { public boolean isOfflineTick() {
return offlineGrow; return offlineTick;
} }
public boolean isEnableSeason() { public boolean isEnableSeason() {

View File

@@ -94,7 +94,6 @@ public class CChunk implements CustomCropsChunk {
this.lastLoadedTime = current; this.lastLoadedTime = current;
var setting = cWorld.getWorldSetting(); var setting = cWorld.getWorldSetting();
int minTickUnit = setting.getMinTickUnit(); int minTickUnit = setting.getMinTickUnit();
for (int i = 0; i < offlineTimeInSeconds; i++) { for (int i = 0; i < offlineTimeInSeconds; i++) {
this.loadedSeconds++; this.loadedSeconds++;
if (this.loadedSeconds >= minTickUnit) { if (this.loadedSeconds >= minTickUnit) {

View File

@@ -481,7 +481,7 @@ public class WorldManagerImpl implements WorldManager, Listener {
this.worldAdaptor.loadChunkData(customCropsWorld, chunkPos); this.worldAdaptor.loadChunkData(customCropsWorld, chunkPos);
// offline grow part // offline grow part
if (!customCropsWorld.getWorldSetting().isOfflineGrow()) return; if (!customCropsWorld.getWorldSetting().isOfflineTick()) return;
// If chunk data not exists, return // If chunk data not exists, return
Optional<CustomCropsChunk> optionalChunk = customCropsWorld.getLoadedChunkAt(chunkPos); Optional<CustomCropsChunk> optionalChunk = customCropsWorld.getLoadedChunkAt(chunkPos);

View File

@@ -70,8 +70,8 @@ public class ConfigUtils {
section.getInt("pot.tick-interval", 2), section.getInt("pot.tick-interval", 2),
getRandomTickModeByString(section.getString("sprinkler.mode")), getRandomTickModeByString(section.getString("sprinkler.mode")),
section.getInt("sprinkler.tick-interval", 2), section.getInt("sprinkler.tick-interval", 2),
section.getBoolean("offline-growth.enable", false), section.getBoolean("offline-tick.enable", false),
section.getInt("offline-growth.max-offline-seconds", 1200), section.getInt("offline-tick.max-offline-seconds", 1200),
section.getBoolean("season.enable", false), section.getBoolean("season.enable", false),
section.getBoolean("season.auto-alternation", false), section.getBoolean("season.auto-alternation", false),
section.getInt("season.duration", 28), section.getInt("season.duration", 28),

View File

@@ -46,10 +46,10 @@ worlds:
# For crops, under the same conditions, the growth rate of crops is basically the same # For crops, under the same conditions, the growth rate of crops is basically the same
# For sprinklers and pots, they would work periodically. # For sprinklers and pots, they would work periodically.
min-tick-unit: 300 min-tick-unit: 300
# Offline growth settings # Offline tick settings
# This option allows crops to grow even if the world is unloaded or the server is closed # This option allows crops to grow even if the world is unloaded or the server is closed
# This may lead to some issues caused by timeliness conditions for instance seasons # This may lead to some issues caused by timeliness conditions for instance seasons
offline-growth: offline-tick:
enable: false enable: false
# Maximum offline time recorded in seconds # Maximum offline time recorded in seconds
# Please do not set this option to a value that is too large, # Please do not set this option to a value that is too large,