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


Java EnumFacing.ordinal方法代码示例

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


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

示例1: getConnectedModules

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
Set<TubeModule> getConnectedModules(TubeModule module) {
    Set<TubeModule> modules = new HashSet<>();
    Set<TileEntityPressureTube> traversedTubes = new HashSet<>();
    Stack<TileEntityPressureTube> pendingTubes = new Stack<>();
    pendingTubes.push((TileEntityPressureTube) module.getTube());
    while (!pendingTubes.isEmpty()) {
        TileEntityPressureTube tube = pendingTubes.pop();
        for (TubeModule m : tube.modules) {
            if (m != null) modules.add(m);
        }
        TileEntityCache[] cache = ((AirHandler) tube.getAirHandler(null)).getTileCache();
        for (EnumFacing d : EnumFacing.VALUES) {
            if (tube.sidesConnected[d.ordinal()]) {
                TileEntityPressureTube newTube = ModInteractionUtils.getInstance().getTube(cache[d.ordinal()].getTileEntity());
                if (newTube != null && !traversedTubes.contains(newTube)) {
                    pendingTubes.add(newTube);
                    traversedTubes.add(newTube);
                }
            }
        }
    }
    return modules;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:24,代码来源:ModuleNetworkManager.java

示例2: setPosition

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Sets the RenderChunk base position
 */
public void setPosition(int p_189562_1_, int p_189562_2_, int p_189562_3_)
{
    if (p_189562_1_ != this.position.getX() || p_189562_2_ != this.position.getY() || p_189562_3_ != this.position.getZ())
    {
        this.stopCompileTask();
        this.position.setPos(p_189562_1_, p_189562_2_, p_189562_3_);
        this.boundingBox = new AxisAlignedBB((double)p_189562_1_, (double)p_189562_2_, (double)p_189562_3_, (double)(p_189562_1_ + 16), (double)(p_189562_2_ + 16), (double)(p_189562_3_ + 16));

        for (EnumFacing enumfacing : EnumFacing.VALUES)
        {
            this.mapEnumFacing[enumfacing.ordinal()].setPos(this.position).move(enumfacing, 16);
            this.renderChunksOfset16[enumfacing.ordinal()] = null;
        }

        this.chunk = null;
        this.initModelviewMatrix();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:RenderChunk.java

示例3: handlePressureTube

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static void handlePressureTube(ProbeMode mode, IProbeInfo probeInfo, TileEntityPressureTube te, EnumFacing face) {
    if (face != null) {
        TubeModule module = te.modules[face.ordinal()];
        if (module != null) {
            IProbeInfo vert = probeInfo.vertical(new LayoutStyle().borderColor(0xFF4040FF).spacing(3));
            List<String> currenttip = new ArrayList<>();
            module.addInfo(currenttip);
            for (String s : currenttip) vert.text(s);
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:TOPCallback.java

示例4: updateConnections

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void updateConnections() {
	for (EnumFacing dir : EnumFacing.VALUES) {
		if (TubeUtil.canConnect(dir, getPos(), getWorld()))
			neighborConns[dir.ordinal()] = dir;
		else
			neighborConns[dir.ordinal()] = null;
	}
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:9,代码来源:TileTube.java

示例5: addSideQuad

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static void addSideQuad(ImmutableList.Builder<BakedQuad> builder, BitSet faces, VertexFormat format, Optional<TRSRTransformation> transform, EnumFacing side, int tint, TextureAtlasSprite sprite, int uMax, int vMax, int u, int v)
{
    int si = side.ordinal();
    if(si > 4) si -= 2;
    int index = (vMax + 1) * ((uMax + 1) * si + u) + v;
    if(!faces.get(index))
    {
        faces.set(index);
        builder.add(buildSideQuad(format, transform, side, tint, sprite, u, v));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:ItemLayerModel.java

示例6: onAirDispersion

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void onAirDispersion(IAirHandler handler, EnumFacing side, int amount) {
    if (side != null) {
        int intSide = side/*.getOpposite()*/.ordinal();
        if (modules[intSide] instanceof IInfluenceDispersing) {
            ((IInfluenceDispersing) modules[intSide]).onAirDispersion(amount);
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:10,代码来源:TileEntityPressureTube.java

示例7: updateConnections

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void updateConnections() {
    sidesConnected = new boolean[6];

    List<Pair<EnumFacing, IAirHandler>> connections = getAirHandler(null).getConnectedPneumatics();
    Arrays.fill(sidesConnected, false);
    for (Pair<EnumFacing, IAirHandler> entry : connections) {
        sidesConnected[entry.getKey().ordinal()] = true;
    }

    boolean hasModule = false;
    for (int i = 0; i < 6; i++) {
        if (modules[i] != null) {
            hasModule = true;
            break;
        }
    }

    int sidesCount = 0;
    for (boolean bool : sidesConnected) {
        if (bool) sidesCount++;
    }
    if (sidesCount == 1 && !hasModule) {
        for (int i = 0; i < 6; i++) {
            if (sidesConnected[i]) {
                EnumFacing opposite = EnumFacing.getFront(i).getOpposite();
                if (isConnectedTo(opposite)) sidesConnected[opposite.ordinal()] = true;
                break;
            }
        }
    }
    for (int i = 0; i < 6; i++) {
        if (modules[i] != null && modules[i].isInline()) sidesConnected[i] = false;
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:35,代码来源:TileEntityPressureTube.java

示例8: printManometerMessage

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void printManometerMessage(EntityPlayer player, List<String> text) {
    RayTraceResult mop = PneumaticCraftUtils.getEntityLookedObject(player);
    if (mop != null && mop.hitInfo instanceof EnumFacing) {
        EnumFacing dir = (EnumFacing) mop.hitInfo;
        if (modules[dir.ordinal()] != null) {
            modules[dir.ordinal()].addInfo(text);
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:11,代码来源:TileEntityPressureTube.java

示例9: writeNBT

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public NBTTagCompound writeNBT() {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setIntArray("inSlots", this.inSlots);
    tag.setIntArray("outSlots", this.outSlots);
    tag.setIntArray("miscSlots", this.miscSlots);

    NBTTagList inv = new NBTTagList();
    for (Integer slot : this.inventory.keySet()) {
        SlotStackHolder holder = this.inventory.get(slot);
        NBTTagCompound holderTag = new NBTTagCompound();
        holderTag.setBoolean("holderEmpty", holder.itemStack.isEmpty());
        holderTag.setInteger("holderId", slot);
        if(!holder.itemStack.isEmpty()) {
            holder.itemStack.writeToNBT(holderTag);
        }
        inv.appendTag(holderTag);
    }
    tag.setTag("inventoryArray", inv);

    int[] sides = new int[accessibleSides.size()];
    for (int i = 0; i < accessibleSides.size(); i++) {
        EnumFacing side = accessibleSides.get(i);
        sides[i] = side.ordinal();
    }
    tag.setIntArray("sides", sides);
    return tag;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:28,代码来源:IOInventory.java

示例10: getMetaFromState

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public int getMetaFromState(IBlockState state) {
	ChipTypes type = (ChipTypes) state.getValue(TYPE);
	EnumFacing facing = (EnumFacing) state.getValue(FACING);
	int meta = type.getID() * EnumFacing.values().length + facing.ordinal();
	return meta;
}
 
开发者ID:IvanSteklow,项目名称:VanillaExtras,代码行数:8,代码来源:BlockBreaker.java

示例11: setDirection

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void setDirection(byte p_189561_1_, EnumFacing p_189561_2_)
{
    this.setFacing = this.setFacing | p_189561_1_ | 1 << p_189561_2_.ordinal();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:RenderGlobal.java

示例12: hasData

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public boolean hasData(EnumFacing face) {
    return face == null ? temp[6] != null : temp[face.ordinal()] != null;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:4,代码来源:HeatExchangerManager.java

示例13: getSidesFromDir

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static boolean[] getSidesFromDir(EnumFacing dir) {
    boolean[] dirs = new boolean[6];
    dirs[dir.ordinal()] = true;
    return dirs;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:ProgWidgetPlace.java

示例14: func_178603_a

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private int func_178603_a(int p_178603_1_, EnumFacing p_178603_2_)
{
    switch (VisGraph.VisGraph$1.field_178617_a[p_178603_2_.ordinal()])
    {
        case 1:
            if ((p_178603_1_ >> 8 & 15) == 0)
            {
                return -1;
            }

            return p_178603_1_ - field_178615_c;

        case 2:
            if ((p_178603_1_ >> 8 & 15) == 15)
            {
                return -1;
            }

            return p_178603_1_ + field_178615_c;

        case 3:
            if ((p_178603_1_ >> 4 & 15) == 0)
            {
                return -1;
            }

            return p_178603_1_ - field_178614_b;

        case 4:
            if ((p_178603_1_ >> 4 & 15) == 15)
            {
                return -1;
            }

            return p_178603_1_ + field_178614_b;

        case 5:
            if ((p_178603_1_ >> 0 & 15) == 0)
            {
                return -1;
            }

            return p_178603_1_ - field_178616_a;

        case 6:
            if ((p_178603_1_ >> 0 & 15) == 15)
            {
                return -1;
            }

            return p_178603_1_ + field_178616_a;

        default:
            return -1;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:57,代码来源:VisGraph.java

示例15: fillQuadBounds

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void fillQuadBounds(Block blockIn, int[] vertexData, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags)
{
    float f = 32.0F;
    float f1 = 32.0F;
    float f2 = 32.0F;
    float f3 = -32.0F;
    float f4 = -32.0F;
    float f5 = -32.0F;

    for (int i = 0; i < 4; ++i)
    {
        float f6 = Float.intBitsToFloat(vertexData[i * 7]);
        float f7 = Float.intBitsToFloat(vertexData[i * 7 + 1]);
        float f8 = Float.intBitsToFloat(vertexData[i * 7 + 2]);
        f = Math.min(f, f6);
        f1 = Math.min(f1, f7);
        f2 = Math.min(f2, f8);
        f3 = Math.max(f3, f6);
        f4 = Math.max(f4, f7);
        f5 = Math.max(f5, f8);
    }

    if (quadBounds != null)
    {
        quadBounds[EnumFacing.WEST.getIndex()] = f;
        quadBounds[EnumFacing.EAST.getIndex()] = f3;
        quadBounds[EnumFacing.DOWN.getIndex()] = f1;
        quadBounds[EnumFacing.UP.getIndex()] = f4;
        quadBounds[EnumFacing.NORTH.getIndex()] = f2;
        quadBounds[EnumFacing.SOUTH.getIndex()] = f5;
        quadBounds[EnumFacing.WEST.getIndex() + EnumFacing.VALUES.length] = 1.0F - f;
        quadBounds[EnumFacing.EAST.getIndex() + EnumFacing.VALUES.length] = 1.0F - f3;
        quadBounds[EnumFacing.DOWN.getIndex() + EnumFacing.VALUES.length] = 1.0F - f1;
        quadBounds[EnumFacing.UP.getIndex() + EnumFacing.VALUES.length] = 1.0F - f4;
        quadBounds[EnumFacing.NORTH.getIndex() + EnumFacing.VALUES.length] = 1.0F - f2;
        quadBounds[EnumFacing.SOUTH.getIndex() + EnumFacing.VALUES.length] = 1.0F - f5;
    }

    float f10 = 1.0E-4F;
    float f9 = 0.9999F;

    switch (BlockModelRenderer.BlockModelRenderer$1.field_178290_a[facingIn.ordinal()])
    {
        case 1:
            boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F);
            boundsFlags.set(0, (f1 < 1.0E-4F || blockIn.isFullCube()) && f1 == f4);
            break;

        case 2:
            boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F);
            boundsFlags.set(0, (f4 > 0.9999F || blockIn.isFullCube()) && f1 == f4);
            break;

        case 3:
            boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F);
            boundsFlags.set(0, (f2 < 1.0E-4F || blockIn.isFullCube()) && f2 == f5);
            break;

        case 4:
            boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F);
            boundsFlags.set(0, (f5 > 0.9999F || blockIn.isFullCube()) && f2 == f5);
            break;

        case 5:
            boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F);
            boundsFlags.set(0, (f < 1.0E-4F || blockIn.isFullCube()) && f == f3);
            break;

        case 6:
            boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F);
            boundsFlags.set(0, (f3 > 0.9999F || blockIn.isFullCube()) && f == f3);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:74,代码来源:BlockModelRenderer.java


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