Make smaller cables have a smaller bounding box
This commit is contained in:
parent
dc4cdbb9cc
commit
3c7cd638c1
1 changed files with 13 additions and 6 deletions
|
@ -196,12 +196,19 @@ public class BlockCable extends BlockContainer {
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||||
state = state.getActualState(source, pos);
|
state = state.getActualState(source, pos);
|
||||||
float minX = state.getValue(WEST) ? 0.0F : 0.3125F;
|
float minSize = 0.3125F;
|
||||||
float minY = state.getValue(DOWN) ? 0.0F : 0.3125F;
|
float maxSize = 0.6875F;
|
||||||
float minZ = state.getValue(NORTH) ? 0.0F : 0.3125F;
|
int thinkness = (int) state.getValue(TYPE).cableThickness;
|
||||||
float maxX = state.getValue(EAST) ? 1.0F : 0.6875F;
|
if(thinkness == 6){
|
||||||
float maxY = state.getValue(UP) ? 1.0F : 0.6875F;
|
minSize = 0.35F;
|
||||||
float maxZ = state.getValue(SOUTH) ? 1.0F : 0.6875F;
|
maxSize = 0.65F;
|
||||||
|
}
|
||||||
|
float minX = state.getValue(WEST) ? 0.0F : minSize;
|
||||||
|
float minY = state.getValue(DOWN) ? 0.0F : minSize;
|
||||||
|
float minZ = state.getValue(NORTH) ? 0.0F : minSize;
|
||||||
|
float maxX = state.getValue(EAST) ? 1.0F : maxSize;
|
||||||
|
float maxY = state.getValue(UP) ? 1.0F : maxSize;
|
||||||
|
float maxZ = state.getValue(SOUTH) ? 1.0F : maxSize;
|
||||||
return new AxisAlignedBB((double) minX, (double) minY, (double) minZ, (double) maxX, (double) maxY, (double) maxZ);
|
return new AxisAlignedBB((double) minX, (double) minY, (double) minZ, (double) maxX, (double) maxY, (double) maxZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue