当前位置: 首页>>代码示例>>Java>>正文


Java EnumFacing.rotateYCCW方法代码示例

本文整理汇总了Java中net.minecraft.util.EnumFacing.rotateYCCW方法的典型用法代码示例。如果您正苦于以下问题:Java EnumFacing.rotateYCCW方法的具体用法?Java EnumFacing.rotateYCCW怎么用?Java EnumFacing.rotateYCCW使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.util.EnumFacing的用法示例。


在下文中一共展示了EnumFacing.rotateYCCW方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getActualState

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    TileEntity te = PneumaticCraftUtils.getTileEntitySafely(worldIn, pos);
    if (te instanceof TileEntityPneumaticDoor) {
        TileEntityPneumaticDoor teDoor = (TileEntityPneumaticDoor) te;
        if (teDoor.rotationAngle == 90) {
            EnumFacing originalRotation = state.getValue(ROTATION);
            if(originalRotation != EnumFacing.UP && originalRotation != EnumFacing.DOWN){
                EnumFacing facing = teDoor.rightGoing ? originalRotation.rotateY() : originalRotation.rotateYCCW();
                state = state.withProperty(ROTATION, facing);
            }
            state = state.withProperty(DOOR_STATE, DoorState.OPEN);
        } else if (teDoor.rotationAngle == 0) {
            state = state.withProperty(DOOR_STATE, DoorState.CLOSED);
        } else if (teDoor.rotationAngle > 0) {
            // currently rotating - hide the static model; TESR will show the rotating door
            state = state.withProperty(DOOR_STATE, DoorState.MOVING);
        }
    }
    return state;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:22,代码来源:BlockPneumaticDoor.java

示例2: onEnable

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void onEnable()
{
	// get start pos and facings
	BlockPos startPos = new BlockPos(WMinecraft.getPlayer());
	EnumFacing facing = WMinecraft.getPlayer().getHorizontalFacing();
	EnumFacing facing2 = facing.rotateYCCW();
	
	// set positions
	positions.clear();
	for(int[] pos : template)
		positions.add(startPos.up(pos[1]).offset(facing, pos[2])
			.offset(facing2, pos[0]));
	
	if(mode.getSelected() == 1)
	{
		// initialize building process
		blockIndex = 0;
		building = true;
		mc.rightClickDelayTimer = 4;
	}
	
	wurst.events.add(UpdateListener.class, this);
	wurst.events.add(RenderListener.class, this);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:26,代码来源:InstantBunkerMod.java

示例3: doesSideBlockRendering

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
{
    if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
        return super.doesSideBlockRendering(state, world, pos, face);

    if ( state.isOpaqueCube() )
        return true;

    state = this.getActualState(state, world, pos);

    EnumHalf half = state.getValue(HALF);
    EnumFacing side = state.getValue(FACING);
    EnumShape shape = state.getValue(SHAPE);
    if (face == EnumFacing.UP) return half == EnumHalf.TOP;
    if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM;
    if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
    if (face == side) return true;
    if (shape == EnumShape.INNER_LEFT && face.rotateY() == side) return true;
    if (shape == EnumShape.INNER_RIGHT && face.rotateYCCW() == side) return true;
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:BlockStairs.java

示例4: rotateFacing

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static EnumFacing rotateFacing(EnumFacing facing, int rotation) {
  if (rotation >= 0) {
    for (int i = 0; i < rotation; i++) {
      facing = facing.rotateY();
    }
  } else {
    rotation = -rotation;
    for (int i = 0; i < rotation; i++) {
      facing = facing.rotateYCCW();
    }
  }
  return facing;
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:14,代码来源:RedstoneUtil.java

示例5: getPowerOnSides

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
protected int getPowerOnSides(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    EnumFacing enumfacing1 = enumfacing.rotateY();
    EnumFacing enumfacing2 = enumfacing.rotateYCCW();
    return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:BlockRedstoneDiode.java

示例6: func_191110_a

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void func_191110_a(WoodlandMansionPieces.SimpleGrid p_191110_1_, int p_191110_2_, int p_191110_3_, EnumFacing p_191110_4_, int p_191110_5_)
{
    if (p_191110_5_ > 0)
    {
        p_191110_1_.func_191144_a(p_191110_2_, p_191110_3_, 1);
        p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ(), 0, 1);

        for (int i = 0; i < 8; ++i)
        {
            EnumFacing enumfacing = EnumFacing.getHorizontal(this.field_191117_a.nextInt(4));

            if (enumfacing != p_191110_4_.getOpposite() && (enumfacing != EnumFacing.EAST || !this.field_191117_a.nextBoolean()))
            {
                int j = p_191110_2_ + p_191110_4_.getFrontOffsetX();
                int k = p_191110_3_ + p_191110_4_.getFrontOffsetZ();

                if (p_191110_1_.func_191145_a(j + enumfacing.getFrontOffsetX(), k + enumfacing.getFrontOffsetZ()) == 0 && p_191110_1_.func_191145_a(j + enumfacing.getFrontOffsetX() * 2, k + enumfacing.getFrontOffsetZ() * 2) == 0)
                {
                    this.func_191110_a(p_191110_1_, p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing.getFrontOffsetZ(), enumfacing, p_191110_5_ - 1);
                    break;
                }
            }
        }

        EnumFacing enumfacing1 = p_191110_4_.rotateY();
        EnumFacing enumfacing2 = p_191110_4_.rotateYCCW();
        p_191110_1_.func_191141_a(p_191110_2_ + enumfacing1.getFrontOffsetX(), p_191110_3_ + enumfacing1.getFrontOffsetZ(), 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + enumfacing2.getFrontOffsetX(), p_191110_3_ + enumfacing2.getFrontOffsetZ(), 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing1.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing1.getFrontOffsetZ(), 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing2.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing2.getFrontOffsetZ(), 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() * 2, p_191110_3_ + p_191110_4_.getFrontOffsetZ() * 2, 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + enumfacing1.getFrontOffsetX() * 2, p_191110_3_ + enumfacing1.getFrontOffsetZ() * 2, 0, 2);
        p_191110_1_.func_191141_a(p_191110_2_ + enumfacing2.getFrontOffsetX() * 2, p_191110_3_ + enumfacing2.getFrontOffsetZ() * 2, 0, 2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:36,代码来源:WoodlandMansionPieces.java

示例7: getStairsShape

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static BlockStairs.EnumShape getStairsShape(IBlockState p_185706_0_, IBlockAccess p_185706_1_, BlockPos p_185706_2_)
{
    EnumFacing enumfacing = (EnumFacing)p_185706_0_.getValue(FACING);
    IBlockState iblockstate = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing));

    if (isBlockStairs(iblockstate) && p_185706_0_.getValue(HALF) == iblockstate.getValue(HALF))
    {
        EnumFacing enumfacing1 = (EnumFacing)iblockstate.getValue(FACING);

        if (enumfacing1.getAxis() != ((EnumFacing)p_185706_0_.getValue(FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing1.getOpposite()))
        {
            if (enumfacing1 == enumfacing.rotateYCCW())
            {
                return BlockStairs.EnumShape.OUTER_LEFT;
            }

            return BlockStairs.EnumShape.OUTER_RIGHT;
        }
    }

    IBlockState iblockstate1 = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing.getOpposite()));

    if (isBlockStairs(iblockstate1) && p_185706_0_.getValue(HALF) == iblockstate1.getValue(HALF))
    {
        EnumFacing enumfacing2 = (EnumFacing)iblockstate1.getValue(FACING);

        if (enumfacing2.getAxis() != ((EnumFacing)p_185706_0_.getValue(FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing2))
        {
            if (enumfacing2 == enumfacing.rotateYCCW())
            {
                return BlockStairs.EnumShape.INNER_LEFT;
            }

            return BlockStairs.EnumShape.INNER_RIGHT;
        }
    }

    return BlockStairs.EnumShape.STRAIGHT;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:BlockStairs.java

示例8: getCollEighthBlock

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Returns a bounding box representing an eighth of a block (a block whose three dimensions are halved).
 * Used in all stair shapes except STRAIGHT (gets added alone in the case of OUTER; alone with a quarter block in
 * case of INSIDE).
 */
private static AxisAlignedBB getCollEighthBlock(IBlockState bstate)
{
    EnumFacing enumfacing = (EnumFacing)bstate.getValue(FACING);
    EnumFacing enumfacing1;

    switch ((BlockStairs.EnumShape)bstate.getValue(SHAPE))
    {
        case OUTER_LEFT:
        default:
            enumfacing1 = enumfacing;
            break;
        case OUTER_RIGHT:
            enumfacing1 = enumfacing.rotateY();
            break;
        case INNER_RIGHT:
            enumfacing1 = enumfacing.getOpposite();
            break;
        case INNER_LEFT:
            enumfacing1 = enumfacing.rotateYCCW();
    }

    boolean flag = bstate.getValue(HALF) == BlockStairs.EnumHalf.TOP;

    switch (enumfacing1)
    {
        case NORTH:
        default:
            return flag ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;
        case SOUTH:
            return flag ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;
        case WEST:
            return flag ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;
        case EAST:
            return flag ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:42,代码来源:BlockStairs.java

示例9: onItemUse

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if(worldIn.isRemote) return EnumActionResult.SUCCESS;
    TileEntity te = worldIn.getTileEntity(pos);
    if(te != null && te instanceof TileMachineController) {
        DynamicMachine dm = ((TileMachineController) te).getBlueprintMachine();
        if(dm != null) {
            BlockArray pattern = dm.getPattern();
            if(pattern != null) {

                EnumFacing face = EnumFacing.NORTH;
                player.sendMessage(new TextComponentString("Attempting structure matching:"));
                player.sendMessage(new TextComponentString("Structure is facing: " + worldIn.getBlockState(pos).getValue(BlockController.FACING).name()));
                do {
                    if(face == worldIn.getBlockState(pos).getValue(BlockController.FACING)) {
                        BlockPos mismatch = pattern.getRelativeMismatchPosition(worldIn, pos);
                        if(mismatch != null) {
                            player.sendMessage(new TextComponentString("Failed at relative position: " + mismatch.toString()));
                        }
                    }
                    face = face.rotateYCCW();
                    pattern = pattern.rotateYCCW();
                } while (face != EnumFacing.NORTH);
            }
        }
    }
    return EnumActionResult.SUCCESS;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:29,代码来源:ItemDebugStruct.java

示例10: matchesRotation

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Nullable
public Tuple<EnumFacing, BlockArray> matchesRotation(BlockArray pattern) {
    EnumFacing face = EnumFacing.NORTH;
    do {
        if(pattern.matches(getWorld(), getPos(), false)) {
            return new Tuple<>(face, pattern);
        }
        face = face.rotateYCCW();
        pattern = pattern.rotateYCCW();
    } while (face != EnumFacing.NORTH);
    return null;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:13,代码来源:TileMachineController.java

示例11: func_191130_a

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void func_191130_a(List<WoodlandMansionPieces.MansionTemplate> p_191130_1_, WoodlandMansionPieces.PlacementData p_191130_2_, WoodlandMansionPieces.SimpleGrid p_191130_3_, EnumFacing p_191130_4_, int p_191130_5_, int p_191130_6_, int p_191130_7_, int p_191130_8_)
{
    int i = p_191130_5_;
    int j = p_191130_6_;
    EnumFacing enumfacing = p_191130_4_;

    while (true)
    {
        if (!WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ()))
        {
            this.func_191124_c(p_191130_1_, p_191130_2_);
            p_191130_4_ = p_191130_4_.rotateY();

            if (i != p_191130_7_ || j != p_191130_8_ || enumfacing != p_191130_4_)
            {
                this.func_191131_b(p_191130_1_, p_191130_2_);
            }
        }
        else if (WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ()) && WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX() + p_191130_4_.rotateYCCW().getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ() + p_191130_4_.rotateYCCW().getFrontOffsetZ()))
        {
            this.func_191126_d(p_191130_1_, p_191130_2_);
            i += p_191130_4_.getFrontOffsetX();
            j += p_191130_4_.getFrontOffsetZ();
            p_191130_4_ = p_191130_4_.rotateYCCW();
        }
        else
        {
            i += p_191130_4_.getFrontOffsetX();
            j += p_191130_4_.getFrontOffsetZ();

            if (i != p_191130_7_ || j != p_191130_8_ || enumfacing != p_191130_4_)
            {
                this.func_191131_b(p_191130_1_, p_191130_2_);
            }
        }

        if (i == p_191130_7_ && j == p_191130_8_ && enumfacing == p_191130_4_)
        {
            break;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:43,代码来源:WoodlandMansionPieces.java

示例12: getCollEighthBlock

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Returns a bounding box representing an eighth of a block (a block whose three dimensions are halved).
 * Used in all stair shapes except STRAIGHT (gets added alone in the case of OUTER; alone with a quarter block in
 * case of INSIDE).
 */
private static AxisAlignedBB getCollEighthBlock(IBlockState bstate)
{
    EnumFacing enumfacing = (EnumFacing)bstate.getValue(FACING);
    EnumFacing enumfacing1;

    switch ((BlockStairs.EnumShape)bstate.getValue(SHAPE))
    {
        case OUTER_LEFT:
        default:
            enumfacing1 = enumfacing;
            break;

        case OUTER_RIGHT:
            enumfacing1 = enumfacing.rotateY();
            break;

        case INNER_RIGHT:
            enumfacing1 = enumfacing.getOpposite();
            break;

        case INNER_LEFT:
            enumfacing1 = enumfacing.rotateYCCW();
    }

    boolean flag = bstate.getValue(HALF) == BlockStairs.EnumHalf.TOP;

    switch (enumfacing1)
    {
        case NORTH:
        default:
            return flag ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;

        case SOUTH:
            return flag ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;

        case WEST:
            return flag ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;

        case EAST:
            return flag ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:BlockStairs.java


注:本文中的net.minecraft.util.EnumFacing.rotateYCCW方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。