SteamWar/BauSystem2.0
Archiviert
12
0

Hotfix FreezeListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-09-18 14:59:55 +02:00
Ursprung 0cf588784d
Commit 0f4924c9e8

Datei anzeigen

@ -13,6 +13,7 @@ import org.bukkit.block.Block;
import org.bukkit.block.data.type.Switch;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.EntityChangeBlockEvent;
@ -103,13 +104,14 @@ public class FreezeListener implements Listener {
}
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockBreak(BlockBreakEvent e) {
if (Core.getVersion() < 19) return;
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return;
if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
if (e.isCancelled()) return;
e.setCancelled(true);
e.getBlock().setType(Material.AIR, false);
e.getBlock().setType(e.getBlock().getType(), false);
}
}