Compare commits

..
@@ -164,7 +164,7 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
socketLocations);
}
private Builder<T> compileShape(String name, String[][] structurePiece) {
private void compileShape(String name, String[][] structurePiece) {
StringBuilder builder = new StringBuilder();
if (structurePiece.length > 0) {
@@ -247,33 +247,16 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
occupiedSpaces.put(name, occupiedSpace);
boolean hasPlus = false;
boolean hasMinus = false;
String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]", "");
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) {
if (built.contains("+")) {
addElement('+', notAir());
}
if (hasMinus) {
if (built.contains("-")) {
addElement('-', isAir());
}
shapes.put(name, builder.toString());
return this;
shapes.put(name, built);
}
@SuppressWarnings("unchecked")