mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 16:39:36 +00:00
1.5.16
This commit is contained in:
0
libs/KingdomsX(premium).txt
Normal file
0
libs/KingdomsX(premium).txt
Normal file
0
libs/Lands(premium).txt
Normal file
0
libs/Lands(premium).txt
Normal file
0
libs/PlotSquared(premium).txt
Normal file
0
libs/PlotSquared(premium).txt
Normal file
0
libs/Residence(premium).txt
Normal file
0
libs/Residence(premium).txt
Normal file
@@ -44,7 +44,7 @@ public class ConfigReader {
|
|||||||
public static HashMap<String, WateringCan> CANS = new HashMap<>();
|
public static HashMap<String, WateringCan> CANS = new HashMap<>();
|
||||||
public static HashMap<String, Sprinkler> SPRINKLERS = new HashMap<>();
|
public static HashMap<String, Sprinkler> SPRINKLERS = new HashMap<>();
|
||||||
|
|
||||||
private static YamlConfiguration getConfig(String configName) {
|
public static YamlConfiguration getConfig(String configName) {
|
||||||
File file = new File(CustomCrops.instance.getDataFolder(), configName);
|
File file = new File(CustomCrops.instance.getDataFolder(), configName);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
CustomCrops.instance.saveResource(configName, false);
|
CustomCrops.instance.saveResource(configName, false);
|
||||||
@@ -227,6 +227,14 @@ public class ConfigReader {
|
|||||||
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><gold>Lands <color:#FFEBCD>Hooked!");
|
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><gold>Lands <color:#FFEBCD>Hooked!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(config.getBoolean("config.integration.GriefPrevention",false)){
|
||||||
|
if(Bukkit.getPluginManager().getPlugin("GriefPrevention") == null){
|
||||||
|
CustomCrops.instance.getLogger().warning("Failed to initialize GriefPrevention!");
|
||||||
|
}else {
|
||||||
|
integration.add(new GriefPrevention());
|
||||||
|
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><gold>GriefPrevention <color:#FFEBCD>Hooked!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,11 @@ import net.momirealms.customcrops.utils.BackUp;
|
|||||||
import net.momirealms.customcrops.utils.HoloUtil;
|
import net.momirealms.customcrops.utils.HoloUtil;
|
||||||
import net.momirealms.customcrops.utils.Placeholders;
|
import net.momirealms.customcrops.utils.Placeholders;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public final class CustomCrops extends JavaPlugin {
|
public final class CustomCrops extends JavaPlugin {
|
||||||
@@ -111,8 +114,19 @@ public final class CustomCrops extends JavaPlugin {
|
|||||||
this.potManager = new PotManager(this);
|
this.potManager = new PotManager(this);
|
||||||
this.potManager.loadData();
|
this.potManager.loadData();
|
||||||
|
|
||||||
//启动完成
|
FileConfiguration fileConfiguration = Bukkit.getPluginManager().getPlugin("ItemsAdder").getConfig();
|
||||||
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><color:#F5DEB3>Plugin Enabled!");
|
if (fileConfiguration.getBoolean("blocks.disable-REAL_WIRE")){
|
||||||
|
fileConfiguration.set("blocks.disable-REAL_WIRE", false);
|
||||||
|
try {
|
||||||
|
fileConfiguration.save(new File(Bukkit.getPluginManager().getPlugin("ItemsAdder").getDataFolder(), "config.yml"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><red>Detected that you might have not set \"disable-REAL_WIRE\" false in ItemsAdder's config!");
|
||||||
|
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><red>You need a restart to apply that config :)");
|
||||||
|
}else {
|
||||||
|
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><color:#F5DEB3>Plugin Enabled!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package net.momirealms.customcrops.integrations;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class GriefPrevention implements Integration{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBreak(Location location, Player player) {
|
||||||
|
return me.ryanhamshire.GriefPrevention.GriefPrevention.instance.allowBreak(player, location.getBlock(), location) == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlace(Location location, Player player) {
|
||||||
|
return me.ryanhamshire.GriefPrevention.GriefPrevention.instance.allowBuild(player, location) == null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,7 +33,6 @@ public class CropTimer {
|
|||||||
|
|
||||||
public void stopTimer(int ID) {
|
public void stopTimer(int ID) {
|
||||||
Bukkit.getScheduler().cancelTask(ID);
|
Bukkit.getScheduler().cancelTask(ID);
|
||||||
Bukkit.getServer().getScheduler().cancelTask(ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTaskID() {
|
public int getTaskID() {
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public class CropTimerAsync {
|
|||||||
|
|
||||||
public void stopTimer(int ID) {
|
public void stopTimer(int ID) {
|
||||||
Bukkit.getScheduler().cancelTask(ID);
|
Bukkit.getScheduler().cancelTask(ID);
|
||||||
Bukkit.getServer().getScheduler().cancelTask(ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTaskID() {
|
public int getTaskID() {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ config:
|
|||||||
PlotSquared: false
|
PlotSquared: false
|
||||||
Towny: false
|
Towny: false
|
||||||
Lands: false
|
Lands: false
|
||||||
|
GriefPrevention: false
|
||||||
|
|
||||||
#The time to start growing(ticks)
|
#The time to start growing(ticks)
|
||||||
#1000ticks is 7am in game. (0-23999)
|
#1000ticks is 7am in game. (0-23999)
|
||||||
@@ -27,8 +28,6 @@ config:
|
|||||||
|
|
||||||
quality:
|
quality:
|
||||||
#If disabled, you need to configurate the loot in ItemsAdder config
|
#If disabled, you need to configurate the loot in ItemsAdder config
|
||||||
#If enabled, make sure that your Grief Prevention Plugin is supported.
|
|
||||||
#Otherwise there might exists duplication.
|
|
||||||
enable: true
|
enable: true
|
||||||
#Default ratio
|
#Default ratio
|
||||||
default-ratio: 17/2/1
|
default-ratio: 17/2/1
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ softdepend:
|
|||||||
- PlotSquared
|
- PlotSquared
|
||||||
- Towny
|
- Towny
|
||||||
- Lands
|
- Lands
|
||||||
|
- GriefPrevention
|
||||||
commands:
|
commands:
|
||||||
customcrops:
|
customcrops:
|
||||||
usage: /customcrops <args>
|
usage: /customcrops <args>
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
config:
|
config:
|
||||||
|
lang: chinese
|
||||||
|
|
||||||
#插件兼容
|
#插件兼容
|
||||||
integration:
|
integration:
|
||||||
Residence: false
|
Residence: false
|
||||||
@@ -8,6 +10,7 @@ config:
|
|||||||
PlotSquared: false
|
PlotSquared: false
|
||||||
Towny: false
|
Towny: false
|
||||||
Lands: false
|
Lands: false
|
||||||
|
GriefPrevention: false
|
||||||
|
|
||||||
#生长时间点(tick)
|
#生长时间点(tick)
|
||||||
#1000代表上午7点,农作物陆续开始生长
|
#1000代表上午7点,农作物陆续开始生长
|
||||||
@@ -27,8 +30,6 @@ config:
|
|||||||
quality:
|
quality:
|
||||||
#若不启用则植物成熟阶段会掉落IA配置里的loot
|
#若不启用则植物成熟阶段会掉落IA配置里的loot
|
||||||
#如果关闭产物品质需要在IA物品配置内自行添加最后一阶段掉落物
|
#如果关闭产物品质需要在IA物品配置内自行添加最后一阶段掉落物
|
||||||
#如果你使用的领地插件不被兼容,请不要启用产物品质功能,
|
|
||||||
#请立即更换领地插件或寻找作者写领地兼容
|
|
||||||
enable: true
|
enable: true
|
||||||
#默认品质权重比
|
#默认品质权重比
|
||||||
default-ratio: 17/2/1
|
default-ratio: 17/2/1
|
||||||
@@ -75,4 +76,7 @@ config:
|
|||||||
#因为有大量世界所以无法通过添加白名单世界的方式生长
|
#因为有大量世界所以无法通过添加白名单世界的方式生长
|
||||||
#在此选项开启的状态下,白名单世界只能填写一个
|
#在此选项开启的状态下,白名单世界只能填写一个
|
||||||
#作为所有世界农作物生长的时间、季节判断依据
|
#作为所有世界农作物生长的时间、季节判断依据
|
||||||
all-world-grow: false
|
all-world-grow: false
|
||||||
|
|
||||||
|
#玩家是否能空手右键收获
|
||||||
|
right-click-harvest: true
|
||||||
Reference in New Issue
Block a user