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


Java ForgeDirection.SOUTH屬性代碼示例

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


在下文中一共展示了ForgeDirection.SOUTH屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildComponent

@Override
@SuppressWarnings("unchecked")
public void buildComponent(StructureComponent component, List list, Random random) {
	ComponentTiamatCenterLine componentE = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) + 1, (this.boundingBox.minZ >> 4), ForgeDirection.EAST, 1);
	((ComponentTiamatCenter) component).structureComponents.add(componentE);
	list.add(componentE);
	ComponentTiamatCenterLine componentW = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) - 1, (this.boundingBox.minZ >> 4), ForgeDirection.WEST, 1);
	((ComponentTiamatCenter) component).structureComponents.add(componentW);
	list.add(componentW);
	ComponentTiamatCenterLine componentS = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) + 1, ForgeDirection.SOUTH, 1);
	((ComponentTiamatCenter) component).structureComponents.add(componentS);
	list.add(componentS);
	ComponentTiamatCenterLine componentN = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) - 1, ForgeDirection.NORTH, 1);
	((ComponentTiamatCenter) component).structureComponents.add(componentN);
	list.add(componentN);
}
 
開發者ID:Team-Antimatter-Mod,項目名稱:AntiMatterMod,代碼行數:16,代碼來源:ComponentTiamatCenter.java

示例2: ReversalForgeDirection

public static ForgeDirection ReversalForgeDirection(ForgeDirection dir){
    if (dir == null) return null;
    switch (dir){
        case UP:
            return ForgeDirection.DOWN;
        case DOWN:
            return ForgeDirection.UP;
        case EAST:
            return ForgeDirection.WEST;
        case WEST:
            return ForgeDirection.EAST;
        case NORTH:
            return ForgeDirection.SOUTH;
        case SOUTH:
            return ForgeDirection.NORTH;
        default:
            return null;
    }
}
 
開發者ID:Team-Antimatter-Mod,項目名稱:AntiMatterMod,代碼行數:19,代碼來源:OreBlock.java

示例3: getPlayerDirection

/**
 * プレイヤーの向きを取得します
 *
 * @param player プレイヤー
 * @return 向きの {@link ForgeDirection}
 */
private static ForgeDirection getPlayerDirection(EntityLivingBase player) {
	int playerDirY = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	int playerDirP = MathHelper.floor_double((double) (player.rotationPitch * 4.0F / 360.0F) + 0.5D) & 3;
	switch (playerDirP) {
		case 1:
			return ForgeDirection.DOWN;
		case 3:
			return ForgeDirection.UP;
		default:
	}
	
	switch (playerDirY) {
		case 0:
			return ForgeDirection.NORTH;
		case 1:
			return ForgeDirection.EAST;
		case 2:
			return ForgeDirection.SOUTH;
		case 3:
			return ForgeDirection.WEST;
	}
	return null;
}
 
開發者ID:Team-Antimatter-Mod,項目名稱:AntiMatterMod,代碼行數:29,代碼來源:MiningHammer.java

示例4: onBlockPlacedBy

@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
    int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    if (world.getTileEntity(x, y, z) instanceof GateFront) {
        GateFront gateFront = (GateFront) world.getTileEntity(x, y, z);
        switch (meta) {
            case 0:
                gateFront.direction = ForgeDirection.SOUTH;
                break;
            case 1:
                gateFront.direction = ForgeDirection.WEST;
                break;
            case 2:
                gateFront.direction = ForgeDirection.NORTH;
                break;
            case 3:
                gateFront.direction = ForgeDirection.EAST;
                break;
            default:
                break;
        }
        world.setBlockMetadataWithNotify(x, y, z, meta, 2);
    }
}
 
開發者ID:NSDN,項目名稱:NyaSamaRailway,代碼行數:24,代碼來源:BlockGateFront.java

示例5: onBlockPlacedBy

@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
    int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    if (world.getTileEntity(x, y, z) instanceof GateBase) {
        GateBase gateBase = (GateBase) world.getTileEntity(x, y, z);
        switch (meta) {
            case 0:
                gateBase.direction = ForgeDirection.SOUTH;
                break;
            case 1:
                gateBase.direction = ForgeDirection.WEST;
                break;
            case 2:
                gateBase.direction = ForgeDirection.NORTH;
                break;
            case 3:
                gateBase.direction = ForgeDirection.EAST;
                break;
            default:
                break;
        }
        world.setBlockMetadataWithNotify(x, y, z, meta, 2);

    }
}
 
開發者ID:NSDN,項目名稱:NyaSamaRailway,代碼行數:25,代碼來源:BlockGateBase.java

示例6: onBlockPlacedBy

@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
    int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    world.setBlockMetadataWithNotify(x, y, z, meta, 2);
    if (world.getTileEntity(x, y, z) instanceof MagnetSwitch) {
        MagnetSwitch monoSwitch = (MagnetSwitch) world.getTileEntity(x, y, z);
        switch (meta) {
            case 0:
                monoSwitch.direction = ForgeDirection.SOUTH;
                break;
            case 1:
                monoSwitch.direction = ForgeDirection.WEST;
                break;
            case 2:
                monoSwitch.direction = ForgeDirection.NORTH;
                break;
            case 3:
                monoSwitch.direction = ForgeDirection.EAST;
                break;
            default:
                break;
        }
    }
}
 
開發者ID:NSDN,項目名稱:NyaSamaRailway,代碼行數:24,代碼來源:RailMagnetSwitch.java

示例7: generateChorusPlant

public static void generateChorusPlant(World world, int x, int y, int z, int pass) {
	int height;
	for (height = 0; height < 4; height++) {
		if (!ChorusFlower.canPlantStay(world, x, y + height, z)) {
			world.setBlock(x, y + height, z, ModBlocks.chorus_flower, 5, 2);
			break;
		}
		world.setBlock(x, y + height, z, ModBlocks.chorus_plant);
	}
	if (height > 1) {
		world.setBlock(x, y + height, z, ModBlocks.chorus_plant);
		boolean grew = false;

		if (pass < 5) {
			ForgeDirection[] dirs = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.NORTH, ForgeDirection.SOUTH };
			for (int j = 0; j < world.rand.nextInt(4); j++) {
				ForgeDirection dir = dirs[world.rand.nextInt(dirs.length)];
				int xx = x + dir.offsetX;
				int yy = y + height + dir.offsetY;
				int zz = z + dir.offsetZ;
				if (world.isAirBlock(xx, yy, zz) && ChorusFlower.isSpaceAroundFree(world, xx, yy, zz, dir.getOpposite())) {
					generateChorusPlant(world, xx, yy, zz, pass + 1);
					grew = true;
				}
			}
		}

		if (!grew)
			world.setBlock(x, y + height, z, ModBlocks.chorus_flower, 5, 2);
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:31,代碼來源:EtFuturumWorldGenerator.java

示例8: randomDisplayTick

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
	if (world.getBlockMetadata(x, y, z) == 1) {
		ForgeDirection dir = getRandomDirection(rand);

		if (dir != ForgeDirection.UP && !World.doesBlockHaveSolidTopSurface(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) {
			double d0 = x;
			double d1 = y;
			double d2 = z;

			if (dir == ForgeDirection.DOWN) {
				d1 -= 0.05D;
				d0 += rand.nextDouble();
				d2 += rand.nextDouble();
			} else {
				d1 += rand.nextDouble() * 0.8D;

				if (dir == ForgeDirection.EAST || dir == ForgeDirection.WEST) {
					d2 += rand.nextDouble();

					if (dir == ForgeDirection.EAST)
						d0++;
					else
						d0 += 0.05D;
				} else {
					d0 += rand.nextDouble();

					if (dir == ForgeDirection.SOUTH)
						d2++;
					else
						d2 += 0.05D;
				}
			}

			world.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
		}
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:39,代碼來源:Sponge.java

示例9: setBlockBoundsBasedOnState

@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
	ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));

	if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP)
		setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);
	else if (dir == ForgeDirection.WEST || dir == ForgeDirection.EAST)
		setBlockBounds(0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);
	else if (dir == ForgeDirection.NORTH || dir == ForgeDirection.SOUTH)
		setBlockBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:11,代碼來源:EndRod.java

示例10: canConnectRedstone

public boolean canConnectRedstone(ForgeDirection fd)
{
    switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
    {
        case 2: return (fd == ForgeDirection.WEST);
        case 3: return (fd == ForgeDirection.NORTH);
        case 4: return (fd == ForgeDirection.EAST);
        case 5: return (fd == ForgeDirection.SOUTH);
        default: return false;
    }
}
 
開發者ID:XFactHD,項目名稱:RFUtilities,代碼行數:11,代碼來源:TileEntityTransistor.java

示例11: canConnectEnergy

@Override
public boolean canConnectEnergy(ForgeDirection fd)
{
    switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
    {
        case 2: return (fd == ForgeDirection.NORTH || fd == ForgeDirection.SOUTH);
        case 3: return (fd == ForgeDirection.EAST || fd == ForgeDirection.WEST);
        case 4: return (fd == ForgeDirection.NORTH || fd == ForgeDirection.SOUTH);
        case 5: return (fd == ForgeDirection.EAST || fd == ForgeDirection.WEST);
        default: return false;
    }
}
 
開發者ID:XFactHD,項目名稱:RFUtilities,代碼行數:12,代碼來源:TileEntityTransistor.java

示例12: canConnectEnergy

@Override
public boolean canConnectEnergy(ForgeDirection fd)
{
    switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
    {
        case 0: return fd == ForgeDirection.DOWN;
        case 1: return fd == ForgeDirection.UP;
        case 2: return fd == ForgeDirection.WEST;
        case 3: return fd == ForgeDirection.NORTH;
        case 4: return fd == ForgeDirection.EAST;
        case 5: return fd == ForgeDirection.SOUTH;
        default: return false;
    }
}
 
開發者ID:XFactHD,項目名稱:RFUtilities,代碼行數:14,代碼來源:TileEntityInvisibleTesseract.java

示例13: 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;
}
 
開發者ID:NSDN,項目名稱:NyaSamaRailway,代碼行數:9,代碼來源:AbsSignalLight.java

示例14: extractEnergy

@Override
public int extractEnergy(ForgeDirection fd, int amount, boolean simulate)
{
    switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
    {
        case 2: if(fd == ForgeDirection.NORTH) return storage.extractEnergy(amount, simulate);
        case 3: if(fd == ForgeDirection.EAST)  return storage.extractEnergy(amount, simulate);
        case 4: if(fd == ForgeDirection.SOUTH) return storage.extractEnergy(amount, simulate);
        case 5: if(fd == ForgeDirection.WEST)  return storage.extractEnergy(amount, simulate);
        default: return 0;
    }
}
 
開發者ID:XFactHD,項目名稱:RFUtilities,代碼行數:12,代碼來源:TileEntityCapacitor.java

示例15: 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;
    }
 
開發者ID:NSDN,項目名稱:NyaSamaRailway,代碼行數:13,代碼來源:LightBeam.java


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