Search in sources :

Example 1 with CreeperPowerEvent

use of org.bukkit.event.entity.CreeperPowerEvent in project WindSpigot by Wind-Development.

the class CraftCreeper method setPowered.

@Override
public void setPowered(boolean powered) {
    CraftServer server = this.server;
    Creeper entity = (Creeper) this.getHandle().getBukkitEntity();
    if (powered) {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_ON);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(true);
        }
    } else {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(false);
        }
    }
}
Also used : EntityCreeper(net.minecraft.server.EntityCreeper) Creeper(org.bukkit.entity.Creeper) CreeperPowerEvent(org.bukkit.event.entity.CreeperPowerEvent) CraftServer(org.bukkit.craftbukkit.CraftServer)

Example 2 with CreeperPowerEvent

use of org.bukkit.event.entity.CreeperPowerEvent in project Magma by magmafoundation.

the class CraftCreeper method setPowered.

public void setPowered(boolean powered) {
    CraftServer server = this.server;
    Creeper entity = (Creeper) this.getHandle().getBukkitEntity();
    if (powered) {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_ON);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(true);
        }
    } else {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(false);
        }
    }
}
Also used : EntityCreeper(net.minecraft.entity.monster.EntityCreeper) Creeper(org.bukkit.entity.Creeper) CreeperPowerEvent(org.bukkit.event.entity.CreeperPowerEvent) CraftServer(org.bukkit.craftbukkit.v1_12_R1.CraftServer)

Example 3 with CreeperPowerEvent

use of org.bukkit.event.entity.CreeperPowerEvent in project NachoSpigot by CobbleSword.

the class CraftCreeper method setPowered.

public void setPowered(boolean powered) {
    CraftServer server = this.server;
    Creeper entity = (Creeper) this.getHandle().getBukkitEntity();
    if (powered) {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_ON);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(true);
        }
    } else {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(false);
        }
    }
}
Also used : EntityCreeper(net.minecraft.server.EntityCreeper) Creeper(org.bukkit.entity.Creeper) CreeperPowerEvent(org.bukkit.event.entity.CreeperPowerEvent) CraftServer(org.bukkit.craftbukkit.CraftServer)

Example 4 with CreeperPowerEvent

use of org.bukkit.event.entity.CreeperPowerEvent in project CumServerPro by MCUmbrella.

the class CraftCreeper method setPowered.

public void setPowered(boolean powered) {
    CraftServer server = this.server;
    Creeper entity = (Creeper) this.getHandle().getBukkitEntity();
    if (powered) {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_ON);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(true);
        }
    } else {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(false);
        }
    }
}
Also used : EntityCreeper(net.minecraft.entity.monster.EntityCreeper) Creeper(org.bukkit.entity.Creeper) CreeperPowerEvent(org.bukkit.event.entity.CreeperPowerEvent) CraftServer(org.bukkit.craftbukkit.CraftServer)

Example 5 with CreeperPowerEvent

use of org.bukkit.event.entity.CreeperPowerEvent in project Magma-1.16.x by magmafoundation.

the class CraftCreeper method setPowered.

@Override
public void setPowered(boolean powered) {
    CraftServer server = this.server;
    Creeper entity = (Creeper) this.getHandle().getBukkitEntity();
    if (powered) {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_ON);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(true);
        }
    } else {
        CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
        server.getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            getHandle().setPowered(false);
        }
    }
}
Also used : Creeper(org.bukkit.entity.Creeper) CreeperPowerEvent(org.bukkit.event.entity.CreeperPowerEvent) CraftServer(org.bukkit.craftbukkit.v1_16_R3.CraftServer)

Aggregations

CreeperPowerEvent (org.bukkit.event.entity.CreeperPowerEvent)10 Creeper (org.bukkit.entity.Creeper)6 CraftServer (org.bukkit.craftbukkit.CraftServer)3 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)2 EntityCreeper (net.minecraft.server.EntityCreeper)2 CraftServer (org.bukkit.craftbukkit.v1_16_R3.CraftServer)2 CraftServer (org.bukkit.craftbukkit.v1_12_R1.CraftServer)1