当前位置: 首页>>代码示例>>Java>>正文


Java LightningStrike类代码示例

本文整理汇总了Java中org.bukkit.entity.LightningStrike的典型用法代码示例。如果您正苦于以下问题:Java LightningStrike类的具体用法?Java LightningStrike怎么用?Java LightningStrike使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LightningStrike类属于org.bukkit.entity包,在下文中一共展示了LightningStrike类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: strike

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public LightningStrike strike(Location loc, boolean effect) {
	BaseFullChunk chunk = nukkit.getChunk(loc.getChunk().getX(), loc.getChunk().getZ());
       int x = loc.getBlockX();
       int z = loc.getBlockZ();
       int y = loc.getBlockY();
       int bId = nukkit.getBlockIdAt(x, y, z);
       if (bId != cn.nukkit.block.Block.TALL_GRASS && bId != cn.nukkit.block.Block.WATER)
           y += 1;
       CompoundTag nbt = new CompoundTag()
               .putList(new ListTag<DoubleTag>("Pos").add(new DoubleTag("", x))
                       .add(new DoubleTag("", y)).add(new DoubleTag("", z)))
               .putList(new ListTag<DoubleTag>("Motion").add(new DoubleTag("", 0))
                       .add(new DoubleTag("", 0)).add(new DoubleTag("", 0)))
               .putList(new ListTag<FloatTag>("Rotation").add(new FloatTag("", 0))
                       .add(new FloatTag("", 0)));

       EntityLightning bolt = new EntityLightning(chunk, nbt);
       bolt.setEffect(effect);
       bolt.spawnToAll();
       return PokkitEntityLightningStrike.toBukkit(bolt);
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:22,代码来源:PokkitWorld.java

示例2: toBukkit

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public static LightningStrike toBukkit(cn.nukkit.entity.Entity nukkit) {
	if (nukkit == null) {
		return null;
	}
	if (!(nukkit instanceof EntityLightningStrike)) {
		return null;
	}
	
	return new PokkitEntityLightningStrike(nukkit);
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:11,代码来源:PokkitEntityLightningStrike.java

示例3: strikeLightning

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@Override
public LightningStrike strikeLightning(final Location loc) {
    return TaskManager.IMP.sync(new RunnableVal<LightningStrike>() {
        @Override
        public void run(LightningStrike value) {
            this.value = parent.strikeLightning(loc);
        }
    });
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:10,代码来源:AsyncWorld.java

示例4: strikeLightningEffect

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@Override
public LightningStrike strikeLightningEffect(final Location loc) {
    return TaskManager.IMP.sync(new RunnableVal<LightningStrike>() {
        @Override
        public void run(LightningStrike value) {
            this.value = parent.strikeLightningEffect(loc);
        }
    });
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:10,代码来源:AsyncWorld.java

示例5: canDodge

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public boolean canDodge(Entity damager) {
    if (Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.DODGE)) {
        if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) {
            return false;
        }

        return skill.shouldProcess(damager);
    }

    return false;
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:12,代码来源:AcrobaticsManager.java

示例6: onPlayerDeath

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)
public void onPlayerDeath(EntityDamageByEntityEvent event) {
	if (event.getEntity() instanceof Player && 
			event.getDamager() instanceof LightningStrike &&
			strikeID.containsKey(event.getDamager().getEntityId()) &&
			((Player)event.getEntity()).getHealth() - event.getDamage() <= 0 &&
			Bukkit.getServer().getPlayer(strikeID.get(event.getDamager().getEntityId())) != null) {
		event.setCancelled(true);
		((Player)event.getEntity()).damage(event.getDamage(), Bukkit.getPlayer(strikeID.get(event.getDamager().getEntityId())));
	}
}
 
开发者ID:EvilKanoa,项目名称:RodsTwo,代码行数:12,代码来源:Lightning.java

示例7: onEntityDamageByEntity

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
	if (event.getEntity() instanceof Player && 
			event.getDamager() instanceof LightningStrike &&
			strikeID.containsKey(event.getDamager().getEntityId()) &&
			strikeID.get(event.getDamager().getEntityId()).equalsIgnoreCase(((Player) event.getEntity()).getName()))
		event.setCancelled(true);
		
}
 
开发者ID:EvilKanoa,项目名称:RodsTwo,代码行数:10,代码来源:Lightning.java

示例8: onPlayerDeathByLightning

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)
public void onPlayerDeathByLightning(EntityDamageByEntityEvent event) {
	if (event.getEntity() instanceof Player && 
			event.getDamager() instanceof LightningStrike &&
			strikeID.containsKey(event.getDamager().getEntityId()) &&
			((Player)event.getEntity()).getHealth() - event.getDamage() <= 0 &&
			Bukkit.getServer().getPlayer(strikeID.get(event.getDamager().getEntityId())) != null) {
		event.setCancelled(true);
		((Player)event.getEntity()).damage(event.getDamage(), Bukkit.getPlayer(strikeID.get(event.getDamager().getEntityId())));
	}
}
 
开发者ID:EvilKanoa,项目名称:RodsTwo,代码行数:12,代码来源:God.java

示例9: onEntityDamageByLightning

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@EventHandler
public void onEntityDamageByLightning(EntityDamageByEntityEvent event) {
	if (event.getEntity() instanceof Player && 
			event.getDamager() instanceof LightningStrike &&
			strikeID.containsKey(event.getDamager().getEntityId()) &&
			strikeID.get(event.getDamager().getEntityId()).equalsIgnoreCase(((Player) event.getEntity()).getName()))
		event.setCancelled(true);
		
}
 
开发者ID:EvilKanoa,项目名称:RodsTwo,代码行数:10,代码来源:God.java

示例10: strikeLightning

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public LightningStrike strikeLightning(Location loc) {
    net.minecraft.entity.effect.EntityLightningBolt lightning = new net.minecraft.entity.effect.EntityLightningBolt(world, loc.getX(), loc.getY(), loc.getZ());
    world.addWeatherEffect(lightning);
    return new CraftLightningStrike(server, lightning);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:6,代码来源:CraftWorld.java

示例11: strikeLightningEffect

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public LightningStrike strikeLightningEffect(Location loc) {
    net.minecraft.entity.effect.EntityLightningBolt lightning = new net.minecraft.entity.effect.EntityLightningBolt(world, loc.getX(), loc.getY(), loc.getZ(), true);
    world.addWeatherEffect(lightning);
    return new CraftLightningStrike(server, lightning);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:6,代码来源:CraftWorld.java

示例12: callPigZapEvent

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
public static PigZapEvent callPigZapEvent(net.minecraft.entity.Entity pig, net.minecraft.entity.Entity lightning, net.minecraft.entity.Entity pigzombie) {
    PigZapEvent event = new PigZapEvent((Pig) pig.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), (PigZombie) pigzombie.getBukkitEntity());
    pig.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:6,代码来源:CraftEventFactory.java

示例13: callCreeperPowerEvent

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
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;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:6,代码来源:CraftEventFactory.java

示例14: strikeLightning

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@Override
public LightningStrike strikeLightning(Location loc)
{
	// TODO Auto-generated method stub
	throw new UnimplementedOperationException();
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:WorldMock.java

示例15: strikeLightningEffect

import org.bukkit.entity.LightningStrike; //导入依赖的package包/类
@Override
public LightningStrike strikeLightningEffect(Location loc)
{
	// TODO Auto-generated method stub
	throw new UnimplementedOperationException();
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:WorldMock.java


注:本文中的org.bukkit.entity.LightningStrike类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。