Java Code Examples for cn.nukkit.event.entity.CreeperPowerEvent#isCancelled()
The following examples show how to use
cn.nukkit.event.entity.CreeperPowerEvent#isCancelled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityCreeper.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public void setPowered(EntityLightningStrike bolt) { CreeperPowerEvent ev = new CreeperPowerEvent(this, bolt, CreeperPowerEvent.PowerCause.LIGHTNING); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, 1)); this.namedTag.putBoolean("powered", true); } }
Example 2
Source File: EntityCreeper.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public void setPowered(boolean powered) { CreeperPowerEvent ev = new CreeperPowerEvent(this, powered ? CreeperPowerEvent.PowerCause.SET_ON : CreeperPowerEvent.PowerCause.SET_OFF); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, powered ? 1 : 0)); this.namedTag.putBoolean("powered", powered); } }
Example 3
Source File: EntityCreeper.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public void setPowered(EntityLightningStrike bolt) { CreeperPowerEvent ev = new CreeperPowerEvent(this, bolt, CreeperPowerEvent.PowerCause.LIGHTNING); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, 1)); this.namedTag.putBoolean("powered", true); } }
Example 4
Source File: EntityCreeper.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public void setPowered(boolean powered) { CreeperPowerEvent ev = new CreeperPowerEvent(this, powered ? CreeperPowerEvent.PowerCause.SET_ON : CreeperPowerEvent.PowerCause.SET_OFF); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, powered ? 1 : 0)); this.namedTag.putBoolean("powered", powered); } }
Example 5
Source File: EntityCreeper.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public void setPowered(EntityLightningStrike bolt) { CreeperPowerEvent ev = new CreeperPowerEvent(this, bolt, CreeperPowerEvent.PowerCause.LIGHTNING); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, 1)); this.namedTag.putBoolean("powered", true); } }
Example 6
Source File: EntityCreeper.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public void setPowered(boolean powered) { CreeperPowerEvent ev = new CreeperPowerEvent(this, powered ? CreeperPowerEvent.PowerCause.SET_ON : CreeperPowerEvent.PowerCause.SET_OFF); this.getServer().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.setDataProperty(new ByteEntityData(DATA_POWERED, powered ? 1 : 0)); this.namedTag.putBoolean("powered", powered); } }