本文整理汇总了Java中net.minecraft.block.state.IBlockState.addCollisionBoxToList方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.addCollisionBoxToList方法的具体用法?Java IBlockState.addCollisionBoxToList怎么用?Java IBlockState.addCollisionBoxToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.addCollisionBoxToList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_190609_a
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void func_190609_a(World p_190609_1_, BlockPos p_190609_2_, AxisAlignedBB p_190609_3_, List<AxisAlignedBB> p_190609_4_, @Nullable Entity p_190609_5_)
{
if (!this.extending && this.shouldHeadBeRendered)
{
this.pistonState.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true)).addCollisionBoxToList(p_190609_1_, p_190609_2_, p_190609_3_, p_190609_4_, p_190609_5_, false);
}
EnumFacing enumfacing = (EnumFacing)field_190613_i.get();
if ((double)this.progress >= 1.0D || enumfacing != (this.extending ? this.pistonFacing : this.pistonFacing.getOpposite()))
{
int i = p_190609_4_.size();
IBlockState iblockstate;
if (this.shouldPistonHeadBeRendered())
{
iblockstate = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.FACING, this.pistonFacing).withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(this.extending != 1.0F - this.progress < 0.25F));
}
else
{
iblockstate = this.pistonState;
}
float f = this.getExtendedProgress(this.progress);
double d0 = (double)((float)this.pistonFacing.getFrontOffsetX() * f);
double d1 = (double)((float)this.pistonFacing.getFrontOffsetY() * f);
double d2 = (double)((float)this.pistonFacing.getFrontOffsetZ() * f);
iblockstate.addCollisionBoxToList(p_190609_1_, p_190609_2_, p_190609_3_.offset(-d0, -d1, -d2), p_190609_4_, p_190609_5_, true);
for (int j = i; j < p_190609_4_.size(); ++j)
{
p_190609_4_.set(j, ((AxisAlignedBB)p_190609_4_.get(j)).offset(d0, d1, d2));
}
}
}
示例2: func_191504_a
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_)
{
int i = MathHelper.floor(p_191504_2_.minX) - 1;
int j = MathHelper.ceil(p_191504_2_.maxX) + 1;
int k = MathHelper.floor(p_191504_2_.minY) - 1;
int l = MathHelper.ceil(p_191504_2_.maxY) + 1;
int i1 = MathHelper.floor(p_191504_2_.minZ) - 1;
int j1 = MathHelper.ceil(p_191504_2_.maxZ) + 1;
WorldBorder worldborder = this.getWorldBorder();
boolean flag = p_191504_1_ != null && p_191504_1_.isOutsideBorder();
boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
IBlockState iblockstate = Blocks.STONE.getDefaultState();
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
try
{
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = i1; l1 < j1; ++l1)
{
boolean flag2 = k1 == i || k1 == j - 1;
boolean flag3 = l1 == i1 || l1 == j1 - 1;
if ((!flag2 || !flag3) && this.isBlockLoaded(blockpos$pooledmutableblockpos.setPos(k1, 64, l1)))
{
for (int i2 = k; i2 < l; ++i2)
{
if (!flag2 && !flag3 || i2 != l - 1)
{
if (p_191504_3_)
{
if (k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000)
{
boolean lvt_21_1_ = true;
return lvt_21_1_;
}
}
else if (p_191504_1_ != null && flag == flag1)
{
p_191504_1_.setOutsideBorder(!flag1);
}
blockpos$pooledmutableblockpos.setPos(k1, i2, l1);
IBlockState iblockstate1;
if (!p_191504_3_ && !worldborder.contains(blockpos$pooledmutableblockpos) && flag1)
{
iblockstate1 = iblockstate;
}
else
{
iblockstate1 = this.getBlockState(blockpos$pooledmutableblockpos);
}
iblockstate1.addCollisionBoxToList(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
if (p_191504_3_ && !p_191504_4_.isEmpty())
{
boolean flag5 = true;
return flag5;
}
}
}
}
}
}
}
finally
{
blockpos$pooledmutableblockpos.release();
}
return !p_191504_4_.isEmpty();
}
示例3: getBoatGlide
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
* Decides how much the boat should be gliding on the land (based on any slippery blocks)
*/
public float getBoatGlide()
{
AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX, axisalignedbb.minY - 0.001D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
int i = MathHelper.floor(axisalignedbb1.minX) - 1;
int j = MathHelper.ceil(axisalignedbb1.maxX) + 1;
int k = MathHelper.floor(axisalignedbb1.minY) - 1;
int l = MathHelper.ceil(axisalignedbb1.maxY) + 1;
int i1 = MathHelper.floor(axisalignedbb1.minZ) - 1;
int j1 = MathHelper.ceil(axisalignedbb1.maxZ) + 1;
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
float f = 0.0F;
int k1 = 0;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
try
{
for (int l1 = i; l1 < j; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
int j2 = (l1 != i && l1 != j - 1 ? 0 : 1) + (i2 != i1 && i2 != j1 - 1 ? 0 : 1);
if (j2 != 2)
{
for (int k2 = k; k2 < l; ++k2)
{
if (j2 <= 0 || k2 != k && k2 != l - 1)
{
blockpos$pooledmutableblockpos.setPos(l1, k2, i2);
IBlockState iblockstate = this.world.getBlockState(blockpos$pooledmutableblockpos);
iblockstate.addCollisionBoxToList(this.world, blockpos$pooledmutableblockpos, axisalignedbb1, list, this, false);
if (!list.isEmpty())
{
f += iblockstate.getBlock().slipperiness;
++k1;
}
list.clear();
}
}
}
}
}
}
finally
{
blockpos$pooledmutableblockpos.release();
}
return f / (float)k1;
}
示例4: getCollisionBoxes
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public List<AxisAlignedBB> getCollisionBoxes(AxisAlignedBB bb)
{
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
int i = MathHelper.floor_double(bb.minX) - 1;
int j = MathHelper.ceiling_double_int(bb.maxX) + 1;
int k = MathHelper.floor_double(bb.minY) - 1;
int l = MathHelper.ceiling_double_int(bb.maxY) + 1;
int i1 = MathHelper.floor_double(bb.minZ) - 1;
int j1 = MathHelper.ceiling_double_int(bb.maxZ) + 1;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = i1; l1 < j1; ++l1)
{
int i2 = (k1 != i && k1 != j - 1 ? 0 : 1) + (l1 != i1 && l1 != j1 - 1 ? 0 : 1);
if (i2 != 2 && this.isBlockLoaded(blockpos$pooledmutableblockpos.setPos(k1, 64, l1)))
{
for (int j2 = k; j2 < l; ++j2)
{
if (i2 <= 0 || j2 != k && j2 != l - 1)
{
blockpos$pooledmutableblockpos.setPos(k1, j2, l1);
IBlockState iblockstate;
if (k1 >= -30000000 && k1 < 30000000 && l1 >= -30000000 && l1 < 30000000)
{
iblockstate = this.getBlockState(blockpos$pooledmutableblockpos);
}
else
{
iblockstate = Blocks.BEDROCK.getDefaultState();
}
iblockstate.addCollisionBoxToList(this, blockpos$pooledmutableblockpos, bb, list, (Entity)null);
}
}
}
}
}
blockpos$pooledmutableblockpos.release();
return list;
}
示例5: collidesWithAnyBlock
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
* Returns true if the given bbox collides with any block.
*/
public boolean collidesWithAnyBlock(AxisAlignedBB bbox)
{
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
int i = MathHelper.floor_double(bbox.minX) - 1;
int j = MathHelper.ceiling_double_int(bbox.maxX) + 1;
int k = MathHelper.floor_double(bbox.minY) - 1;
int l = MathHelper.ceiling_double_int(bbox.maxY) + 1;
int i1 = MathHelper.floor_double(bbox.minZ) - 1;
int j1 = MathHelper.ceiling_double_int(bbox.maxZ) + 1;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
try
{
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = i1; l1 < j1; ++l1)
{
int i2 = (k1 != i && k1 != j - 1 ? 0 : 1) + (l1 != i1 && l1 != j1 - 1 ? 0 : 1);
if (i2 != 2 && this.isBlockLoaded(blockpos$pooledmutableblockpos.setPos(k1, 64, l1)))
{
for (int j2 = k; j2 < l; ++j2)
{
if (i2 <= 0 || j2 != k && j2 != l - 1)
{
blockpos$pooledmutableblockpos.setPos(k1, j2, l1);
if (k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000)
{
boolean flag1 = true;
return flag1;
}
IBlockState iblockstate = this.getBlockState(blockpos$pooledmutableblockpos);
iblockstate.addCollisionBoxToList(this, blockpos$pooledmutableblockpos, bbox, list, (Entity)null);
if (!list.isEmpty())
{
boolean flag = true;
return flag;
}
}
}
}
}
}
return false;
}
finally
{
blockpos$pooledmutableblockpos.release();
}
}
示例6: getBoatGlide
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
* Decides how much the boat should be gliding on the land (based on any slippery blocks)
*/
public float getBoatGlide()
{
AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX, axisalignedbb.minY - 0.001D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
int i = MathHelper.floor_double(axisalignedbb1.minX) - 1;
int j = MathHelper.ceiling_double_int(axisalignedbb1.maxX) + 1;
int k = MathHelper.floor_double(axisalignedbb1.minY) - 1;
int l = MathHelper.ceiling_double_int(axisalignedbb1.maxY) + 1;
int i1 = MathHelper.floor_double(axisalignedbb1.minZ) - 1;
int j1 = MathHelper.ceiling_double_int(axisalignedbb1.maxZ) + 1;
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
float f = 0.0F;
int k1 = 0;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
try
{
for (int l1 = i; l1 < j; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
int j2 = (l1 != i && l1 != j - 1 ? 0 : 1) + (i2 != i1 && i2 != j1 - 1 ? 0 : 1);
if (j2 != 2)
{
for (int k2 = k; k2 < l; ++k2)
{
if (j2 <= 0 || k2 != k && k2 != l - 1)
{
blockpos$pooledmutableblockpos.setPos(l1, k2, i2);
IBlockState iblockstate = this.worldObj.getBlockState(blockpos$pooledmutableblockpos);
iblockstate.addCollisionBoxToList(this.worldObj, blockpos$pooledmutableblockpos, axisalignedbb1, list, this);
if (!list.isEmpty())
{
f += iblockstate.getBlock().slipperiness;
++k1;
}
list.clear();
}
}
}
}
}
}
finally
{
blockpos$pooledmutableblockpos.release();
}
return f / (float)k1;
}