Fix tnt spawning on redstone sources
Dieser Commit ist enthalten in:
Ursprung
7be5700359
Commit
709e6f11dc
@ -20,7 +20,10 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.commands;
|
package de.steamwar.bausystem.commands;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.world.Region;
|
import de.steamwar.bausystem.world.Region;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.*;
|
import org.bukkit.event.block.*;
|
||||||
@ -65,15 +68,21 @@ public class CommandFreeze extends RegionToggleCommand {
|
|||||||
if (!region.isFreeze()) {
|
if (!region.isFreeze()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.getEntityType() == EntityType.FALLING_BLOCK) {
|
e.setCancelled(true);
|
||||||
e.setCancelled(true);
|
if (e.getEntityType() == EntityType.PRIMED_TNT) {
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> {
|
||||||
|
e.getLocation().getBlock().setType(Material.TNT, false);
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
}, () -> {
|
}, () -> {
|
||||||
if (!Region.NoRegion.freeze) {
|
if (!Region.NoRegion.freeze) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.getEntityType() == EntityType.FALLING_BLOCK) {
|
e.setCancelled(true);
|
||||||
e.setCancelled(true);
|
if (e.getEntityType() == EntityType.PRIMED_TNT) {
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> {
|
||||||
|
e.getLocation().getBlock().setType(Material.TNT, false);
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren