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


Java ForgeDirection.ordinal方法代码示例

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


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

示例1: matchType

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public boolean matchType(ForgeDirection orientation, EnumFilterType type, IBee bee) {
	EnumFilterType filter = typeFilter[orientation.ordinal()];
	if (filter == EnumFilterType.BEE)
		return type != EnumFilterType.ITEM && type != EnumFilterType.CLOSED && type != EnumFilterType.CLOSED;

	// Special bee filtering
	if (bee != null) {
		if (filter == EnumFilterType.PURE_BREED)
			return bee.isPureBred(EnumBeeChromosome.SPECIES);
		if (filter == EnumFilterType.NOCTURNAL)
			return bee.getGenome().getNocturnal();
		if (filter == EnumFilterType.PURE_NOCTURNAL)
			return bee.getGenome().getNocturnal() && bee.isPureBred(EnumBeeChromosome.NOCTURNAL);
		if (filter == EnumFilterType.FLYER)
			return bee.getGenome().getTolerantFlyer();
		if (filter == EnumFilterType.PURE_FLYER)
			return bee.getGenome().getTolerantFlyer() && bee.isPureBred(EnumBeeChromosome.TOLERANT_FLYER);
		if (filter == EnumFilterType.CAVE)
			return bee.getGenome().getCaveDwelling();
		if (filter == EnumFilterType.PURE_CAVE)
			return bee.getGenome().getCaveDwelling() && bee.isPureBred(EnumBeeChromosome.CAVE_DWELLING);
	}

	// Compare the remaining
	return filter == type;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:27,代码来源:PipeLogicPropolis.java

示例2: getAdjacentOxygenConnections

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public static TileEntity[] getAdjacentOxygenConnections(TileEntity tile)
/*     */   {
/* 858 */     TileEntity[] adjacentConnections = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
/*     */ 
/* 860 */     boolean isMekLoaded = NetworkConfigHandler.isMekanismLoaded();
/*     */ 
/* 862 */     BlockVec3 thisVec = new BlockVec3(tile);
/* 863 */     for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
/*     */     {
/* 865 */       TileEntity tileEntity = thisVec.getTileEntityOnSide(tile.field_70331_k, direction);
/*     */ 
/* 867 */       if ((tileEntity instanceof IConnector))
/*     */       {
/* 869 */         if (((IConnector)tileEntity).canConnect(direction.getOpposite(), NetworkType.OXYGEN))
/*     */         {
/* 871 */           adjacentConnections[direction.ordinal()] = tileEntity;
/*     */         }
/*     */       }
/* 874 */       else if (isMekLoaded)
/*     */       {
/* 876 */         if (((tileEntity instanceof ITubeConnection)) && ((!(tileEntity instanceof IGasTransmitter)) || (TransmissionType.checkTransmissionType(tileEntity, TransmissionType.GAS, tileEntity))))
/*     */         {
/* 878 */           if (((ITubeConnection)tileEntity).canTubeConnect(direction))
/*     */           {
/* 880 */             adjacentConnections[direction.ordinal()] = tileEntity;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */ 
/* 886 */     return adjacentConnections;
/*     */   }
 
开发者ID:Nathor40000,项目名称:Connection,代码行数:33,代码来源:WorldUtil.java

示例3: receiveEnergy

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
@Override
public void receiveEnergy(float quantity, ForgeDirection from) {
	powerSources[from.ordinal()] = 2;

	energyStored += quantity;

	if (energyStored > maxEnergyStored) {
		energyStored = maxEnergyStored;
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:11,代码来源:PowerProvider.java

示例4: updateSources

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
private void updateSources(ForgeDirection source) {
	if (sourcesTracker.markTimeIfDelay(receptor.getWorld(), 1)) {
		for (int i = 0; i < 6; ++i) {
			powerSources[i] -= sourcesTracker.durationOfLastDelay();
			if (powerSources[i] < 0) {
				powerSources[i] = 0;
			}
		}
	}

	if (source != null)
		powerSources[source.ordinal()] = 10;
}
 
开发者ID:piotrb,项目名称:hamcraft,代码行数:14,代码来源:PowerHandler.java

示例5: PacketFactoryController

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public PacketFactoryController(int x, int y, int z, ForgeDirection orientation, boolean validMultiblock, String selectedModule, String selectedChipset, int armorId, boolean progressing, int progress, Vector3 energyPos)
{
    super(x, y, z);
    this.orientation = orientation.ordinal();
    this.validMultiblock = validMultiblock;
    this.selectedModule = selectedModule;
    this.selectedChipset = selectedChipset;
    this.armorId = armorId;
    this.progressing = progressing;
    this.progress = progress;
    this.energyPos = energyPos;
}
 
开发者ID:PaleoCrafter,项目名称:R0b0ts,代码行数:13,代码来源:PacketFactoryController.java

示例6: isBlockSolidOnSide

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
/**
 * Checks if the block is a solid face on the given side, used by placement logic.
 *
 * @param world The current world
 * @param x X Position
 * @param y Y position
 * @param z Z position
 * @param side The side to check
 * @return True if the block is solid on the specified side.
 */
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
{
    int meta = world.getBlockMetadata(x, y, z);
    if (this instanceof BlockHalfSlab)
    {
        return (((meta & 8) == 8 && (side == UP)) || isOpaqueCube());
    }
    else if (this instanceof BlockFarmland)
    {
        return (side != DOWN && side != UP);
    }
    else if (this instanceof BlockStairs)
    {
        boolean flipped = ((meta & 4) != 0);
        return ((meta & 3) + side.ordinal() == 5) || (side == UP && flipped);
    }
    else if (this instanceof BlockHopper && side == UP)
    {
        return true;
    }
    else if (this instanceof BlockPoweredOre)
    {
        return true;
    }
    return isBlockNormalCube(world, x, y, z);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:37,代码来源:Block.java

示例7: getGenomeFilters

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public ArrayList<IAllele[]> getGenomeFilters(ForgeDirection orientation) {
	ArrayList<IAllele[]> filters = new ArrayList();

	for (int i = 0; i < 3; i++)
		if (genomeFilter[orientation.ordinal()][i] != null
				&& (genomeFilter[orientation.ordinal()][i][0] != null || genomeFilter[orientation.ordinal()][i][1] != null)) {
			filters.add(genomeFilter[orientation.ordinal()][i]);
		}

	return filters;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:PipeLogicPropolis.java

示例8: sendGenomeFilterChange

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public void sendGenomeFilterChange(ForgeDirection orientation, int pattern, int allele, IAllele species) {
	PacketPayload payload = new PacketPayload(3, 0, 1);
	payload.intPayload[0] = orientation.ordinal();
	payload.intPayload[1] = pattern;
	payload.intPayload[2] = allele;
	if (species != null) {
		payload.stringPayload[0] = species.getUID();
	} else {
		payload.stringPayload[0] = "NULL";
	}

	Proxies.net.sendToServer(new PacketUpdate(PacketIds.PROP_SEND_FILTER_CHANGE_GENOME, container.xCoord, container.yCoord, container.zCoord, payload));
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:14,代码来源:PipeLogicPropolis.java

示例9: getTextureIndex

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
@Override
public int getTextureIndex(ForgeDirection direction) {
	if (direction == ForgeDirection.UNKNOWN)
		return 0;

	return direction.ordinal() + 1;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:PipeItemsPropolis.java

示例10: getAdjacentPowerConnections

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public static TileEntity[] getAdjacentPowerConnections(TileEntity tile)
/*     */   {
/* 891 */     TileEntity[] adjacentConnections = new TileEntity[6];
/*     */ 
/* 893 */     boolean isMekLoaded = NetworkConfigHandler.isMekanismLoaded();
/* 894 */     boolean isTELoaded = NetworkConfigHandler.isThermalExpansionLoaded();
/* 895 */     boolean isIC2Loaded = NetworkConfigHandler.isIndustrialCraft2Loaded();
/* 896 */     boolean isBCLoaded = NetworkConfigHandler.isBuildcraftLoaded();
/*     */ 
/* 898 */     BlockVec3 thisVec = new BlockVec3(tile);
/* 899 */     for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
/*     */     {
/* 901 */       TileEntity tileEntity = thisVec.getTileEntityOnSide(tile.field_70331_k, direction);
/*     */ 
/* 903 */       if ((tileEntity instanceof IConnector))
/*     */       {
/* 905 */         if (((IConnector)tileEntity).canConnect(direction.getOpposite(), NetworkType.POWER))
/*     */         {
/* 907 */           adjacentConnections[direction.ordinal()] = tileEntity;
/*     */         }
/*     */       }
/* 910 */       else if ((isMekLoaded) && ((tileEntity instanceof IStrictEnergyAcceptor)))
/*     */       {
/* 912 */         if (((IStrictEnergyAcceptor)tileEntity).canReceiveEnergy(direction.getOpposite()))
/*     */         {
/* 914 */           adjacentConnections[direction.ordinal()] = tileEntity;
/*     */         }
/*     */       }
/* 917 */       else if ((isTELoaded) && ((tileEntity instanceof IEnergyHandler)))
/*     */       {
/* 919 */         if (((IEnergyHandler)tileEntity).canInterface(direction.getOpposite()))
/*     */         {
/* 921 */           adjacentConnections[direction.ordinal()] = tileEntity;
/*     */         }
/*     */       }
/* 924 */       else if ((isIC2Loaded) && ((tileEntity instanceof IEnergyTile)))
/*     */       {
/* 926 */         if ((tileEntity instanceof IEnergyAcceptor))
/*     */         {
/* 928 */           if (((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(tile, direction.getOpposite()))
/*     */           {
/* 930 */             adjacentConnections[direction.ordinal()] = tileEntity;
/* 931 */             continue;
/*     */           }
/*     */         }
/*     */ 
/* 935 */         if ((tileEntity instanceof IEnergyEmitter))
/*     */         {
/* 937 */           if (((IEnergyEmitter)tileEntity).emitsEnergyTo(tileEntity, direction.getOpposite()))
/*     */           {
/* 939 */             adjacentConnections[direction.ordinal()] = tileEntity;
/* 940 */             continue;
/*     */           }
/*     */         }
/*     */ 
/* 944 */         adjacentConnections[direction.ordinal()] = tileEntity;
/*     */       }
/* 946 */       else if ((isBCLoaded) && ((tileEntity instanceof IPowerReceptor)))
/*     */       {
/* 948 */         if (((IPowerReceptor)tileEntity).getPowerReceiver(direction.getOpposite()) != null)
/*     */         {
/* 950 */           adjacentConnections[direction.ordinal()] = tileEntity;
/*     */         }
/*     */       }
/*     */     }
/*     */ 
/* 955 */     return adjacentConnections;
/*     */   }
 
开发者ID:Nathor40000,项目名称:Connection,代码行数:69,代码来源:WorldUtil.java

示例11: isPowerSource

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
@Override
public boolean isPowerSource(ForgeDirection from) {
	return powerSources[from.ordinal()] != 0;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:5,代码来源:PowerProvider.java

示例12: isPowerSource

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public boolean isPowerSource(ForgeDirection from) {
	return powerSources[from.ordinal()] != 0;
}
 
开发者ID:piotrb,项目名称:hamcraft,代码行数:4,代码来源:PowerHandler.java

示例13: isClosed

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public boolean isClosed(ForgeDirection orientation) {
	return typeFilter[orientation.ordinal()] == EnumFilterType.CLOSED;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:PipeLogicPropolis.java

示例14: isIndiscriminate

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public boolean isIndiscriminate(ForgeDirection orientation) {
	return typeFilter[orientation.ordinal()] == EnumFilterType.ANYTHING;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:PipeLogicPropolis.java

示例15: getTypeFilter

import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public EnumFilterType getTypeFilter(ForgeDirection orientation) {
	return typeFilter[orientation.ordinal()];
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:PipeLogicPropolis.java


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