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


Java ForgeDirection.EAST属性代码示例

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


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

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

示例2: receiveEnergy

@Override
public int receiveEnergy(ForgeDirection fd, int amount, boolean simulate)
{
    if (!worldObj.isRemote)
    {
        switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
        {
            case 2: return fd == ForgeDirection.SOUTH ? receivePower(fd, amount, simulate) : 0;
            case 3: return fd == ForgeDirection.WEST  ? receivePower(fd, amount, simulate) : 0;
            case 4: return fd == ForgeDirection.NORTH ? receivePower(fd, amount, simulate) : 0;
            case 5: return fd == ForgeDirection.EAST  ? receivePower(fd, amount, simulate) : 0;
            default: return 0;
        }
    }
    return 0;
}
 
开发者ID:XFactHD,项目名称:RFUtilities,代码行数:16,代码来源:TileEntityDiode.java

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

示例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 MonoSwitch) {
        MonoSwitch monoSwitch = (MonoSwitch) 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;
        }
        if ((meta + 2) % 2 == 0) meta = 0;
        else meta = 1;
        world.setBlockMetadataWithNotify(x, y, z, meta, 2);
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:26,代码来源:RailMonoSwitch.java

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

示例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;
    if (world.getTileEntity(x, y, z) instanceof GateFrontN) {
        GateFrontN gateFrontN = (GateFrontN) world.getTileEntity(x, y, z);
        switch (meta) {
            case 0:
                gateFrontN.direction = ForgeDirection.SOUTH;
                break;
            case 1:
                gateFrontN.direction = ForgeDirection.WEST;
                break;
            case 2:
                gateFrontN.direction = ForgeDirection.NORTH;
                break;
            case 3:
                gateFrontN.direction = ForgeDirection.EAST;
                break;
            default:
                break;
        }
        world.setBlockMetadataWithNotify(x, y, z, meta, 2);
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:24,代码来源:BlockGateFrontN.java

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

示例8: 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 TriSwitch) {
        TriSwitch triSwitch = (TriSwitch) world.getTileEntity(x, y, z);
        switch (meta) {
            case 0:
                triSwitch.direction = ForgeDirection.SOUTH;
                break;
            case 1:
                triSwitch.direction = ForgeDirection.WEST;
                break;
            case 2:
                triSwitch.direction = ForgeDirection.NORTH;
                break;
            case 3:
                triSwitch.direction = ForgeDirection.EAST;
                break;
            default:
                break;
        }
        if ((meta + 2) % 2 == 0) meta = 0;
        else meta = 1;
        world.setBlockMetadataWithNotify(x, y, z, meta, 2);
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:26,代码来源:RailTriSwitch.java

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

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

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

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

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

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

示例15: getLookDirection

public static ForgeDirection getLookDirection(EntityLivingBase livingBase){
    double side = MathHelper.floor_double((double)(livingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    switch((int) side){
        case 0:
            return ForgeDirection.SOUTH;
        case 1:
            return ForgeDirection.WEST;
        case 2:
            return ForgeDirection.NORTH;
        case 3:
            return ForgeDirection.EAST;
    }
    return null;
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:14,代码来源:Utils.java


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