Skip to content

Commit 942894b

Browse files
committed
Fix: Fix recipe fill sound and update Refined Storage repository
- Update the build script to use the CreeperHost Maven for Refined Storage dependencies instead of GitHub Packages. - Fix an issue where the fill sound would play even if the recipe fill action failed. - Move the mod integration check class into the Api class. - Bump version to 1.1.1.
1 parent 7aeb3c0 commit 942894b

5 files changed

Lines changed: 29 additions & 41 deletions

File tree

build.gradle

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,10 @@ repositories {
1919
url "https://cursemaven.com"
2020
}
2121
maven {
22-
name = "GitHubPackages"
23-
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage2")
24-
credentials {
25-
username = "link-fgfgui"
26-
password = System.getenv("GITHUB_MAVEN_PAT")
27-
}
28-
}
29-
maven {
30-
name = "GitHubPackages"
31-
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage-emi-integration")
32-
credentials {
33-
username = "link-fgfgui"
34-
password = System.getenv("GITHUB_MAVEN_PAT")
22+
name = "Refined Storage"
23+
url = uri("https://maven.creeperhost.net")
24+
content {
25+
includeGroup("com.refinedmods.refinedstorage")
3526
}
3627
}
3728
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ parchment_mappings_version=2025.12.20
2626
mod_id=emi_patternizer
2727
mod_name=EMI Patternizer
2828
mod_license=GNU LGPL 3.0
29-
mod_version=1.1.0
29+
mod_version=1.1.1
3030
mod_group_id=io.github.linkfgfgui
3131
mod_authors=link-fgfgui
3232
mod_description=Automatically Encoding Patterns from the EMI Recipe Tree.

src/main/java/io/github/linkfgfgui/emi_patternizer/Patternize.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import dev.emi.emi.bom.MaterialNode;
1010
import dev.emi.emi.registry.EmiRecipeFiller;
1111
import io.github.linkfgfgui.emi_patternizer.intergrated.Api;
12-
import io.github.linkfgfgui.emi_patternizer.intergrated.INTERGRATED;
1312
import net.minecraft.client.Minecraft;
1413
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
1514
import net.minecraft.client.multiplayer.MultiPlayerGameMode;
@@ -58,8 +57,8 @@ public static void Encode(long initDelay,
5857
Api api) {
5958
CompletableFuture.delayedExecutor(initDelay, TimeUnit.MILLISECONDS).execute(() -> {
6059
minecraft.execute(() -> {
61-
EmiRecipeFiller.performFill(recipe, screen, EmiCraftContext.Type.FILL_BUTTON, EmiCraftContext.Destination.NONE, 1);
62-
if (isPlaySound) {
60+
boolean fillResult = EmiRecipeFiller.performFill(recipe, screen, EmiCraftContext.Type.FILL_BUTTON, EmiCraftContext.Destination.NONE, 1);
61+
if (isPlaySound && fillResult) {
6362
minecraft.getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0f));
6463
}
6564
});
@@ -125,7 +124,7 @@ public static void onKeyPressed(ScreenEvent.KeyPressed.Post event) {
125124
.forEachOrdered(node -> {
126125
if (node.recipe != null && node.recipe.getId() != null && !containsAllItems(node.recipe)) {
127126
List<EmiStack> output = node.recipe.getOutputs();
128-
if (INTERGRATED.RS) {
127+
if (Api.INTEGRATED.RS) {
129128
for (EmiStack emiStack : output) {
130129
if (emiStack.getItemStack().isEmpty()) {
131130
return;

src/main/java/io/github/linkfgfgui/emi_patternizer/intergrated/Api.java

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.minecraft.client.gui.screens.Screen;
44
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
55
import net.minecraft.world.level.Level;
6+
import net.neoforged.fml.ModList;
67

78
import java.util.HashMap;
89
import java.util.Map;
@@ -27,29 +28,43 @@ static boolean isInstanceOf(Object obj, String className) {
2728
return clazz.isInstance(obj);
2829
}
2930

31+
class INTEGRATED {
32+
public static boolean AE2;
33+
public static boolean RS;
34+
35+
static {
36+
ModList list = ModList.get();
37+
if (list.isLoaded("ae2")) {
38+
AE2 = true;
39+
} else if (list.isLoaded("refinedstorage_emi_integration")) {
40+
RS = true;
41+
}
42+
}
43+
}
44+
3045

3146
static Api getApi(AbstractContainerScreen<?> screen) {
32-
if (INTERGRATED.AE2) {
47+
if (INTEGRATED.AE2) {
3348
return new appliedenergistics2(screen);
34-
} else if (INTERGRATED.RS) {
49+
} else if (INTEGRATED.RS) {
3550
return new refinedstorage(screen);
3651
} else {
3752
return null;
3853
}
3954
}
4055

4156
static boolean isValidEncodingScreen(Screen screen) {
42-
if (INTERGRATED.AE2) {
57+
if (INTEGRATED.AE2) {
4358
return isInstanceOf(screen, "appeng.client.gui.me.items.PatternEncodingTermScreen");
44-
} else if (INTERGRATED.RS) {
59+
} else if (INTEGRATED.RS) {
4560
return isInstanceOf(screen, "com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen");
4661
}
4762
return false;
4863
}
4964
static boolean isValidAccessScreen(Screen screen) {
50-
if (INTERGRATED.AE2) {
65+
if (INTEGRATED.AE2) {
5166
return isInstanceOf(screen, "appeng.client.gui.me.patternaccess.PatternAccessTermScreen");
52-
} else if (INTERGRATED.RS) {
67+
} else if (INTEGRATED.RS) {
5368
return isInstanceOf(screen, "com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerScreen");
5469
}
5570
return false;

src/main/java/io/github/linkfgfgui/emi_patternizer/intergrated/INTERGRATED.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)