mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 00:19:24 +00:00
2.0-pre-release-1
This commit is contained in:
1
libs/Oraxen(premium).txt
Normal file
1
libs/Oraxen(premium).txt
Normal file
@@ -0,0 +1 @@
|
||||
https://www.spigotmc.org/resources/%E2%9C%85-10-%E2%98%84%EF%B8%8F-oraxen-add-items-blocks-armors-hats-food-furnitures-plants-and-gui.72448/
|
||||
@@ -27,6 +27,7 @@ import net.momirealms.customcrops.helper.LibraryLoader;
|
||||
import net.momirealms.customcrops.integrations.papi.PlaceholderManager;
|
||||
import net.momirealms.customcrops.managers.CropManager;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -88,6 +89,7 @@ public final class CustomCrops extends JavaPlugin {
|
||||
}
|
||||
|
||||
AdventureUtil.consoleMessage("[CustomCrops] Plugin Enabled!");
|
||||
new Metrics(this, 16593);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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.api.event;
|
||||
|
||||
import net.momirealms.customcrops.objects.WorldState;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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.api.event;
|
||||
|
||||
import net.momirealms.customcrops.api.crop.Crop;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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.api.event;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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.api.event;
|
||||
|
||||
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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.api.utils;
|
||||
|
||||
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.commands;
|
||||
|
||||
import net.momirealms.customcrops.config.MainConfig;
|
||||
|
||||
@@ -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.commands;
|
||||
|
||||
import net.momirealms.customcrops.commands.subcmd.ReloadCommand;
|
||||
|
||||
@@ -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.commands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -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.commands.subcmd;
|
||||
|
||||
import net.momirealms.customcrops.commands.AbstractSubCommand;
|
||||
|
||||
@@ -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.commands.subcmd;
|
||||
|
||||
import net.momirealms.customcrops.api.utils.SeasonUtils;
|
||||
|
||||
@@ -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.commands.subcmd;
|
||||
|
||||
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.config;
|
||||
|
||||
import net.kyori.adventure.key.Key;
|
||||
|
||||
@@ -240,6 +240,12 @@ public abstract class HandlerP extends Function {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeScarecrow(Location location) {
|
||||
CustomWorld customWorld = cropManager.getCustomWorld(location.getWorld());
|
||||
if (customWorld == null) return;
|
||||
customWorld.removeScarecrow(location);
|
||||
}
|
||||
|
||||
public boolean placeSprinkler(String id, Location location, Player player, ItemStack item) {
|
||||
|
||||
Sprinkler config = SprinklerConfig.SPRINKLERS_2D.get(id);
|
||||
@@ -292,12 +298,6 @@ public abstract class HandlerP extends Function {
|
||||
return StringUtils.chop(id) + nextStage;
|
||||
}
|
||||
|
||||
public void placeScareCrow(Location location) {
|
||||
CustomWorld customWorld = cropManager.getCustomWorld(location.getWorld());
|
||||
if (customWorld == null) return;
|
||||
|
||||
}
|
||||
|
||||
public boolean fillWaterCan(String id, NBTItem nbtItem, ItemStack itemStack, Player player) {
|
||||
WaterCan config = WaterCanConfig.CANS.get(id);
|
||||
if (config != null) {
|
||||
|
||||
@@ -91,6 +91,14 @@ public class ItemsAdderFrameHandler extends ItemsAdderHandler {
|
||||
if (player.getGameMode() != GameMode.CREATIVE) itemInHand.setAmount(itemInHand.getAmount() - 1);
|
||||
if (Math.random() < MainConfig.boneMealChance) {
|
||||
entity.getWorld().spawnParticle(MainConfig.boneMealSuccess, location.clone().add(0,0.5, 0),3,0.2,0.2,0.2);
|
||||
if (SoundConfig.boneMeal.isEnable()) {
|
||||
AdventureUtil.playerSound(
|
||||
player,
|
||||
SoundConfig.boneMeal.getSource(),
|
||||
SoundConfig.boneMeal.getKey(),
|
||||
1,1
|
||||
);
|
||||
}
|
||||
CustomFurniture.remove(entity, false);
|
||||
CustomFurniture.spawn(getNextStage(namespacedID), location.getBlock());
|
||||
}
|
||||
@@ -119,6 +127,11 @@ public class ItemsAdderFrameHandler extends ItemsAdderHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (MainConfig.enableCrow && namespacedId.equals(BasicItemConfig.scarecrow)) {
|
||||
super.removeScarecrow(event.getBukkitEntity().getLocation());
|
||||
return;
|
||||
}
|
||||
|
||||
if (namespacedId.contains("_stage_")) {
|
||||
if (namespacedId.equals(BasicItemConfig.deadCrop)) return;
|
||||
if (hasNextStage(namespacedId)) {
|
||||
|
||||
@@ -21,23 +21,18 @@ 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 dev.lone.itemsadder.api.Events.CustomBlockBreakEvent;
|
||||
import dev.lone.itemsadder.api.Events.CustomBlockInteractEvent;
|
||||
import dev.lone.itemsadder.api.Events.FurnitureBreakEvent;
|
||||
import dev.lone.itemsadder.api.Events.FurnitureInteractEvent;
|
||||
import dev.lone.itemsadder.api.Events.*;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.api.crop.Crop;
|
||||
import net.momirealms.customcrops.api.event.WaterEvent;
|
||||
import net.momirealms.customcrops.config.CropConfig;
|
||||
import net.momirealms.customcrops.config.MainConfig;
|
||||
import net.momirealms.customcrops.config.SoundConfig;
|
||||
import net.momirealms.customcrops.config.WaterCanConfig;
|
||||
import net.momirealms.customcrops.config.*;
|
||||
import net.momirealms.customcrops.integrations.AntiGrief;
|
||||
import net.momirealms.customcrops.integrations.customplugin.HandlerP;
|
||||
import net.momirealms.customcrops.integrations.customplugin.itemsadder.listeners.ItemsAdderBlockListener;
|
||||
import net.momirealms.customcrops.integrations.customplugin.itemsadder.listeners.ItemsAdderFurnitureListener;
|
||||
import net.momirealms.customcrops.managers.CropManager;
|
||||
import net.momirealms.customcrops.managers.CustomWorld;
|
||||
import net.momirealms.customcrops.objects.WaterCan;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -78,6 +73,16 @@ public abstract class ItemsAdderHandler extends HandlerP {
|
||||
HandlerList.unregisterAll(this.itemsAdderFurnitureListener);
|
||||
}
|
||||
|
||||
public void placeScarecrow(FurniturePlaceSuccessEvent event) {
|
||||
if (!MainConfig.enableCrow) return;
|
||||
String id = event.getNamespacedID();
|
||||
if (id == null || !id.equals(BasicItemConfig.scarecrow)) return;
|
||||
Location location = event.getBukkitEntity().getLocation();
|
||||
CustomWorld customWorld = cropManager.getCustomWorld(location.getWorld());
|
||||
if (customWorld == null) return;
|
||||
customWorld.addScarecrow(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
|
||||
@@ -191,7 +196,7 @@ public abstract class ItemsAdderHandler extends HandlerP {
|
||||
}
|
||||
|
||||
itemStack.setItemMeta(nbtItem.getItem().getItemMeta());
|
||||
super.waterPot(waterCan.width(), waterCan.getLength(), potLoc, player.getLocation().getYaw());
|
||||
super.waterPot(waterCan.getWidth(), waterCan.getLength(), potLoc, player.getLocation().getYaw());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -87,6 +87,11 @@ public class ItemsAdderWireHandler extends ItemsAdderHandler {
|
||||
Sprinkler sprinkler = SprinklerConfig.SPRINKLERS_3D.get(namespacedID);
|
||||
if (sprinkler != null) {
|
||||
super.onBreakSprinkler(event.getBukkitEntity().getLocation());
|
||||
return;
|
||||
}
|
||||
|
||||
if (MainConfig.enableCrow && namespacedID.equals(BasicItemConfig.scarecrow)) {
|
||||
super.removeScarecrow(event.getBukkitEntity().getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +133,14 @@ public class ItemsAdderWireHandler extends ItemsAdderHandler {
|
||||
if (player.getGameMode() != GameMode.CREATIVE) itemInHand.setAmount(itemInHand.getAmount() - 1);
|
||||
if (Math.random() < MainConfig.boneMealChance) {
|
||||
location.getWorld().spawnParticle(MainConfig.boneMealSuccess, location.clone().add(0.5,0.5, 0.5),3,0.2,0.2,0.2);
|
||||
if (SoundConfig.boneMeal.isEnable()) {
|
||||
AdventureUtil.playerSound(
|
||||
player,
|
||||
SoundConfig.boneMeal.getSource(),
|
||||
SoundConfig.boneMeal.getKey(),
|
||||
1,1
|
||||
);
|
||||
}
|
||||
CustomBlock.remove(location);
|
||||
CustomBlock.place(getNextStage(blockID), location);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package net.momirealms.customcrops.integrations.customplugin.itemsadder.listener
|
||||
|
||||
import dev.lone.itemsadder.api.Events.FurnitureBreakEvent;
|
||||
import dev.lone.itemsadder.api.Events.FurnitureInteractEvent;
|
||||
import dev.lone.itemsadder.api.Events.FurniturePlaceEvent;
|
||||
import dev.lone.itemsadder.api.Events.FurniturePlaceSuccessEvent;
|
||||
import net.momirealms.customcrops.integrations.customplugin.itemsadder.ItemsAdderHandler;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@@ -43,7 +43,7 @@ public class ItemsAdderFurnitureListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlaceFurniture(FurniturePlaceEvent event) {
|
||||
//TODO scarecrow
|
||||
public void onPlaceFurniture(FurniturePlaceSuccessEvent event) {
|
||||
handler.placeScarecrow(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +237,14 @@ public class OraxenFrameHandler extends OraxenHandler {
|
||||
if (player.getGameMode() != GameMode.CREATIVE) itemInHand.setAmount(itemInHand.getAmount() - 1);
|
||||
if (Math.random() < MainConfig.boneMealChance) {
|
||||
itemFrame.getWorld().spawnParticle(MainConfig.boneMealSuccess, location.clone().add(0,0.5, 0),3,0.2,0.2,0.2);
|
||||
if (SoundConfig.boneMeal.isEnable()) {
|
||||
AdventureUtil.playerSound(
|
||||
player,
|
||||
SoundConfig.boneMeal.getSource(),
|
||||
SoundConfig.boneMeal.getKey(),
|
||||
1,1
|
||||
);
|
||||
}
|
||||
String nextStage = getNextStage(id);
|
||||
itemFrame.setItem(customInterface.getItemStack(nextStage));
|
||||
itemFrame.getPersistentDataContainer().set(OraxenHook.FURNITURE, PersistentDataType.STRING, nextStage);
|
||||
|
||||
@@ -84,12 +84,6 @@ public abstract class OraxenHandler extends HandlerP {
|
||||
customWorld.addScarecrow(location);
|
||||
}
|
||||
|
||||
public void removeScarecrow(Location location) {
|
||||
CustomWorld customWorld = cropManager.getCustomWorld(location.getWorld());
|
||||
if (customWorld == null) return;
|
||||
customWorld.removeScarecrow(location);
|
||||
}
|
||||
|
||||
public boolean tryMisc(Player player, ItemStack itemInHand, Location potLoc) {
|
||||
if (itemInHand == null || itemInHand.getType() == Material.AIR) return true;
|
||||
String id = OraxenItems.getIdByItem(itemInHand);
|
||||
@@ -182,7 +176,7 @@ public abstract class OraxenHandler extends HandlerP {
|
||||
}
|
||||
|
||||
can.setItemMeta(nbtItem.getItem().getItemMeta());
|
||||
super.waterPot(waterCan.width(), waterCan.getLength(), potLoc, player.getLocation().getYaw());
|
||||
super.waterPot(waterCan.getWidth(), waterCan.getLength(), potLoc, player.getLocation().getYaw());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -274,6 +274,14 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
if (player.getGameMode() != GameMode.CREATIVE) itemInHand.setAmount(itemInHand.getAmount() - 1);
|
||||
if (Math.random() < MainConfig.boneMealChance) {
|
||||
seedLoc.getWorld().spawnParticle(MainConfig.boneMealSuccess, seedLoc.clone().add(0.5,0.5, 0.5),3,0.2,0.2,0.2);
|
||||
if (SoundConfig.boneMeal.isEnable()) {
|
||||
AdventureUtil.playerSound(
|
||||
player,
|
||||
SoundConfig.boneMeal.getSource(),
|
||||
SoundConfig.boneMeal.getKey(),
|
||||
1,1
|
||||
);
|
||||
}
|
||||
StringBlockMechanicFactory.setBlockModel(block, getNextStage(id));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.momirealms.customcrops.config.MainConfig;
|
||||
import org.bukkit.World;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.mozilla.javascript.tools.jsc.Main;
|
||||
|
||||
public class RealisticSeasonsHook extends Function implements SeasonInterface {
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.momirealms.customcrops.api.event.CropHarvestEvent;
|
||||
import net.momirealms.customcrops.config.BasicItemConfig;
|
||||
import net.momirealms.customcrops.config.MainConfig;
|
||||
import net.momirealms.customcrops.config.SeasonConfig;
|
||||
import net.momirealms.customcrops.config.SoundConfig;
|
||||
import net.momirealms.customcrops.integrations.customplugin.CustomInterface;
|
||||
import net.momirealms.customcrops.integrations.customplugin.HandlerP;
|
||||
import net.momirealms.customcrops.integrations.customplugin.itemsadder.ItemsAdderFrameHandler;
|
||||
@@ -48,6 +49,7 @@ import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
|
||||
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
|
||||
import net.momirealms.customcrops.objects.fertilizer.RetainingSoil;
|
||||
import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import net.momirealms.customcrops.utils.ArmorStandUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@@ -269,6 +271,15 @@ public class CropManager extends Function {
|
||||
ActionInterface[] actions = crop.getActions();
|
||||
if (actions != null) performActions(actions, player);
|
||||
|
||||
if (SoundConfig.harvestCrop.isEnable()) {
|
||||
AdventureUtil.playerSound(
|
||||
player,
|
||||
SoundConfig.harvestCrop.getSource(),
|
||||
SoundConfig.harvestCrop.getKey(),
|
||||
1,1
|
||||
);
|
||||
}
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE) return;
|
||||
|
||||
QualityLoot qualityLoot = crop.getQualityLoot();
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.momirealms.customcrops.config.CropConfig;
|
||||
import net.momirealms.customcrops.config.MainConfig;
|
||||
import net.momirealms.customcrops.integrations.customplugin.CustomInterface;
|
||||
import net.momirealms.customcrops.integrations.customplugin.oraxen.OraxenHook;
|
||||
import net.momirealms.customcrops.managers.timer.CrowTask;
|
||||
import net.momirealms.customcrops.objects.GiganticCrop;
|
||||
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
|
||||
import net.momirealms.customcrops.objects.fertilizer.Gigantic;
|
||||
@@ -35,7 +34,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
|
||||
public class OraxenFrameCropImpl implements CropModeInterface {
|
||||
|
||||
@@ -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.managers.timer;
|
||||
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
|
||||
@@ -35,6 +35,7 @@ optimization:
|
||||
# Recommend enabling this to prevent large quantities of crops/itemframes lagging the server
|
||||
limitation:
|
||||
enable: true
|
||||
# max amount per chunk
|
||||
tripwire-amount: 64
|
||||
itemframe-amount: 64
|
||||
|
||||
@@ -42,7 +43,7 @@ optimization:
|
||||
disable-water-particles: false
|
||||
# Disable the animation when sprinkler works
|
||||
disable-sprinkler-animation: false
|
||||
# Auto back up the data for when a world is unloaded
|
||||
# Auto back up the data when a world is unloaded
|
||||
auto-back-up: true
|
||||
|
||||
mechanics:
|
||||
@@ -108,6 +109,8 @@ mechanics:
|
||||
enable: true
|
||||
#effective range
|
||||
range: 5
|
||||
# During the crop grow progress, crops have little chance to be eaten by a crow
|
||||
# Place a scarecrow would protect the crops in this chunk
|
||||
crow:
|
||||
enable: true
|
||||
chance: 0.005
|
||||
|
||||
Reference in New Issue
Block a user