Skip to content

Commit 855e7a0

Browse files
committed
allow changing java pseudo code generator
1 parent 5efd95b commit 855e7a0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ public static String getPseudoJavaCode(World world,
13681368
positionOffset[2] = Math.abs(positionOffset[2]);
13691369
}
13701370

1371-
return getPseudoJavaCode(world,
1371+
return WRITER.write(world,
13721372
facing,
13731373
center.get0(),
13741374
center.get1(),
@@ -1384,13 +1384,23 @@ public static String getPseudoJavaCode(World world,
13841384
);
13851385
}
13861386

1387+
public interface PseudoWriter {
1388+
String write(World world, ExtendedFacing extendedFacing,
1389+
int basePositionX, int basePositionY, int basePositionZ,
1390+
int basePositionA, int basePositionB, int basePositionC,
1391+
Function<? super TileEntity, String> tileEntityClassifier,
1392+
int sizeA, int sizeB, int sizeC, boolean transpose);
1393+
}
1394+
1395+
public static PseudoWriter WRITER = StructureUtility::getPseudoJavaCode;
1396+
13871397
/**
13881398
* Used only to get pseudo code in structure writer...
13891399
*
13901400
* NOTE: GT specific code got removed. TODO add a mean
13911401
* @param tileEntityClassifier return a string that denote the type of a tile entity, or null if it's nothing special. useful if the tile entity cannot be simply distinguished via getClass.
13921402
*/
1393-
public static String getPseudoJavaCode(World world, ExtendedFacing extendedFacing,
1403+
private static String getPseudoJavaCode(World world, ExtendedFacing extendedFacing,
13941404
int basePositionX, int basePositionY, int basePositionZ,
13951405
int basePositionA, int basePositionB, int basePositionC,
13961406
Function<? super TileEntity, String> tileEntityClassifier,

0 commit comments

Comments
 (0)