mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-11-20 03:59:34 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e774dd5e10 |
@@ -148,15 +148,32 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
|
|||||||
|
|
||||||
occupiedSpaces.put(name, occupiedSpace);
|
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());
|
addElement('+', notAir());
|
||||||
}
|
}
|
||||||
if (built.contains("-")) {
|
if (hasMinus) {
|
||||||
addElement('-', isAir());
|
addElement('-', isAir());
|
||||||
}
|
}
|
||||||
shapes.put(name, built);
|
shapes.put(name, builder.toString());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user