Add Region section Support for /tnt /fire /freeze #168
@ -25,6 +25,7 @@ import de.steamwar.bausystem.world.Region;
|
|||||||
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.*;
|
||||||
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||||
|
|
||||||
@ -78,6 +79,15 @@ public class CommandFreeze extends RegionToggleCommand {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onEntityChangeBlock(EntityChangeBlockEvent e) {
|
||||||
|
Region.getRegion(e.getBlock().getLocation(), region -> {
|
||||||
|
if (region.isFreeze()) e.setCancelled(true);
|
||||||
|
}, () -> {
|
||||||
|
if (Region.NoRegion.freeze) e.setCancelled(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPhysicsEvent(BlockPhysicsEvent e){
|
public void onPhysicsEvent(BlockPhysicsEvent e){
|
||||||
Region.getRegion(e.getBlock().getLocation(), region -> {
|
Region.getRegion(e.getBlock().getLocation(), region -> {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren