本文整理汇总了Java中net.minecraft.block.BlockRailBase.func_150049_b_方法的典型用法代码示例。如果您正苦于以下问题:Java BlockRailBase.func_150049_b_方法的具体用法?Java BlockRailBase.func_150049_b_怎么用?Java BlockRailBase.func_150049_b_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockRailBase
的用法示例。
在下文中一共展示了BlockRailBase.func_150049_b_方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isCartLockedDown
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
/**
* Checks to see if a cart is being held by a ITrackLockdown.
*
* @param cart The cart to check
* @return True if being held
*/
public static boolean isCartLockedDown(EntityMinecart cart) {
int x = MathHelper.floor_double(cart.posX);
int y = MathHelper.floor_double(cart.posY);
int z = MathHelper.floor_double(cart.posZ);
if (BlockRailBase.func_150049_b_(cart.worldObj, x, y - 1, z))
y--;
TileEntity tile = cart.worldObj.getTileEntity(x, y, z);
if (tile instanceof ITrackTile) {
ITrackInstance track = ((ITrackTile) tile).getTrackInstance();
return track instanceof ITrackLockdown && ((ITrackLockdown) track).isCartLockedDown(cart);
} else if (tile instanceof ITrackLockdown)
return ((ITrackLockdown) tile).isCartLockedDown(cart);
return false;
}
示例2: func_70495_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public Vec3 func_70495_a(double doubleX, double doubleY, double doubleZ, double v)
{
int x = MathHelper.floor_double(doubleX);
int y = MathHelper.floor_double(doubleY);
int z = MathHelper.floor_double(doubleZ);
if (!BlockRailBase.func_150049_b_(this.worldObj, x, y, z) && BlockRailBase.func_150049_b_(this.worldObj, x, y - 1, z))
{
--y;
}
Block block = this.worldObj.getBlock(x, y, z);
if (!BlockRailBase.func_150051_a(block))
{
return null;
}
else
{
int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, x, y, z);
doubleY = (double)y;
if (l >= 2 && l <= 5)
{
doubleY = (double)(y + 1);
}
int[][] aint = matrix[l];
double d4 = (double)(aint[1][0] - aint[0][0]);
double d5 = (double)(aint[1][2] - aint[0][2]);
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
d4 /= d6;
d5 /= d6;
doubleX += d4 * v;
doubleZ += d5 * v;
if (aint[0][1] != 0 && MathHelper.floor_double(doubleX) - x == aint[0][0] && MathHelper.floor_double(doubleZ) - z == aint[0][2])
{
doubleY += (double)aint[0][1];
}
else if (aint[1][1] != 0 && MathHelper.floor_double(doubleX) - x == aint[1][0] && MathHelper.floor_double(doubleZ) - z == aint[1][2])
{
doubleY += (double)aint[1][1];
}
return this.func_70489_a(doubleX, doubleY, doubleZ);
}
}
示例3: func_70489_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
@Override
public Vec3 func_70489_a(double doubleX, double doubleY, double doubleZ)
{
int x = MathHelper.floor_double(doubleX);
int y = MathHelper.floor_double(doubleY);
int z = MathHelper.floor_double(doubleZ);
if (!BlockRailBase.func_150049_b_(this.worldObj, x, y, z) && BlockRailBase.func_150049_b_(this.worldObj, x, y - 1, z))
{
--y;
}
Block block = this.worldObj.getBlock(x, y, z);
if (BlockRailBase.func_150051_a(block))
{
int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, x, y, z);
doubleY = (double)y;
if (l >= 2 && l <= 5)
{
doubleY = (double)(y + 1);
}
int[][] aint = matrix[l];
double d3 = 0.0D;
double d4 = (double)x + 0.5D + (double)aint[0][0] * 0.5D;
double d5 = (double)y + 0.5D + (double)aint[0][1] * 0.5D;
double d6 = (double)z + 0.5D + (double)aint[0][2] * 0.5D;
double d7 = (double)x + 0.5D + (double)aint[1][0] * 0.5D;
double d8 = (double)y + 0.5D + (double)aint[1][1] * 0.5D;
double d9 = (double)z + 0.5D + (double)aint[1][2] * 0.5D;
double d10 = d7 - d4;
double d11 = (d8 - d5) * 2.0D;
double d12 = d9 - d6;
if (d10 == 0.0D)
{
doubleX = (double)x + 0.5D;
d3 = doubleZ - (double)z;
}
else if (d12 == 0.0D)
{
doubleZ = (double)z + 0.5D;
d3 = doubleX - (double)x;
}
else
{
double d13 = doubleX - d4;
double d14 = doubleZ - d6;
d3 = (d13 * d10 + d14 * d12) * 2.0D;
}
doubleX = d4 + d10 * d3;
doubleY = d5 + d11 * d3;
doubleZ = d6 + d12 * d3;
if (d11 < 0.0D)
{
++doubleY;
}
if (d11 > 0.0D)
{
doubleY += 0.5D;
}
return Vec3.createVectorHelper(doubleX, doubleY, doubleZ);
}
else
{
return null;
}
}
示例4: func_145772_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_)
{
return this.isIgnited() && (BlockRailBase.func_150051_a(p_145772_6_) || BlockRailBase.func_150049_b_(p_145772_2_, p_145772_3_, p_145772_4_ + 1, p_145772_5_)) ? 0.0F : super.func_145772_a(p_145772_1_, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, p_145772_6_);
}
示例5: func_145774_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_)
{
return this.isIgnited() && (BlockRailBase.func_150051_a(p_145774_6_) || BlockRailBase.func_150049_b_(p_145774_2_, p_145774_3_, p_145774_4_ + 1, p_145774_5_)) ? false : super.func_145774_a(p_145774_1_, p_145774_2_, p_145774_3_, p_145774_4_, p_145774_5_, p_145774_6_, p_145774_7_);
}
示例6: func_70495_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public Vec3 func_70495_a(double par1, double par3, double par5, double par7)
{
int var9 = MathHelper.floor_double(par1);
int var10 = MathHelper.floor_double(par3);
int var11 = MathHelper.floor_double(par5);
if (BlockRailBase.func_150049_b_(this.worldObj, var9, var10 - 1, var11))
{
--var10;
}
Block var12 = this.worldObj.getBlock(var9, var10, var11);
if (!BlockRailBase.func_150051_a(var12))
{
return null;
}
else
{
int var13 = this.worldObj.getBlockMetadata(var9, var10, var11);
if (((BlockRailBase)var12).func_150050_e())
{
var13 &= 7;
}
par3 = (double)var10;
if (var13 >= 2 && var13 <= 5)
{
par3 = (double)(var10 + 1);
}
int[][] var14 = matrix[var13];
double var15 = (double)(var14[1][0] - var14[0][0]);
double var17 = (double)(var14[1][2] - var14[0][2]);
double var19 = Math.sqrt(var15 * var15 + var17 * var17);
var15 /= var19;
var17 /= var19;
par1 += var15 * par7;
par5 += var17 * par7;
if (var14[0][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[0][0] && MathHelper.floor_double(par5) - var11 == var14[0][2])
{
par3 += (double)var14[0][1];
}
else if (var14[1][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[1][0] && MathHelper.floor_double(par5) - var11 == var14[1][2])
{
par3 += (double)var14[1][1];
}
return this.func_70489_a(par1, par3, par5);
}
}
示例7: func_70489_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public Vec3 func_70489_a(double par1, double par3, double par5)
{
int var7 = MathHelper.floor_double(par1);
int var8 = MathHelper.floor_double(par3);
int var9 = MathHelper.floor_double(par5);
if (BlockRailBase.func_150049_b_(this.worldObj, var7, var8 - 1, var9))
{
--var8;
}
Block var10 = this.worldObj.getBlock(var7, var8, var9);
if (BlockRailBase.func_150051_a(var10))
{
int var11 = this.worldObj.getBlockMetadata(var7, var8, var9);
par3 = (double)var8;
if (((BlockRailBase)var10).func_150050_e())
{
var11 &= 7;
}
if (var11 >= 2 && var11 <= 5)
{
par3 = (double)(var8 + 1);
}
int[][] var12 = matrix[var11];
double var13 = 0.0D;
double var15 = (double)var7 + 0.5D + (double)var12[0][0] * 0.5D;
double var17 = (double)var8 + 0.5D + (double)var12[0][1] * 0.5D;
double var19 = (double)var9 + 0.5D + (double)var12[0][2] * 0.5D;
double var21 = (double)var7 + 0.5D + (double)var12[1][0] * 0.5D;
double var23 = (double)var8 + 0.5D + (double)var12[1][1] * 0.5D;
double var25 = (double)var9 + 0.5D + (double)var12[1][2] * 0.5D;
double var27 = var21 - var15;
double var29 = (var23 - var17) * 2.0D;
double var31 = var25 - var19;
if (var27 == 0.0D)
{
par1 = (double)var7 + 0.5D;
var13 = par5 - (double)var9;
}
else if (var31 == 0.0D)
{
par5 = (double)var9 + 0.5D;
var13 = par1 - (double)var7;
}
else
{
double var33 = par1 - var15;
double var35 = par5 - var19;
var13 = (var33 * var27 + var35 * var31) * 2.0D;
}
par1 = var15 + var27 * var13;
par3 = var17 + var29 * var13;
par5 = var19 + var31 * var13;
if (var29 < 0.0D)
{
++par3;
}
if (var29 > 0.0D)
{
par3 += 0.5D;
}
return this.worldObj.getWorldVec3Pool().getVecFromPool(par1, par3, par5);
}
else
{
return null;
}
}
示例8: isMinecartOnRailAt
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public static boolean isMinecartOnRailAt(World world, int i, int j, int k, float sensitivity, Class<? extends EntityMinecart> type, boolean subclass) {
if (BlockRailBase.func_150049_b_(world, i, j, k))
return isMinecartAt(world, i, j, k, sensitivity, type, subclass);
return false;
}
示例9: isTrackFuzzyAt
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public static boolean isTrackFuzzyAt(World world, int x, int y, int z) {
return BlockRailBase.func_150049_b_(world, x, y, z) ? true : (BlockRailBase.func_150049_b_(world, x, y + 1, z) ? true : BlockRailBase.func_150049_b_(world, x, y - 1, z));
}
示例10: func_70495_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public Vec3 func_70495_a(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_)
{
int i = MathHelper.floor_double(p_70495_1_);
int j = MathHelper.floor_double(p_70495_3_);
int k = MathHelper.floor_double(p_70495_5_);
if (BlockRailBase.func_150049_b_(this.worldObj, i, j - 1, k))
{
--j;
}
Block block = this.worldObj.getBlock(i, j, k);
if (!BlockRailBase.func_150051_a(block))
{
return null;
}
else
{
int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k);
p_70495_3_ = (double)j;
if (l >= 2 && l <= 5)
{
p_70495_3_ = (double)(j + 1);
}
int[][] aint = matrix[l];
double d4 = (double)(aint[1][0] - aint[0][0]);
double d5 = (double)(aint[1][2] - aint[0][2]);
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
d4 /= d6;
d5 /= d6;
p_70495_1_ += d4 * p_70495_7_;
p_70495_5_ += d5 * p_70495_7_;
if (aint[0][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[0][0] && MathHelper.floor_double(p_70495_5_) - k == aint[0][2])
{
p_70495_3_ += (double)aint[0][1];
}
else if (aint[1][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[1][0] && MathHelper.floor_double(p_70495_5_) - k == aint[1][2])
{
p_70495_3_ += (double)aint[1][1];
}
return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_);
}
}
示例11: func_70489_a
import net.minecraft.block.BlockRailBase; //导入方法依赖的package包/类
public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_)
{
int i = MathHelper.floor_double(p_70489_1_);
int j = MathHelper.floor_double(p_70489_3_);
int k = MathHelper.floor_double(p_70489_5_);
if (BlockRailBase.func_150049_b_(this.worldObj, i, j - 1, k))
{
--j;
}
Block block = this.worldObj.getBlock(i, j, k);
if (BlockRailBase.func_150051_a(block))
{
int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k);
p_70489_3_ = (double)j;
if (l >= 2 && l <= 5)
{
p_70489_3_ = (double)(j + 1);
}
int[][] aint = matrix[l];
double d3 = 0.0D;
double d4 = (double)i + 0.5D + (double)aint[0][0] * 0.5D;
double d5 = (double)j + 0.5D + (double)aint[0][1] * 0.5D;
double d6 = (double)k + 0.5D + (double)aint[0][2] * 0.5D;
double d7 = (double)i + 0.5D + (double)aint[1][0] * 0.5D;
double d8 = (double)j + 0.5D + (double)aint[1][1] * 0.5D;
double d9 = (double)k + 0.5D + (double)aint[1][2] * 0.5D;
double d10 = d7 - d4;
double d11 = (d8 - d5) * 2.0D;
double d12 = d9 - d6;
if (d10 == 0.0D)
{
p_70489_1_ = (double)i + 0.5D;
d3 = p_70489_5_ - (double)k;
}
else if (d12 == 0.0D)
{
p_70489_5_ = (double)k + 0.5D;
d3 = p_70489_1_ - (double)i;
}
else
{
double d13 = p_70489_1_ - d4;
double d14 = p_70489_5_ - d6;
d3 = (d13 * d10 + d14 * d12) * 2.0D;
}
p_70489_1_ = d4 + d10 * d3;
p_70489_3_ = d5 + d11 * d3;
p_70489_5_ = d6 + d12 * d3;
if (d11 < 0.0D)
{
++p_70489_3_;
}
if (d11 > 0.0D)
{
p_70489_3_ += 0.5D;
}
return Vec3.createVectorHelper(p_70489_1_, p_70489_3_, p_70489_5_);
}
else
{
return null;
}
}