本文整理匯總了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);
}
示例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;
}
示例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);
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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_));
}
}
示例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);
}
}
示例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_);
}
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
}