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


Java EnumFacing.getIndex方法代码示例

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


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

示例1: applyDirection

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static void applyDirection(EnumFacing direction) {
	int rotation = 0;
	switch (direction.getIndex()) {
	case 0:
		rotation = 270;
		break;
	case 1:
		rotation = 180;
		break;
	case 2:
		rotation = 90;
		break;
	case 3:
		rotation = 0;
		break;
	default:
		break;
	}
	GL11.glRotated(rotation, 0, 1, 0);
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:21,代码来源:PictureFrameTileRenderer.java

示例2: getQuintConnection

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public boolean getQuintConnection(EnumFacing dir) {
	TileEntity te = world.getTileEntity(pos.offset(dir));
	if (disabledConnections[dir.getIndex()]) {
		return false;
	}
	if (te != null && te instanceof TileEntityPipe) {
		if (((TileEntityPipe) te).connectionDisabled(dir.getOpposite())) {
			return false;
		}
		return (((TileEntityPipe) te).getAmount() > 0 || (dir != EnumFacing.UP && ((TileEntityPipe) te).getSuction().strength <= 0 && getSuction().strength <= 0));
	}
	if (te != null && te.hasCapability(QuintessenceCapabilityProvider.quintessenceCapability, dir.getOpposite())) {
		return true;
	}
	return false;
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:17,代码来源:TileEntityPipe.java

示例3: activate

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public boolean activate(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,
		EnumFacing side, float hitX, float hitY, float hitZ) {
	// debug
	if (player.getHeldItem(hand).getItem() == RegistryManager.seeing_stone && !world.isRemote) {
		player.sendMessage(new TextComponentString("Suction: " + getSuction()));
		return true;
	} else if (player.getHeldItem(hand).getItem() == RegistryManager.tuning_fork) {
		EnumFacing connection = viewedConnection(player, side, hitX, hitY, hitZ);
		if (connection != null) {
			disabledConnections[connection.getIndex()] = !disabledConnections[connection.getIndex()];
			getWorld().notifyBlockUpdate(pos, getWorld().getBlockState(pos), getWorld().getBlockState(pos), 3);
			markDirty();
			return true;
		}
	}
	return false;
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:18,代码来源:TileEntityPipe.java

示例4: setTargetPosition

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void setTargetPosition(BlockPos targetpos, EnumFacing side) {
    EnumFacing facing = world.getBlockState(pos).getValue(BlockEmberEmitter.facing);
    if(side != facing.getOpposite()) {
        targets[side.getIndex()] = targetpos;
        markDirty();
    }
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:9,代码来源:TileEntityEmberBurst.java

示例5: offset

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Offset this BlockPos 1 block in the given direction
 */
public BlockPos offset(EnumFacing facing)
{
    if (this.level <= 0)
    {
        return super.offset(facing, 1);
    }
    else
    {
        if (this.facings == null)
        {
            this.facings = new BlockPosM[EnumFacing.VALUES.length];
        }

        if (this.needsUpdate)
        {
            this.update();
        }

        int i = facing.getIndex();
        BlockPosM blockposm = this.facings[i];

        if (blockposm == null)
        {
            int j = this.mx + facing.getFrontOffsetX();
            int k = this.my + facing.getFrontOffsetY();
            int l = this.mz + facing.getFrontOffsetZ();
            blockposm = new BlockPosM(j, k, l, this.level - 1);
            this.facings[i] = blockposm;
        }

        return blockposm;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:37,代码来源:BlockPosM.java

示例6: getPositionOffset16

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public BlockPos getPositionOffset16(EnumFacing p_getPositionOffset16_1_)
{
    int i = p_getPositionOffset16_1_.getIndex();
    BlockPos blockpos = this.positionOffsets16[i];

    if (blockpos == null)
    {
        blockpos = this.getPosition().offset(p_getPositionOffset16_1_, 16);
        this.positionOffsets16[i] = blockpos;
    }

    return blockpos;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:RenderChunk.java

示例7: offset

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
 * Offset this BlockPos 1 block in the given direction
 */
public BlockPos offset(EnumFacing facing)
{
    if (this.level <= 0)
    {
        return super.offset(facing, 1).toImmutable();
    }
    else
    {
        if (this.facings == null)
        {
            this.facings = new BlockPosM[EnumFacing.VALUES.length];
        }

        if (this.needsUpdate)
        {
            this.update();
        }

        int i = facing.getIndex();
        BlockPosM blockposm = this.facings[i];

        if (blockposm == null)
        {
            int j = this.mx + facing.getFrontOffsetX();
            int k = this.my + facing.getFrontOffsetY();
            int l = this.mz + facing.getFrontOffsetZ();
            blockposm = new BlockPosM(j, k, l, this.level - 1);
            this.facings[i] = blockposm;
        }

        return blockposm;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:BlockPosM.java

示例8: setConnection

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void setConnection(EnumFacing p_175957_1_, StructureOceanMonumentPieces.RoomDefinition p_175957_2_)
{
    this.connections[p_175957_1_.getIndex()] = p_175957_2_;
    p_175957_2_.connections[p_175957_1_.getOpposite().getIndex()] = this;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:StructureOceanMonumentPieces.java

示例9: Orientation

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private Orientation(EnumFacing p_i46233_3_, boolean p_i46233_4_)
{
    this.shape = p_i46233_3_.getIndex() + (p_i46233_4_ ? EnumFacing.values().length : 0);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockModelRenderer.java

示例10: getNeighbourInfo

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_)
{
    return VALUES[p_178273_0_.getIndex()];
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:BlockModelRenderer.java

示例11: func_175957_a

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void func_175957_a(EnumFacing p_175957_1_, StructureOceanMonumentPieces.RoomDefinition p_175957_2_)
{
    this.field_175965_b[p_175957_1_.getIndex()] = p_175957_2_;
    p_175957_2_.field_175965_b[p_175957_1_.getOpposite().getIndex()] = this;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:StructureOceanMonumentPieces.java

示例12: getVertexTranslations

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_)
{
    return field_178199_k[p_178184_0_.getIndex()];
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:BlockModelRenderer.java

示例13: getVertexTranslations

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_)
{
    return VALUES[p_178184_0_.getIndex()];
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:BlockModelRenderer.java

示例14: getNeighbourInfo

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_)
{
    return field_178282_n[p_178273_0_.getIndex()];
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:BlockModelRenderer.java

示例15: Orientation

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private Orientation(String p_i9_3_, int p_i9_4_, EnumFacing p_i9_5_, boolean p_i9_6_)
{
    this.field_178229_m = p_i9_5_.getIndex() + (p_i9_6_ ? EnumFacing.values().length : 0);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:BlockModelRenderer.java


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