本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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;
}