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


Java EnumFacing.getAxis方法代码示例

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


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

示例1: doDispense

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static void doDispense(World worldIn, ItemStack stack, int speed, EnumFacing facing, IPosition position)
{
    double d0 = position.getX();
    double d1 = position.getY();
    double d2 = position.getZ();

    if (facing.getAxis() == EnumFacing.Axis.Y)
    {
        d1 = d1 - 0.125D;
    }
    else
    {
        d1 = d1 - 0.15625D;
    }

    EntityItem entityitem = new EntityItem(worldIn, d0, d1, d2, stack);
    double d3 = worldIn.rand.nextDouble() * 0.1D + 0.2D;
    entityitem.motionX = (double)facing.getFrontOffsetX() * d3;
    entityitem.motionY = 0.20000000298023224D;
    entityitem.motionZ = (double)facing.getFrontOffsetZ() * d3;
    entityitem.motionX += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed;
    entityitem.motionY += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed;
    entityitem.motionZ += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed;
    worldIn.spawnEntityInWorld(entityitem);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:BehaviorDefaultDispenseItem.java

示例2: setBlockBoundsBasedOnState

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
{
    EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING);

    if (enumfacing.getAxis() == EnumFacing.Axis.X)
    {
        this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F);
    }
    else
    {
        this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:BlockAnvil.java

示例3: getStateFromMeta

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:BlockEnderChest.java

示例4: getStateFromMeta

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:BlockBanner.java

示例5: getStateFromMeta

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getHorizontal(meta & 3); //untill third bit ? so facing only

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(FULL, (meta & 4) > 0); //facing + (saved data after facing = &4
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:13,代码来源:BlockSmelter.java

示例6: getStateFromMeta

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getHorizontal(meta);

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:12,代码来源:BlockRange.java

示例7: getStairsShape

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static BlockStairs.EnumShape getStairsShape(IBlockState p_185706_0_, IBlockAccess p_185706_1_, BlockPos p_185706_2_)
{
    EnumFacing enumfacing = (EnumFacing)p_185706_0_.getValue(FACING);
    IBlockState iblockstate = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing));

    if (isBlockStairs(iblockstate) && p_185706_0_.getValue(HALF) == iblockstate.getValue(HALF))
    {
        EnumFacing enumfacing1 = (EnumFacing)iblockstate.getValue(FACING);

        if (enumfacing1.getAxis() != ((EnumFacing)p_185706_0_.getValue(FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing1.getOpposite()))
        {
            if (enumfacing1 == enumfacing.rotateYCCW())
            {
                return BlockStairs.EnumShape.OUTER_LEFT;
            }

            return BlockStairs.EnumShape.OUTER_RIGHT;
        }
    }

    IBlockState iblockstate1 = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing.getOpposite()));

    if (isBlockStairs(iblockstate1) && p_185706_0_.getValue(HALF) == iblockstate1.getValue(HALF))
    {
        EnumFacing enumfacing2 = (EnumFacing)iblockstate1.getValue(FACING);

        if (enumfacing2.getAxis() != ((EnumFacing)p_185706_0_.getValue(FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing2))
        {
            if (enumfacing2 == enumfacing.rotateYCCW())
            {
                return BlockStairs.EnumShape.INNER_LEFT;
            }

            return BlockStairs.EnumShape.INNER_RIGHT;
        }
    }

    return BlockStairs.EnumShape.STRAIGHT;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:BlockStairs.java

示例8: addBranchingBlocks

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private boolean addBranchingBlocks(BlockPos p_177250_1_)
{
    for (EnumFacing enumfacing : EnumFacing.values())
    {
        if (enumfacing.getAxis() != this.moveDirection.getAxis() && !this.addBlockLine(p_177250_1_.offset(enumfacing)))
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:BlockPistonStructureHelper.java

示例9: func_177250_b

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private boolean func_177250_b(BlockPos p_177250_1_)
{
    for (EnumFacing enumfacing : EnumFacing.values())
    {
        if (enumfacing.getAxis() != this.moveDirection.getAxis() && !this.func_177251_a(p_177250_1_.offset(enumfacing)))
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:BlockPistonStructureHelper.java

示例10: forFacings

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockLever.EnumOrientation forFacings(EnumFacing clickedSide, EnumFacing entityFacing)
{
    switch (clickedSide)
    {
        case DOWN:
            switch (entityFacing.getAxis())
            {
                case X:
                    return DOWN_X;

                case Z:
                    return DOWN_Z;

                default:
                    throw new IllegalArgumentException("Invalid entityFacing " + entityFacing + " for facing " + clickedSide);
            }

        case UP:
            switch (entityFacing.getAxis())
            {
                case X:
                    return UP_X;

                case Z:
                    return UP_Z;

                default:
                    throw new IllegalArgumentException("Invalid entityFacing " + entityFacing + " for facing " + clickedSide);
            }

        case NORTH:
            return NORTH;

        case SOUTH:
            return SOUTH;

        case WEST:
            return WEST;

        case EAST:
            return EAST;

        default:
            throw new IllegalArgumentException("Invalid facing: " + clickedSide);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:47,代码来源:BlockLever.java

示例11: getCapability

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
    return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY && (facing == null || facing.getAxis() == EnumFacing.Axis.Y) ? (T)mixerOutput : super.getCapability(capability, facing);
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:5,代码来源:TileEntityMixerBottomImproved.java

示例12: drawPipeConnectionAABB

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static void drawPipeConnectionAABB(BufferBuilder buffer, EnumFacing side, BlockPos pos) {
	double minX = -0.0020000000949949026D + pos.getX(), minY = -0.0020000000949949026D + pos.getY(),
			minZ = -0.0020000000949949026D + pos.getZ();
	double maxX = 1.0020000000949949026D + pos.getX(), maxY = 1.0020000000949949026D + pos.getY(),
			maxZ = 1.0020000000949949026D + pos.getZ();

	if (side == null) {
		minX = -0.0020000000949949026D + 0.3125 + pos.getX();
		maxX = 1.0020000000949949026D - 0.3125 + pos.getX();
		minY = -0.0020000000949949026D + 0.3125 + pos.getY();
		maxY = 1.0020000000949949026D - 0.3125 + pos.getY();
		minZ = -0.0020000000949949026D + 0.3125 + pos.getZ();
		maxZ = 1.0020000000949949026D - 0.3125 + pos.getZ();
	} else {
		if (side.getAxis() != EnumFacing.Axis.X) {
			minX = -0.0020000000949949026D + 0.3125 + pos.getX();
			maxX = 1.0020000000949949026D - 0.3125 + pos.getX();
		} else {
			if (side == EnumFacing.WEST) {
				maxX = -0.0020000000949949026D + 0.3125 + pos.getX();
			} else if (side == EnumFacing.EAST) {
				minX = 1.0020000000949949026D - 0.3125 + pos.getX();
			}
		}
		if (side.getAxis() != EnumFacing.Axis.Y) {
			minY = -0.0020000000949949026D + 0.3125 + pos.getY();
			maxY = 1.0020000000949949026D - 0.3125 + pos.getY();
		} else {
			if (side == EnumFacing.DOWN) {
				maxY = -0.0020000000949949026D + 0.3125 + pos.getY();
			} else if (side == EnumFacing.UP) {
				minY = 1.0020000000949949026D - 0.3125 + pos.getY();
			}
		}
		if (side.getAxis() != EnumFacing.Axis.Z) {
			minZ = -0.0020000000949949026D + 0.3125 + pos.getZ();
			maxZ = 1.0020000000949949026D - 0.3125 + pos.getZ();
		} else {
			if (side == EnumFacing.NORTH) {
				maxZ = -0.0020000000949949026D + 0.3125 + pos.getZ();
			} else if (side == EnumFacing.SOUTH) {
				minZ = 1.0020000000949949026D - 0.3125 + pos.getZ();
			}
		}
	}

	buffer.pos(minX, minY, minZ).color(0F, 0F, 0F, 0.0F).endVertex();
	buffer.pos(minX, minY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, minY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, minY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(minX, minY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(minX, maxY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(minX, minY, maxZ).color(0F, 0F, 0F, 0.0F).endVertex();
	buffer.pos(minX, maxY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, minY, maxZ).color(0F, 0F, 0F, 0.0F).endVertex();
	buffer.pos(maxX, maxY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, minY, minZ).color(0F, 0F, 0F, 0.0F).endVertex();
	buffer.pos(maxX, maxY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(minX, maxY, minZ).color(0F, 0F, 0F, 0.0F).endVertex();
	buffer.pos(minX, maxY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, maxY, maxZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(maxX, maxY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
	buffer.pos(minX, maxY, minZ).color(0F, 0F, 0F, 0.4F).endVertex();
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:65,代码来源:BoundingBoxRenderHandler.java

示例13: shouldSideBeRendered

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    return side.getAxis() != EnumFacing.Axis.Y;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:BlockRedstoneDiode.java


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