mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-11-15 01:24:40 +00:00
Compare commits
4
Commits
1.4.29-pre
...
1.4.31-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c56642a000 | ||
|
|
f4546ac4f8 | ||
|
|
15e9be364a | ||
|
|
e774dd5e10 |
@@ -164,7 +164,7 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
|
||||
socketLocations);
|
||||
}
|
||||
|
||||
private void compileShape(String name, String[][] structurePiece) {
|
||||
private Builder<T> compileShape(String name, String[][] structurePiece) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (structurePiece.length > 0) {
|
||||
@@ -247,16 +247,33 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
|
||||
|
||||
occupiedSpaces.put(name, occupiedSpace);
|
||||
|
||||
String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]", "");
|
||||
boolean hasPlus = false;
|
||||
boolean hasMinus = false;
|
||||
|
||||
if (built.contains("+")) {
|
||||
int write = 0;
|
||||
for (int read = 0; read < builder.length(); read++) {
|
||||
char ch = builder.charAt(read);
|
||||
if (ch == A || ch == B || ch == C) {
|
||||
continue;
|
||||
}
|
||||
if (ch == '+') {
|
||||
hasPlus = true;
|
||||
} else if (ch == '-') {
|
||||
hasMinus = true;
|
||||
}
|
||||
if (read != write) builder.setCharAt(write, ch);
|
||||
write++;
|
||||
}
|
||||
builder.setLength(write);
|
||||
|
||||
if (hasPlus) {
|
||||
addElement('+', notAir());
|
||||
}
|
||||
if (built.contains("-")) {
|
||||
if (hasMinus) {
|
||||
addElement('-', isAir());
|
||||
}
|
||||
|
||||
shapes.put(name, built);
|
||||
shapes.put(name, builder.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in new issue
Block a user