本文整理匯總了Java中net.minecraft.block.state.IBlockState.withRotation方法的典型用法代碼示例。如果您正苦於以下問題:Java IBlockState.withRotation方法的具體用法?Java IBlockState.withRotation怎麽用?Java IBlockState.withRotation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.withRotation方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: withMirror
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
/**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
示例2: withMirror
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
@SuppressWarnings("incomplete-switch")
/**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
BlockStairs.EnumShape blockstairs$enumshape = (BlockStairs.EnumShape)state.getValue(SHAPE);
switch (mirrorIn)
{
case LEFT_RIGHT:
if (enumfacing.getAxis() == EnumFacing.Axis.Z)
{
switch (blockstairs$enumshape)
{
case OUTER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
case OUTER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
case INNER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT);
case INNER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
default:
return state.withRotation(Rotation.CLOCKWISE_180);
}
}
break;
case FRONT_BACK:
if (enumfacing.getAxis() == EnumFacing.Axis.X)
{
switch (blockstairs$enumshape)
{
case OUTER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
case OUTER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
case INNER_RIGHT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
case INNER_LEFT:
return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT);
case STRAIGHT:
return state.withRotation(Rotation.CLOCKWISE_180);
}
}
}
return super.withMirror(state, mirrorIn);
}
示例3: withMirror
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
/**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(field_190957_a)));
}
示例4: withMirror
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
示例5: withMirror
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
/**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
return state.withRotation(mirrorIn.toRotation(((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing()));
}