本文整理汇总了Java中net.minecraftforge.common.util.ForgeDirection.DOWN属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.DOWN属性的具体用法?Java ForgeDirection.DOWN怎么用?Java ForgeDirection.DOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.common.util.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.DOWN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canConnect
@Override
public boolean canConnect(ForgeDirection direction, NetworkType type)
{
if (direction == null || direction.equals(ForgeDirection.UNKNOWN))
{
return false;
}
if (type == NetworkType.OXYGEN)
{
return direction.ordinal() == this.getBlockMetadata() + 2;
}
if (type == NetworkType.POWER)
{
return direction == ForgeDirection.DOWN;
}
return false;
}
示例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;
}
}
示例3: isSealed
@Override
public boolean isSealed(World world, int x, int y, int z, ForgeDirection direction)
{
int metadata = world.getBlockMetadata(x, y, z);
//Landing pad and refueling pad
if (metadata == 2 || metadata == 6)
{
return direction == ForgeDirection.DOWN;
}
//Basic solar panel fixed top
if (metadata == 4)
{
return direction == ForgeDirection.UP;
}
return false;
}
示例4: 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;
}
示例5: 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);
}
}
}
示例6: 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);
}
示例7: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
if (side == ForgeDirection.DOWN) // Down side solid
return true;
if (Helper.rotatedSide(world.getBlockMetadata(x, y, z), Sides.BACK).equals(side)) // Back side solid
return true;
return false;
}
示例8: 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;
}
示例9: 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;
}
示例10: isSideSolid
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
return side == ForgeDirection.DOWN;
}
示例11: getElectricInputDirection
@Override
public ForgeDirection getElectricInputDirection()
{
return ForgeDirection.DOWN;
}
示例12: 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;
}
示例13: getFootprintPosition
public static Vector3 getFootprintPosition(World world, float rotation, Vector3 startPosition, BlockVec3 playerCenter)
{
Vector3 position = startPosition.clone();
float footprintScale = 0.375F;
int mainPosX = position.intX();
int mainPosY = position.intY();
int mainPosZ = position.intZ();
// If the footprint is hovering over air...
Block b1 = world.getBlock(mainPosX, mainPosY, mainPosZ);
if (b1 != null && b1.isAir(world, mainPosX, mainPosY, mainPosZ))
{
position.x += (playerCenter.x - mainPosX);
position.z += (playerCenter.z - mainPosZ);
// If the footprint is still over air....
Block b2 = world.getBlock(position.intX(), position.intY(), position.intZ());
if (b2 != null && b2.isAir(world, position.intX(), position.intY(), position.intZ()))
{
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if (direction != ForgeDirection.DOWN && direction != ForgeDirection.UP)
{
Block b3 = world.getBlock(mainPosX + direction.offsetX, mainPosY, mainPosZ + direction.offsetZ);
if (b3 != null && !b3.isAir(world, mainPosX + direction.offsetX, mainPosY, mainPosZ + direction.offsetZ))
{
position.x += direction.offsetX;
position.z += direction.offsetZ;
break;
}
}
}
}
}
mainPosX = position.intX();
mainPosZ = position.intZ();
double x0 = (Math.sin((45 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x1 = (Math.sin((135 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x2 = (Math.sin((225 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x3 = (Math.sin((315 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double z0 = (Math.cos((45 - rotation) * Math.PI / 180.0D) * footprintScale) + position.z;
double z1 = (Math.cos((135 - rotation) * Math.PI / 180.0D) * footprintScale) + position.z;
double z2 = (Math.cos((225 - rotation) * Math.PI / 180.0D) * footprintScale) + position.z;
double z3 = (Math.cos((315 - rotation) * Math.PI / 180.0D) * footprintScale) + position.z;
double xMin = Math.min(Math.min(x0, x1), Math.min(x2, x3));
double xMax = Math.max(Math.max(x0, x1), Math.max(x2, x3));
double zMin = Math.min(Math.min(z0, z1), Math.min(z2, z3));
double zMax = Math.max(Math.max(z0, z1), Math.max(z2, z3));
if (xMin < mainPosX)
{
position.x += mainPosX - xMin;
}
if (xMax > mainPosX + 1)
{
position.x -= xMax - (mainPosX + 1);
}
if (zMin < mainPosZ)
{
position.z += mainPosZ - zMin;
}
if (zMax > mainPosZ + 1)
{
position.z -= zMax - (mainPosZ + 1);
}
return position;
}
示例14: canConnect
@Override
public boolean canConnect(ForgeDirection side) {
return ForgeDirection.DOWN == side;
}
示例15: canConnectEnergy
@Override
public boolean canConnectEnergy(ForgeDirection dir) {
return dir == ForgeDirection.DOWN;
}