當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumFacing.rotateY方法代碼示例

本文整理匯總了Java中net.minecraft.util.EnumFacing.rotateY方法的典型用法代碼示例。如果您正苦於以下問題:Java EnumFacing.rotateY方法的具體用法?Java EnumFacing.rotateY怎麽用?Java EnumFacing.rotateY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.EnumFacing的用法示例。


在下文中一共展示了EnumFacing.rotateY方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: correctFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = null;

    for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));

        if (iblockstate.getBlock() == this)
        {
            return state;
        }

        if (iblockstate.getBlock().isFullBlock())
        {
            if (enumfacing != null)
            {
                enumfacing = null;
                break;
            }

            enumfacing = enumfacing1;
        }
    }

    if (enumfacing != null)
    {
        return state.withProperty(FACING, enumfacing.getOpposite());
    }
    else
    {
        EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.rotateY();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        return state.withProperty(FACING, enumfacing2);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:52,代碼來源:BlockChest.java

示例8: correctFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state) {
	EnumFacing enumfacing = null;

	for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
		EnumFacing enumfacing1 = (EnumFacing) enumfacing0;
		IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));

		if (iblockstate.getBlock() == this) {
			return state;
		}

		if (iblockstate.getBlock().isFullBlock()) {
			if (enumfacing != null) {
				enumfacing = null;
				break;
			}

			enumfacing = enumfacing1;
		}
	}

	if (enumfacing != null) {
		return state.withProperty(FACING, enumfacing.getOpposite());
	} else {
		EnumFacing enumfacing2 = (EnumFacing) state.getValue(FACING);

		if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
			enumfacing2 = enumfacing2.getOpposite();
		}

		if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
			enumfacing2 = enumfacing2.rotateY();
		}

		if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
			enumfacing2 = enumfacing2.getOpposite();
		}

		return state.withProperty(FACING, enumfacing2);
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:42,代碼來源:BlockChest.java

示例9: correctFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = null;

    for (Object enumfacing10 : EnumFacing.Plane.HORIZONTAL)
    {
        EnumFacing enumfacing1 = (EnumFacing) enumfacing10;
        IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));

        if (iblockstate.getBlock() == this)
        {
            return state;
        }

        if (iblockstate.getBlock().isFullBlock())
        {
            if (enumfacing != null)
            {
                enumfacing = null;
                break;
            }

            enumfacing = enumfacing1;
        }
    }

    if (enumfacing != null)
    {
        return state.withProperty(FACING, enumfacing.getOpposite());
    }
    else
    {
        EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.rotateY();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        return state.withProperty(FACING, enumfacing2);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:53,代碼來源:BlockChest.java

示例10: 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

示例11: 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

示例12: correctFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = null;

    for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));

        if (iblockstate.getBlock() == this)
        {
            return state;
        }

        if (iblockstate.isFullBlock())
        {
            if (enumfacing != null)
            {
                enumfacing = null;
                break;
            }

            enumfacing = enumfacing1;
        }
    }

    if (enumfacing != null)
    {
        return state.withProperty(FACING, enumfacing.getOpposite());
    }
    else
    {
        EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.rotateY();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        return state.withProperty(FACING, enumfacing2);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:52,代碼來源:BlockChest.java

示例13: readCustomNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public void readCustomNBT(NBTTagCompound compound) {
    super.readCustomNBT(compound);
    this.inventory = IOInventory.deserialize(this, compound.getCompoundTag("items"));
    this.inventory.setStackLimit(1, BLUEPRINT_SLOT);
    this.craftingStatus = CraftingStatus.values()[compound.getInteger("status")];

    if(compound.hasKey("machine") && compound.hasKey("rotation")) {
        ResourceLocation rl = new ResourceLocation(compound.getString("machine"));
        DynamicMachine machine = MachineRegistry.getRegistry().getMachine(rl);
        if(machine == null) {
            ModularMachinery.log.info("Couldn't find machine named " + rl.toString() + " for controller at " + getPos().toString());
            this.foundMachine = null;
            this.foundPattern = null;
            this.patternRotation = null;
        } else {
            EnumFacing rot = EnumFacing.getHorizontal(compound.getInteger("rotation"));
            EnumFacing offset = EnumFacing.NORTH;
            BlockArray pattern = machine.getPattern();
            while (offset != rot) {
                pattern = pattern.rotateYCCW();
                offset = offset.rotateY();
            }
            this.patternRotation = rot;
            this.foundPattern = pattern;
            this.foundMachine = machine;
        }
    } else {
        this.foundMachine = null;
        this.foundPattern = null;
        this.patternRotation = null;
    }
    if(compound.hasKey("activeRecipe")) {
        NBTTagCompound tag = compound.getCompoundTag("activeRecipe");
        ActiveMachineRecipe recipe = new ActiveMachineRecipe(tag);
        if(recipe.getRecipe() == null) {
            ModularMachinery.log.info("Couldn't find recipe named " + tag.getString("recipeName") + " for controller at " + getPos().toString());
            this.activeRecipe = null;
        } else {
            this.activeRecipe = recipe;
        }
    } else {
        this.activeRecipe = null;
    }
}
 
開發者ID:HellFirePvP,項目名稱:ModularMachinery,代碼行數:46,代碼來源:TileMachineController.java


注:本文中的net.minecraft.util.EnumFacing.rotateY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。