本文整理汇总了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;
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例5: sidedNode
@Override
public Node sidedNode(ForgeDirection side) {
if(side != ForgeDirection.UP){
return node;
}else{
return null;
}
}
示例6: canConnect
@Override
public boolean canConnect(ForgeDirection side) {
if(side != ForgeDirection.UP){
return true;
}else{
return false;
}
}
示例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;
}
}
示例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;
}
示例9: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
return side == ForgeDirection.UP;
}
示例10: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
return side != ForgeDirection.UP;
}
示例11: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
return side == ForgeDirection.UP;
}
示例12: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
return side == ForgeDirection.UP;
}
示例13: canConnectEnergy
@Override
public boolean canConnectEnergy(ForgeDirection dir) {
return dir != ForgeDirection.UP;
}
示例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;
}