fix may wrong rail type passed in
All checks were successful
Java CI-CD with Maven / build (push) Successful in 11m55s

This commit is contained in:
zhangyuheng 2024-01-19 10:53:24 +08:00
parent 3d70612b5b
commit 822b7dd2ee
2 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>EssentialsD</artifactId>
<version>1.2.12</version>
<version>1.2.13</version>
<packaging>jar</packaging>
<name>EssentialsD</name>

View File

@ -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;