當前位置: 首頁>>代碼示例>>Java>>正文


Java Explosion類代碼示例

本文整理匯總了Java中net.minecraft.world.Explosion的典型用法代碼示例。如果您正苦於以下問題:Java Explosion類的具體用法?Java Explosion怎麽用?Java Explosion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Explosion類屬於net.minecraft.world包,在下文中一共展示了Explosion類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBlockExploded

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
	
	Utils.dropStackInWorld(world, x, y, z, Utils.getTankStackFromTile((TileGlassFluidTank) world.getTileEntity(x, y, z), true));
	world.setBlockToAir(x, y, z);
	onBlockDestroyedByExplosion(world, x, y, z, explosion);
	
}
 
開發者ID:grand-mine-inc,項目名稱:Steam-and-Steel,代碼行數:9,代碼來源:GlassFluidTank.java

示例2: getExplosionResistance

import net.minecraft.world.Explosion; //導入依賴的package包/類
/**
 * Explosion resistance of a block relative to this entity
 */
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn)
{
    float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
    Block block = blockStateIn.getBlock();

    if (this.isInvulnerable() && EntityWither.func_181033_a(block))
    {
        f = Math.min(0.8F, f);
    }

    return f;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:16,代碼來源:EntityWitherSkull.java

示例3: onBlockDestroyedByExplosion

import net.minecraft.world.Explosion; //導入依賴的package包/類
/**
 * Called when this Block is destroyed by an Explosion
 */
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
{
    if (!worldIn.isRemote)
    {
        EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
        entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
        worldIn.spawnEntityInWorld(entitytntprimed);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:BlockTNT.java

示例4: handleExplosion

import net.minecraft.world.Explosion; //導入依賴的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

示例5: handleExplosion

import net.minecraft.world.Explosion; //導入依賴的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

示例6: createExplosion

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking) {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyWorld.createExplosion(entityIn, x, y, z, strength, isSmoking);
	} else if (m_realWorld != null) {
		return m_realWorld.createExplosion(entityIn, x, y, z, strength, isSmoking);
	} else {
		return super.createExplosion(entityIn, x, y, z, strength, isSmoking);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:11,代碼來源:WorldServerProxy.java

示例7: newExplosion

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming,
		boolean isSmoking) {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyWorld.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking);
	} else if (m_realWorld != null) {
		return m_realWorld.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking);
	} else {
		return super.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:12,代碼來源:WorldServerProxy.java

示例8: getExplosionResistance

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) {
	if (m_realPlayer == null) {
		return super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
	} else {
		syncToRealPlayer();
		return syncPublicFieldsFromRealAndReturn(m_realPlayer.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn));
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:10,代碼來源:EntityPlayerMPProxy.java

示例9: canExplosionDestroyBlock

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public boolean canExplosionDestroyBlock(Explosion explosionIn, World worldIn, BlockPos pos,
		IBlockState blockStateIn, float p_174816_5_) {
	if (m_realPlayer == null) {
		return super.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_);
	} else {
		syncToRealPlayer();
		return syncPublicFieldsFromRealAndReturn(m_realPlayer.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_));
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:11,代碼來源:EntityPlayerMPProxy.java

示例10: getExplosionResistance

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) {
	if (m_realPlayer == null) {
		return super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
	} else {
		return m_realPlayer.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:9,代碼來源:EntityPlayerProxy.java

示例11: canExplosionDestroyBlock

import net.minecraft.world.Explosion; //導入依賴的package包/類
@Override
public boolean canExplosionDestroyBlock(Explosion explosionIn, World worldIn, BlockPos pos,
		IBlockState blockStateIn, float p_174816_5_) {
	if (m_realPlayer == null) {
		return super.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_);
	} else {
		return m_realPlayer.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:10,代碼來源:EntityPlayerProxy.java

示例12: Megumin

import net.minecraft.world.Explosion; //導入依賴的package包/類
private Megumin(World world, Vector3 pos, float size, boolean damageEntities) {
	dummy = new Explosion(world, null, pos.x, pos.y, pos.z, size, false, false);
	this.world = world;
	this.pos = pos;
	this.size = size;
	this.damageEntities = damageEntities;
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:8,代碼來源:Megumin.java

示例13: handleExplosion

import net.minecraft.world.Explosion; //導入依賴的package包/類
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(SPacketExplosion packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
    explosion.doExplosionB(true);
    this.gameController.player.motionX += (double)packetIn.getMotionX();
    this.gameController.player.motionY += (double)packetIn.getMotionY();
    this.gameController.player.motionZ += (double)packetIn.getMotionZ();
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:13,代碼來源:NetHandlerPlayClient.java

示例14: getExplosionResistance

import net.minecraft.world.Explosion; //導入依賴的package包/類
/**
 * Explosion resistance of a block relative to this entity
 */
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn)
{
    float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
    Block block = blockStateIn.getBlock();

    if (this.isInvulnerable() && EntityWither.canDestroyBlock(block))
    {
        f = Math.min(0.8F, f);
    }

    return f;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:16,代碼來源:EntityWitherSkull.java

示例15: onBlockDestroyedByExplosion

import net.minecraft.world.Explosion; //導入依賴的package包/類
/**
 * Called when this Block is destroyed by an Explosion
 */
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
{
    if (!worldIn.isRemote)
    {
        EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
        entitytntprimed.setFuse((short)(worldIn.rand.nextInt(entitytntprimed.getFuse() / 4) + entitytntprimed.getFuse() / 8));
        worldIn.spawnEntityInWorld(entitytntprimed);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:13,代碼來源:BlockTNT.java


注:本文中的net.minecraft.world.Explosion類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。