本文整理了Java中net.minecraft.block.Block.getExplosionResistance()
方法的一些代码示例,展示了Block.getExplosionResistance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getExplosionResistance()
方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:getExplosionResistance
暂无
代码示例来源:origin: SlimeKnights/TinkersConstruct
IBlockState iblockstate = this.world.getBlockState(blockpos);
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.world, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(world, blockpos, null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: SlimeKnights/TinkersConstruct
float f2 = exploder != null ? exploder.getExplosionResistance(explosion, world, pos, state) : state.getBlock().getExplosionResistance(world, pos, null, explosion);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: Vazkii/Botania
private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) {
RayTraceResult mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D());
if(mop == null)
return prevresistance;
if(mop.typeOfHit == RayTraceResult.Type.BLOCK) {
Block block = world.getBlockState(mop.getBlockPos()).getBlock();
if(world.isAirBlock(mop.getBlockPos()))
return prevresistance;
return prevresistance + block.getExplosionResistance(null) + 0.3F;
} else return prevresistance;
}
代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft
@SuppressWarnings("deprecation")
@Override
public float getExplosionResistance(Entity exploder)
{
return modelBlock.getExplosionResistance(exploder);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private BlockSlabCommon( Block block )
{
super( block.getMaterial( block.getDefaultState() ) );
this.setHardness( block.getBlockHardness( block.getDefaultState(), null, null ) );
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
IBlockState iblockstate = this.blockState.getBaseState();
if( !this.isDouble() )
{
iblockstate = iblockstate.withProperty( HALF, BlockSlab.EnumBlockHalf.BOTTOM );
}
this.setDefaultState( iblockstate.withProperty( VARIANT, Variant.DEFAULT ) );
this.setCreativeTab( CreativeTabs.BUILDING_BLOCKS );
this.useNeighborBrightness = true;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final float resistance = block.getExplosionResistance( this.world, point, this, ex );
strength -= ( resistance + 0.3F ) * 0.11f;
代码示例来源:origin: RS485/LogisticsPipes
@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) {
Block block = mcmpBlockAccess.getBlock();
return block != null ? block.getExplosionResistance(world, pos, exploder, explosion) : super.getExplosionResistance(world, pos, exploder, explosion);
}
代码示例来源:origin: AlgorithmX2/Chisels-and-Bits
@Override
public float getExplosionResistance(
final World world,
final BlockPos pos,
final Entity exploder,
final Explosion explosion )
{
try
{
return getTileEntity( world, pos ).getBlockInfo( this ).explosionResistance;
}
catch ( final ExceptionNoTileEntity e )
{
Log.noTileError( e );
return super.getExplosionResistance( world, pos, exploder, explosion );
}
}
代码示例来源:origin: amadornes/MCMultiPart
public default float getExplosionResistance(IPartInfo part, Entity exploder, Explosion explosion) {
return part.getState().getBlock().getExplosionResistance(part.getPartWorld(), part.getPartPos(), exploder, explosion);
}
代码示例来源:origin: Vazkii/Quark
public BlockQuarkWall(String name, IBlockState state) {
super(name, state.getMaterial());
setHardness(state.getBlockHardness(null, new BlockPos(0, 0, 0)));
setResistance(state.getBlock().getExplosionResistance(null) * 5F / 3F);
setSoundType(state.getBlock().getSoundType());
setDefaultState(blockState.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
setCreativeTab(CreativeTabs.DECORATIONS);
}
代码示例来源:origin: sinkillerj/ProjectE
float f2 = this.getExplosivePlacedBy() != null ? this.getExplosivePlacedBy().getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: Vazkii/Quark
public BlockVanillaSlab(String name, IBlockState state, boolean doubleSlab) {
super(name, state.getMaterial(), doubleSlab);
setHardness(state.getBlockHardness(null, new BlockPos(0, 0, 0)));
setResistance(state.getBlock().getExplosionResistance(null) * 5F / 3F);
setSoundType(state.getBlock().getSoundType());
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
代码示例来源:origin: Darkhax-Minecraft/Bookshelf
final float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.world, blockpos, affectedState) : affectedState.getBlock().getExplosionResistance(this.world, blockpos, (Entity) null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
public AncientSlabBlock(TreeType type, IBlockState referenceState) {
super(referenceState.getBlock().getMaterial(referenceState));
this.type = type;
IBlockState state = this.blockState.getBaseState();
if (!this.isDouble()) {
state = state.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
}
Block block = state.getBlock();
this.setHardness(block.getBlockHardness(state, null, null));
this.setResistance((block.getExplosionResistance(null) * 5.0F) / 3.0F);
this.setSoundType(SoundType.WOOD);
this.setHarvestLevel(block.getHarvestTool(state), block.getHarvestLevel(state));
this.setUnlocalizedName(type.name().toLowerCase(Locale.ENGLISH) + "_slab");
this.setDefaultState(state);
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity) null, this);
代码示例来源:origin: PrinceOfAmber/Cyclic
IBlockState iblockstate = this.world.getBlockState(blockpos);
if (iblockstate.getMaterial() != Material.AIR) {
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.world, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(world, blockpos, (Entity) null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: PrinceOfAmber/Cyclic
IBlockState iblockstate = this.world.getBlockState(blockpos);
if (iblockstate.getMaterial() != Material.AIR) {
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.world, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(world, blockpos, (Entity) null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity) null, this);
代码示例来源:origin: Alex-the-666/Ice_and_Fire
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity) null, this);
f -= (f2 + 0.3F) * 0.3F;
代码示例来源:origin: Alex-the-666/Ice_and_Fire
float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity) null, this);
f -= (f2 + 0.3F) * 0.3F;
内容来源于网络,如有侵权,请联系作者删除!