Fixed Auto Rotating Model (reverted to old code for now, fix later)
This commit is contained in:
@@ -21,6 +21,7 @@ package appeng.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -234,17 +235,18 @@ public abstract class AEBaseBlock extends Block
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState rotate(BlockState state, IWorld w, BlockPos pos, Rotation direction) {
|
||||
/**
|
||||
* Rotates around the given Axis (usually the current up axis).
|
||||
*/
|
||||
public boolean rotateAroundFaceAxis(IWorld w, BlockPos pos, Direction face) {
|
||||
final IOrientable rotatable = this.getOrientable( w, pos );
|
||||
|
||||
if( rotatable != null && rotatable.canBeRotated() )
|
||||
{
|
||||
if( this.hasCustomRotation() )
|
||||
{
|
||||
// FIXME this.customRotateBlock( rotatable, axis );
|
||||
// FIXME return true;
|
||||
throw new IllegalStateException();
|
||||
this.customRotateBlock( rotatable, face );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -253,26 +255,19 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
for( int rs = 0; rs < 4; rs++ )
|
||||
{
|
||||
// FIXME forward = Platform.rotateAround( forward, axis );
|
||||
// FIXME up = Platform.rotateAround( up, axis );
|
||||
forward = Platform.rotateAround( forward, face );
|
||||
up = Platform.rotateAround( up, face );
|
||||
|
||||
if( this.isValidOrientation( w, pos, forward, up ) )
|
||||
{
|
||||
rotatable.setOrientation( forward, up );
|
||||
// FIXME
|
||||
throw new IllegalStateException();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction[] getValidRotations(BlockState state, IBlockReader world, BlockPos pos)
|
||||
{
|
||||
return new Direction[0];
|
||||
return false;
|
||||
}
|
||||
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.function.Supplier;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -33,12 +34,16 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
@@ -152,18 +157,6 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
super.onReplaced( state, w, pos, newState, isMoving );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction[] getValidRotations(BlockState state, IBlockReader world, BlockPos pos)
|
||||
{
|
||||
final AEBaseTile obj = this.getTileEntity( world, pos );
|
||||
if( obj != null && obj.canBeRotated() )
|
||||
{
|
||||
return Direction.values();
|
||||
}
|
||||
|
||||
return super.getValidRotations( state, world, pos );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolorBlock( BlockState state, final IWorld world, final BlockPos pos, final Direction side, final DyeColor color )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user