9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-26 10:29:10 +00:00
This commit is contained in:
XiaoMoMi
2023-07-27 00:15:02 +08:00
parent 8754add61a
commit b6fa1dc5d0
2 changed files with 4 additions and 2 deletions

View File

@@ -17,6 +17,8 @@
package net.momirealms.customcrops.api.object.world;
import net.momirealms.customcrops.api.event.CropBreakEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkLoadEvent;

View File

@@ -574,7 +574,7 @@ public class PlatformManager extends Function {
if (item_in_hand_id.equals("AIR")) {
InteractCrop interactCrop = stageConfig.getInteractByHand();
if (interactCrop != null) {
if (interactCrop.canInteract(player, location))
if (!interactCrop.canInteract(player, location))
return true;
for (Action action : interactCrop.getActions())
action.doOn(player, SimpleLocation.getByBukkitLocation(location), cropConfig.getCropMode());
@@ -659,7 +659,7 @@ public class PlatformManager extends Function {
if (interactActions != null) {
for (InteractCrop interactCrop : interactActions) {
if (interactCrop.isRightItem(item_in_hand_id)) {
if (interactCrop.canInteract(player, location))
if (!interactCrop.canInteract(player, location))
continue;
if (player.getGameMode() != GameMode.CREATIVE) {
if (interactCrop.isConsumed())