Skip to content

Commit

Permalink
Fixed food ingredients not having nbt on JEI
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Oct 1, 2023
1 parent 7388155 commit dee9c6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx2G
modGroup=com.buuz135
modVersion=0.4.0
modVersion=0.4.1
modBaseName=sushigocrafting
minecraftVersion=1.20.1
10 changes: 9 additions & 1 deletion src/main/java/com/buuz135/sushigocrafting/item/AmountItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.buuz135.sushigocrafting.api.IFoodIngredient;
import com.buuz135.sushigocrafting.api.impl.FoodAPI;
import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.hrznstudio.titanium.api.ISpecialCreativeTabItem;
import com.mojang.datafixers.util.Pair;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
Expand All @@ -15,11 +16,12 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;

import java.awt.*;
import java.util.List;

public class AmountItem extends SushiItem {
public class AmountItem extends SushiItem implements ISpecialCreativeTabItem {

public static final String NBT_AMOUNT = "Amount";

Expand Down Expand Up @@ -134,4 +136,10 @@ public static ItemStack combineStacks(ItemStack first, ItemStack second) {
return null;
}

@Override
public void addToTab(BuildCreativeModeTabContentsEvent event) {
ItemStack stack = new ItemStack(this);
stack.getOrCreateTag().putInt(NBT_AMOUNT, maxAmount / 2);
event.accept(stack);
}
}

0 comments on commit dee9c6a

Please sign in to comment.