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


Java ForgeDirection.UP属性代码示例

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


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

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

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

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

示例4: isFireSource

@Override
public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) {
       int meta = world.getBlockMetadata(x, y, z);
        
       if (blocks[meta].smokeFactor > 0.0f) {
		if (side == ForgeDirection.UP) {
			return true;
		}
       }
       
	return super.isFireSource(world, x, y, z, side);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:12,代码来源:BlockBasics.java

示例5: sidedNode

@Override
public Node sidedNode(ForgeDirection side) {
	if(side != ForgeDirection.UP){
		return node;
	}else{
		return null;
	}
}
 
开发者ID:java8compiler,项目名称:OpenTeleporter,代码行数:8,代码来源:TileEntityTeleporter.java

示例6: canConnect

@Override
public boolean canConnect(ForgeDirection side) {
	if(side != ForgeDirection.UP){
		return true;
	}else{
		return false;
	}
}
 
开发者ID:java8compiler,项目名称:OpenTeleporter,代码行数:8,代码来源:TileEntityTeleporter.java

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

示例8: isSideSolid

@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
	int meta = world.getBlockMetadata(x, y, z);
	return meta == 2 || side == ForgeDirection.UP && meta == 1 || side == ForgeDirection.DOWN && meta == 0;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:5,代码来源:GenericSlab.java

示例9: isSideSolid

@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
	return side == ForgeDirection.UP;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:4,代码来源:BlockWoodFence.java

示例10: isSideSolid

@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
    return side != ForgeDirection.UP;
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:5,代码来源:BlockGlassShield3X1D5.java

示例11: isSideSolid

@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
    return side == ForgeDirection.UP;
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:5,代码来源:BumperNoSleeper.java

示例12: isSideSolid

@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
    return side == ForgeDirection.UP;
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:4,代码来源:BlockSignalPillar.java

示例13: canConnectEnergy

@Override
public boolean canConnectEnergy(ForgeDirection dir) {
	return dir != ForgeDirection.UP;
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:4,代码来源:TileEntityTurretBase.java

示例14: isTouchingBlock

public static ForgeDirection isTouchingBlock(IBlockAccess world, int x, int y, int z, ForgeDirection chain,ArrayList<Point> pointList){
    ForgeDirection oreBlocktouvhing = null;
    if(world.getBlock(x,y+1,z) != Blocks.air){
        if(!(world.getBlock(x,y+1,z) instanceof OreBlock)) {
            return ForgeDirection.UP;
        }
        if (chain != ForgeDirection.UP && !Point.isOnPoint(pointList,x,y+1,z))oreBlocktouvhing = ForgeDirection.UP;
    }
    if(world.getBlock(x,y,z-1) != Blocks.air){
        if(!(world.getBlock(x,y,z-1) instanceof OreBlock)) {
            return ForgeDirection.NORTH;
        }
        if (chain != ForgeDirection.NORTH && !Point.isOnPoint(pointList,x,y,z-1))oreBlocktouvhing = ForgeDirection.NORTH;
    }
    if(world.getBlock(x,y,z+1) != Blocks.air){
        if(!(world.getBlock(x,y,z+1) instanceof OreBlock)) {
            return ForgeDirection.SOUTH;
        }
        if (chain != ForgeDirection.SOUTH && !Point.isOnPoint(pointList,x,y,z+1))oreBlocktouvhing = ForgeDirection.SOUTH;
    }
    if(world.getBlock(x-1,y,z) != Blocks.air){
        if(!(world.getBlock(x-1,y,z) instanceof OreBlock)) {
            return ForgeDirection.WEST;
        }
        if (chain != ForgeDirection.WEST && !Point.isOnPoint(pointList,x-1,y,z))oreBlocktouvhing = ForgeDirection.WEST;
    }
    if(world.getBlock(x+1,y,z) != Blocks.air){
        if(!(world.getBlock(x+1,y,z) instanceof OreBlock)) {
            return ForgeDirection.EAST;
        }
        if (chain != ForgeDirection.EAST && !Point.isOnPoint(pointList,x+1,y,z))oreBlocktouvhing = ForgeDirection.EAST;
    }
    if(world.getBlock(x,y-1,z) != Blocks.air){
        if(!(world.getBlock(x,y-1,z) instanceof OreBlock)) {
            return ForgeDirection.DOWN;
        }
        if (chain != ForgeDirection.DOWN && !Point.isOnPoint(pointList,x,y-1,z))oreBlocktouvhing = ForgeDirection.DOWN;
    }
    
    return oreBlocktouvhing;
}
 
开发者ID:Team-Antimatter-Mod,项目名称:AntiMatterMod,代码行数:41,代码来源:OreBlock.java


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