Fixed
- Clicking on buttons, doors, levers, trap doors no longer trigger the "Please select a Hopper, Chest, or Barrel." message.
This commit is contained in:
BigPappa committed 2026-09-05 10:34:42 -05:00
1 parent 377158b5be
commit d754addf93
2 files changed
+24 -19

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>com.rsscripting</groupId>
<artifactId>RS-ItemMagnet</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
@@ -11,6 +11,7 @@ import com.rsscripting.itemmagnet.managers.PendingConversion;
import com.rsscripting.itemmagnet.managers.RSConversionManager;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -77,24 +78,22 @@ public class RSConvertListener
if (targetAssignmentMachine != null) {
Material type =
block.getType();
Material type = block.getType();
if (isIgnoredTargetSelectionBlock(type)) {
return;
}
if (
type != Material.HOPPER
&&
type != Material.CHEST
&&
type != Material.BARREL
&& type != Material.CHEST
&& type != Material.BARREL
) {
RSMessageUtils.error(
player,
"Please select a Hopper, Chest, or Barrel."
);
return;
}
event.setCancelled(true);
@@ -183,24 +182,22 @@ public class RSConvertListener
}
Material type =
block.getType();
Material type = block.getType();
if (isIgnoredTargetSelectionBlock(type)) {
return;
}
if (
type != Material.HOPPER
&&
type != Material.CHEST
&&
type != Material.BARREL
&& type != Material.CHEST
&& type != Material.BARREL
) {
RSMessageUtils.error(
player,
"Please select a Hopper, Chest, or Barrel."
);
return;
}
event.setCancelled(true);
@@ -467,4 +464,12 @@ public class RSConvertListener
}
private boolean isIgnoredTargetSelectionBlock(Material type) {
return Tag.DOORS.isTagged(type)
|| Tag.BUTTONS.isTagged(type)
|| Tag.TRAPDOORS.isTagged(type)
|| Tag.FENCE_GATES.isTagged(type)
|| type == Material.LEVER;
}
}