Java Code Examples for org.bukkit.entity.Creeper

The following are top voted examples for showing how to use org.bukkit.entity.Creeper. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenUHC   File: BlastMining.java   View source code 6 votes vote down vote up
/**
 * Spawns a creeper or primed TNT when a player breaks an ore block, by chance.
 *
 * @param event The event
 */
@EventHandler(ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event) {
  Block block = event.getBlock();
  if (ORES.contains(block.getType())) {
    double chance = Math.random();
    Location location = block.getLocation().add(0.5, 0.5, 0.5);
    if (0.05 > chance) {
      TNTPrimed tnt = location.getWorld().spawn(location, TNTPrimed.class);
      tnt.setFuseTicks(80);
    } else if (0.1 > chance) {
      Creeper creeper = location.getWorld().spawn(location, Creeper.class);
      creeper.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 2, 2));
    }
  }
}
 
Example 2
Project: Debuggery   File: InputFormatterTest.java   View source code 6 votes vote down vote up
@Test
public void testBukkitClasses() throws InputException {
    Class[] inputTypes = {Class[].class};
    String[] input = {"Zombie,Creeper,Pig"};

    Object[] output = InputFormatter.getTypesFromInput(inputTypes, Arrays.asList(input), null);

    // First let's make sure we didn't lose anything, or get anything
    assertEquals(inputTypes.length, output.length);

    // Next let's make sure everything is the right type
    for (Object object : output) {
        assertTrue(object instanceof Class[]);
    }

    // Finally, let's make sure the values are correct
    Class[] classes = (Class[]) output[0];
    assertEquals(classes[0], Zombie.class);
    assertEquals(classes[1], Creeper.class);
    assertEquals(classes[2], Pig.class);
}
 
Example 3
Project: AsgardAscension   File: ChallengeListener.java   View source code 6 votes vote down vote up
@EventHandler
public void onExplode(EntityExplodeEvent event) {
	if(event.getEntity() instanceof Creeper) {
		Entity e = event.getEntity();
		if(e.hasMetadata("challenge")) {
			event.blockList().clear();
			String[] meta = e.getMetadata("challenge").get(0).asString().split(", ");
			final String player = meta[1];
			plugin.getChallenges().addKill(Bukkit.getPlayer(player));
			Bukkit.getPlayer(player).setLevel(plugin.getChallenges().getKillsLeft(Bukkit.getPlayer(player)));
			if(plugin.getChallenges().getKillsLeft(Bukkit.getPlayer(player)) == 0) {
				plugin.getChallenges().finishChallenge(Bukkit.getPlayer(player), false);
			}
		}
	}
}
 
Example 4
Project: BendingExp   File: DeathByBendingListener.java   View source code 6 votes vote down vote up
@EventHandler
public void onEntityBendingDeath(EntityBendingDeathEvent event) {
	Entity v = event.getVictim();
	Element e = CoreAbility.getAbility(event.getAbility()).getElement();
	int xp;
	
	if(v == null || e == null)
		return;
	
	if(v instanceof Player) {
		xp = 25 + (int)(Math.random() * ((35 - 25) + 1));
	}
	else if(v instanceof Zombie || v instanceof Creeper || v instanceof Witch || v instanceof Skeleton || v instanceof Guardian || v instanceof Spider) {
		xp = 13 + (int)(Math.random() * ((22 - 13) + 1));
	}
	else {
		xp = 3 + (int)(Math.random() * ((8 - 3) + 1));
	}
	BendingExp.addExp(event.getAttacker(), e, xp);
}
 
Example 5
Project: UberHardcore   File: CreeperDeathHandler.java   View source code 6 votes vote down vote up
@EventHandler
public void on(EntityDeathEvent event) {
    if (!(event.getEntity() instanceof Creeper)) return;

    Creeper creeper = (Creeper) event.getEntity();

    // explode after 2 seconds ticks
    ExplosionTask task = new ExplosionTask(creeper.getLocation(), creeper.isPowered() ? 6 : 3, false);
    task.runTaskLater(plugin, 40);

    // set up some layered smoke effects
    for (int i = 0; i < 5; i++) {
        // increase the count over time
        ImpendingExplosionParticleTask smoke = new ImpendingExplosionParticleTask(creeper.getLocation(), 20 * (i+1));
        smoke.runTaskLater(plugin, 10 + (i * 10));
    }
}
 
Example 6
Project: UberHardcore   File: CreeperDeathHandler.java   View source code 6 votes vote down vote up
@EventHandler
public void on(EntityDeathEvent event) {
    if (!(event.getEntity() instanceof Creeper)) return;

    Creeper creeper = (Creeper) event.getEntity();

    // explode after 2 seconds ticks
    ExplosionTask task = new ExplosionTask(creeper.getLocation(), creeper.isPowered() ? 6 : 3, false);
    task.runTaskLater(plugin, 40);

    // set up some layered smoke effects
    for (int i = 0; i < 5; i++) {
        // increase the count over time
        ImpendingExplosionParticleTask smoke = new ImpendingExplosionParticleTask(creeper.getLocation(), 20 * (i+1));
        smoke.runTaskLater(plugin, 10 + (i * 10));
    }
}
 
Example 7
Project: UberHardcore   File: CreeperDeathHandler.java   View source code 6 votes vote down vote up
@EventHandler
public void on(EntityDeathEvent event) {
    if (!(event.getEntity() instanceof Creeper)) return;

    Creeper creeper = (Creeper) event.getEntity();

    // explode after 2 seconds ticks
    ExplosionTask task = new ExplosionTask(creeper.getLocation(), creeper.isPowered() ? 6 : 3, false);
    task.runTaskLater(plugin, 40);

    // set up some layered smoke effects
    for (int i = 0; i < 5; i++) {
        // increase the count over time
        ImpendingExplosionParticleTask smoke = new ImpendingExplosionParticleTask(creeper.getLocation(), 20 * (i+1));
        smoke.runTaskLater(plugin, 10 + (i * 10));
    }
}
 
Example 8
Project: buildinggame   File: CreeperMenu.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public CreeperMenu(Plot plot, Creeper creeper) {
    super(plot, creeper);

    //powered
    ItemStack powered = new ItemStack(Material.REDSTONE);
    ItemMeta poweredMeta = powered.getItemMeta();
    poweredMeta.setDisplayName(ChatColor.GREEN + "Change whether this creeper is charged");
    powered.setItemMeta(poweredMeta);

    insertItem(powered, event -> {
        creeper.setPowered(!creeper.isPowered());

        event.setCancelled(true);
    }, 0);
}
 
Example 9
Project: AlmightyNotch   File: CreeperExplodeEvent.java   View source code 6 votes vote down vote up
@Override
public void trigger(AlmightyNotchPlugin plugin, World world) {
    PluginManager pluginManager = Bukkit.getPluginManager();
    for (LivingEntity entity : world.getLivingEntities()) {
        if (entity.getType() == EntityType.CREEPER) {
            Creeper creeper = (Creeper) entity;

            float power = creeper.isPowered() ? 6.0F : 3.0F;
            ExplosionPrimeEvent event = new ExplosionPrimeEvent(creeper, power, false);
            pluginManager.callEvent(event);
            if (!event.isCancelled()) {
                creeper.damage(creeper.getHealth());
                world.createExplosion(creeper.getLocation(), power);
            }
        }
    }
    plugin.getMessenger().sendMessage(Bukkit.getServer(), getOccurMessage());
}
 
Example 10
Project: BlockLocker   File: BlockDestroyListener.java   View source code 6 votes vote down vote up
@EventHandler(ignoreCancelled = true)
public void onEntityExplodeEvent(EntityExplodeEvent event) {
    AttackType attackType = AttackType.UNKNOWN;
    Entity attacker = event.getEntity();
    if (attacker instanceof TNTPrimed) {
        attackType = AttackType.TNT;
    } else if (attacker instanceof Creeper) {
        attackType = AttackType.CREEPER;
    } else if (attacker instanceof Fireball) {
        if (((Fireball) attacker).getShooter() instanceof Ghast) {
            attackType = AttackType.GHAST;
        }
    }
    if (plugin.getChestSettings().allowDestroyBy(attackType)) {
        return;
    }
    for (Iterator<Block> it = event.blockList().iterator(); it.hasNext();) {
        Block block = it.next();
        if (isProtected(block)) {
            it.remove();
        }
    }
}
 
Example 11
Project: Hub   File: HolyCreeperDisplayer.java   View source code 5 votes vote down vote up
@Override
public void display()
{
    Creeper creeper = this.baseLocation.getWorld().spawn(this.baseLocation.clone().add(0.0D, 5.0D, 0.0D), Creeper.class);
    creeper.setPowered(true);
    creeper.setMetadata("owner-id", new FixedMetadataValue(this.hub, this.player.getUniqueId().toString()));

    this.lovingTask = this.hub.getServer().getScheduler().runTaskTimer(this.hub, () ->
    {
        if (!creeper.isDead())
            ParticleEffect.HEART.display(0.25F, 0.5F, 0.25F, 1.0F, 6, creeper.getLocation(), 20.0D);
    }, 5L, 5L);
}
 
Example 12
Project: Hub   File: HolyCreeperDisplayer.java   View source code 5 votes vote down vote up
private void explode(Creeper creeper)
{
    this.lovingTask.cancel();

    Location flowerSpawnLocation = creeper.getLocation().clone().add(0.0D, 1.5D, 0.0D);

    for (int i = 0; i < 64; i++)
    {
        ItemStack redDye = new ItemStack(Material.INK_SACK, 1, (short) 1);
        Item item = this.player.getWorld().dropItemNaturally(flowerSpawnLocation, redDye);
        item.setVelocity(new Vector(GadgetManager.RANDOM.nextInt(2) - 1, 1.5, GadgetManager.RANDOM.nextInt(2) - 1));

        try
        {
            GadgetManager.AGE_FIELD.set((((CraftItem) item).getHandle()), 5500);
        }
        catch (IllegalAccessException e)
        {
            e.printStackTrace();
        }
    }

    creeper.getWorld().strikeLightningEffect(creeper.getLocation());
    creeper.getWorld().createExplosion(creeper.getLocation().getX(), (creeper.getLocation().getY() + 2.0D), creeper.getLocation().getZ(), 2.5F, false, false);
    creeper.remove();

    HeartEffect heartEffect = new HeartEffect(this.hub.getCosmeticManager().getParticleManager().getEffectManager());
    heartEffect.particle = de.slikey.effectlib.util.ParticleEffect.HEART;
    heartEffect.setLocation(flowerSpawnLocation.clone().add(0.0D, 1.5D, 0.0D));
    heartEffect.start();

    this.end();
}
 
Example 13
Project: Skript   File: ExprSkull.java   View source code 5 votes vote down vote up
@Override
@Nullable
public ItemType convert(final Object o) {
	final SkullType type;
	if (o instanceof Skeleton || o instanceof SkeletonData) {
		if (o instanceof SkeletonData ? ((SkeletonData) o).isWither() : ((Skeleton) o).getSkeletonType() == SkeletonType.WITHER) {
			type = SkullType.WITHER;
		} else {
			type = SkullType.SKELETON;
		}
	} else if (o instanceof Zombie || o instanceof EntityData && Zombie.class.isAssignableFrom(((EntityData<?>) o).getType())) {
		type = SkullType.ZOMBIE;
	} else if (o instanceof OfflinePlayer || o instanceof PlayerData) {
		type = SkullType.PLAYER;
	} else if (o instanceof Creeper || o instanceof CreeperData) {
		type = SkullType.CREEPER;
	} else {
		return null;
	}
	@SuppressWarnings("deprecation")
	final ItemType i = new ItemType(Material.SKULL_ITEM.getId(), (short) type.ordinal());
	if (o instanceof OfflinePlayer) {
		final SkullMeta s = (SkullMeta) Bukkit.getItemFactory().getItemMeta(Material.SKULL_ITEM);
		s.setOwner(((OfflinePlayer) o).getName());
		i.setItemMeta(s);
	}
	return i;
}
 
Example 14
Project: Pokkit   File: EntityEvents.java   View source code 5 votes vote down vote up
@EventHandler(ignoreCancelled = false)
public void onCreeperPower(cn.nukkit.event.entity.CreeperPowerEvent event) {
	if (canIgnore(CreeperPowerEvent.getHandlerList())) {
		return;
	}

	PowerCause cause = PowerCause.valueOf(event.getCause().name()); // Dirty and fast conversion

	CreeperPowerEvent bukkitEvent = new CreeperPowerEvent((Creeper) PokkitEntity.toBukkit(event.getEntity()), cause);

	callCancellable(event, bukkitEvent);
}
 
Example 15
Project: BloodMoon   File: SuperCreepersListener.java   View source code 5 votes vote down vote up
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onStart(BloodMoonStartEvent event) {
    World world = event.getWorld();
    PluginConfig worldConfig = plugin.getConfig(world);

    if (plugin.isFeatureEnabled(world, Feature.SUPER_CREEPERS) && worldConfig.getBoolean(Config.FEATURE_SUPER_CREEPERS_LIGHTNING)) {
        for (LivingEntity entity : world.getLivingEntities()) {
            if (entity.getType() == EntityType.CREEPER) {
                ((Creeper) entity).setPowered(true);
            }
        }
    }
}
 
Example 16
Project: BloodMoon   File: SuperCreepersListener.java   View source code 5 votes vote down vote up
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onStop(BloodMoonEndEvent event) {
    World world = event.getWorld();
    PluginConfig worldConfig = plugin.getConfig(world);

    if (plugin.isFeatureEnabled(world, Feature.SUPER_CREEPERS) && worldConfig.getBoolean(Config.FEATURE_SUPER_CREEPERS_LIGHTNING)) {
        for (LivingEntity entity : world.getLivingEntities()) {
            if (entity.getType() == EntityType.CREEPER) {
                ((Creeper) entity).setPowered(false);
            }
        }
    }
}
 
Example 17
Project: BloodMoon   File: SuperCreepersListener.java   View source code 5 votes vote down vote up
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onCreatureSpawn(CreatureSpawnEvent event) {
    LivingEntity entity = event.getEntity();
    World world = entity.getWorld();
    PluginConfig worldConfig = plugin.getConfig(world);

    if (entity.getType() == EntityType.CREEPER && plugin.isActive(world) && plugin.isFeatureEnabled(world, Feature.SUPER_CREEPERS) && worldConfig.getBoolean(Config.FEATURE_SUPER_CREEPERS_LIGHTNING)) {
        ((Creeper) entity).setPowered(true);
    }
}
 
Example 18
Project: RpgPlus   File: EntityWrapperTest.java   View source code 5 votes vote down vote up
private void mockDamagableEntity() {
    //create a mocked, minimal creeper
    entity = mock(Creeper.class);
    assumeTrue(entity instanceof Damageable);
    managedEntity = mock(RpgPlusEntity.class);
    when(managedEntity.getEntity()).thenReturn(entity);
}
 
Example 19
Project: uSkyBlock   File: GriefEvents.java   View source code 5 votes vote down vote up
@EventHandler
public void onCreeperExplode(ExplosionPrimeEvent event) {
    if (!creeperEnabled || !plugin.isSkyWorld(event.getEntity().getWorld())) {
        return;
    }
    if (event.getEntity() instanceof Creeper
        && !isValidTarget(((Creeper)event.getEntity()).getTarget()))
    {
        event.setCancelled(true);
    } else if (event.getEntity() instanceof TNTPrimed
        && !isValidTarget(((TNTPrimed) event.getEntity()).getSource())) {
        event.setCancelled(true);
    }
}
 
Example 20
Project: Creepocalypse   File: Creepocalypse.java   View source code 5 votes vote down vote up
/**
 * On creeper death, drop fireworks and heads with a configurable chance.
 */
@EventHandler(ignoreCancelled = true)
public void onCreeperDeath(EntityDeathEvent event) {
    if (!CONFIG.isAffectedWorld(event)) {
        return;
    }

    Entity entity = event.getEntity();
    if (entity.getType() == EntityType.CREEPER && entity.hasMetadata(SPECIAL_KEY)) {
        Creeper creeper = (Creeper) entity;

        // Require recent player damage on the creeper for special drops.
        Long damageTime = getPlayerDamageTime(entity);
        if (damageTime != null) {
            Location loc = creeper.getLocation();
            if (loc.getWorld().getFullTime() - damageTime < PLAYER_DAMAGE_TICKS) {
                if (Math.random() < CONFIG.FIREWORK_DROP_CHANCE) {
                    // Replace the default drops.
                    event.getDrops().clear();
                    final int amount = random(CONFIG.MIN_FIREWORK_DROPS, CONFIG.MAX_FIREWORK_DROPS);
                    for (int i = 0; i < amount; ++i) {
                        ItemStack firework = new ItemStack(Material.FIREWORK);
                        FireworkMeta meta = (FireworkMeta) firework.getItemMeta();
                        meta.setPower(random(0, 3));
                        meta.addEffect(randomFireworkFffect(false));
                        firework.setItemMeta(meta);
                        event.getDrops().add(firework);
                    }
                }

                // Powered creepers may drop a creeper skull in addition to
                // fireworks.
                if (creeper.isPowered() && Math.random() < CONFIG.CHARGED_CREEPER_SKULL_CHANCE) {
                    event.getDrops().add(new ItemStack(Material.SKULL_ITEM, 1, (short) 4));
                }
            }
        }
    }
}
 
Example 21
Project: Creepocalypse   File: Creepocalypse.java   View source code 5 votes vote down vote up
/**
 * When a creeper explodes, reinforcements are launched from him with random
 * velocities by this method.
 * 
 * Reinforcements are always launched at a 45 degree angle, a configurable
 * range from the exploding creeper.
 * 
 * @param creeper the exploding creeper.
 */
protected void launchReinforcements(Entity creeper) {
    final int numReinforcements = random(CONFIG.MIN_REINFORCEMENTS, CONFIG.MAX_REINFORCEMENTS);
    for (int i = 0; i < numReinforcements; ++i) {
        // Compute unit velocity vector components, given 45 degree pitch.
        double yaw = 2.0 * Math.PI * Math.random();
        double y = INV_ROOT_2;
        double x = INV_ROOT_2 * Math.cos(yaw);
        double z = INV_ROOT_2 * Math.sin(yaw);

        // Spawn one reinforcement.
        Location origin = creeper.getLocation();
        World world = origin.getWorld();
        Location loc = origin.clone().add(CONFIG.REINFORCEMENT_RANGE * x, 0.5, CONFIG.REINFORCEMENT_RANGE * z);
        Creeper reinforcement = (Creeper) world.spawnEntity(loc, EntityType.CREEPER);
        if (reinforcement != null) {
            reinforcement.setMetadata(SPECIAL_KEY, SPECIAL_META);

            double speed = random(CONFIG.MIN_REINFORCEMENT_SPEED, CONFIG.MAX_REINFORCEMENT_SPEED);
            Vector velocity = new Vector(speed * x, speed * y, speed * z);
            reinforcement.setVelocity(velocity);

            // Randomly charge a fraction of creepers.
            if (Math.random() < CONFIG.CHARGED_CHANCE) {
                reinforcement.setPowered(true);
            }
        }
    }
}
 
Example 22
Project: ObsidianDestroyer   File: MaterialManager.java   View source code 5 votes vote down vote up
/**
 * Returns the amount of damage done to the material by an entity
 *
 * @param entity   the entity that is involved in damaging
 * @param material the name of the material to lookup
 * @param data
 * @return amount of damage done
 */
public int getDamageTypeAmount(Entity entity, String material, int data) {
    material = getMaterialName(material, data);
    if (durabilityMaterials.containsKey(material)) {
        EntityType eventTypeRep = entity.getType();
        switch (eventTypeRep) {
            case PRIMED_TNT:
                return durabilityMaterials.get(material).getTntDamage();
            case SNOWBALL:
                return 0;
            case CREEPER:
                Creeper creeper = (Creeper) entity;
                return creeper.isPowered() ? durabilityMaterials.get(material).getChargedCreeperDamage() : durabilityMaterials.get(material).getCreepersDamage();
            case WITHER:
            case WITHER_SKULL:
                return durabilityMaterials.get(material).getWithersDamage();
            case MINECART_TNT:
                return durabilityMaterials.get(material).getTntMinecartsDamage();
            case FIREBALL:
            case SMALL_FIREBALL:
            case GHAST:
                return durabilityMaterials.get(material).getGhastsDamage();
            case BAT:
                return durabilityMaterials.get(material).getNullDamage();
            default:
                break;
        }
    }
    return 1;
}
 
Example 23
Project: Bytecraft   File: BytecraftBlockListener.java   View source code 5 votes vote down vote up
@EventHandler
public void onExplode(EntityExplodeEvent event)
{
    if (event.getEntity() instanceof Creeper) {
        event.setCancelled(true);
        return;
    }
    else if (event.getEntityType() == EntityType.PRIMED_TNT) {
        event.setCancelled(true);
    }
}
 
Example 24
Project: ce   File: Headless.java   View source code 5 votes vote down vote up
@Override
public void effect(Event e, ItemStack item, int level) {
    EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) e;
    final Player player = (Player) event.getDamager();
    final LivingEntity ent = (LivingEntity) event.getEntity();

    new BukkitRunnable() {
        @Override
        public void run() {

            if (ent.getHealth() <= 0) {
                byte type = 3;

                if (ent instanceof Skeleton) {
                    type = 0;
                    if (((Skeleton) ent).getSkeletonType().equals(SkeletonType.WITHER))
                        type = 1;
                } else if (ent instanceof Zombie)
                    type = 2;
                else if (ent instanceof Creeper)
                    type = 4;

                ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, type);
                if (type == 3) {
                    SkullMeta sm = (SkullMeta) skull.getItemMeta();
                    sm.setOwner(ent.getName());
                    skull.setItemMeta(sm);
                }
                ent.getWorld().dropItem(ent.getLocation(), skull);
                EffectManager.playSound(player.getLocation(), "BLOCK_ANVIL_LAND", 0.1f, 1.5f);
            }
        }
    }.runTaskLater(getPlugin(), 5l);

}
 
Example 25
Project: Uranium   File: CraftEventFactory.java   View source code 4 votes vote down vote up
public static CreeperPowerEvent callCreeperPowerEvent(net.minecraft.entity.Entity creeper, net.minecraft.entity.Entity lightning, CreeperPowerEvent.PowerCause cause) {
    CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
    creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 26
Project: bskyblock   File: IslandGuard.java   View source code 4 votes vote down vote up
/**
 * Prevents the breakage of hanging items
 *
 * @param e
 */
@EventHandler(priority = EventPriority.LOW)
public void onBreakHanging(final HangingBreakByEntityEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
        plugin.getLogger().info(e.getRemover().toString());
    }
    if (Util.inWorld(e.getEntity())) {
        if ((e.getRemover() instanceof Creeper) && !Settings.allowCreeperDamage) {
            e.setCancelled(true);
            return;
        }
        // Check if creeper griefing is allowed
        if ((e.getRemover() instanceof Creeper) && !Settings.allowCreeperGriefing) {
            // Find out who the creeper was targeting
            Creeper creeper = (Creeper)e.getRemover();
            if (creeper.getTarget() instanceof Player) {
                Player target = (Player)creeper.getTarget();
                // Check if the target is on their own island or not
                if (!plugin.getIslands().locationIsOnIsland(target, e.getEntity().getLocation())) {
                    // They are a visitor tsk tsk
                    e.setCancelled(true);
                    return;
                }
            }
            // Check if this creeper was lit by a visitor
            if (litCreeper.contains(creeper.getUniqueId())) {
                if (DEBUG) {
                    plugin.getLogger().info("DBEUG: preventing creeper from damaging");
                }
                e.setCancelled(true);
                return;
            }
        }
        if (e.getRemover() instanceof Player) {
            Player p = (Player) e.getRemover();
            // This permission bypasses protection
            if (p.isOp() || VaultHelper.hasPerm(p, Settings.PERMPREFIX + "mod.bypassprotect")) {
                return;
            }
            if (actionAllowed(p,e.getEntity().getLocation(),SettingsFlag.BREAK_BLOCKS)) {
                return;
            }
            // Not allowed
            Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
            e.setCancelled(true);
        }
    }
}
 
Example 27
Project: Hub   File: HolyCreeperDisplayer.java   View source code 4 votes vote down vote up
@Override
public void handleInteraction(Entity who, Entity with)
{
    if (with instanceof Creeper)
        this.explode((Creeper) with);
}
 
Example 28
Project: Skript   File: CreeperData.java   View source code 4 votes vote down vote up
@Override
protected boolean init(final @Nullable Class<? extends Creeper> c, final @Nullable Creeper e) {
	powered = e == null ? 0 : e.isPowered() ? 1 : -1;
	return true;
}
 
Example 29
Project: Skript   File: CreeperData.java   View source code 4 votes vote down vote up
@Override
public void set(final Creeper c) {
	if (powered != 0)
		c.setPowered(powered == 1);
}
 
Example 30
Project: Skript   File: CreeperData.java   View source code 4 votes vote down vote up
@Override
public boolean match(final Creeper entity) {
	return powered == 0 || entity.isPowered() == (powered == 1);
}
 
Example 31
Project: Skript   File: CreeperData.java   View source code 4 votes vote down vote up
@Override
public Class<Creeper> getType() {
	return Creeper.class;
}
 
Example 32
Project: ThermosRebased   File: CraftEventFactory.java   View source code 4 votes vote down vote up
public static CreeperPowerEvent callCreeperPowerEvent(net.minecraft.entity.Entity creeper, net.minecraft.entity.Entity lightning, CreeperPowerEvent.PowerCause cause) {
    CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
    creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 33
Project: Thermos-Bukkit   File: CreeperPowerEvent.java   View source code 4 votes vote down vote up
public CreeperPowerEvent(final Creeper creeper, final LightningStrike bolt, final PowerCause cause) {
    this(creeper, cause);
    this.bolt = bolt;
}
 
Example 34
Project: Thermos-Bukkit   File: CreeperPowerEvent.java   View source code 4 votes vote down vote up
public CreeperPowerEvent(final Creeper creeper, final PowerCause cause) {
    super(creeper);
    this.cause = cause;
}
 
Example 35
Project: Thermos-Bukkit   File: CreeperPowerEvent.java   View source code 4 votes vote down vote up
@Override
public Creeper getEntity() {
    return (Creeper) entity;
}
 
Example 36
Project: SonarPet   File: EntityCreeperPet.java   View source code 4 votes vote down vote up
@Override
public Creeper getBukkitEntity() {
    return (Creeper) super.getBukkitEntity();
}
 
Example 37
Project: Thermos   File: CraftEventFactory.java   View source code 4 votes vote down vote up
public static CreeperPowerEvent callCreeperPowerEvent(net.minecraft.entity.Entity creeper, net.minecraft.entity.Entity lightning, CreeperPowerEvent.PowerCause cause) {
    CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
    creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 38
Project: KCauldron   File: CraftEventFactory.java   View source code 4 votes vote down vote up
public static CreeperPowerEvent callCreeperPowerEvent(net.minecraft.entity.Entity creeper, net.minecraft.entity.Entity lightning, CreeperPowerEvent.PowerCause cause) {
    CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
    creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 39
Project: CauldronGit   File: CreeperPowerEvent.java   View source code 4 votes vote down vote up
public CreeperPowerEvent(final Creeper creeper, final LightningStrike bolt, final PowerCause cause) {
    this(creeper, cause);
    this.bolt = bolt;
}
 
Example 40
Project: CauldronGit   File: CreeperPowerEvent.java   View source code 4 votes vote down vote up
public CreeperPowerEvent(final Creeper creeper, final PowerCause cause) {
    super(creeper);
    this.cause = cause;
}