本文整理汇总了Java中net.minecraft.util.EnumFacing.NORTH属性的典型用法代码示例。如果您正苦于以下问题:Java EnumFacing.NORTH属性的具体用法?Java EnumFacing.NORTH怎么用?Java EnumFacing.NORTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.util.EnumFacing
的用法示例。
在下文中一共展示了EnumFacing.NORTH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderParticle
public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
//super.renderParticle(buffer, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
//System.out.println("rot: "+rotationX+" "+rotationZ+" "+rotationYZ+" "+rotationXY+" "+rotationXZ);
EnumFacing face=this.block.sideHit;
if(face == EnumFacing.UP)
super.renderParticle(buffer, entityIn, partialTicks, 1, 0, 0, 0, 1);
else if(face == EnumFacing.DOWN)
super.renderParticle(buffer, entityIn, partialTicks, 1, 0, 0, 0, -1);
else if(face == EnumFacing.NORTH)
super.renderParticle(buffer, entityIn, partialTicks, 1, 1, 0, 0, 0);
else if(face == EnumFacing.SOUTH)
super.renderParticle(buffer, entityIn, partialTicks, -1, 1, 0, 0, 0);
else if(face == EnumFacing.EAST)
super.renderParticle(buffer, entityIn, partialTicks, 0, 1, 1, 0, 0);
else if(face == EnumFacing.WEST)
super.renderParticle(buffer, entityIn, partialTicks, 0, 1, -1, 0, 0);
}
示例2: getFacing
protected static EnumFacing getFacing(int meta)
{
switch (meta & 3)
{
case 0:
return EnumFacing.NORTH;
case 1:
return EnumFacing.SOUTH;
case 2:
return EnumFacing.WEST;
case 3:
default:
return EnumFacing.EAST;
}
}
示例3: getFacing
private static EnumFacing getFacing(int p_getFacing_0_)
{
switch (p_getFacing_0_)
{
case 0:
return EnumFacing.DOWN;
case 1:
return EnumFacing.UP;
case 2:
return EnumFacing.NORTH;
case 3:
return EnumFacing.SOUTH;
case 4:
return EnumFacing.WEST;
case 5:
return EnumFacing.EAST;
default:
return EnumFacing.UP;
}
}
示例4: getTarget
public BlockData getTarget(BlockPos pos) {
EnumFacing[] orderedFacingValues = new EnumFacing[] {
EnumFacing.UP,
EnumFacing.EAST,
EnumFacing.NORTH,
EnumFacing.WEST,
EnumFacing.SOUTH,
EnumFacing.DOWN
};
for (EnumFacing facing : orderedFacingValues) {
BlockPos alteredPos = pos.add(facing.getOpposite().getDirectionVec());
if (!mc.theWorld.getBlockState(alteredPos).getBlock().isReplaceable(mc.theWorld, alteredPos) && !(mc.theWorld.getBlockState(alteredPos).getBlock() instanceof BlockLiquid) && !(mc.theWorld.getBlockState(alteredPos).getBlock() instanceof BlockAir)) {
return new BlockData(alteredPos, facing);
}
}
return null;
}
示例5: Piece
protected Piece(int p_i45590_1_, EnumFacing p_i45590_2_, StructureOceanMonumentPieces.RoomDefinition p_i45590_3_, int p_i45590_4_, int p_i45590_5_, int p_i45590_6_)
{
super(p_i45590_1_);
this.setCoordBaseMode(p_i45590_2_);
this.roomDefinition = p_i45590_3_;
int i = p_i45590_3_.index;
int j = i % 5;
int k = i / 5 % 5;
int l = i / 25;
if (p_i45590_2_ != EnumFacing.NORTH && p_i45590_2_ != EnumFacing.SOUTH)
{
this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_6_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_4_ * 8 - 1);
}
else
{
this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_4_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_6_ * 8 - 1);
}
switch (p_i45590_2_)
{
case NORTH:
this.boundingBox.offset(j * 8, l * 4, -(k + p_i45590_6_) * 8 + 1);
break;
case SOUTH:
this.boundingBox.offset(j * 8, l * 4, k * 8);
break;
case WEST:
this.boundingBox.offset(-(k + p_i45590_6_) * 8 + 1, l * 4, j * 8);
break;
default:
this.boundingBox.offset(k * 8, l * 4, j * 8);
}
}
示例6: getStateFromMeta
/**
* Convert the given metadata into a BlockState for this Block
*/
public IBlockState getStateFromMeta(int meta)
{
EnumFacing enumfacing = EnumFacing.getFront(meta);
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
{
enumfacing = EnumFacing.NORTH;
}
return this.getDefaultState().withProperty(FACING, enumfacing);
}
示例7: buildComponent
public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
{
this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
}
else
{
this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
}
}
示例8: setDefaultDirection
private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state)
{
if (!worldIn.isRemote)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
boolean flag = worldIn.getBlockState(pos.north()).getBlock().isFullBlock();
boolean flag1 = worldIn.getBlockState(pos.south()).getBlock().isFullBlock();
if (enumfacing == EnumFacing.NORTH && flag && !flag1)
{
enumfacing = EnumFacing.SOUTH;
}
else if (enumfacing == EnumFacing.SOUTH && flag1 && !flag)
{
enumfacing = EnumFacing.NORTH;
}
else
{
boolean flag2 = worldIn.getBlockState(pos.west()).getBlock().isFullBlock();
boolean flag3 = worldIn.getBlockState(pos.east()).getBlock().isFullBlock();
if (enumfacing == EnumFacing.WEST && flag2 && !flag3)
{
enumfacing = EnumFacing.EAST;
}
else if (enumfacing == EnumFacing.EAST && flag3 && !flag2)
{
enumfacing = EnumFacing.WEST;
}
}
worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2);
}
}
示例9: getStateFromMeta
@Override
public IBlockState getStateFromMeta(int meta)
{
EnumFacing enumfacing = EnumFacing.getHorizontal(meta & 3); //untill third bit ? so facing only
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
{
enumfacing = EnumFacing.NORTH;
}
return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(FULL, (meta & 4) > 0); //facing + (saved data after facing = &4
}
示例10: Size
public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_)
{
this.world = worldIn;
this.axis = p_i45694_3_;
if (p_i45694_3_ == EnumFacing.Axis.X)
{
this.field_150863_d = EnumFacing.EAST;
this.field_150866_c = EnumFacing.WEST;
}
else
{
this.field_150863_d = EnumFacing.NORTH;
this.field_150866_c = EnumFacing.SOUTH;
}
for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && this.func_150857_a(worldIn.getBlockState(p_i45694_2_.down()).getBlock()); p_i45694_2_ = p_i45694_2_.down())
{
;
}
int i = this.func_180120_a(p_i45694_2_, this.field_150863_d) - 1;
if (i >= 0)
{
this.field_150861_f = p_i45694_2_.offset(this.field_150863_d, i);
this.field_150868_h = this.func_180120_a(this.field_150861_f, this.field_150866_c);
if (this.field_150868_h < 2 || this.field_150868_h > 21)
{
this.field_150861_f = null;
this.field_150868_h = 0;
}
}
if (this.field_150861_f != null)
{
this.field_150862_g = this.func_150858_a();
}
}
示例11: Corridor
public Corridor(int p_i45581_1_, Random p_i45581_2_, StructureBoundingBox p_i45581_3_, EnumFacing p_i45581_4_)
{
super(p_i45581_1_);
this.coordBaseMode = p_i45581_4_;
this.boundingBox = p_i45581_3_;
this.field_74993_a = p_i45581_4_ != EnumFacing.NORTH && p_i45581_4_ != EnumFacing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize();
}
示例12: getStateFromMeta
/**
* Convert the given metadata into a BlockState for this Block
*/
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if(meta >= EnumFacing.HORIZONTALS.length) {
meta = 1;
}
EnumFacing face = EnumFacing.values()[meta>>1];
if(face == EnumFacing.DOWN || face == EnumFacing.UP) {
face = EnumFacing.NORTH;
}
return this.getDefaultState().withProperty(FACING, face);
}
示例13: setBoundBasedOnMeta
private void setBoundBasedOnMeta(int combinedMeta)
{
float f = 0.1875F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
EnumFacing enumfacing = getFacing(combinedMeta);
boolean flag = isOpen(combinedMeta);
boolean flag1 = isHingeLeft(combinedMeta);
if (flag)
{
if (enumfacing == EnumFacing.EAST)
{
if (!flag1)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
}
else if (enumfacing == EnumFacing.SOUTH)
{
if (!flag1)
{
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
}
else if (enumfacing == EnumFacing.WEST)
{
if (!flag1)
{
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
}
else if (enumfacing == EnumFacing.NORTH)
{
if (!flag1)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
else
{
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
}
}
else if (enumfacing == EnumFacing.EAST)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
else if (enumfacing == EnumFacing.SOUTH)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
else if (enumfacing == EnumFacing.WEST)
{
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
else if (enumfacing == EnumFacing.NORTH)
{
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
}
示例14: addBlockHitEffects
/**
* Adds block hit particles for the specified block
*/
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
IBlockState iblockstate = this.worldObj.getBlockState(pos);
Block block = iblockstate.getBlock();
if (block.getRenderType() != -1)
{
int i = pos.getX();
int j = pos.getY();
int k = pos.getZ();
float f = 0.1F;
double d0 = (double)i + this.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinX();
double d1 = (double)j + this.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinY();
double d2 = (double)k + this.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinZ();
if (side == EnumFacing.DOWN)
{
d1 = (double)j + block.getBlockBoundsMinY() - (double)f;
}
if (side == EnumFacing.UP)
{
d1 = (double)j + block.getBlockBoundsMaxY() + (double)f;
}
if (side == EnumFacing.NORTH)
{
d2 = (double)k + block.getBlockBoundsMinZ() - (double)f;
}
if (side == EnumFacing.SOUTH)
{
d2 = (double)k + block.getBlockBoundsMaxZ() + (double)f;
}
if (side == EnumFacing.WEST)
{
d0 = (double)i + block.getBlockBoundsMinX() - (double)f;
}
if (side == EnumFacing.EAST)
{
d0 = (double)i + block.getBlockBoundsMaxX() + (double)f;
}
this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).func_174846_a(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
}
示例15: getFacingFromVertexData
public static EnumFacing getFacingFromVertexData(int[] faceData)
{
Vector3f vector3f = new Vector3f(Float.intBitsToFloat(faceData[0]), Float.intBitsToFloat(faceData[1]), Float.intBitsToFloat(faceData[2]));
Vector3f vector3f1 = new Vector3f(Float.intBitsToFloat(faceData[7]), Float.intBitsToFloat(faceData[8]), Float.intBitsToFloat(faceData[9]));
Vector3f vector3f2 = new Vector3f(Float.intBitsToFloat(faceData[14]), Float.intBitsToFloat(faceData[15]), Float.intBitsToFloat(faceData[16]));
Vector3f vector3f3 = new Vector3f();
Vector3f vector3f4 = new Vector3f();
Vector3f vector3f5 = new Vector3f();
Vector3f.sub(vector3f, vector3f1, vector3f3);
Vector3f.sub(vector3f2, vector3f1, vector3f4);
Vector3f.cross(vector3f4, vector3f3, vector3f5);
float f = (float)Math.sqrt((double)(vector3f5.x * vector3f5.x + vector3f5.y * vector3f5.y + vector3f5.z * vector3f5.z));
vector3f5.x /= f;
vector3f5.y /= f;
vector3f5.z /= f;
EnumFacing enumfacing = null;
float f1 = 0.0F;
for (EnumFacing enumfacing1 : EnumFacing.values())
{
Vec3i vec3i = enumfacing1.getDirectionVec();
Vector3f vector3f6 = new Vector3f((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
float f2 = Vector3f.dot(vector3f5, vector3f6);
if (f2 >= 0.0F && f2 > f1)
{
f1 = f2;
enumfacing = enumfacing1;
}
}
if (f1 < 0.719F)
{
if (enumfacing != EnumFacing.EAST && enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.SOUTH)
{
enumfacing = EnumFacing.UP;
}
else
{
enumfacing = EnumFacing.NORTH;
}
}
return enumfacing == null ? EnumFacing.UP : enumfacing;
}