Search in sources :

Example 61 with BuildWorld

use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by Trichtern.

the class BlockPhysicsListener method onEntityExplode.

@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
    Location location = event.getLocation();
    World bukkitWorld = location.getWorld();
    BuildWorld buildWorld = worldManager.getBuildWorld(bukkitWorld.getName());
    if (buildWorld != null && !buildWorld.isExplosions()) {
        event.setCancelled(true);
    }
}
Also used : BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) World(org.bukkit.World) BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) Location(org.bukkit.Location) EventHandler(org.bukkit.event.EventHandler)

Example 62 with BuildWorld

use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by Trichtern.

the class BlockPhysicsListener method onLeavesDecay.

@EventHandler
public void onLeavesDecay(LeavesDecayEvent event) {
    Block block = event.getBlock();
    BuildWorld buildWorld = worldManager.getBuildWorld(block.getWorld().getName());
    if (buildWorld != null && !buildWorld.isPhysics()) {
        event.setCancelled(true);
    }
}
Also used : BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) Block(org.bukkit.block.Block) EventHandler(org.bukkit.event.EventHandler)

Example 63 with BuildWorld

use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by Trichtern.

the class BlockPhysicsListener method onBlockForm.

@EventHandler
public void onBlockForm(BlockFormEvent event) {
    Block block = event.getBlock();
    BuildWorld buildWorld = worldManager.getBuildWorld(block.getWorld().getName());
    if (buildWorld != null && !buildWorld.isPhysics()) {
        event.setCancelled(true);
    }
}
Also used : BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) Block(org.bukkit.block.Block) EventHandler(org.bukkit.event.EventHandler)

Example 64 with BuildWorld

use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by Trichtern.

the class BlockPhysicsListener method onBlockGrow.

@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
    Block block = event.getBlock();
    BuildWorld buildWorld = worldManager.getBuildWorld(block.getWorld().getName());
    if (buildWorld != null && !buildWorld.isPhysics()) {
        event.setCancelled(true);
    }
}
Also used : BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) Block(org.bukkit.block.Block) EventHandler(org.bukkit.event.EventHandler)

Example 65 with BuildWorld

use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by Trichtern.

the class BlockPhysicsListener method onBlockExplode.

@EventHandler
public void onBlockExplode(BlockExplodeEvent event) {
    Block block = event.getBlock();
    World bukkitWorld = block.getWorld();
    BuildWorld buildWorld = worldManager.getBuildWorld(bukkitWorld.getName());
    if (buildWorld != null && !buildWorld.isExplosions()) {
        event.setCancelled(true);
    }
}
Also used : BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) Block(org.bukkit.block.Block) World(org.bukkit.World) BuildWorld(com.eintosti.buildsystem.object.world.BuildWorld) EventHandler(org.bukkit.event.EventHandler)

Aggregations

BuildWorld (com.eintosti.buildsystem.object.world.BuildWorld)143 EventHandler (org.bukkit.event.EventHandler)58 Player (org.bukkit.entity.Player)52 World (org.bukkit.World)40 Block (org.bukkit.block.Block)20 ItemStack (org.bukkit.inventory.ItemStack)18 XMaterial (com.cryptomorin.xseries.XMaterial)16 PlayerChatInput (com.eintosti.buildsystem.util.external.PlayerChatInput)16 UUID (java.util.UUID)14 Location (org.bukkit.Location)14 File (java.io.File)12 ArrayList (java.util.ArrayList)9 BuildSystem (com.eintosti.buildsystem.BuildSystem)6 Builder (com.eintosti.buildsystem.object.world.Builder)6 List (java.util.List)6 Bukkit (org.bukkit.Bukkit)6 Material (org.bukkit.Material)6 ChunkGenerator (org.bukkit.generator.ChunkGenerator)6 Inventory (org.bukkit.inventory.Inventory)6 ItemMeta (org.bukkit.inventory.meta.ItemMeta)6