本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例10: getNeighbourInfo
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_)
{
return VALUES[p_178273_0_.getIndex()];
}
示例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;
}
示例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()];
}
示例13: getVertexTranslations
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_)
{
return VALUES[p_178184_0_.getIndex()];
}
示例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()];
}
示例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);
}