本文整理了Java中net.minecraft.util.EnumFacing.rotateAround()
方法的一些代码示例,展示了EnumFacing.rotateAround()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EnumFacing.rotateAround()
方法的具体详情如下:
包路径:net.minecraft.util.EnumFacing
类名称:EnumFacing
方法名:rotateAround
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
EnumFacing perpendicular = a.rotateAround( side.getAxis() );
for( EnumFacing cornerCandidate : EnumSet.of( perpendicular, perpendicular.getOpposite() ) )
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean rotateBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis) {
setRotation(world, pos, getRotation(world, pos).rotateAround(EnumFacing.Axis.Y));
return true;
}
代码示例来源:origin: SleepyTrousers/EnderCore
public EnumFacing rotate(@Nonnull EnumFacing dir) {
if (dir.getFrontOffsetY() != 0) {
return dir;
}
if (getAngle() == ROTATION_AMOUNT) {
return dir.rotateAround(Axis.Y);
}
if (getAngle() == ROTATION_AMOUNT * 2) {
return dir.getOpposite();
}
if (getAngle() == ROTATION_AMOUNT * 3) {
return dir.rotateAround(Axis.Y).rotateAround(Axis.Y).rotateAround(Axis.Y);
}
return dir;
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
private void rotateTile(EnumFacing facing, IRotatableTile te) {
EnumFacing o = te.getPrimaryFacing().rotateAround(facing.getAxis());
te.setPrimaryFacing(o);//twb will send update packets / etc
}
代码示例来源:origin: SleepyTrousers/EnderCore
public void setRotation(@Nonnull EnumFacing dir) {
if (dir == defaultDir) {
setAngle(0);
} else if (dir == defaultDir.getOpposite()) {
setAngle(ROTATION_AMOUNT * 2);
} else if (dir == defaultDir.rotateAround(Axis.Y)) {
setAngle(ROTATION_AMOUNT);
} else {
setAngle(ROTATION_AMOUNT * 3);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
if (world.isRemote)
return false;
IBlockState state = world.getBlockState(pos);
EnumFacing facing = state.getValue(FACING);
EnumFacing rotatedFacing = facing.rotateAround(axis.getAxis());
if (facing != rotatedFacing) {
world.setBlockState(pos, state.withProperty(FACING, rotatedFacing));
return true;
}
return false;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
if (world.isRemote) { //TODO is this needed or it's always server side?
return false;
}
//noinspection ConstantConditions
IRotatableTile tt = WorldTools.getTile(world, pos, IRotatableTile.class).get();
EnumFacing facing = tt.getPrimaryFacing();
EnumFacing rotatedFacing = facing;
if (axis.getAxis() == EnumFacing.Axis.Y || getRotationType() == BlockRotationHandler.RotationType.SIX_WAY) {
rotatedFacing = facing.rotateAround(axis.getAxis());
}
if (facing != rotatedFacing) {
tt.setPrimaryFacing(rotatedFacing);
return true;
}
return false;
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@Override
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entity) {
EnumFacing face = getFacingFromState(state);
if (state.getValue(FLIPPED)) {
face = face.getOpposite();
}
//are we going ahead or turning the corner
boolean forward = false;//worldIn.rand.nextDouble() > 0.5;
if (forward) {//first part: go ahead
tickMovement(pos, entity, face);
}
else {// turn the corner
tickMovement(pos, entity, face.rotateAround(EnumFacing.Axis.Y));
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
EnumFacing right = dir.rotateAround(EnumFacing.Axis.Y);
内容来源于网络,如有侵权,请联系作者删除!