Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuqi154 committed Oct 19, 2024
1 parent 25b5923 commit 48db6d5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import org.hiedacamellia.whispergrove.core.debug.Debug;
import org.hiedacamellia.whispergrove.registers.WGClientTab;
import org.hiedacamellia.whispergrove.registers.WGTab;

import java.util.List;
Expand All @@ -32,7 +33,7 @@ protected VisceraScreen(Component title, int page) {
@Override
public void init() {
super.init();
new TabManager<>(this, new InvTabData()).init(this::addRenderableWidget, WGTab.TAB_VISCERA.get());
new TabManager<>(this, new InvTabData()).init(this::addRenderableWidget, WGClientTab.TAB_VISCERA.get());
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.hiedacamellia.whispergrove.registers;

import dev.xkmc.l2core.init.reg.simple.Val;
import dev.xkmc.l2tabs.init.L2Tabs;
import dev.xkmc.l2tabs.tabs.core.TabToken;
import dev.xkmc.l2tabs.tabs.inventory.InvTabData;
import net.minecraft.network.chat.Component;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.hiedacamellia.whispergrove.content.client.tab.VisceraTab;

import static dev.xkmc.l2tabs.init.L2Tabs.TAB_REG;

@OnlyIn(Dist.CLIENT)
public class WGClientTab {
public static Val<TabToken<InvTabData, VisceraTab>> TAB_VISCERA = TAB_REG.reg("viscera_tab",
() -> L2Tabs.GROUP.registerTab(() -> VisceraTab::new,
Component.translatable("menu.whispergrove.viscera_tab")));
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
import org.hiedacamellia.whispergrove.WhisperGrove;
Expand All @@ -26,7 +28,4 @@ public class WGTab {
WGItem.ITEMS.getEntries().forEach(holder -> output.accept(holder.get()));
}).build());

public static Val<TabToken<InvTabData, VisceraTab>> TAB_VISCERA = TAB_REG.reg("viscera_tab",
() -> L2Tabs.GROUP.registerTab(() -> VisceraTab::new,
Component.translatable("menu.whispergrove.viscera_tab")));
}

0 comments on commit 48db6d5

Please sign in to comment.