Skip to content

Commit

Permalink
te veel moleculen message
Browse files Browse the repository at this point in the history
  • Loading branch information
IneMEGAmaxi committed Nov 23, 2022
1 parent 39f5306 commit 026223a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,11 @@ public int getStatus() {
return 2;
} else {
if (craftingGrid.isEmpty()
|| craftingGrid.getPartialMolecule().getStructure().getTotalOpenConnections() != 0) {
|| craftingGrid.getPartialMolecule().getStructure().getTotalOpenConnections() != 0 ) {
// Empty grid or still has possible conections
return 0;
} if (!craftingGrid.getPartialMolecule().getStructure().isConnectedManagerFunctieOmdatJoeyZaagtZoalsVaak()){
return 3;
} else {
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
Text.translatable("text.minelabs.not_implemented")), mouseX, mouseY);
case 2 -> renderTooltip(matrices,
Text.translatable("text.minelabs.valid"), mouseX, mouseY);
case 3 -> renderTooltip(matrices,
Text.translatable("text.minelabs.multiple_molecules"), mouseX, mouseY);
default -> renderTooltip(matrices,
Text.translatable("text.minelabs.invalid"), mouseX, mouseY);
}
Expand All @@ -194,6 +196,7 @@ private void renderRecipeCheck(MatrixStack matrices, int x, int y) {
switch (handler.getStatus()) {
case 1 -> drawTexture(matrices, x + 105, y + 17, 176, 38, 16, 16); // NOT IMPLEMENTED
case 2 -> drawTexture(matrices, x + 105, y + 17, 176, 55, 16, 16); // VALID
case 3 -> drawTexture(matrices, x + 105, y + 17, 176, 38, 16, 16);
default -> drawTexture(matrices, x + 105, y + 17, 176, 21, 16, 16); // INVALID
}
}
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/be/uantwerpen/minelabs/util/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,27 @@ public String toCanonical() {
public String toString() {
return toCanonical();
}

public boolean isConnectedManagerFunctieOmdatJoeyZaagtZoalsVaak() {
// Dit is de beste functie die sowiezo nooit gaat crashen <3 LIEEEESSSSSS
// we've been bamboozled!!!!!!!!!!!!!
// NEVERRRRRRRRRRRRRRR! I AM ALL POWERFUL! I AM GOD

List<Vertex> vertices = new ArrayList<>();
vertices.add(this.vertices.get(0));
boolean hasAdded = true;
while(hasAdded) {
hasAdded = false;
List<Vertex> copy = new ArrayList<>(vertices);
for(Vertex v: copy) {
for(Vertex w: v.getNeighbours()) {
if(!vertices.contains(w)) {
vertices.add(w);
hasAdded = true;
}
}
}
}
return (vertices.size() == this.vertices.size());
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/minelabs/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"text.minelabs.valid": "Correct Molecule",
"text.minelabs.invalid": "Incomplete Molecule",
"text.minelabs.not_implemented": "Molecule is not implemented",
"text.minelabs.multiple_molecules": "Too many molecules",

"block.minelabs.salt_ore": "Salt Ore",
"block.minelabs.deepslate_salt_ore": "Deepslate Salt Ore",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/minelabs/lang/nl_be.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"text.minelabs.valid": "Correcte Molecule",
"text.minelabs.invalid": "Onvolledige Molecule",
"text.minelabs.not_implemented": "Molecule niet geïmplementeerd",
"text.minelabs.multiple_molecules": "Te veel moleculen",

"block.minelabs.salt_ore": "Zouterts",
"block.minelabs.deepslate_salt_ore": "Deepslate Zouterts",
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/assets/minelabs/lang/nl_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"itemGroup.minelabs.chemicals": "Chemische Stoffen",
"itemGroup.minelabs.elementary_particles": "Elementaire Deeltjes",
"itemGroup.minelabs.atoms": "Atomen",
"text.minelabs.valid": "Correcte Molecule",
"text.minelabs.invalid": "Onvolledige Molecule",
"text.minelabs.not_implemented": "Molecule niet geïmplementeerd",
"text.minelabs.multiple_molecules": "Te veel moleculen",

"block.minelabs.salt_ore": "Zouterts",
"block.minelabs.deepslate_salt_ore": "Deepslate Zouterts",
Expand Down

0 comments on commit 026223a

Please sign in to comment.