Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a09e6058a9 | ||
|
|
e774dd5e10 | ||
|
|
0866dbee98 |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -6,4 +6,5 @@ dependencies {
|
||||
|
||||
testImplementation(platform('org.junit:junit-bom:5.9.2'))
|
||||
testImplementation('org.junit.jupiter:junit-jupiter')
|
||||
testRuntimeOnly ('org.junit.platform:junit-platform-launcher')
|
||||
}
|
||||
@@ -148,15 +148,32 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 141 B |
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 139 B |
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 143 B |
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 361 B |