本文整理了Java中net.minecraft.world.World.addWeatherEffect()
方法的一些代码示例,展示了World.addWeatherEffect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.addWeatherEffect()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:addWeatherEffect
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean addWeatherEffect(@Nonnull Entity entityIn) {
return wrapped.addWeatherEffect(entityIn);
}
代码示例来源:origin: CoFH/CoFHCore
public static void doFakeLightningBolt(World world, double x, double y, double z) {
EntityLightningBoltFake bolt = new EntityLightningBoltFake(world, x, y, z);
world.addWeatherEffect(bolt);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public boolean addWeatherEffect(Entity entityIn) {
return getActualWorld().addWeatherEffect(entityIn);
}
代码示例来源:origin: CyclopsMC/EvilCraft
private void explode(World world, double x, double y, double z) {
Random rand = new Random();
for (int i = 0; i < 32; ++i) {
world.spawnParticle(EnumParticleTypes.CRIT_MAGIC, x, y + rand.nextDouble() * 2.0D, z, rand.nextGaussian(), 0.0D, rand.nextGaussian());
}
if (!world.isRemote) {
this.world.createExplosion(this, this.posX, this.posY, this.posZ, EXPLOSION_STRENGTH, true);
world.addWeatherEffect(new EntityLightningBolt(world, x, y, z, false));
}
}
代码示例来源:origin: ForestryMC/Binnie
@Override
protected IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing, World world, BlockPos position) {
if (world.rand.nextInt(100) < 1 && world.canBlockSeeSky(position) && world instanceof WorldServer) {
world.addWeatherEffect(new EntityBeeLightning(world, position.getX(), position.getY(), position.getZ()));
}
return storedData;
}
},
代码示例来源:origin: WayofTime/BloodMagic
public void lightning(World world, BlockPos blockPos) {
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY(), blockPos.getZ(), true));
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
protected void onImpact(RayTraceResult par1MovingObjectPosition) {
if (par1MovingObjectPosition.entityHit != null) {
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
}
for (int i = 0; i < 32; ++i) {
this.world.spawnParticle(EnumParticleTypes.CRIT_MAGIC, this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian());
}
if (!this.world.isRemote) {
if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) {
EntityHelpers.onEntityCollided(this.world, par1MovingObjectPosition.getBlockPos(), this);
this.world.addWeatherEffect(new EntityLightningBolt(this.world, this.posX, this.posY, this.posZ, false));
}
this.setDead();
}
}
代码示例来源:origin: sinkillerj/ProjectE
@Override
public void updateInPedestal(@Nonnull World world, @Nonnull BlockPos pos)
{
if (!world.isRemote && ProjectEConfig.pedestalCooldown.swrgPedCooldown != -1)
{
TileEntity te = world.getTileEntity(pos);
if(!(te instanceof DMPedestalTile))
{
return;
}
DMPedestalTile tile = (DMPedestalTile) te;
if (tile.getActivityCooldown() <= 0)
{
List<EntityLiving> list = world.getEntitiesWithinAABB(EntityLiving.class, tile.getEffectBounds());
for (EntityLiving living : list)
{
if (living instanceof EntityTameable && ((EntityTameable) living).isTamed())
{
continue;
}
world.addWeatherEffect(new EntityLightningBolt(world, living.posX, living.posY, living.posZ, false));
}
tile.setActivityCooldown(ProjectEConfig.pedestalCooldown.swrgPedCooldown);
}
else
{
tile.decrementActivityCooldown();
}
}
}
代码示例来源:origin: sinkillerj/ProjectE
public void doZap(EntityPlayer player)
{
if (ProjectEConfig.difficulty.offensiveAbilities)
{
BlockPos strikePos = PlayerHelper.getBlockLookingAt(player, 120.0F);
if (strikePos != null)
{
player.getEntityWorld().addWeatherEffect(new EntityLightningBolt(player.getEntityWorld(), strikePos.getX(), strikePos.getY(), strikePos.getZ(), false));
}
}
}
}
代码示例来源:origin: Vazkii/Psi
@Override
public Object execute(SpellContext context) throws SpellRuntimeException {
if(context.caster.getEntityWorld().isRemote)
return null;
Vector3 positionVal = this.getParamValue(context, position);
if(positionVal == null)
throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR);
if(!context.isInRadius(positionVal))
throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS);
EntityLightningBolt lightning = new EntityLightningBolt(context.caster.getEntityWorld(), positionVal.x, positionVal.y, positionVal.z, false);
context.caster.getEntityWorld().addWeatherEffect(lightning);
return null;
}
代码示例来源:origin: vadis365/TheErebus
@SuppressWarnings("unchecked")
protected Entity findEnemyToAttack() {
List<EntityLivingBase> list = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(getPos()).grow(6D, 2D, 6D));
if (active)
for (int i = 0; i < list.size(); i++) {
Entity entity = list.get(i);
if (entity != null)
if (entity instanceof EntityLivingBase)
if (((EntityLivingBase) entity).getCreatureAttribute().equals(EnumCreatureAttribute.ARTHROPOD) && !(entity instanceof EntityAnimatedBlock) && !(entity instanceof EntityUmberGolem)) {
double a = entity.posX;
double b = entity.getEntityBoundingBox().minY;
double c = entity.posZ;
EntityLightningBolt entitybolt = new EntityLightningBolt(getWorld(), 0D, 0D, 0D, false);
entitybolt.setLocationAndAngles(a, b, c, 0F, 0F);
getWorld().addWeatherEffect(entitybolt);
}
}
return null;
}
代码示例来源:origin: sinkillerj/ProjectE
world.addWeatherEffect(lightning);
world.addWeatherEffect(bonus);
代码示例来源:origin: SleepyTrousers/EnderIO
if (world.canBlockSeeSky(pos)) { // exposed to the sky?
world.setBlockToAir(pos);
world.addWeatherEffect(new EntityLightningBolt(world, pos.getX(), pos.getY(), pos.getZ(), true));
return;
代码示例来源:origin: WayofTime/BloodMagic
@Override
public boolean performRitual(World world, BlockPos pos, @Nullable ImperfectRitual imperfectRitual, EntityPlayer player) {
if (imperfectRitual != null && BloodMagic.RITUAL_MANAGER.enabled(BloodMagic.RITUAL_MANAGER.getId(imperfectRitual), true)) {
if (!PlayerHelper.isFakePlayer(player) && !world.isRemote) {
NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, SoulTicket.block(getWorld(), getPos(), imperfectRitual.getActivationCost()));
if (imperfectRitual.onActivate(this, player)) {
if (imperfectRitual.isLightShow())
getWorld().addWeatherEffect(new EntityLightningBolt(getWorld(), getPos().getX(), getPos().getY() + 2, getPos().getZ(), true));
return true;
}
}
return true;
}
return false;
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
public void update() {
if (ritualTicksLeft == 0) return;
if (!world.isRemote) {
switch (ritualTicksLeft) {
case 5:
world.addWeatherEffect(new EntityLightningBolt(world, this.pos.getX(), this.pos.getY(), this.pos.getZ(), true));
ritualPlayer.setHealth(ritualPlayer.getMaxHealth());
VampirePlayer.get(ritualPlayer).drinkBlood(100, 0);
break;
case 1:
VampirePlayer player = VampirePlayer.get(ritualPlayer);
int targetLevel = player.getLevel() + 1;
VampireLevelingConf levelingConf = VampireLevelingConf.getInstance();
int blood = levelingConf.getRequiredBloodForAltarInspiration(targetLevel) * VReference.FOOD_TO_FLUID_BLOOD;
((InternalTank) tank).doDrain(blood, true);
ritualPlayer.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, targetLevel * 10 * 20));
FactionPlayerHandler.get(ritualPlayer).setFactionLevel(VReference.VAMPIRE_FACTION, targetLevel);
VampirePlayer.get(ritualPlayer).drinkBlood(Integer.MAX_VALUE, 0, false);
markDirty();
IBlockState state = world.getBlockState(getPos());
this.world.notifyBlockUpdate(pos, state, state, 3);
break;
default:
break;
}
}
ritualTicksLeft--;
}
代码示例来源:origin: vadis365/TheErebus
private void openPyramid(World world, BlockPos pos, int offsetX, int offsetZ) {
EntityLightningBolt entitybolt = new EntityLightningBolt(world, 0D, 0D, 0D, false);
entitybolt.setLocationAndAngles(pos.getX() + offsetX, pos.getY(), pos.getZ() + offsetZ, 0F, 0F);
world.addWeatherEffect(entitybolt);
world.playEvent(null, 2001, pos, Block.getIdFromBlock(world.getBlockState(pos).getBlock()));
world.setBlockToAir(pos);
world.playEvent(null, 2001, pos.add(offsetX, 0, 0), Block.getIdFromBlock(world.getBlockState(pos.add(offsetX, 0, 0)).getBlock()));
world.setBlockToAir(pos.add(offsetX, 0, 0));
world.playEvent(null, 2001, pos.add(0, 0, offsetZ), Block.getIdFromBlock(world.getBlockState(pos.add(0, 0, offsetZ)).getBlock()));
world.setBlockToAir(pos.add(0, 0, offsetZ));
world.playEvent(null, 2001, pos.add(offsetX, 0, offsetZ), Block.getIdFromBlock(world.getBlockState(pos.add(offsetX, 0, offsetZ)).getBlock()));
world.setBlockToAir(pos.add(offsetX, 0, offsetZ));
}
内容来源于网络,如有侵权,请联系作者删除!