mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 16:39:36 +00:00
1.6.3.2
This commit is contained in:
@@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
|
||||
group = 'net.momirealms'
|
||||
version = '1.6.1.2'
|
||||
version = '1.6.3.2'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -182,39 +182,43 @@ public class ConfigReader {
|
||||
integration = new ArrayList<>();
|
||||
if (config.getBoolean("config.integration.Residence",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("Residence") == null) Log.warn("Failed to initialize Residence!");
|
||||
else {integration.add(new Residence());hookMessage("Residence");}
|
||||
else {integration.add(new ResidenceIntegration());hookMessage("Residence");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.Kingdoms",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("Kingdoms") == null) Log.warn("Failed to initialize Kingdoms!");
|
||||
else {integration.add(new KingdomsX());hookMessage("Kingdoms");}
|
||||
else {integration.add(new KingdomsXIntegration());hookMessage("Kingdoms");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.WorldGuard",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("WorldGuard") == null) Log.warn("Failed to initialize WorldGuard!");
|
||||
else {integration.add(new WorldGuard());hookMessage("WorldGuard");}
|
||||
else {integration.add(new WorldGuardIntegration());hookMessage("WorldGuard");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.GriefDefender",false)){
|
||||
if(Bukkit.getPluginManager().getPlugin("GriefDefender") == null) Log.warn("Failed to initialize GriefDefender!");
|
||||
else {integration.add(new GriefDefender());hookMessage("GriefDefender");}
|
||||
else {integration.add(new GriefDefenderIntegration());hookMessage("GriefDefender");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.PlotSquared",false)){
|
||||
if(Bukkit.getPluginManager().getPlugin("PlotSquared") == null) Log.warn("Failed to initialize PlotSquared!");
|
||||
else {integration.add(new PlotSquared());hookMessage("PlotSquared");}
|
||||
else {integration.add(new PlotSquaredIntegration());hookMessage("PlotSquared");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.Towny",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("Towny") == null) Log.warn("Failed to initialize Towny!");
|
||||
else {integration.add(new Towny());hookMessage("Towny");}
|
||||
else {integration.add(new TownyIntegration());hookMessage("Towny");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.Lands",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("Lands") == null) Log.warn("Failed to initialize Lands!");
|
||||
else {integration.add(new Lands());hookMessage("Lands");}
|
||||
else {integration.add(new LandsIntegration());hookMessage("Lands");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.GriefPrevention",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("GriefPrevention") == null) Log.warn("Failed to initialize GriefPrevention!");
|
||||
else {integration.add(new GriefPrevention());hookMessage("GriefPrevention");}
|
||||
else {integration.add(new GriefPreventionIntegration());hookMessage("GriefPrevention");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.CrashClaim",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("CrashClaim") == null) Log.warn("Failed to initialize CrashClaim!");
|
||||
else {integration.add(new CrashClaim());hookMessage("CrashClaim");}
|
||||
else {integration.add(new CrashClaimIntegration());hookMessage("CrashClaim");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.BentoBox",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("BentoBox") == null) Log.warn("Failed to initialize BentoBox!");
|
||||
else {integration.add(new BentoBoxIntegration());hookMessage("BentoBox");}
|
||||
}
|
||||
|
||||
realisticSeason = false;
|
||||
@@ -226,23 +230,23 @@ public class ConfigReader {
|
||||
skillXP = null;
|
||||
if (config.getBoolean("config.integration.mcMMO",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("mcMMO") == null) Log.warn("Failed to initialize mcMMO!");
|
||||
else {skillXP = new mcMMO();hookMessage("mcMMO");}
|
||||
else {skillXP = new mcMMOIntegration();hookMessage("mcMMO");}
|
||||
}
|
||||
if (config.getBoolean("config.integration.AureliumSkills",false)){
|
||||
if (Bukkit.getPluginManager().getPlugin("AureliumSkills") == null) Log.warn("Failed to initialize AureliumSkills!");
|
||||
else {skillXP = new Aurelium();hookMessage("AureliumSkills");}
|
||||
else {skillXP = new AureliumIntegration();hookMessage("AureliumSkills");}
|
||||
}
|
||||
if(config.getBoolean("config.integration.MMOCore",false)){
|
||||
if(Bukkit.getPluginManager().getPlugin("MMOCore") == null) Log.warn("Failed to initialize MMOCore!");
|
||||
else {skillXP = new MMOCore();hookMessage("MMOCore");}
|
||||
else {skillXP = new MMOCoreIntegration();hookMessage("MMOCore");}
|
||||
}
|
||||
if(config.getBoolean("config.integration.EcoSkills",false)){
|
||||
if(Bukkit.getPluginManager().getPlugin("EcoSkills") == null) Log.warn("Failed to initialize EcoSkills!");
|
||||
else {skillXP = new EcoSkill();hookMessage("EcoSkills");}
|
||||
else {skillXP = new EcoSkillsIntegration();hookMessage("EcoSkills");}
|
||||
}
|
||||
if(config.getBoolean("config.integration.JobsReborn",false)){
|
||||
if(Bukkit.getPluginManager().getPlugin("Jobs") == null) Log.warn("Failed to initialize Jobs!");
|
||||
else {skillXP = new JobsReborn();hookMessage("JobsReborn");}
|
||||
else {skillXP = new JobsRebornIntegration();hookMessage("JobsReborn");}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,10 +76,9 @@ public final class CustomCrops extends JavaPlugin {
|
||||
AdventureManager.consoleMessage("[CustomCrops] Running on <white>" + Bukkit.getVersion());
|
||||
|
||||
ConfigReader.reloadConfig();
|
||||
if (!Objects.equals(ConfigReader.Config.version, "5")){
|
||||
if (!Objects.equals(ConfigReader.Config.version, "6")){
|
||||
ConfigUtil.update();
|
||||
}
|
||||
|
||||
if(Bukkit.getPluginManager().getPlugin("PlaceHolderAPI") != null){
|
||||
placeholders = new Placeholders();
|
||||
placeholders.register();
|
||||
|
||||
@@ -56,17 +56,22 @@ public class PotManager {
|
||||
String key = map.getString("fertilizer");
|
||||
Fertilizer fertilizer = ConfigReader.FERTILIZERS.get(key);
|
||||
if (fertilizer == null) return;
|
||||
if (fertilizer instanceof SpeedGrow){
|
||||
if (fertilizer instanceof SpeedGrow speedGrowConfig){
|
||||
SpeedGrow speedGrow = new SpeedGrow(key, map.getInt("times"));
|
||||
speedGrow.setChance(speedGrowConfig.getChance());
|
||||
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), speedGrow);
|
||||
}else if (fertilizer instanceof QualityCrop){
|
||||
}else if (fertilizer instanceof QualityCrop qualityCropConfig){
|
||||
QualityCrop qualityCrop = new QualityCrop(key, map.getInt("times"));
|
||||
qualityCrop.setChance(qualityCropConfig.getChance());
|
||||
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), qualityCrop);
|
||||
}else if (fertilizer instanceof RetainingSoil){
|
||||
}else if (fertilizer instanceof RetainingSoil retainingSoilConfig){
|
||||
RetainingSoil retainingSoil = new RetainingSoil(key, map.getInt("times"));
|
||||
retainingSoil.setChance(retainingSoilConfig.getChance());
|
||||
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), retainingSoil);
|
||||
}else if(fertilizer instanceof YieldIncreasing){
|
||||
}else if(fertilizer instanceof YieldIncreasing yieldIncreasingConfig){
|
||||
YieldIncreasing yieldIncreasing = new YieldIncreasing(key, map.getInt("times"));
|
||||
yieldIncreasing.setChance(yieldIncreasingConfig.getChance());
|
||||
yieldIncreasing.setBonus(yieldIncreasingConfig.getBonus());
|
||||
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), yieldIncreasing);
|
||||
}else {
|
||||
AdventureManager.consoleMessage("<red>[CustomCrops] 未知肥料类型错误!</red>");
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.integrations.protection;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.database.objects.Island;
|
||||
import world.bentobox.bentobox.lists.Flags;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class BentoBoxIntegration implements Integration{
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
User user = User.getInstance(player);
|
||||
Optional<Island> islandOptional = BentoBox.getInstance().getIslands().getIslandAt(location);
|
||||
return islandOptional.map(island -> island.isAllowed(user, Flags.BREAK_BLOCKS)).orElse(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlace(Location location, Player player) {
|
||||
User user = User.getInstance(player);
|
||||
Optional<Island> islandOptional = BentoBox.getInstance().getIslands().getIslandAt(location);
|
||||
return islandOptional.map(island -> island.isAllowed(user, Flags.PLACE_BLOCKS)).orElse(true);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import net.crashcraft.crashclaim.permissions.PermissionRoute;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrashClaim implements Integration{
|
||||
public class CrashClaimIntegration implements Integration{
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -20,7 +20,7 @@ package net.momirealms.customcrops.integrations.protection;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class GriefDefender implements Integration {
|
||||
public class GriefDefenderIntegration implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -20,7 +20,7 @@ package net.momirealms.customcrops.integrations.protection;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class GriefPrevention implements Integration{
|
||||
public class GriefPreventionIntegration implements Integration{
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -23,7 +23,7 @@ import org.kingdoms.constants.group.Kingdom;
|
||||
import org.kingdoms.constants.land.Land;
|
||||
import org.kingdoms.constants.player.KingdomPlayer;
|
||||
|
||||
public class KingdomsX implements Integration {
|
||||
public class KingdomsXIntegration implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -18,24 +18,23 @@
|
||||
package net.momirealms.customcrops.integrations.protection;
|
||||
|
||||
import me.angeschossen.lands.api.flags.Flags;
|
||||
import me.angeschossen.lands.api.integration.LandsIntegration;
|
||||
import me.angeschossen.lands.api.land.Area;
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Lands implements Integration{
|
||||
public class LandsIntegration implements Integration{
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
Area area = new LandsIntegration(CustomCrops.plugin).getAreaByLoc(location);
|
||||
Area area = new me.angeschossen.lands.api.integration.LandsIntegration(CustomCrops.plugin).getAreaByLoc(location);
|
||||
if (area != null) return area.hasFlag(player, Flags.BLOCK_BREAK, false);
|
||||
else return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlace(Location location, Player player) {
|
||||
Area area = new LandsIntegration(CustomCrops.plugin).getAreaByLoc(location);
|
||||
Area area = new me.angeschossen.lands.api.integration.LandsIntegration(CustomCrops.plugin).getAreaByLoc(location);
|
||||
if (area != null) return area.hasFlag(player, Flags.BLOCK_PLACE, false);
|
||||
else return true;
|
||||
}
|
||||
@@ -20,7 +20,7 @@ package net.momirealms.customcrops.integrations.protection;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlotSquared implements Integration {
|
||||
public class PlotSquaredIntegration implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(org.bukkit.Location location, Player player) {
|
||||
@@ -23,7 +23,7 @@ import com.bekvon.bukkit.residence.protection.ResidencePermissions;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Residence implements Integration {
|
||||
public class ResidenceIntegration implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -22,7 +22,7 @@ import com.palmergames.bukkit.towny.utils.PlayerCacheUtil;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Towny implements Integration{
|
||||
public class TownyIntegration implements Integration{
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
@@ -30,10 +30,11 @@ import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class WorldGuard implements Integration {
|
||||
public class WorldGuardIntegration implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canPlace(Location location, Player player) {
|
||||
if (player.isOp()) return true;
|
||||
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
|
||||
World world = BukkitAdapter.adapt(location.getWorld());
|
||||
WorldGuardPlatform platform = com.sk89q.worldguard.WorldGuard.getInstance().getPlatform();
|
||||
@@ -46,6 +47,7 @@ public class WorldGuard implements Integration {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
if (player.isOp()) return true;
|
||||
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
|
||||
World world = BukkitAdapter.adapt(location.getWorld());
|
||||
WorldGuardPlatform platform = com.sk89q.worldguard.WorldGuard.getInstance().getPlatform();
|
||||
@@ -22,7 +22,7 @@ import com.archyx.aureliumskills.leveler.Leveler;
|
||||
import com.archyx.aureliumskills.skills.Skill;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Aurelium implements SkillXP {
|
||||
public class AureliumIntegration implements SkillXP {
|
||||
|
||||
private static final Leveler leveler = AureliumAPI.getPlugin().getLeveler();
|
||||
private static final Skill skill = AureliumAPI.getPlugin().getSkillRegistry().getSkill("farming");
|
||||
@@ -1,13 +0,0 @@
|
||||
package net.momirealms.customcrops.integrations.skill;
|
||||
|
||||
import com.willfp.ecoskills.api.EcoSkillsAPI;
|
||||
import com.willfp.ecoskills.skills.Skills;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class EcoSkill implements SkillXP{
|
||||
|
||||
@Override
|
||||
public void addXp(Player player, double amount) {
|
||||
EcoSkillsAPI.getInstance().giveSkillExperience(player, Skills.FARMING, amount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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.integrations.skill;
|
||||
|
||||
import com.willfp.ecoskills.api.EcoSkillsAPI;
|
||||
import com.willfp.ecoskills.skills.Skills;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class EcoSkillsIntegration implements SkillXP{
|
||||
|
||||
@Override
|
||||
public void addXp(Player player, double amount) {
|
||||
EcoSkillsAPI.getInstance().giveSkillExperience(player, Skills.FARMING, amount);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.integrations.skill;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
@@ -8,7 +25,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JobsReborn implements SkillXP{
|
||||
public class JobsRebornIntegration implements SkillXP{
|
||||
|
||||
@Override
|
||||
public void addXp(Player player, double amount) {
|
||||
@@ -21,7 +21,7 @@ import net.Indyuce.mmocore.experience.EXPSource;
|
||||
import net.Indyuce.mmocore.experience.Profession;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class MMOCore implements SkillXP{
|
||||
public class MMOCoreIntegration implements SkillXP{
|
||||
@Override
|
||||
public void addXp(Player player, double amount) {
|
||||
Profession profession = net.Indyuce.mmocore.MMOCore.plugin.professionManager.get("farming");
|
||||
@@ -20,7 +20,7 @@ package net.momirealms.customcrops.integrations.skill;
|
||||
import com.gmail.nossr50.api.ExperienceAPI;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class mcMMO implements SkillXP {
|
||||
public class mcMMOIntegration implements SkillXP {
|
||||
|
||||
@Override
|
||||
public void addXp(Player player, double amount) {
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener;
|
||||
|
||||
import net.momirealms.customcrops.ConfigReader;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener;
|
||||
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener.itemframe;
|
||||
|
||||
import dev.lone.itemsadder.api.CustomFurniture;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener.itemframe;
|
||||
|
||||
import dev.lone.itemsadder.api.CustomFurniture;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener.itemframe;
|
||||
|
||||
import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
@@ -5,6 +22,8 @@ import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import dev.lone.itemsadder.api.CustomFurniture;
|
||||
import dev.lone.itemsadder.api.CustomStack;
|
||||
import dev.lone.itemsadder.api.Events.FurnitureInteractEvent;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.momirealms.customcrops.ConfigReader;
|
||||
@@ -23,11 +42,13 @@ import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
|
||||
import net.momirealms.customcrops.utils.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -83,6 +104,18 @@ public class InteractFurnitureI implements Listener {
|
||||
if (water > 0){
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.addWaterToSprinklerSource, ConfigReader.Sounds.addWaterToSprinklerKey);
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
if (sprinkler != null){
|
||||
currentWater = sprinkler.getWater();
|
||||
currentWater++;
|
||||
@@ -157,6 +190,18 @@ public class InteractFurnitureI implements Listener {
|
||||
int water = nbtItem.getInteger("WaterAmount");
|
||||
if (water > 0){
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.waterPotSource, ConfigReader.Sounds.waterPotKey);
|
||||
PotUtil.waterPot(wateringCan.getWidth(), wateringCan.getLength(), location.subtract(0.5,1,0.5), player.getLocation().getYaw());
|
||||
}
|
||||
@@ -242,6 +287,8 @@ public class InteractFurnitureI implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 右键收获判定
|
||||
* @param crop 农作物实体
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
/*
|
||||
* 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.listener.itemframe;
|
||||
|
||||
import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import dev.lone.itemsadder.api.CustomBlock;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.momirealms.customcrops.ConfigReader;
|
||||
@@ -26,12 +44,14 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -156,6 +176,18 @@ public class RightClickI implements Listener {
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.waterPotSource, ConfigReader.Sounds.waterPotKey);
|
||||
PotUtil.waterPot(wateringCan.getWidth(), wateringCan.getLength(), block.getLocation(), player.getLocation().getYaw());
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigReader.Message.hasWaterInfo)
|
||||
AdventureManager.playerActionbar(player,
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.momirealms.customcrops.ConfigReader;
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.datamanager.CropManager;
|
||||
import net.momirealms.customcrops.datamanager.PotManager;
|
||||
import net.momirealms.customcrops.listener.JoinAndQuit;
|
||||
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
|
||||
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
|
||||
import net.momirealms.customcrops.integrations.protection.Integration;
|
||||
@@ -51,9 +52,12 @@ public class BreakBlockT implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onBreak(CustomBlockBreakEvent event){
|
||||
long time = System.currentTimeMillis();
|
||||
Player player = event.getPlayer();
|
||||
if (time - (JoinAndQuit.coolDown.getOrDefault(player, time - 150)) < 150) return;
|
||||
JoinAndQuit.coolDown.put(player, time);
|
||||
String namespacedId = event.getNamespacedID();
|
||||
if(namespacedId.contains("_stage_")){
|
||||
Player player = event.getPlayer();
|
||||
Location location = event.getBlock().getLocation();
|
||||
for (Integration integration : ConfigReader.Config.integration)
|
||||
if(!integration.canBreak(location, player)) return;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.listener.tripwire;
|
||||
|
||||
import dev.lone.itemsadder.api.Events.FurnitureBreakEvent;
|
||||
|
||||
@@ -20,6 +20,8 @@ package net.momirealms.customcrops.listener.tripwire;
|
||||
import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import dev.lone.itemsadder.api.Events.FurnitureInteractEvent;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.momirealms.customcrops.ConfigReader;
|
||||
@@ -89,6 +91,18 @@ public class InteractFurnitureT implements Listener {
|
||||
int water = nbtItem.getInteger("WaterAmount");
|
||||
if (water > 0){
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.addWaterToSprinklerSource, ConfigReader.Sounds.addWaterToSprinklerKey);
|
||||
if (sprinkler != null){
|
||||
currentWater = sprinkler.getWater();
|
||||
|
||||
@@ -21,6 +21,7 @@ import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import dev.lone.itemsadder.api.CustomBlock;
|
||||
import dev.lone.itemsadder.api.CustomStack;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.momirealms.customcrops.ConfigReader;
|
||||
@@ -28,6 +29,7 @@ import net.momirealms.customcrops.datamanager.CropManager;
|
||||
import net.momirealms.customcrops.datamanager.PotManager;
|
||||
import net.momirealms.customcrops.datamanager.SeasonManager;
|
||||
import net.momirealms.customcrops.datamanager.SprinklerManager;
|
||||
import net.momirealms.customcrops.listener.itemframe.InteractFurnitureI;
|
||||
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
|
||||
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
|
||||
import net.momirealms.customcrops.integrations.protection.Integration;
|
||||
@@ -46,12 +48,14 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@@ -177,6 +181,18 @@ public class RightClickT implements Listener {
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.waterPotSource, ConfigReader.Sounds.waterPotKey);
|
||||
PotUtil.waterPot(wateringCan.getWidth(), wateringCan.getLength(), block.getLocation(), player.getLocation().getYaw());
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigReader.Message.hasWaterInfo)
|
||||
AdventureManager.playerActionbar(player,
|
||||
@@ -205,6 +221,18 @@ public class RightClickT implements Listener {
|
||||
nbtItem.setInteger("WaterAmount", --water);
|
||||
AdventureManager.playerSound(player, ConfigReader.Sounds.waterPotSource, ConfigReader.Sounds.waterPotKey);
|
||||
PotUtil.waterPot(wateringCan.getWidth(), wateringCan.getLength(), block.getLocation().subtract(0, 1, 0), player.getLocation().getYaw());
|
||||
if (nbtCompound.hasKey("custom_durability")){
|
||||
int dur = nbtCompound.getInteger("custom_durability");
|
||||
int max_dur = nbtCompound.getInteger("max_custom_durability");
|
||||
if (dur > 0){
|
||||
nbtCompound.setInteger("custom_durability", dur - 1);
|
||||
nbtCompound.setDouble("fake_durability", (int) itemStack.getType().getMaxDurability() * (double) (dur/max_dur));
|
||||
nbtItem.setInteger("Damage", (int) (itemStack.getType().getMaxDurability() * (1 - (double) dur/max_dur)));
|
||||
} else {
|
||||
AdventureManager.playerSound(player, net.kyori.adventure.sound.Sound.Source.PLAYER, Key.key("minecraft:item.shield.break"));
|
||||
itemStack.setAmount(itemStack.getAmount() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigReader.Message.hasWaterInfo)
|
||||
AdventureManager.playerActionbar(player,
|
||||
|
||||
@@ -19,8 +19,16 @@ package net.momirealms.customcrops.objects;
|
||||
|
||||
public record WateringCan(int max, int width, int length) {
|
||||
|
||||
public int getMax() { return max; }
|
||||
public int getLength() { return length; }
|
||||
public int getWidth() { return width; }
|
||||
public int getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.objects.fertilizer;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* 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.objects.fertilizer;
|
||||
|
||||
public class YieldIncreasing extends Fertilizer {
|
||||
|
||||
@@ -78,6 +78,7 @@ public class HoloUtil {
|
||||
packet2.getModifier().write(0,id);
|
||||
packet2.getWatchableCollectionModifier().write(0, wrappedDataWatcher.getWatchableObjects());
|
||||
cache.put(location, id);
|
||||
|
||||
try {
|
||||
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet1);
|
||||
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet2);
|
||||
|
||||
@@ -94,15 +94,20 @@ public class PotUtil {
|
||||
public static void addFertilizer(Fertilizer fertilizerConfig, Location location) {
|
||||
if (fertilizerConfig instanceof QualityCrop config){
|
||||
QualityCrop qualityCrop = new QualityCrop(config.getKey(), config.getTimes());
|
||||
qualityCrop.setChance(config.getChance());
|
||||
PotManager.Cache.put(LocUtil.fromLocation(location), qualityCrop);
|
||||
}else if (fertilizerConfig instanceof SpeedGrow config){
|
||||
SpeedGrow speedGrow = new SpeedGrow(config.getKey(), config.getTimes());
|
||||
speedGrow.setChance(config.getChance());
|
||||
PotManager.Cache.put(LocUtil.fromLocation(location), speedGrow);
|
||||
}else if (fertilizerConfig instanceof RetainingSoil config){
|
||||
RetainingSoil retainingSoil = new RetainingSoil(config.getKey(), config.getTimes());
|
||||
retainingSoil.setChance(config.getChance());
|
||||
PotManager.Cache.put(LocUtil.fromLocation(location), retainingSoil);
|
||||
}else if (fertilizerConfig instanceof YieldIncreasing config){
|
||||
YieldIncreasing yieldIncreasing = new YieldIncreasing(config.getKey(), config.getTimes());
|
||||
yieldIncreasing.setBonus(config.getBonus());
|
||||
yieldIncreasing.setChance(config.getChance());
|
||||
PotManager.Cache.put(LocUtil.fromLocation(location), yieldIncreasing);
|
||||
}
|
||||
if (fertilizerConfig.getParticle() != null) location.getWorld().spawnParticle(fertilizerConfig.getParticle(), location.add(0.5,1.3,0.5), 5,0.2,0.2,0.2);
|
||||
|
||||
@@ -7,7 +7,9 @@ basic:
|
||||
soil-detector: customcrops:soil_detector
|
||||
|
||||
|
||||
|
||||
# If you want watering-can has custom durability
|
||||
# Just set material to damageable items like wooden_sword
|
||||
# custom durability in itemsadder is compatible in CustomCrops
|
||||
water-can:
|
||||
watering_can_1:
|
||||
item: customcrops:watering_can_1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Don't change
|
||||
config-version: '5'
|
||||
config-version: '6'
|
||||
|
||||
#Want to sell the crops?
|
||||
#Try this plugin: https://www.spigotmc.org/resources/shipping-bin.104591/
|
||||
@@ -62,6 +62,7 @@ config:
|
||||
Lands: false
|
||||
GriefPrevention: false
|
||||
CrashClaim: false
|
||||
BentoBox: false
|
||||
#integration to add players' farming skill xp
|
||||
AureliumSkills: false
|
||||
mcMMO: false
|
||||
@@ -78,10 +79,10 @@ config:
|
||||
# Mode 2:
|
||||
# ● Online players' crops will grow
|
||||
# Mode 3:
|
||||
# ● Recommended Mode 1 + Mode 2
|
||||
# ● If you enable season, mode 3 is recommended (Mode 1 + Mode 2)
|
||||
# Mode 4:
|
||||
# ● Please disable season in this mode!
|
||||
# ● All the crops will grow
|
||||
# ● If you disable season, mode 4 is recommended
|
||||
# ● All the crops will grow, this is good for offline crops
|
||||
# ● If season not disabled, your server would be lagging when there's a lot of data
|
||||
# ● Crop data would be removed as soon as they are ripe when season disabled, so it would not cause lag!
|
||||
grow-mode: 3
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: CustomCrops
|
||||
version: '${version}'
|
||||
main: net.momirealms.customcrops.CustomCrops
|
||||
api-version: 1.17
|
||||
api-version: 1.16
|
||||
authors: [ XiaoMoMi ]
|
||||
depend:
|
||||
- ItemsAdder
|
||||
|
||||
@@ -11,6 +11,9 @@ basic:
|
||||
#土质探测器,用于查看使用的肥料种类和残余量
|
||||
soil-detector: customcrops:soil_detector
|
||||
|
||||
#如果你想要水壶有自定义耐久度
|
||||
#请在ia里将它设置为耐久度的物品(例如木剑)
|
||||
#IA的自定义耐久度对本插件生效
|
||||
water-can:
|
||||
watering_can_1:
|
||||
item: customcrops:watering_can_1
|
||||
@@ -19,6 +22,8 @@ water-can:
|
||||
#水壶工作的范围
|
||||
width: 1
|
||||
length: 1
|
||||
#水壶的最大耐久度,不填写则无限耐久
|
||||
durability: 100
|
||||
watering_can_2:
|
||||
item: customcrops:watering_can_2
|
||||
max: 4
|
||||
@@ -40,12 +45,11 @@ lore:
|
||||
watering-can:
|
||||
enable: true
|
||||
#Lore样式
|
||||
#可用变量 {water}当前水量 {max_water}最大蓄水量
|
||||
lore:
|
||||
- '<italic:false><white>{water_info}'
|
||||
- '<italic:false><gray>右键水方块为水壶加水'
|
||||
|
||||
#水量 {water_info}
|
||||
#可用变量 {water}当前水量 {max_water}最大蓄水量
|
||||
left: '<font:customcrops:default>뀂'
|
||||
full: '뀁뀃'
|
||||
empty: '뀁뀄'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#请不要修改此值
|
||||
config-version: '5'
|
||||
config-version: '6'
|
||||
|
||||
|
||||
config:
|
||||
@@ -54,6 +54,7 @@ config:
|
||||
Lands: false
|
||||
GriefPrevention: false
|
||||
CrashClaim: false
|
||||
BentoBox: false
|
||||
#增加技能经验
|
||||
AureliumSkills: false
|
||||
mcMMO: false
|
||||
|
||||
Reference in New Issue
Block a user