From 822b7dd2ee5e977eabada2443f3ac5566ea887ab Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Fri, 19 Jan 2024 10:53:24 +0800 Subject: [PATCH] fix may wrong rail type passed in --- pom.xml | 2 +- src/main/java/cn/lunadeer/essentialsd/Events.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11b0f05..0c995fc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.lunadeer EssentialsD - 1.2.12 + 1.2.13 jar EssentialsD diff --git a/src/main/java/cn/lunadeer/essentialsd/Events.java b/src/main/java/cn/lunadeer/essentialsd/Events.java index 07c9e5b..32d512e 100644 --- a/src/main/java/cn/lunadeer/essentialsd/Events.java +++ b/src/main/java/cn/lunadeer/essentialsd/Events.java @@ -25,6 +25,8 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; +import org.bukkit.material.DetectorRail; +import org.bukkit.material.PoweredRail; import org.bukkit.persistence.PersistentDataType; import java.util.HashSet; @@ -170,6 +172,9 @@ public class Events implements Listener { return; } Block block = event.getClickedBlock(); + if (block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL || block.getType() == Material.ACTIVATOR_RAIL) { + return; + } BlockData blockData = block.getBlockData(); if (!(blockData instanceof Rail)) { return;