SteamWar/BauSystem2.0
Archiviert
12
0

Fix TNTListener not igniting other tnt

Dieser Commit ist enthalten in:
yoyosource 2021-05-01 12:00:01 +02:00
Ursprung b63c388523
Commit bb64d0021e

Datei anzeigen

@ -8,7 +8,7 @@ import de.steamwar.bausystem.region.flags.Flag;
import de.steamwar.bausystem.region.flags.flagvalues.TNTMode; import de.steamwar.bausystem.region.flags.flagvalues.TNTMode;
import de.steamwar.bausystem.region.utils.RegionExtensionType; import de.steamwar.bausystem.region.utils.RegionExtensionType;
import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.bausystem.region.utils.RegionType;
import org.bukkit.block.data.type.TNT; import org.bukkit.Material;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
@ -19,6 +19,9 @@ public class TNTListener implements Listener {
@EventHandler @EventHandler
public void onExplode(EntityExplodeEvent event) { public void onExplode(EntityExplodeEvent event) {
event.blockList().removeIf(block -> { event.blockList().removeIf(block -> {
if (block.getType() == Material.TNT) {
return false;
}
Region region = Region.getRegion(block.getLocation()); Region region = Region.getRegion(block.getLocation());
TNTMode value = region.getPlain(Flag.TNT); TNTMode value = region.getPlain(Flag.TNT);
if (value == TNTMode.ALLOW) { if (value == TNTMode.ALLOW) {