本文整理汇总了Java中net.minecraft.util.math.AxisAlignedBB.offset方法的典型用法代码示例。如果您正苦于以下问题:Java AxisAlignedBB.offset方法的具体用法?Java AxisAlignedBB.offset怎么用?Java AxisAlignedBB.offset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.math.AxisAlignedBB
的用法示例。
在下文中一共展示了AxisAlignedBB.offset方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isNotColliding
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
/**
* Checks if entity bounding box is not colliding with terrain
*/
private boolean isNotColliding(double x, double y, double z, double doubleIn)
{
double d0 = (x - this.parentEntity.posX) / doubleIn;
double d1 = (y - this.parentEntity.posY) / doubleIn;
double d2 = (z - this.parentEntity.posZ) / doubleIn;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
for (int i = 1; (double)i < doubleIn; ++i)
{
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
if (!this.parentEntity.worldObj.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
{
return false;
}
}
return true;
}
示例2: updateFlyHeight
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
private void updateFlyHeight()
{
double h = 1;
AxisAlignedBB box = WMinecraft.getPlayer().getEntityBoundingBox()
.expand(0.0625, 0.0625, 0.0625);
for(flyHeight = 0; flyHeight < WMinecraft.getPlayer().posY; flyHeight +=
h)
{
AxisAlignedBB nextBox = box.offset(0, -flyHeight, 0);
if(WMinecraft.getWorld().checkBlockCollision(nextBox))
{
if(h < 0.0625)
break;
flyHeight -= h;
h /= 2;
}
}
}
示例3: isNotColliding
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
double d0 = (x - this.parentEntity.posX) / p_179926_7_;
double d1 = (y - this.parentEntity.posY) / p_179926_7_;
double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
for (int i = 1; (double)i < p_179926_7_; ++i)
{
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
{
return false;
}
}
return true;
}
示例4: getOffsetBoundingBox
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
public static AxisAlignedBB getOffsetBoundingBox(AxisAlignedBB p_getOffsetBoundingBox_0_, Block.EnumOffsetType p_getOffsetBoundingBox_1_, BlockPos p_getOffsetBoundingBox_2_)
{
int i = p_getOffsetBoundingBox_2_.getX();
int j = p_getOffsetBoundingBox_2_.getZ();
long k = (long)(i * 3129871) ^ (long)j * 116129781L;
k = k * k * 42317861L + k * 11L;
double d0 = ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
double d1 = ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
double d2 = 0.0D;
if (p_getOffsetBoundingBox_1_ == Block.EnumOffsetType.XYZ)
{
d2 = ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
}
return p_getOffsetBoundingBox_0_.offset(d0, d2, d1);
}
示例5: getHead
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
public static AxisAlignedBB getHead(EntityLivingBase target){
double ymax = target.posY + target.getEyeHeight();
AxisAlignedBB head = new AxisAlignedBB(target.posX - 0.25, ymax - 0.16, target.posZ - 0.25, target.posX + 0.25, ymax + 0.25, target.posZ + 0.25);
//if (target instanceof EntityCreeper || target instanceof EntityEnderman || target instanceof EntityIronGolem)
// head=head.offset(0, -0.2, 0);
if (target.width >= 0.63) {
float offsetX = -MathHelper.sin(target.renderYawOffset * 0.017453292F) * Math.max(0f,target.width*0.6f-0.32f);
// float f1 = -MathHelper.sin((rotationPitchIn + pitchOffset) * 0.017453292F);
float offsetZ = MathHelper.cos(target.renderYawOffset * 0.017453292F) * Math.max(0f,target.width*0.6f-0.32f);
/*double offsetX = MathHelper.cos(target.renderYawOffset / 180.0F * (float) Math.PI) * target.width / 2;
double offsetZ = -(double) (MathHelper.sin(target.renderYawOffset / 180.0F * (float) Math.PI) * target.width / 2);// cos*/
// double offsetX2=- (double)(MathHelper.sin(living.rotationYaw
// / 180.0F * (float)Math.PI) * var5.width/2);
// double offsetZ2=(double)(MathHelper.cos(living.rotationYaw /
// 180.0F * (float)Math.PI) * var5.width/2);//cos
// System.out.println("Offsets: "+offsetX+" "+offsetZ+"
// "+offsetX2+" "+offsetZ2);
head=head.offset(offsetX, 0, offsetZ);
}
return head;
}
示例6: isNotColliding
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
/**
* Checks if entity bounding box is not colliding with terrain
*/
private boolean isNotColliding(double x, double y, double z, double p_179926_7_) {
double d0 = (x - this.parentEntity.posX) / p_179926_7_;
double d1 = (y - this.parentEntity.posY) / p_179926_7_;
double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
for (int i = 1; i < p_179926_7_; ++i) {
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
return false;
}
return true;
}
示例7: isNotColliding
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
/**
* Checks if entity bounding box is not colliding with terrain
*/
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
double d0 = (x - this.parentEntity.posX) / p_179926_7_;
double d1 = (y - this.parentEntity.posY) / p_179926_7_;
double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
for (int i = 1; (double)i < p_179926_7_; ++i)
{
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
if (!this.parentEntity.worldObj.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
{
return false;
}
}
return true;
}
示例8: getSelectedBoundingBox
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
@Nullable
@Override
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos)
{
AxisAlignedBB bounds = getContent().selectionBounds.get(getSubtype(state)).orElse(null);
if (bounds == DEFAULT_AABB_MARKER)
return super.getSelectedBoundingBox(state, worldIn, pos);
else
return bounds != null ? bounds.offset(pos) : null;
}
示例9: addCollisionBoxToList
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
protected static void addCollisionBoxToList(BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable AxisAlignedBB blockBox)
{
if (blockBox != NULL_AABB)
{
AxisAlignedBB axisalignedbb = blockBox.offset(pos);
if (entityBox.intersectsWith(axisalignedbb))
{
collidingBoxes.add(axisalignedbb);
}
}
}
示例10: func_190607_a
import net.minecraft.util.math.AxisAlignedBB; //导入方法依赖的package包/类
private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_)
{
double d0 = (double)this.getExtendedProgress(this.progress);
return p_190607_1_.offset((double)this.pos.getX() + d0 * (double)this.pistonFacing.getFrontOffsetX(), (double)this.pos.getY() + d0 * (double)this.pistonFacing.getFrontOffsetY(), (double)this.pos.getZ() + d0 * (double)this.pistonFacing.getFrontOffsetZ());
}