Skip to content

Commit

Permalink
Merge branch 'midnightlib' into midnightlib-trigam
Browse files Browse the repository at this point in the history
  • Loading branch information
TrigamDev authored Sep 22, 2024
2 parents 6417262 + 8358546 commit 56923bd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/dev/symphony/harmony/Harmony.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static dev.symphony.harmony.food.StewStack.StewStackMethod;

public class Harmony implements ModInitializer {
public static final String MOD_ID = "harmony";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/dev/symphony/harmony/food/StewStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package dev.symphony.harmony.food;

import dev.symphony.harmony.config.HarmonyConfig;
import net.fabricmc.fabric.api.item.v1.DefaultItemComponentEvents;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.item.Items;

public class StewStack {

// Would be nice if this was applied to all items with a specific custom item tag to facilitate mod compat.
public static void StewStackMethod(){
if(HarmonyConfig.StewStackBool){

DefaultItemComponentEvents.MODIFY.register(context -> {
context.modify(Items.MUSHROOM_STEW, builder -> {
builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.StewStackSize);
});
});

DefaultItemComponentEvents.MODIFY.register(context -> {
context.modify(Items.BEETROOT_SOUP, builder -> {
builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.StewStackSize);
});
});

DefaultItemComponentEvents.MODIFY.register(context -> {
context.modify(Items.RABBIT_STEW, builder -> {
builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.StewStackSize);
});
});

DefaultItemComponentEvents.MODIFY.register(context -> {
context.modify(Items.SUSPICIOUS_STEW, builder -> {
builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.StewStackSize);
});
});
}
}
}

0 comments on commit 56923bd

Please sign in to comment.