Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
This is too big to explain, so I'm not going to.
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed Aug 14, 2023
1 parent f4d0c13 commit f4e9e63
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 484 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: publish
on:
push:
tags:
- 'v*'
on: [workflow_dispatch]

jobs:
publish:
Expand All @@ -26,29 +23,32 @@ jobs:
- name: build
run: ./gradlew build
- name: Publish Minecraft Mods
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
version-type: release
changelog-file: CHANGELOG.md
name: ${{ env.VERSION_INFORMATION }}
version: ${{ env.VERSION_PLAIN }}

game-versions: |
1.18
1.18.1
1.18.2
1.19
1.19.1
1.19.2
loaders: |
fabric
github-tag: v${{ env.VERSION_PLAIN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-prerelease: false

modrinth-id: etNS9OnA
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-dependencies: |
dark-matter(embedded)
curseforge-id: 643246
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-dependencies: |
dark-matter(embedded)
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### What's new:

* Added compat with `dark-matter-recipe-book`
* 1.18.2 version now uses Dark Matter
* Updated Dark Matter.
* Other changes, but I forgor 💀
22 changes: 15 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower' version '1.7.+'
id 'io.github.juuxel.loom-vineflower' version '1.11.+'
}

version = project.mod_version
Expand All @@ -16,10 +16,10 @@ repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
content { includeGroup "maven.modrinth" }
}
maven { url 'https://jitpack.io' }
maven { url 'https://maven.wispforest.io' }
}

dependencies {
Expand All @@ -28,7 +28,15 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modCompileOnly("maven.modrinth:mouse-wheelie:1.8.8+mc1.18-pre5")
modCompileOnly("maven.modrinth:mouse-wheelie:1.12.2+mc1.18.2")

def dmModules = ["base", "minecraft", "enums", "recipe-book"]
for (final def module in dmModules) {
modApi include("me.melontini.dark-matter:dark-matter-${module}:${project.dark_matter}")
}
modApi("me.melontini.dark-matter:dark-matter-content:${project.dark_matter}")

modImplementation "io.wispforest:owo-lib:${project.owo_version}"
}

processResources {
Expand Down Expand Up @@ -72,7 +80,7 @@ jar {

tasks.register('printVersionName') {
doLast {
println version.split("-")[0] + " (1.18 - 1.19.2)"
println version.split("-")[0] + " (${version.split("-")[1]})"
}
}

Expand Down
11 changes: 7 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.14.8
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.4
loader_version=0.14.22
# Mod Properties
mod_version=0.9.1-1.18
mod_version=0.10.0-1.18.2
maven_group=me.melontini
archives_base_name=recipe-book-is-pain

dark_matter=177e7f2915
owo_version=0.7.2+1.18
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,39 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.gui.screen.recipebook.RecipeGroupButtonWidget;
import net.minecraft.client.recipebook.RecipeBookGroup;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemGroup;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Unique;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Environment(EnvType.CLIENT)
public class RecipeBookIsPainClient implements ClientModInitializer {
@Unique
public static List<RecipeBookGroup> CRAFTING_SEARCH_LIST;
@Unique
public static List<RecipeBookGroup> CRAFTING_LIST;

public static final Logger LOGGER = LogManager.getLogger("RBIP");
public static final boolean isOwOLoaded = FabricLoader.getInstance().isModLoaded("owo");
public static final boolean isDarkMatterContentLoaded = FabricLoader.getInstance().isModLoaded("dark-matter-content");
public static List<RecipeBookGroup> CRAFTING_SEARCH_LIST;
public static List<RecipeBookGroup> CRAFTING_LIST;
public static Map<RecipeBookGroup, ItemGroup> RECIPE_BOOK_GROUP_TO_ITEM_GROUP = new HashMap<>();
public static Map<ItemGroup, RecipeBookGroup> ITEM_GROUP_TO_RECIPE_BOOK_GROUP = new HashMap<>();

@Override
public void onInitializeClient() {
}

public static boolean renderDarkMatter(MatrixStack matrices, int i, RecipeGroupButtonWidget widget, ItemGroup group) {
if (group.dm$shouldAnimateIcon()) {
group.dm$getIconAnimation().animateIcon(matrices, widget.x + 9 + i, widget.y + 5, widget.isToggled(), false);
return true;
}
return false;
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

import de.siphalor.mousewheelie.client.mixin.gui.other.MixinRecipeBookWidget;
import de.siphalor.mousewheelie.client.util.ScrollAction;
import me.melontini.recipebookispain.access.RecipeBookWidgetAccess;
import me.melontini.recipebookispain.access.RecipeGroupButtonAccess;
import net.minecraft.client.gui.screen.recipebook.RecipeBookResults;
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
import net.minecraft.client.gui.screen.recipebook.RecipeGroupButtonWidget;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
Expand All @@ -23,17 +19,26 @@ public abstract class MouseWheelieCompatMixin {
@Nullable
private RecipeGroupButtonWidget currentTab;

@Shadow @Final private RecipeBookResults recipesArea;

@SuppressWarnings("ReferenceToMixin")
@Dynamic(mixin = MixinRecipeBookWidget.class)
@Inject(at = @At(value = "INVOKE", target = "net/minecraft/client/gui/screen/recipebook/RecipeGroupButtonWidget.setToggled (Z)V", ordinal = 1, shift = At.Shift.AFTER), method = "mouseWheelie_scrollRecipeBook")
@Inject(at = @At(value = "INVOKE", target = "net/minecraft/client/gui/screen/recipebook/RecipeGroupButtonWidget.setToggled (Z)V", ordinal = 1, shift = At.Shift.AFTER), method = "mouseWheelie_scrollRecipeBook", require = 0)
private void rbip$scrollPages(double mouseX, double mouseY, double scrollAmount, CallbackInfoReturnable<ScrollAction> cir) {
RecipeBookWidget bookWidget = (RecipeBookWidget) (Object) this;
RecipeBookWidgetAccess widgetAccess = ((RecipeBookWidgetAccess) bookWidget);
RecipeGroupButtonAccess buttonAccess = ((RecipeGroupButtonAccess) this.currentTab);
if (this.currentTab == null) return;//how tho?
this.recipesArea.hideAlternates();

assert buttonAccess != null;
if (widgetAccess.getPage() != buttonAccess.getPage()) {
widgetAccess.setPage(buttonAccess.getPage());
RecipeBookWidget bookWidget = (RecipeBookWidget) (Object) this;
if (bookWidget.dm$getPage() != currentTab.dm$getPage()) {
bookWidget.dm$setPage(currentTab.dm$getPage());
}
}

@SuppressWarnings("ReferenceToMixin")
@Dynamic(mixin = MixinRecipeBookWidget.class)
@Inject(at = @At(value = "INVOKE", target = "de/siphalor/mousewheelie/client/util/accessors/IRecipeBookResults.mouseWheelie_refreshResultButtons ()V", shift = At.Shift.BEFORE), method = "mouseWheelie_scrollRecipeBook", require = 0)
private void rbip$hideAlternatives(double mouseX, double mouseY, double scrollAmount, CallbackInfoReturnable<ScrollAction> cir) {
this.recipesArea.hideAlternates();
}

}

This file was deleted.

This file was deleted.

Loading

0 comments on commit f4e9e63

Please sign in to comment.