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


Java BlockLog.EnumAxis方法代码示例

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


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

示例1: getLogAxis

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
private BlockLog.EnumAxis getLogAxis(BlockPos p_175938_1_, BlockPos p_175938_2_)
{
    BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y;
    int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX());
    int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ());
    int k = Math.max(i, j);

    if (k > 0)
    {
        if (i == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.X;
        }
        else if (j == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.Z;
        }
    }

    return blocklog$enumaxis;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:22,代码来源:BaseLargeTreeGenerator.java

示例2: getMetaFromState

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
/**
 * Convert the BlockState into the correct metadata value
 */
@SuppressWarnings("incomplete-switch")
public int getMetaFromState(IBlockState state)
{
    int i = 0;

    switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS))
    {
        case X:
            i |= 0;
            break;
        case Z:
            i |= 1;
            break;
        case NONE:
            i |= 2;
    }
    
    int j = state.getValue(GENERATED);
    i += j*3;

    return i;
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:26,代码来源:SappyLog.java

示例3: func_175938_b

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
private BlockLog.EnumAxis func_175938_b(BlockPos p_175938_1_, BlockPos p_175938_2_)
{
    BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y;
    int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX());
    int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ());
    int k = Math.max(i, j);

    if (k > 0)
    {
        if (i == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.X;
        }
        else if (j == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.Z;
        }
    }

    return blocklog$enumaxis;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:WorldGenBigTree.java

示例4: limb

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
void limb(BlockPos p_175937_1_, BlockPos p_175937_2_, BlockLog p_175937_3_)
{
    BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ());
    int i = this.getGreatestDistance(blockpos);
    float f = (float)blockpos.getX() / (float)i;
    float f1 = (float)blockpos.getY() / (float)i;
    float f2 = (float)blockpos.getZ() / (float)i;

    for (int j = 0; j <= i; ++j)
    {
        BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
        BlockLog.EnumAxis blocklog$enumaxis = this.getLogAxis(p_175937_1_, blockpos1);
        this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.getDefaultState().withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis));
    }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:16,代码来源:BaseLargeTreeGenerator.java

示例5: func_175937_a

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
void func_175937_a(BlockPos p_175937_1_, BlockPos p_175937_2_, Block p_175937_3_)
{
    BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ());
    int i = this.getGreatestDistance(blockpos);
    float f = (float)blockpos.getX() / (float)i;
    float f1 = (float)blockpos.getY() / (float)i;
    float f2 = (float)blockpos.getZ() / (float)i;

    for (int j = 0; j <= i; ++j)
    {
        BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
        BlockLog.EnumAxis blocklog$enumaxis = this.func_175938_b(p_175937_1_, blockpos1);
        this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.getDefaultState().withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:WorldGenBigTree.java

示例6: limb

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
void limb(BlockPos p_175937_1_, BlockPos p_175937_2_, Block p_175937_3_)
{
    BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ());
    int i = this.getGreatestDistance(blockpos);
    float f = (float)blockpos.getX() / (float)i;
    float f1 = (float)blockpos.getY() / (float)i;
    float f2 = (float)blockpos.getZ() / (float)i;

    for (int j = 0; j <= i; ++j)
    {
        BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
        BlockLog.EnumAxis blocklog$enumaxis = this.getLogAxis(p_175937_1_, blockpos1);
        this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.getDefaultState().withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:WorldGenBigTree.java

示例7: limb

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
void limb(BlockPos pos1, BlockPos pos2)
{
    BlockPos blockpos = pos2.add(-pos1.getX(), -pos1.getY(), -pos1.getZ());
    int i = this.getGreatestDistance(blockpos);
    float f = (float)blockpos.getX() / (float)i;
    float f1 = (float)blockpos.getY() / (float)i;
    float f2 = (float)blockpos.getZ() / (float)i;

    for (int j = 0; j <= i; ++j)
    {
        BlockPos blockpos1 = pos1.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
        BlockLog.EnumAxis blocklog$enumaxis = this.getLogAxis(pos1, blockpos1);
        this.setBlockAndNotifyAdequately(this.world, blockpos1, log.withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis));
    }
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:16,代码来源:WorldGenBigTrees.java

示例8: getMetaFromState

import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
@Override
  public int getMetaFromState(IBlockState state)
  {
int meta = 0;
meta = meta | ((EnumLogType)state.getValue(wood_type)).getMeta();

if (!((Boolean)state.getValue(double_drop)).booleanValue())
{
	meta |= 2;
}

      switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS))
      {
      	case Y:
      		break;
          case X:
          	meta |= 4;
              break;
          case Z:
          	meta |= 8;
              break;
          case NONE:
          	meta |= 12;
      }

return meta;
  }
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:28,代码来源:BlockAetherLog.java


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