本文整理汇总了Java中net.minecraft.block.state.IBlockState.getBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.getBoundingBox方法的具体用法?Java IBlockState.getBoundingBox怎么用?Java IBlockState.getBoundingBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.getBoundingBox方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCollisionBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
if(Hacks.findMod(Freecam.class).isEnabled())
return NULL_AABB;
else
return blockState.getBoundingBox(worldIn, pos);
}
示例2: getCollisionBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
int i = ((Integer)blockState.getValue(LAYERS)).intValue() - 1;
float f = 0.125F;
AxisAlignedBB axisalignedbb = blockState.getBoundingBox(worldIn, pos);
if(Hacks.findMod(Freecam.class).isEnabled())
return NULL_AABB;
else
return new AxisAlignedBB(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ, axisalignedbb.maxX, (double)((float)i * 0.125F), axisalignedbb.maxZ);
}
示例3: renderShadowSingle
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void renderShadowSingle(IBlockState state, double p_188299_2_, double p_188299_4_, double p_188299_6_, BlockPos p_188299_8_, float p_188299_9_, float p_188299_10_, double p_188299_11_, double p_188299_13_, double p_188299_15_)
{
if (state.isFullCube())
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
double d0 = ((double)p_188299_9_ - (p_188299_4_ - ((double)p_188299_8_.getY() + p_188299_13_)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(p_188299_8_);
if (d0 >= 0.0D)
{
if (d0 > 1.0D)
{
d0 = 1.0D;
}
AxisAlignedBB axisalignedbb = state.getBoundingBox(this.getWorldFromRenderManager(), p_188299_8_);
double d1 = (double)p_188299_8_.getX() + axisalignedbb.minX + p_188299_11_;
double d2 = (double)p_188299_8_.getX() + axisalignedbb.maxX + p_188299_11_;
double d3 = (double)p_188299_8_.getY() + axisalignedbb.minY + p_188299_13_ + 0.015625D;
double d4 = (double)p_188299_8_.getZ() + axisalignedbb.minZ + p_188299_15_;
double d5 = (double)p_188299_8_.getZ() + axisalignedbb.maxZ + p_188299_15_;
float f = (float)((p_188299_2_ - d1) / 2.0D / (double)p_188299_10_ + 0.5D);
float f1 = (float)((p_188299_2_ - d2) / 2.0D / (double)p_188299_10_ + 0.5D);
float f2 = (float)((p_188299_6_ - d4) / 2.0D / (double)p_188299_10_ + 0.5D);
float f3 = (float)((p_188299_6_ - d5) / 2.0D / (double)p_188299_10_ + 0.5D);
vertexbuffer.pos(d1, d3, d4).tex((double)f, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
vertexbuffer.pos(d1, d3, d5).tex((double)f, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
vertexbuffer.pos(d2, d3, d5).tex((double)f1, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
vertexbuffer.pos(d2, d3, d4).tex((double)f1, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
}
}
}
示例4: getCollisionBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
{
int i = ((Integer)blockState.getValue(LAYERS)).intValue() - 1;
float f = 0.125F;
AxisAlignedBB axisalignedbb = blockState.getBoundingBox(worldIn, pos);
return new AxisAlignedBB(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ, axisalignedbb.maxX, (double)((float)i * 0.125F), axisalignedbb.maxZ);
}
示例5: getBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
IBlockState camo = getCamoState(source, pos);
return camo != null && doesCamoOverrideBounds() ? camo.getBoundingBox(source, pos) : super.getBoundingBox(state, source, pos);
}
示例6: getCollisionBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
return blockState.getBoundingBox(worldIn, pos);
}
示例7: shouldSideBeRendered
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
if (Hacks.findMod(XRay.class).isEnabled()) {
return XRay.xrayBlocks.contains(this);
}
AxisAlignedBB axisalignedbb = blockState.getBoundingBox(blockAccess, pos);
switch (side)
{
case DOWN:
if (axisalignedbb.minY > 0.0D)
{
return true;
}
break;
case UP:
if (axisalignedbb.maxY < 1.0D)
{
return true;
}
break;
case NORTH:
if (axisalignedbb.minZ > 0.0D)
{
return true;
}
break;
case SOUTH:
if (axisalignedbb.maxZ < 1.0D)
{
return true;
}
break;
case WEST:
if (axisalignedbb.minX > 0.0D)
{
return true;
}
break;
case EAST:
if (axisalignedbb.maxX < 1.0D)
{
return true;
}
}
return !blockAccess.getBlockState(pos.offset(side)).isOpaqueCube();
}
示例8: randomDisplayTick
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
double d0 = (double)pos.getX();
double d1 = (double)pos.getY();
double d2 = (double)pos.getZ();
if (this.blockMaterial == Material.WATER)
{
int i = ((Integer)stateIn.getValue(LEVEL)).intValue();
if (i > 0 && i < 8)
{
if (rand.nextInt(64) == 0)
{
worldIn.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, SoundEvents.BLOCK_WATER_AMBIENT, SoundCategory.BLOCKS, rand.nextFloat() * 0.25F + 0.75F, rand.nextFloat() + 0.5F, false);
}
}
else if (rand.nextInt(10) == 0)
{
worldIn.spawnParticle(EnumParticleTypes.SUSPENDED, d0 + (double)rand.nextFloat(), d1 + (double)rand.nextFloat(), d2 + (double)rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
}
}
if (this.blockMaterial == Material.LAVA && worldIn.getBlockState(pos.up()).getMaterial() == Material.AIR && !worldIn.getBlockState(pos.up()).isOpaqueCube())
{
if (rand.nextInt(100) == 0)
{
double d8 = d0 + (double)rand.nextFloat();
double d4 = d1 + stateIn.getBoundingBox(worldIn, pos).maxY;
double d6 = d2 + (double)rand.nextFloat();
worldIn.spawnParticle(EnumParticleTypes.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D, new int[0]);
worldIn.playSound(d8, d4, d6, SoundEvents.BLOCK_LAVA_POP, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
}
if (rand.nextInt(200) == 0)
{
worldIn.playSound(d0, d1, d2, SoundEvents.BLOCK_LAVA_AMBIENT, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
}
}
if (rand.nextInt(10) == 0 && worldIn.getBlockState(pos.down()).isFullyOpaque())
{
Material material = worldIn.getBlockState(pos.down(2)).getMaterial();
if (!material.blocksMovement() && !material.isLiquid())
{
double d3 = d0 + (double)rand.nextFloat();
double d5 = d1 - 1.05D;
double d7 = d2 + (double)rand.nextFloat();
if (this.blockMaterial == Material.WATER)
{
worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]);
}
else
{
worldIn.spawnParticle(EnumParticleTypes.DRIP_LAVA, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]);
}
}
}
}
示例9: addBlockHitEffects
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
* Adds block hit particles for the specified block
*/
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
IBlockState iblockstate = this.worldObj.getBlockState(pos);
if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
{
int i = pos.getX();
int j = pos.getY();
int k = pos.getZ();
float f = 0.1F;
AxisAlignedBB axisalignedbb = iblockstate.getBoundingBox(this.worldObj, pos);
double d0 = (double)i + this.rand.nextDouble() * (axisalignedbb.maxX - axisalignedbb.minX - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minX;
double d1 = (double)j + this.rand.nextDouble() * (axisalignedbb.maxY - axisalignedbb.minY - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minY;
double d2 = (double)k + this.rand.nextDouble() * (axisalignedbb.maxZ - axisalignedbb.minZ - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minZ;
if (side == EnumFacing.DOWN)
{
d1 = (double)j + axisalignedbb.minY - 0.10000000149011612D;
}
if (side == EnumFacing.UP)
{
d1 = (double)j + axisalignedbb.maxY + 0.10000000149011612D;
}
if (side == EnumFacing.NORTH)
{
d2 = (double)k + axisalignedbb.minZ - 0.10000000149011612D;
}
if (side == EnumFacing.SOUTH)
{
d2 = (double)k + axisalignedbb.maxZ + 0.10000000149011612D;
}
if (side == EnumFacing.WEST)
{
d0 = (double)i + axisalignedbb.minX - 0.10000000149011612D;
}
if (side == EnumFacing.EAST)
{
d0 = (double)i + axisalignedbb.maxX + 0.10000000149011612D;
}
this.addEffect((new ParticleDigging(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).setBlockPos(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
}
示例10: onUpdate
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
if (this.particleMaxAge-- <= 0)
{
this.setExpired();
}
if (this.isCollided)
{
if (Math.random() < 0.5D)
{
this.setExpired();
}
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ);
IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
Material material = iblockstate.getMaterial();
if (material.isLiquid() || material.isSolid())
{
double d0;
if (iblockstate.getBlock() instanceof BlockLiquid)
{
d0 = (double)(1.0F - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()));
}
else
{
d0 = iblockstate.getBoundingBox(this.worldObj, blockpos).maxY;
}
double d1 = (double)MathHelper.floor(this.posY) + d0;
if (this.posY < d1)
{
this.setExpired();
}
}
}
示例11: getCollisionBoundingBox
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
{
return blockState.getBoundingBox(worldIn, pos);
}
示例12: shouldSideBeRendered
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
AxisAlignedBB axisalignedbb = blockState.getBoundingBox(blockAccess, pos);
switch (side)
{
case DOWN:
if (axisalignedbb.minY > 0.0D)
{
return true;
}
break;
case UP:
if (axisalignedbb.maxY < 1.0D)
{
return true;
}
break;
case NORTH:
if (axisalignedbb.minZ > 0.0D)
{
return true;
}
break;
case SOUTH:
if (axisalignedbb.maxZ < 1.0D)
{
return true;
}
break;
case WEST:
if (axisalignedbb.minX > 0.0D)
{
return true;
}
break;
case EAST:
if (axisalignedbb.maxX < 1.0D)
{
return true;
}
}
return !blockAccess.getBlockState(pos.offset(side)).doesSideBlockRendering(blockAccess, pos.offset(side), side.getOpposite());
}
示例13: randomDisplayTick
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
double d0 = (double)pos.getX();
double d1 = (double)pos.getY();
double d2 = (double)pos.getZ();
if (this.blockMaterial == Material.WATER)
{
int i = ((Integer)stateIn.getValue(LEVEL)).intValue();
if (i > 0 && i < 8)
{
if (rand.nextInt(64) == 0)
{
worldIn.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, SoundEvents.BLOCK_WATER_AMBIENT, SoundCategory.BLOCKS, rand.nextFloat() * 0.25F + 0.75F, rand.nextFloat() + 0.5F, false);
}
}
else if (rand.nextInt(10) == 0)
{
worldIn.spawnParticle(EnumParticleTypes.SUSPENDED, d0 + (double)rand.nextFloat(), d1 + (double)rand.nextFloat(), d2 + (double)rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
}
}
if (this.blockMaterial == Material.LAVA && worldIn.getBlockState(pos.up()).getMaterial() == Material.AIR && !worldIn.getBlockState(pos.up()).isOpaqueCube())
{
if (rand.nextInt(100) == 0)
{
double d8 = d0 + (double)rand.nextFloat();
double d4 = d1 + stateIn.getBoundingBox(worldIn, pos).maxY;
double d6 = d2 + (double)rand.nextFloat();
worldIn.spawnParticle(EnumParticleTypes.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D, new int[0]);
worldIn.playSound(d8, d4, d6, SoundEvents.BLOCK_LAVA_POP, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
}
if (rand.nextInt(200) == 0)
{
worldIn.playSound(d0, d1, d2, SoundEvents.BLOCK_LAVA_AMBIENT, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
}
}
if (rand.nextInt(10) == 0 && worldIn.getBlockState(pos.down()).isFullyOpaque())
{
Material material = worldIn.getBlockState(pos.down(2)).getMaterial();
if (!material.blocksMovement() && !material.isLiquid())
{
double d3 = d0 + (double)rand.nextFloat();
double d5 = d1 - 1.05D;
double d7 = d2 + (double)rand.nextFloat();
if (this.blockMaterial == Material.WATER)
{
worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]);
}
else
{
worldIn.spawnParticle(EnumParticleTypes.DRIP_LAVA, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]);
}
}
}
}
示例14: onUpdate
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
if (this.particleMaxAge-- <= 0)
{
this.setExpired();
}
if (this.isCollided)
{
if (Math.random() < 0.5D)
{
this.setExpired();
}
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ);
IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
Material material = iblockstate.getMaterial();
if (material.isLiquid() || material.isSolid())
{
double d0;
if (iblockstate.getBlock() instanceof BlockLiquid)
{
d0 = (double)(1.0F - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()));
}
else
{
d0 = iblockstate.getBoundingBox(this.worldObj, blockpos).maxY;
}
double d1 = (double)MathHelper.floor_double(this.posY) + d0;
if (this.posY < d1)
{
this.setExpired();
}
}
}