mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-24 17:39:26 +00:00
changed config keys
This commit is contained in:
@@ -24,7 +24,7 @@ public class WorldSetting implements Cloneable {
|
||||
private final int tickCropInterval;
|
||||
private final int tickPotInterval;
|
||||
private final int tickSprinklerInterval;
|
||||
private final boolean offlineGrow;
|
||||
private final boolean offlineTick;
|
||||
private final boolean enableSeason;
|
||||
private final boolean autoSeasonChange;
|
||||
private final int seasonDuration;
|
||||
@@ -47,7 +47,7 @@ public class WorldSetting implements Cloneable {
|
||||
int tickPotInterval,
|
||||
boolean tickSprinklerRandomly,
|
||||
int tickSprinklerInterval,
|
||||
boolean offlineGrow,
|
||||
boolean offlineTick,
|
||||
int maxOfflineTime,
|
||||
boolean enableSeason,
|
||||
boolean autoSeasonChange,
|
||||
@@ -62,7 +62,7 @@ public class WorldSetting implements Cloneable {
|
||||
this.tickCropInterval = tickCropInterval;
|
||||
this.tickPotInterval = tickPotInterval;
|
||||
this.tickSprinklerInterval = tickSprinklerInterval;
|
||||
this.offlineGrow = offlineGrow;
|
||||
this.offlineTick = offlineTick;
|
||||
this.maxOfflineTime = maxOfflineTime;
|
||||
this.enableSeason = enableSeason;
|
||||
this.autoSeasonChange = autoSeasonChange;
|
||||
@@ -137,8 +137,8 @@ public class WorldSetting implements Cloneable {
|
||||
return tickSprinklerInterval;
|
||||
}
|
||||
|
||||
public boolean isOfflineGrow() {
|
||||
return offlineGrow;
|
||||
public boolean isOfflineTick() {
|
||||
return offlineTick;
|
||||
}
|
||||
|
||||
public boolean isEnableSeason() {
|
||||
|
||||
@@ -94,7 +94,6 @@ public class CChunk implements CustomCropsChunk {
|
||||
this.lastLoadedTime = current;
|
||||
var setting = cWorld.getWorldSetting();
|
||||
int minTickUnit = setting.getMinTickUnit();
|
||||
|
||||
for (int i = 0; i < offlineTimeInSeconds; i++) {
|
||||
this.loadedSeconds++;
|
||||
if (this.loadedSeconds >= minTickUnit) {
|
||||
|
||||
@@ -481,7 +481,7 @@ public class WorldManagerImpl implements WorldManager, Listener {
|
||||
this.worldAdaptor.loadChunkData(customCropsWorld, chunkPos);
|
||||
|
||||
// offline grow part
|
||||
if (!customCropsWorld.getWorldSetting().isOfflineGrow()) return;
|
||||
if (!customCropsWorld.getWorldSetting().isOfflineTick()) return;
|
||||
|
||||
// If chunk data not exists, return
|
||||
Optional<CustomCropsChunk> optionalChunk = customCropsWorld.getLoadedChunkAt(chunkPos);
|
||||
|
||||
@@ -70,8 +70,8 @@ public class ConfigUtils {
|
||||
section.getInt("pot.tick-interval", 2),
|
||||
getRandomTickModeByString(section.getString("sprinkler.mode")),
|
||||
section.getInt("sprinkler.tick-interval", 2),
|
||||
section.getBoolean("offline-growth.enable", false),
|
||||
section.getInt("offline-growth.max-offline-seconds", 1200),
|
||||
section.getBoolean("offline-tick.enable", false),
|
||||
section.getInt("offline-tick.max-offline-seconds", 1200),
|
||||
section.getBoolean("season.enable", false),
|
||||
section.getBoolean("season.auto-alternation", false),
|
||||
section.getInt("season.duration", 28),
|
||||
|
||||
@@ -46,10 +46,10 @@ worlds:
|
||||
# For crops, under the same conditions, the growth rate of crops is basically the same
|
||||
# For sprinklers and pots, they would work periodically.
|
||||
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 may lead to some issues caused by timeliness conditions for instance seasons
|
||||
offline-growth:
|
||||
offline-tick:
|
||||
enable: false
|
||||
# Maximum offline time recorded in seconds
|
||||
# Please do not set this option to a value that is too large,
|
||||
|
||||
Reference in New Issue
Block a user