mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-23 21:49:45 +00:00
restore mixin target for hodgepodge (#188)
Co-authored-by: Alexdoru <[email protected]>
This commit is contained in:
1 parent
3e2db38426
commit
48e40d69fd
2 files changed
+23
-13
No files matched your search
@@ -60,7 +60,7 @@ public class ArmorProxyClient extends ArmorProxyCommon {
|
||||
@Override
|
||||
public void preInit() {
|
||||
controlInstance = new ArmorControls();
|
||||
MinecraftForge.EVENT_BUS.register(new TabRegistry.EventHandler());
|
||||
new TabRegistry().registerEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -16,6 +17,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TabRegistry {
|
||||
|
||||
public void registerEvent() {
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
private static final ArrayList<AbstractTab> tabList = new ArrayList<>();
|
||||
|
||||
public static void registerTab(AbstractTab tab) {
|
||||
@@ -81,21 +86,26 @@ public class TabRegistry {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static class EventHandler {
|
||||
// Client method
|
||||
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
if ((event.gui instanceof GuiInventory)) {
|
||||
int xSize = 176;
|
||||
int ySize = 166;
|
||||
int guiLeft = (event.gui.width - xSize) / 2;
|
||||
int guiTop = (event.gui.height - ySize) / 2;
|
||||
guiLeft += getPotionOffset();
|
||||
|
||||
updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
|
||||
addTabsToList(event.gui.buttonList);
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
if ((event.gui instanceof GuiInventory)) {
|
||||
int xSize = 176;
|
||||
int ySize = 166;
|
||||
int guiLeft = (event.gui.width - xSize) / 2;
|
||||
int guiTop = (event.gui.height - ySize) / 2;
|
||||
guiLeft += getPotionOffset();
|
||||
|
||||
updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
|
||||
addTabsToList(event.gui.buttonList);
|
||||
}
|
||||
public void guiPostInitWrapper(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
TabRegistry.this.guiPostInit(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user