Removing these methods since subclasses have to handle their own collision shapes.
This commit is contained in:
@@ -50,8 +50,6 @@ public abstract class AEBaseBlock extends Block {
|
||||
private boolean isFullSize = true;
|
||||
private boolean isInventory = false;
|
||||
|
||||
protected VoxelShape boundingBox = VoxelShapes.fullCube();
|
||||
|
||||
protected AEBaseBlock(final Block.Properties props) {
|
||||
super(props);
|
||||
}
|
||||
@@ -92,145 +90,6 @@ public abstract class AEBaseBlock extends Block {
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
// FIXME @SuppressWarnings( "deprecation" )
|
||||
// FIXME @Override
|
||||
// FIXME public void addCollisionBoxToList(final BlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
|
||||
// FIXME {
|
||||
// FIXME final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
// FIXME
|
||||
// FIXME if( collisionHandler != null && bb != null )
|
||||
// FIXME {
|
||||
// FIXME final List<AxisAlignedBB> tmp = new ArrayList<>();
|
||||
// FIXME collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e );
|
||||
// FIXME for( final AxisAlignedBB b : tmp )
|
||||
// FIXME {
|
||||
// FIXME final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
|
||||
// FIXME if( bb.intersects( offset ) )
|
||||
// FIXME {
|
||||
// FIXME out.add( offset );
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else
|
||||
// FIXME {
|
||||
// FIXME super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ );
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME
|
||||
|
||||
// @Override
|
||||
// public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
// final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
//
|
||||
// if( context instanceof EntitySelectionContext && collisionHandler != null )
|
||||
// {
|
||||
// EntitySelectionContext entitySelectionContext = (EntitySelectionContext) context;
|
||||
//
|
||||
// if( Platform.isClient() )
|
||||
// {
|
||||
// final PlayerEntity player = Minecraft.getInstance().player;
|
||||
// if (player != null && player == entitySelectionContext.getEntity()) {
|
||||
// final LookDirection ld = Platform.getPlayerRay(player);
|
||||
//
|
||||
// final Iterable<VoxelShape> bbs = collisionHandler.getSelectedBoundingBoxesFromPool(w, pos, Minecraft.getInstance().player, true);
|
||||
// VoxelShape br = null;
|
||||
//
|
||||
// double lastDist = 0;
|
||||
//
|
||||
// for (final VoxelShape bb : bbs) {
|
||||
// final RayTraceResult r = bb.rayTrace(ld.getA(), ld.getB(), pos);
|
||||
//
|
||||
// if (r != null) {
|
||||
// final double xLen = (ld.getA().x - r.getHitVec().x);
|
||||
// final double yLen = (ld.getA().y - r.getHitVec().y);
|
||||
// final double zLen = (ld.getA().z - r.getHitVec().z);
|
||||
//
|
||||
// final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
//
|
||||
// if (br == null || lastDist > thisDist) {
|
||||
// lastDist = thisDist;
|
||||
// br = bb;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (br != null) {
|
||||
// return br;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // FIXME: This seems fishy because it is NOT solely related to selection
|
||||
//// VoxelShape b = VoxelShapes.empty();
|
||||
////
|
||||
//// for( final VoxelShape bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, null, false ) )
|
||||
//// {
|
||||
//// if( b.isEmpty() )
|
||||
//// {
|
||||
//// b = bx;
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
//// b = VoxelShapes.or(b, bx);
|
||||
//// }
|
||||
////
|
||||
//// return b;
|
||||
// }
|
||||
//
|
||||
// return super.getShape( state, w, pos, context );
|
||||
// }
|
||||
|
||||
// FIXME: Move to state
|
||||
// FIXME @Override
|
||||
// FIXME public final boolean isOpaqueCube( BlockState state )
|
||||
// {
|
||||
// return this.isOpaque();
|
||||
// }
|
||||
|
||||
//FIXME @SuppressWarnings( "deprecation" )
|
||||
//FIXME @Override
|
||||
//FIXME public RayTraceResult collisionRayTrace(final BlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||
//FIXME {
|
||||
//FIXME final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
//FIXME
|
||||
//FIXME if( collisionHandler != null )
|
||||
//FIXME {
|
||||
//FIXME final Iterable<VoxelShape> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, null, true );
|
||||
//FIXME RayTraceResult br = null;
|
||||
//FIXME
|
||||
//FIXME double lastDist = 0;
|
||||
//FIXME
|
||||
//FIXME for( final VoxelShape bb : bbs )
|
||||
//FIXME {
|
||||
//FIXME final RayTraceResult r = bb.rayTrace( state, w, pos, a, b );
|
||||
//FIXME
|
||||
//FIXME if( r != null )
|
||||
//FIXME {
|
||||
//FIXME final double xLen = ( a.x - r.getHitVec().x );
|
||||
//FIXME final double yLen = ( a.y - r.getHitVec().y );
|
||||
//FIXME final double zLen = ( a.z - r.getHitVec().z );
|
||||
//FIXME
|
||||
//FIXME final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
//FIXME if( br == null || lastDist > thisDist )
|
||||
//FIXME {
|
||||
//FIXME lastDist = thisDist;
|
||||
//FIXME br = r;
|
||||
//FIXME }
|
||||
//FIXME }
|
||||
//FIXME }
|
||||
//FIXME
|
||||
//FIXME if( br != null )
|
||||
//FIXME {
|
||||
//FIXME return br;
|
||||
//FIXME }
|
||||
//FIXME
|
||||
//FIXME return null;
|
||||
//FIXME }
|
||||
//FIXME
|
||||
//FIXME this.boundingBox = FULL_BLOCK_AABB;
|
||||
//FIXME return super.collisionRayTrace( state, w, pos, a, b );
|
||||
//FIXME }
|
||||
//FIXME
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride(BlockState state) {
|
||||
return this.isInventory();
|
||||
|
||||
Reference in New Issue
Block a user