本文整理汇总了Java中net.minecraftforge.common.util.ForgeDirection.UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.UNKNOWN属性的具体用法?Java ForgeDirection.UNKNOWN怎么用?Java ForgeDirection.UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.common.util.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.UNKNOWN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canConnectRedstone
@Override
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
{
TileEntity te = world.getTileEntity(x, y, z);
ForgeDirection fd;
switch (side)
{
case -1: fd = ForgeDirection.UP; break;
case 0: fd = ForgeDirection.NORTH; break;
case 1: fd = ForgeDirection.EAST; break;
case 2: fd = ForgeDirection.SOUTH; break;
case 3: fd = ForgeDirection.WEST; break;
default: fd = ForgeDirection.UNKNOWN; break;
}
return te instanceof TileEntityTransistor && ((TileEntityTransistor)te).canConnectRedstone(fd);
}
示例2: injectEnergyUnits
@VersionSpecific(version = "[1.7.2]")
@RuntimeInterface(clazz = "ic2.api.energy.tile.IEnergySink", modID = "IC2")
public double injectEnergyUnits(ForgeDirection direction, double amount)
{
if (!EnergyConfigHandler.disableIC2Input && (direction == ForgeDirection.UNKNOWN || this.getElectricalInputDirections().contains(direction)))
{
float convertedEnergy = (float) amount * EnergyConfigHandler.IC2_RATIO;
int tierFromIC2 = (amount >= 128) ? 2 : 1;
float receive = this.receiveElectricity(direction, convertedEnergy, tierFromIC2, true);
if (convertedEnergy > receive)
{
this.IC2surplusInGJ = convertedEnergy - receive;
}
else
{
this.IC2surplusInGJ = 0F;
}
// injectEnergyUnits returns left over energy but all is used or goes into 'surplus'
return 0D;
}
return amount;
}
示例3: canOutput
@Override
public boolean canOutput(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection dir) {
if (dir == ForgeDirection.UNKNOWN) {
return false;
}
final IPipe pipe = TNHelper.getPipe(world, x + dir.getOpposite().offsetX, y + dir.getOpposite().offsetY, z + dir.getOpposite().offsetZ);
return pipe != null && (pipe.getPipeType().equals(this.getPipeType()) || pipe.canOutput(world, x + dir.getOpposite().offsetX, y + dir.getOpposite().offsetY, z + dir.getOpposite().offsetZ, dir));
}
示例4: getLightDir
public ForgeDirection getLightDir(World world, int x , int y, int z) {
switch (world.getBlockMetadata(x, y, z) & 0x3) {
case 0: return ForgeDirection.NORTH;
case 1: return ForgeDirection.EAST;
case 2: return ForgeDirection.SOUTH;
case 3: return ForgeDirection.WEST;
}
return ForgeDirection.UNKNOWN;
}
示例5: SearchPosition
public SearchPosition(final int par1, final int par2, final int par3, final ForgeDirection par4) {
this.side = ForgeDirection.UNKNOWN;
this.x = par1;
this.y = par2;
this.z = par3;
this.side = par4;
}
示例6: getIconIndex
@Override
public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN) {
return standardIconIndex;
} else {
int metadata = container.getBlockMetadata();
if (metadata == direction.ordinal()) {
return solidIconIndex;
} else {
return standardIconIndex;
}
}
}
示例7: getElectricInputDirection
@Override
public ForgeDirection getElectricInputDirection()
{
if (this.isMaster)
{
return ForgeDirection.getOrientation(this.facing + 2);
}
TileEntityMinerBase master = this.getMaster();
if (master != null)
{
return ForgeDirection.getOrientation(master.facing + 2);
}
return ForgeDirection.UNKNOWN;
}
示例8: toForgeDirection
/**
* Converts Vector3 into a ForgeDirection.
*/
public ForgeDirection toForgeDirection()
{
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if (this.x == direction.offsetX && this.y == direction.offsetY && this.z == direction.offsetZ)
{
return direction;
}
}
return ForgeDirection.UNKNOWN;
}
示例9: checkForCargoEntity
public void checkForCargoEntity()
{
boolean foundFuelable = false;
for (final ForgeDirection dir : ForgeDirection.values())
{
if (dir != ForgeDirection.UNKNOWN)
{
final TileEntity pad = new BlockVec3(this).getTileEntityOnSide(this.worldObj, dir);
if (pad != null && pad instanceof TileEntityMulti)
{
final TileEntity mainTile = ((TileEntityMulti)pad).getMainBlockTile();
if (mainTile instanceof ICargoEntity)
{
this.attachedFuelable = (ICargoEntity) mainTile;
foundFuelable = true;
break;
}
}
else if (pad != null && pad instanceof ICargoEntity)
{
this.attachedFuelable = (ICargoEntity) pad;
foundFuelable = true;
break;
}
}
}
if (!foundFuelable)
{
this.attachedFuelable = null;
}
}
示例10: Position
public Position(double ci, double cj, double ck, ForgeDirection corientation) {
x = ci;
y = cj;
z = ck;
orientation = corientation;
if (orientation == null) {
orientation = ForgeDirection.UNKNOWN;
}
}
示例11: receiveElectricity
@Override
public float receiveElectricity(ForgeDirection from, float receive, int tier, boolean doReceive)
{
if (this.getElectricalInputDirections().contains(from) || from == ForgeDirection.UNKNOWN)
{
return super.receiveElectricity(from, receive, tier, doReceive);
}
return 0F;
}
示例12: getDir
/******************************************************************************************************************/
public static ForgeDirection getDir(World world, int x, int y, int z) {
switch (world.getBlockMetadata(x, y, z)) {
case 0: return ForgeDirection.NORTH;
case 1: return ForgeDirection.SOUTH;
case 2: return ForgeDirection.WEST;
case 3: return ForgeDirection.EAST;
case 4: return ForgeDirection.UP;
case 5: return ForgeDirection.DOWN;
}
return ForgeDirection.UNKNOWN;
}
示例13: doSwitch
public void doSwitch(World world, int x ,int y, int z) {
if (world.getTileEntity(x, y, z) instanceof MagnetSwitch) {
MagnetSwitch magnetSwitch = (MagnetSwitch) world.getTileEntity(x, y, z);
if (magnetSwitch.direction == null)
magnetSwitch.direction = ForgeDirection.UNKNOWN;
if (world.getBlock(x, y + 1, z) instanceof RailMonoMagnet) {
int old = world.getBlockMetadata(x, y + 1, z);
int meta = 0;
switch (magnetSwitch.state) {
case MagnetSwitch.STATE_POS: //left
switch (magnetSwitch.direction) {
case SOUTH:
meta = 9;
break;
case WEST:
meta = 6;
break;
case NORTH:
meta = 7;
break;
case EAST:
meta = 8;
break;
}
break;
case MagnetSwitch.STATE_NEG: //right
switch (magnetSwitch.direction) {
case SOUTH:
meta = 8;
break;
case WEST:
meta = 9;
break;
case NORTH:
meta = 6;
break;
case EAST:
meta = 7;
break;
}
break;
case MagnetSwitch.STATE_ZERO:
switch (magnetSwitch.direction) {
case SOUTH:
meta = 0;
break;
case WEST:
meta = 1;
break;
case NORTH:
meta = 0;
break;
case EAST:
meta = 1;
break;
}
break;
default:
break;
}
magnetSwitch.state = MagnetSwitch.STATE_ZERO;
if (old != meta) {
world.setBlockMetadataWithNotify(x, y + 1, z, meta, 3);
world.notifyBlockChange(x, y + 1, z, BlockLoader.railMonoMagnet);
world.markBlockForUpdate(x, y + 1, z);
}
}
world.scheduleBlockUpdate(x, y, z, this, 1);
}
}
示例14: toNBT
public NBTTagCompound toNBT(NBTTagCompound tagCompound) {
tagCompound.setString("player", player);
if (direction == null) direction = ForgeDirection.UNKNOWN;
tagCompound.setInteger("direction", direction.ordinal());
return tagCompound;
}
示例15: doSwitch
public void doSwitch(World world, int x ,int y, int z) {
if (world.getTileEntity(x, y, z) instanceof MonoSwitch) {
MonoSwitch monoSwitch = (MonoSwitch) world.getTileEntity(x, y, z);
int old = world.getBlockMetadata(x, y, z);
int meta = 0;
if (monoSwitch.direction == null)
monoSwitch.direction = ForgeDirection.UNKNOWN;
switch (monoSwitch.state) {
case MonoSwitch.STATE_POS: //left
switch (monoSwitch.direction) {
case SOUTH:
meta = 9;
break;
case WEST:
meta = 6;
break;
case NORTH:
meta = 7;
break;
case EAST:
meta = 8;
break;
}
break;
case MonoSwitch.STATE_NEG: //right
switch (monoSwitch.direction) {
case SOUTH:
meta = 8;
break;
case WEST:
meta = 9;
break;
case NORTH:
meta = 6;
break;
case EAST:
meta = 7;
break;
}
break;
case MonoSwitch.STATE_ZERO:
switch (monoSwitch.direction) {
case SOUTH:
meta = 0;
break;
case WEST:
meta = 1;
break;
case NORTH:
meta = 0;
break;
case EAST:
meta = 1;
break;
}
break;
default:
break;
}
monoSwitch.state = MonoSwitch.STATE_ZERO;
if (world.getBlock(x, y + 1, z) instanceof RailMonoMagnet) {
if (world.getBlockMetadata(x, y + 1, z) != meta) {
world.setBlockMetadataWithNotify(x, y + 1, z, meta, 3);
world.notifyBlockChange(x, y + 1, z, BlockLoader.railMonoMagnet);
world.markBlockForUpdate(x, y + 1, z);
}
}
if (old != meta) {
world.setBlockMetadataWithNotify(x, y, z, meta, 3);
world.notifyBlockChange(x, y, z, BlockLoader.railMono);
world.markBlockForUpdate(x, y, z);
}
world.scheduleBlockUpdate(x, y, z, this, 1);
}
}