Skip to content

Commit

Permalink
Merge pull request #9 from PssbleTrngle/fd-refabricated
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle authored Apr 17, 2024
2 parents a6a3769 + 5327fe1 commit 8b0ba1f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
19 changes: 13 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ repositories {
includeGroup("top.theillusivec4.curios")
}
}

maven {
url = uri("https://maven.greenhouseteam.dev/releases/")
content {
includeGroup("vectorwing")
}
}
}

mod {
Expand All @@ -105,27 +112,27 @@ dependencies {

modApi("com.simibubi.create:create-fabric-${mc_version}:${create_version}")

modApi("curse.maven:farmers-delight-482834:${farmers_delight_version}")
modApi("vectorwing:FarmersDelight:${farmers_delight_version}") {
exclude(group = "net.fabricmc")
}

modCompileOnly("dev.latvian.mods:kubejs-forge:${kubejs_version}")
}

enablePublishing {
repositories {
githubPackages(project)
}
githubPackages()
}

uploadToCurseforge {
dependencies {
required("create-fabric")
optional("farmers-delight-fabric")
optional("farmers-delight-refabricated")
}
}

uploadToModrinth {
dependencies {
required("Xbc0uyRg")
optional("4EakbH8e")
optional("7vxePowz")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rei_version=12.0.652
kubejs_version=1902.6.1-build.164
architectury_version=9.1.12

farmers_delight_version=4712795
farmers_delight_version=1.20.1-2.0.17+refabricated

repository=pssbletrngle/sliceanddice-fabric
modrinth_project_id=GmjmRQ0A
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.possible_triangle.sliceanddice.mixins;

import com.nhoryzon.mc.farmersdelight.registry.ItemsRegistry;
import com.possible_triangle.sliceanddice.compat.ModCompat;
import com.simibubi.create.content.contraptions.actors.harvester.HarvesterMovementBehaviour;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import vectorwing.farmersdelight.common.registry.ModItems;

@Mixin(HarvesterMovementBehaviour.class)
public class HarvesterMovementBehaviourMixin {

@Unique
private static final ItemStack sliceanddice$TOOL = ModCompat.INSTANCE.ifLoaded(ModCompat.FARMERS_DELIGHT, () -> new ItemStack(ItemsRegistry.IRON_KNIFE.get()));
private static final ItemStack sliceanddice$TOOL = ModCompat.INSTANCE.ifLoaded(ModCompat.FARMERS_DELIGHT, () -> new ItemStack(ModItems.IRON_KNIFE.get()));

@ModifyVariable(
require = 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.possible_triangle.sliceanddice.compat

import com.nhoryzon.mc.farmersdelight.integration.rei.FarmersDelightModREI
import com.nhoryzon.mc.farmersdelight.recipe.CookingPotRecipe
import com.nhoryzon.mc.farmersdelight.recipe.CuttingBoardRecipe
import com.possible_triangle.sliceanddice.Content
import com.possible_triangle.sliceanddice.SliceAndDice
import com.possible_triangle.sliceanddice.config.Configs
Expand All @@ -15,6 +12,9 @@ import me.shedaniel.rei.api.common.util.EntryStacks
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.item.crafting.Recipe
import vectorwing.farmersdelight.common.crafting.CookingPotRecipe
import vectorwing.farmersdelight.common.crafting.CuttingBoardRecipe
import vectorwing.farmersdelight.integration.rei.REICategoryIdentifiers
import java.util.function.BiConsumer

private fun CuttingBoardRecipe.toBasin(): CuttingProcessingRecipe {
Expand All @@ -38,7 +38,7 @@ class FarmersDelightCompat private constructor() : IRecipeInjector {
}

fun addCatalysts(registration: CategoryRegistry) {
registration.addWorkstations(FarmersDelightModREI.CUTTING, EntryStacks.of(Content.SLICER_BLOCK.get()))
registration.addWorkstations(REICategoryIdentifiers.CUTTING, EntryStacks.of(Content.SLICER_BLOCK.get()))
}

private fun shouldConvert(key: ResourceLocation): Boolean {
Expand Down Expand Up @@ -91,8 +91,8 @@ class FarmersDelightCompat private constructor() : IRecipeInjector {
builder.require(ingredient)
}

if (recipe.container != null && !recipe.container.isEmpty) {
builder.require(Ingredient.of(recipe.container))
if (recipe.outputContainer != null && !recipe.outputContainer.isEmpty) {
builder.require(Ingredient.of(recipe.outputContainer))
}

@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.possible_triangle.sliceanddice.compat

import com.nhoryzon.mc.farmersdelight.registry.ItemsRegistry
import com.possible_triangle.sliceanddice.SliceAndDice
import net.fabricmc.loader.api.FabricLoader
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Recipe
import net.minecraft.world.level.ItemLike
import vectorwing.farmersdelight.common.registry.ModItems
import java.util.function.BiConsumer

interface IRecipeInjector {
Expand All @@ -33,7 +33,7 @@ object ModCompat : IRecipeInjector {

val exampleTool
get(): ItemLike {
return ifLoaded(FARMERS_DELIGHT) { ItemsRegistry.IRON_KNIFE.get() } ?: Items.IRON_AXE
return ifLoaded(FARMERS_DELIGHT) { ModItems.IRON_KNIFE.get() } ?: Items.IRON_AXE
}

val exampleInput
Expand All @@ -43,7 +43,7 @@ object ModCompat : IRecipeInjector {

val exampleOutput
get(): ItemLike {
return ifLoaded(FARMERS_DELIGHT) { ItemsRegistry.CAKE_SLICE.get() } ?: Items.STRIPPED_BIRCH_LOG
return ifLoaded(FARMERS_DELIGHT) { ModItems.CAKE_SLICE.get() } ?: Items.STRIPPED_BIRCH_LOG
}

}

0 comments on commit 8b0ba1f

Please sign in to comment.