SteamWar/BauSystem
Archiviert
13
0

Remove Redstone ore activation while freezed

Dieser Commit ist enthalten in:
jojo 2021-01-26 11:20:42 +01:00
Ursprung ddcbec834e
Commit 2d068abe32

Datei anzeigen

@ -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 -> {