mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 09:09:08 +00:00
Register inventory tabs from the client proxy, not the mod class
Deferring registration to loadComplete is right - TConstruct needs to have registered first - but naming TabRegistry and the tab classes in CustomNpcs put client-only GUI types in a class the server loads, which the verifier resolves at link time regardless of any runtime side check. A proxy hook keeps them in ClientProxy while still running at the same point.
This commit is contained in:
1 parent
74511b7449
commit
c6e361f8e6
3 files changed
+25
-13
No files matched your search
@@ -854,6 +854,19 @@ public class ClientProxy extends CommonProxy {
|
||||
return Minecraft.getMinecraft().currentScreen != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadComplete() {
|
||||
// Deferred from load() so TConstruct has registered its own tabs first - registering
|
||||
// ours before it left the vanilla tab duplicated.
|
||||
if (ConfigClient.InventoryGuiEnabled) {
|
||||
MinecraftForge.EVENT_BUS.register(new TabRegistry());
|
||||
if (TabRegistry.getTabList().isEmpty()) {
|
||||
TabRegistry.registerTab(new InventoryTabVanilla());
|
||||
}
|
||||
TabRegistry.registerTab(new InventoryTabCustomNpc());
|
||||
}
|
||||
}
|
||||
|
||||
public void buildPackageIndex() {
|
||||
try {
|
||||
PackageFinder.init(Thread.currentThread().getContextClassLoader());
|
||||
|
||||
Reference in new issue
Block a user