mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 08:29:35 +00:00
Advancedseasons
This commit is contained in:
@@ -8,7 +8,7 @@ plugins {
|
|||||||
allprojects {
|
allprojects {
|
||||||
|
|
||||||
project.group = "net.momirealms"
|
project.group = "net.momirealms"
|
||||||
project.version = "3.3.1.13"
|
project.version = "3.3.1.14"
|
||||||
|
|
||||||
apply<JavaPlugin>()
|
apply<JavaPlugin>()
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|||||||
BIN
plugin/libs/AdvancedSeasons-API.jar
Normal file
BIN
plugin/libs/AdvancedSeasons-API.jar
Normal file
Binary file not shown.
@@ -30,6 +30,7 @@ import net.momirealms.customcrops.integration.papi.PlaceholderManager;
|
|||||||
import net.momirealms.customcrops.integration.quest.BattlePassCCQuest;
|
import net.momirealms.customcrops.integration.quest.BattlePassCCQuest;
|
||||||
import net.momirealms.customcrops.integration.quest.BetonQuestCCQuest;
|
import net.momirealms.customcrops.integration.quest.BetonQuestCCQuest;
|
||||||
import net.momirealms.customcrops.integration.quest.ClueScrollCCQuest;
|
import net.momirealms.customcrops.integration.quest.ClueScrollCCQuest;
|
||||||
|
import net.momirealms.customcrops.integration.season.AdvancedSeasonsImpl;
|
||||||
import net.momirealms.customcrops.integration.season.CustomCropsSeasonImpl;
|
import net.momirealms.customcrops.integration.season.CustomCropsSeasonImpl;
|
||||||
import net.momirealms.customcrops.integration.season.RealisticSeasonsImpl;
|
import net.momirealms.customcrops.integration.season.RealisticSeasonsImpl;
|
||||||
import net.momirealms.customcrops.integration.skill.AureliumsImpl;
|
import net.momirealms.customcrops.integration.skill.AureliumsImpl;
|
||||||
@@ -115,6 +116,10 @@ public class IntegrationManager extends Function {
|
|||||||
this.seasonInterface = new RealisticSeasonsImpl();
|
this.seasonInterface = new RealisticSeasonsImpl();
|
||||||
ConfigManager.rsHook = true;
|
ConfigManager.rsHook = true;
|
||||||
hookMessage("RealisticSeasons");
|
hookMessage("RealisticSeasons");
|
||||||
|
} else if (pluginManager.isPluginEnabled("AdvancedSeasons")) {
|
||||||
|
this.seasonInterface = new AdvancedSeasonsImpl();
|
||||||
|
ConfigManager.rsHook = true;
|
||||||
|
hookMessage("AdvancedSeasons");
|
||||||
} else {
|
} else {
|
||||||
this.seasonInterface = new CustomCropsSeasonImpl();
|
this.seasonInterface = new CustomCropsSeasonImpl();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) <2022> <XiaoMoMi>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.momirealms.customcrops.integration.season;
|
||||||
|
|
||||||
|
import me.casperge.realisticseasons.api.SeasonsAPI;
|
||||||
|
import net.advancedplugins.seasons.api.AdvancedSeasonsAPI;
|
||||||
|
import net.momirealms.customcrops.api.object.season.CCSeason;
|
||||||
|
import net.momirealms.customcrops.helper.Log;
|
||||||
|
import net.momirealms.customcrops.integration.SeasonInterface;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
public class AdvancedSeasonsImpl implements SeasonInterface {
|
||||||
|
|
||||||
|
private final AdvancedSeasonsAPI api;
|
||||||
|
|
||||||
|
public AdvancedSeasonsImpl() {
|
||||||
|
this.api = new AdvancedSeasonsAPI();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CCSeason getSeason(String world) {
|
||||||
|
return switch (api.getSeason(Bukkit.getWorld(world))) {
|
||||||
|
case "SPRING" -> CCSeason.SPRING;
|
||||||
|
case "WINTER" -> CCSeason.WINTER;
|
||||||
|
case "SUMMER" -> CCSeason.SUMMER;
|
||||||
|
case "FALL" -> CCSeason.AUTUMN;
|
||||||
|
default -> CCSeason.UNKNOWN;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDate(String world) {
|
||||||
|
return SeasonsAPI.getInstance().getDate(Bukkit.getWorld(world)).getDay();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,9 +18,9 @@ worlds:
|
|||||||
# Requires a restart when changing mode or editing world list for the safety of data
|
# Requires a restart when changing mode or editing world list for the safety of data
|
||||||
# 模式:白名单/黑名单
|
# 模式:白名单/黑名单
|
||||||
# 修改本栏需要重启服务器
|
# 修改本栏需要重启服务器
|
||||||
mode: whitelist
|
mode: blacklist
|
||||||
list:
|
list:
|
||||||
- world
|
- blacklist_world
|
||||||
|
|
||||||
schedule-system:
|
schedule-system:
|
||||||
# If disabled, you can do that manually with command /customcrops force [consume/sprinklerwork/cropgrow] or API methods
|
# If disabled, you can do that manually with command /customcrops force [consume/sprinklerwork/cropgrow] or API methods
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ softdepend:
|
|||||||
- MMOCore
|
- MMOCore
|
||||||
- EcoSkills
|
- EcoSkills
|
||||||
- RealisticSeasons
|
- RealisticSeasons
|
||||||
|
- AdvancedSeasons
|
||||||
- Jobs
|
- Jobs
|
||||||
- IridiumSkyblock
|
- IridiumSkyblock
|
||||||
- SuperiorSkyBlock2
|
- SuperiorSkyBlock2
|
||||||
|
|||||||
Reference in New Issue
Block a user