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


Java S27PacketExplosion类代码示例

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


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

示例1: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
 */
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
{
    Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking);
    explosion.doExplosionA();
    explosion.doExplosionB(false);

    if (!isSmoking)
    {
        explosion.func_180342_d();
    }

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.getDistanceSq(x, y, z) < 4096.0D)
        {
            ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), (Vec3)explosion.getPlayerKnockbackMap().get(entityplayer)));
        }
    }

    return explosion;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:WorldServer.java

示例2: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(S27PacketExplosion packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
    explosion.doExplosionB(true);
    this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c();
    this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d();
    this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:NetHandlerPlayClient.java

示例3: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected
 * blocks indicated by the packet.
 */
public void handleExplosion(S27PacketExplosion packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Explosion explosion = new Explosion(this.gameController.theWorld, (Entity) null, packetIn.getX(),
			packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
	explosion.doExplosionB(true);
	this.gameController.thePlayer.motionX += (double) packetIn.func_149149_c();
	this.gameController.thePlayer.motionY += (double) packetIn.func_149144_d();
	this.gameController.thePlayer.motionZ += (double) packetIn.func_149147_e();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:NetHandlerPlayClient.java

示例4: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * returns a new explosion. Does initiation (at time of writing Explosion is
 * not finished)
 */
public Explosion newExplosion(Entity p_72885_1_, double x, double y, double z, float p_72885_8_, boolean isFlaming,
		boolean isSmoking) {
	Explosion explosion = new Explosion(this, p_72885_1_, x, y, z, p_72885_8_);
	explosion.isFlaming = isFlaming;
	explosion.isSmoking = isSmoking;
	if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion))
		return explosion;
	explosion.doExplosionA();
	explosion.doExplosionB(false);

	if (!isSmoking) {
		explosion.affectedBlockPositions.clear();
	}

	Iterator<?> iterator = this.playerEntities.iterator();

	while (iterator.hasNext()) {
		EntityPlayer entityplayer = (EntityPlayer) iterator.next();

		if (entityplayer.getDistanceSq(x, y, z) < 4096.0D) {
			((EntityPlayerMP) entityplayer).playerNetServerHandler
					.sendPacket(new S27PacketExplosion(x, y, z, p_72885_8_, explosion.affectedBlockPositions,
							(Vec3) explosion.func_77277_b().get(entityplayer)));
		}
	}

	return explosion;
}
 
开发者ID:OreCruncher,项目名称:Jiffy,代码行数:33,代码来源:WorldServer.java

示例5: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
public static M4thCustomExplosion newExplosion(World world, Entity entity, double x, double y, double z, float size, boolean par9, boolean destroyBlocks,int explosionSoundChoice)
{
    M4thCustomExplosion explosion = new M4thCustomExplosion(world,entity,x,y,z,size);

    explosion.setExplosionSound(explosionSoundChoice);

    explosion.isFlaming = par9;
    explosion.isSmoking = destroyBlocks;
    if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world,explosion))
    {
        return explosion;
    }
    explosion.doExplosionA();
    explosion.doExplosionB(true);

    //new
    if (!destroyBlocks)
    {
        explosion.affectedBlockPositions.clear();
    }

    Iterator iterator = world.playerEntities.iterator();

    while (iterator.hasNext())
    {
        EntityPlayer entityPlayer = (EntityPlayer)iterator.next();

        if (entityPlayer.getDistanceSq(x,y,z) < 4096.0D)
        {
            ((EntityPlayerMP)entityPlayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(x,y,z,size,explosion.affectedBlockPositions,(Vec3)explosion.func_77277_b().get(entityPlayer)));
        }
    }

    //end new
    return explosion;
}
 
开发者ID:M4thG33k,项目名称:M4thThings,代码行数:37,代码来源:ExplosionHandler.java

示例6: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
 */
public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10)
{
    Explosion var11 = new Explosion(this, par1Entity, par2, par4, par6, par8);
    var11.isFlaming = par9;
    var11.isSmoking = par10;
    var11.doExplosionA();
    var11.doExplosionB(false);

    if (!par10)
    {
        var11.affectedBlockPositions.clear();
    }

    Iterator var12 = this.playerEntities.iterator();

    while (var12.hasNext())
    {
        EntityPlayer var13 = (EntityPlayer)var12.next();

        if (var13.getDistanceSq(par2, par4, par6) < 4096.0D)
        {
            ((EntityPlayerMP)var13).playerNetServerHandler.sendPacket(new S27PacketExplosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13)));
        }
    }

    return var11;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:WorldServer.java

示例7: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(S27PacketExplosion p_147283_1_)
{
    Explosion var2 = new Explosion(this.gameController.theWorld, (Entity)null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i());
    var2.affectedBlockPositions = p_147283_1_.func_149150_j();
    var2.doExplosionB(true);
    this.gameController.thePlayer.motionX += (double)p_147283_1_.func_149149_c();
    this.gameController.thePlayer.motionY += (double)p_147283_1_.func_149144_d();
    this.gameController.thePlayer.motionZ += (double)p_147283_1_.func_149147_e();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:13,代码来源:NetHandlerPlayClient.java

示例8: explodeBlock

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void explodeBlock(World world, int x, int y, int z) {
        if (FMLCommonHandler.instance().getEffectiveSide().isClient())
                return;

    float strength = 3F;
    Explosion explosion = new Explosion(world, null, x + .5, y + .5, z + .5, strength);

    Block block = world.getBlock(x, y, z);
    float res = block.getExplosionResistance(null);
    if(block.getBlockHardness(world, x,y,z) > -1) {

        explosion.affectedBlockPositions.add(new ChunkPosition(x, y, z));
    }


        explosion.doExplosionB(true);

        for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) {
                if (!(player instanceof EntityPlayerMP))
                        continue;

                if (player.getDistanceSq(x, y, z) < 4096) {
                        ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null));
                }
        }
}
 
开发者ID:tm1990,项目名称:MiscUtils,代码行数:28,代码来源:BlockUtil.java

示例9: explodeBlocks

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
public static void explodeBlocks(World world, int x, int y, int z, ArrayList<ChunkPosition> pos) {
    if (FMLCommonHandler.instance().getEffectiveSide().isClient())
        return;

    float strength = 3F;
    Explosion explosion = new Explosion(world, null, x + .5, y + .5, z + .5, strength);


    explosion.affectedBlockPositions.add(new ChunkPosition(x, y, z));

    for(ChunkPosition po : pos){
        Block block = world.getBlock(po.chunkPosX, po.chunkPosY, po.chunkPosZ);
        float res = block.getExplosionResistance(null);
        if(block.getBlockHardness(world, po.chunkPosX, po.chunkPosY, po.chunkPosZ) > -1) {

            explosion.affectedBlockPositions.add(po);
        }
    }

    explosion.doExplosionB(true);

    for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) {
        if (!(player instanceof EntityPlayerMP))
            continue;

        if (player.getDistanceSq(x, y, z) < 4096) {
            ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null));
        }
    }
}
 
开发者ID:tm1990,项目名称:MiscUtils,代码行数:31,代码来源:BlockUtil.java

示例10: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
{
    // CraftBukkit start
    Explosion explosion = super.newExplosion(p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_);

    if (explosion.wasCanceled)
    {
        return explosion;
    }

    /* Remove
    Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_);
    explosion.isFlaming = p_72885_9_;
    explosion.isSmoking = p_72885_10_;
    explosion.doExplosionA();
    explosion.doExplosionB(false);
    */
    // CraftBukkit end - TODO: Check if explosions are still properly implemented

    if (!p_72885_10_)
    {
        explosion.affectedBlockPositions.clear();
    }

    Iterator iterator = this.playerEntities.iterator();

    while (iterator.hasNext())
    {
        EntityPlayer entityplayer = (EntityPlayer)iterator.next();

        if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D)
        {
            ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer)));
        }
    }

    return explosion;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:39,代码来源:WorldServer.java

示例11: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
public void handleExplosion(S27PacketExplosion p_147283_1_)
{
    Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i());
    explosion.affectedBlockPositions = p_147283_1_.func_149150_j();
    explosion.doExplosionB(true);
    this.gameController.thePlayer.motionX += (double)p_147283_1_.func_149149_c();
    this.gameController.thePlayer.motionY += (double)p_147283_1_.func_149144_d();
    this.gameController.thePlayer.motionZ += (double)p_147283_1_.func_149147_e();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:10,代码来源:NetHandlerPlayClient.java

示例12: newExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
{
    Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_);
    explosion.isFlaming = p_72885_9_;
    explosion.isSmoking = p_72885_10_;
    explosion.doExplosionA();
    explosion.doExplosionB(false);

    if (!p_72885_10_)
    {
        explosion.affectedBlockPositions.clear();
    }

    Iterator iterator = this.playerEntities.iterator();

    while (iterator.hasNext())
    {
        EntityPlayer entityplayer = (EntityPlayer)iterator.next();

        if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D)
        {
            ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer)));
        }
    }

    return explosion;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:28,代码来源:WorldServer.java

示例13: notifyClients

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
protected void notifyClients() {
	if (!worldObj.isRemote) {
		Iterator<EntityPlayer> iterator = worldObj.playerEntities.iterator();
		while (iterator.hasNext()) {
			EntityPlayer player = iterator.next();
			if (player.getDistanceSq(explosionX, explosionY, explosionZ) < 4096.0D) {
				((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(explosionX, explosionY, explosionZ, explosionSize, affectedBlockPositions, (Vec3) this.getPlayerKnockbackMap().get(player)));
			}
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:12,代码来源:CustomExplosion.java

示例14: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
void handleExplosion(S27PacketExplosion packetIn);
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:INetHandlerPlayClient.java

示例15: handleExplosion

import net.minecraft.network.play.server.S27PacketExplosion; //导入依赖的package包/类
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
void handleExplosion(S27PacketExplosion var1);
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:INetHandlerPlayClient.java


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