Skip to content

Commit

Permalink
Merge pull request #166 from EnnuiL/1.20.1
Browse files Browse the repository at this point in the history
Backport Recipe Remainder bridge to 1.20.1
  • Loading branch information
ix0rai authored Jul 10, 2024
2 parents 1d7f7b8 + fff064e commit 6faf79f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 78 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
# TODO - Go back to "--warning-mode=fail"
- run: ./gradlew check build publishToMavenLocal --stacktrace --warning-mode=all -Porg.gradle.parallel.threads=4
- run: ./gradlew check build publishToMavenLocal --stacktrace --warning-mode=fail -Porg.gradle.parallel.threads=4
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
with:
Expand Down Expand Up @@ -53,8 +52,7 @@ jobs:
- name: Run Auto test Client
uses: modmuss50/xvfb-action@v1
with:
# TODO - Go back to "--warning-mode=fail"
run: ./gradlew runProductionAutoTestClient --stacktrace --warning-mode=all
run: ./gradlew runProductionAutoTestClient --stacktrace --warning-mode=fail
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "idea"
id "maven-publish"
id "jacoco"
id "org.quiltmc.loom" version "1.6.8" apply false
id "org.quiltmc.loom" version "1.7.3" apply false
id "org.quiltmc.gradle.licenser" version "2.0.1"
id "com.diffplug.spotless" version "6.20.0"
id "net.kyori.indra.git" version "3.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package net.fabricmc.fabric.api.item.v1;

import org.quiltmc.qsl.item.setting.api.RecipeRemainderLocation;
import org.quiltmc.qsl.item.setting.api.RecipeRemainderLogicHandler;

import net.minecraft.item.Item;
Expand All @@ -37,6 +38,6 @@ public interface FabricItemStack {
* @return the leftover item
*/
default ItemStack getRecipeRemainder() {
return RecipeRemainderLogicHandler.getRemainder((ItemStack) (Object) this, null);
return RecipeRemainderLogicHandler.getRemainder((ItemStack) (Object) this, null, RecipeRemainderLocation.DEFAULT_LOCATIONS);
}
}

This file was deleted.

This file was deleted.

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

package net.fabricmc.fabric.mixin.item;

import java.util.function.Supplier;

import org.quiltmc.qsl.item.setting.api.RecipeRemainderProvider;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Mixin(org.quiltmc.qsl.item.setting.impl.CustomItemSettingImpl.class)
public interface CustomItemSettingImplAccessor<T> {
@Mutable
@Accessor(remap = false)
void setDefaultValue(Supplier<T> defaultValue);
@Mixin(org.quiltmc.qsl.item.setting.api.RecipeRemainderLogicHandler.class)
public interface RecipeRemainderLogicHandlerMixin {
@ModifyVariable(method = "getRemainder", index = 4, at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"))
private static RecipeRemainderProvider setDefaultProvider(RecipeRemainderProvider value) {
return (original, recipe) -> original.getItem().getRecipeRemainder(original);
}
}
3 changes: 0 additions & 3 deletions fabric-item-api-v1/src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"icon": "assets/quilted_fabric_item_api_v1/icon.png"
},
"intermediate_mappings": "net.fabricmc:intermediary",
"entrypoints": {
"init": "net.fabricmc.fabric.impl.qsl.item.v1.QuiltItemCompatMod"
},
"depends": [
"quilt_loader",
"quilted_fabric_api_base",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"package": "net.fabricmc.fabric.mixin.item",
"compatibilityLevel": "JAVA_17",
"mixins": [
"CustomItemSettingImplAccessor",
"ItemMixin",
"ItemStackMixin"
"ItemStackMixin",
"RecipeRemainderLogicHandlerMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true

archivesBaseName=quilted_fabric_api
version=7.5.0
version=7.6.0
upstream_version=0.92.2
minecraft_version=1.20.1
yarn_version=+build.1
loader_version=0.26.0
qsl_version=6.1.2+1.20.1
qsl_version=6.2.0+1.20.1
installer_version=0.11.1

prerelease=false
Expand Down

0 comments on commit 6faf79f

Please sign in to comment.