SteamWar/BauSystem2.0
Archiviert
12
0

Fix SmartPlaceListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-12-22 14:57:54 +01:00
Ursprung 927ce1f495
Commit 8da1fdac58

Datei anzeigen

@ -39,6 +39,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import java.io.OutputStream;
import java.io.PrintStream;
@ -100,7 +101,14 @@ public class SmartPlaceListener implements Plain, Listener {
if (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) {
shouldSneak = true;
}
if (!CONTAINERS.contains(block.getType())) {
if (CONTAINERS.contains(block.getType())) {
ItemStack itemStack = player.getInventory().getItemInMainHand();
if (itemStack.getType() == Material.TNT) {
if (block.getType() == Material.CHEST || block.getType() == Material.BARREL || block.getType().name().endsWith("SHULKER_BOX")) {
shouldSneak = false;
}
}
} else {
shouldSneak = false;
}
if (IGNORED.contains(block.getType())) {