17
17
18
18
// Courtesy of jchung01
19
19
@ Mixin (value = CubeTools .class , remap = false )
20
- public class UTCubeToolsMixin {
20
+ public class UTCubeToolsMixin
21
+ {
21
22
22
23
/**
23
24
* Using a block's complete (x,y,z) position, determine the size of compact machine it belongs to.
24
25
*
25
26
* @param section the section of world, possibly a sub-chunk or chunk
26
- * @param pos the block pos, including its y dimension
27
+ * @param pos the block pos, including its y dimension
27
28
* @return the corresponding compact machine's interior size + 1
28
29
*/
29
30
@ Unique
30
- private static int universalTweaks$getCubeSizeWithYContext (IBlockAccess section , MutableBlockPos pos ) {
31
+ private static int universalTweaks$getCubeSizeWithYContext (IBlockAccess section , MutableBlockPos pos )
32
+ {
31
33
pos .setPos (pos .getX () * 1024 , pos .getY (), pos .getZ ());
32
- for (int i = EnumMachineSize .values ().length - 1 ; i >= 0 ; i --) {
34
+ for (int i = EnumMachineSize .values ().length - 1 ; i >= 0 ; i --)
35
+ {
33
36
EnumMachineSize size = EnumMachineSize .values ()[i ];
34
37
// (x + dimension, y, z)
35
38
pos .move (EnumFacing .EAST , size .getDimension ());
36
- if (section .getBlockState (pos ).getBlock () == Blockss .wall ) {
39
+ if (section .getBlockState (pos ).getBlock () == Blockss .wall )
40
+ {
37
41
return size .getDimension ();
38
42
}
39
43
// Reset to (x, y, z)
@@ -52,17 +56,21 @@ public class UTCubeToolsMixin {
52
56
* to get block state info for the bottom sub-chunk of the machine, not the upper sub-chunk. This causes invisible walls for that upper sub-chunk.
53
57
*
54
58
* @param instance the EnumMachineSize instance
55
- * @param world the section of world, possibly a sub-chunk or chunk
56
- * @param pos the block pos
59
+ * @param world the section of world, possibly a sub-chunk or chunk
60
+ * @param pos the block pos
57
61
* @return the corresponding compact machine's interior size + 1
58
62
*/
59
63
@ Redirect (method = "shouldSideBeRendered" , at = @ At (value = "INVOKE" , target = "Lorg/dave/compactmachines3/reference/EnumMachineSize;getDimension()I" ))
60
- private static int utReassignSize (EnumMachineSize instance , IBlockAccess world , BlockPos pos ) {
64
+ private static int utReassignSize (EnumMachineSize instance , IBlockAccess world , BlockPos pos )
65
+ {
61
66
if (!UTConfigMods .COMPACT_MACHINES .utCMRenderFixToggle ) return instance .getDimension ();
62
67
PooledMutableBlockPos mPos = PooledMutableBlockPos .retain (pos );
63
- try {
68
+ try
69
+ {
64
70
return universalTweaks$getCubeSizeWithYContext (world , mPos .setPos (pos .getX () / 1024 , pos .getY (), 0 ));
65
- } finally {
71
+ }
72
+ finally
73
+ {
66
74
// Have to manually release in 1.12
67
75
mPos .release ();
68
76
}
0 commit comments