9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2026-01-03 22:26:22 +00:00
This commit is contained in:
Xiao-MoMi
2022-08-18 00:26:33 +08:00
parent c0dd8830a4
commit 47dc7a0f7d
43 changed files with 527 additions and 694 deletions

View File

@@ -17,6 +17,7 @@
package net.momirealms.customcrops.datamanager;
import net.momirealms.customcrops.hook.RealisticSeason;
import net.momirealms.customcrops.utils.AdventureManager;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.CustomCrops;
@@ -80,13 +81,17 @@ public class SeasonManager{
* @param world 世界
*/
public void getSeason(World world) {
int season = (int) ((world.getFullTime() / 24000L) % (ConfigReader.Season.duration * 4)) / ConfigReader.Season.duration;
switch (season) {
case 0 -> SEASON.put(world.getName(), "spring");
case 1 -> SEASON.put(world.getName(), "summer");
case 2 -> SEASON.put(world.getName(), "autumn");
case 3 -> SEASON.put(world.getName(), "winter");
default -> AdventureManager.consoleMessage("<red>[CustomCrops] 自动季节计算错误!</red>");
if (ConfigReader.Config.realisticSeason){
SEASON.put(world.getName(), RealisticSeason.getSeason(world));
}else {
int season = (int) ((world.getFullTime() / 24000L) % (ConfigReader.Season.duration * 4)) / ConfigReader.Season.duration;
switch (season) {
case 0 -> SEASON.put(world.getName(), "spring");
case 1 -> SEASON.put(world.getName(), "summer");
case 2 -> SEASON.put(world.getName(), "autumn");
case 3 -> SEASON.put(world.getName(), "winter");
default -> AdventureManager.consoleMessage("<red>[CustomCrops] 自动季节计算错误!</red>");
}
}
}