|
10 | 10 | import net.minecraft.core.util.helper.Side;
|
11 | 11 | import net.minecraft.core.util.phys.AABB;
|
12 | 12 | import net.minecraft.core.world.World;
|
| 13 | +import sunsetsatellite.catalyst.Catalyst; |
13 | 14 | import sunsetsatellite.catalyst.CatalystMultipart;
|
14 | 15 | import sunsetsatellite.catalyst.core.util.ISideInteractable;
|
15 | 16 | import sunsetsatellite.catalyst.multipart.api.ISupportsMultiparts;
|
@@ -82,36 +83,38 @@ public void getCollidingBoundingBoxes(World world, int x, int y, int z, AABB aab
|
82 | 83 | if (((ISupportsMultiparts) tile).getParts().values().stream().allMatch(Objects::isNull)) {
|
83 | 84 | super.getCollidingBoundingBoxes(world, x, y, z, aabb, aabbList);
|
84 | 85 | } else {
|
| 86 | + |
85 | 87 | ((ISupportsMultiparts) tile).getParts().forEach((dir,multipart)->{
|
86 | 88 | if(multipart == null) return;
|
| 89 | + double d = Catalyst.map(multipart.type.thickness,1,16,0,1); |
87 | 90 | switch (dir){
|
88 | 91 | case X_POS:{
|
89 |
| - AABB bb = new AABB(x+1,y,z,(x+1)-((1.0f/16.0f)*multipart.type.thickness),y+1,z+1); |
| 92 | + AABB bb = new AABB(x+(1-d),y,z,x+1,y+1,z+1); |
90 | 93 | aabbList.add(bb);
|
91 | 94 | break;
|
92 | 95 | }
|
93 | 96 | case X_NEG:{
|
94 |
| - AABB bb = new AABB(x,y,z,x+((1.0f/16.0f)*multipart.type.thickness),y+1,z+1); |
| 97 | + AABB bb = new AABB(x,y,z,x+d,y+1,z+1); |
95 | 98 | aabbList.add(bb);
|
96 | 99 | break;
|
97 | 100 | }
|
98 | 101 | case Y_POS:{
|
99 |
| - AABB bb = new AABB(x,y+1,z,x+1,(y+1)-((1.0f/16.0f)*multipart.type.thickness),z+1); |
| 102 | + AABB bb = new AABB(x,y+(1-d),z,x+1,y+1,z+1); |
100 | 103 | aabbList.add(bb);
|
101 | 104 | break;
|
102 | 105 | }
|
103 | 106 | case Y_NEG:{
|
104 |
| - AABB bb = new AABB(x,y,z,x+1,y+((1.0f/16.0f)*multipart.type.thickness),z+1); |
| 107 | + AABB bb = new AABB(x,y,z,x+1,y+d,z+1); |
105 | 108 | aabbList.add(bb);
|
106 | 109 | break;
|
107 | 110 | }
|
108 | 111 | case Z_POS: {
|
109 |
| - AABB bb = new AABB(x,y,z+1,x+1,y+1,(z+1)-((1.0f/16.0f)*multipart.type.thickness)); |
| 112 | + AABB bb = new AABB(x,y,z+(1-d),x+1,y+1,z+1); |
110 | 113 | aabbList.add(bb);
|
111 | 114 | break;
|
112 | 115 | }
|
113 | 116 | case Z_NEG: {
|
114 |
| - AABB bb = new AABB(x,y,z,x+1,y+1,z+((1.0f/16.0f)*multipart.type.thickness)); |
| 117 | + AABB bb = new AABB(x,y,z,x+1,y+1,z+d); |
115 | 118 | aabbList.add(bb);
|
116 | 119 | break;
|
117 | 120 | }
|
|
0 commit comments