aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ftbsc')
-rw-r--r--src/main/java/ftbsc/bscv/BoSCoVicino.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/bscv/BoSCoVicino.java b/src/main/java/ftbsc/bscv/BoSCoVicino.java
index 2e5f6c5..8479ed8 100644
--- a/src/main/java/ftbsc/bscv/BoSCoVicino.java
+++ b/src/main/java/ftbsc/bscv/BoSCoVicino.java
@@ -2,10 +2,14 @@ package ftbsc.bscv;
import net.minecraft.block.Block;
import net.minecraft.client.entity.player.ClientPlayerEntity;
+import net.minecraft.client.gui.screen.IngameMenuScreen;
+import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.command.CommandSource;
import net.minecraft.command.Commands;
import net.minecraft.util.text.StringTextComponent;
+import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.client.event.ClientChatEvent;
+import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
@@ -138,6 +142,30 @@ public class BoSCoVicino implements ICommons {
}
@SubscribeEvent
+ public void onPauseMenu(InitGuiEvent.Post event) {
+ if (event.getGui() instanceof IngameMenuScreen) { // TODO de-jank this, maybe by extending IngameMenuScreen
+ IngameMenuScreen screen = (IngameMenuScreen) event.getGui();
+ screen.buttons.remove(3);
+ screen.buttons.remove(3);
+ screen.children.remove(3);
+ screen.children.remove(3);
+ Button mods_btn = new Button(
+ screen.width / 2 + 4,
+ screen.height / 4 + 72 + -16, 98, 20,
+ new TranslationTextComponent("fml.menu.mods"),
+ cb -> {
+ MC.setScreen(new net.minecraftforge.fml.client.gui.screen.ModListScreen(screen));
+ }
+ );
+ // need to add it twice for it to work once...
+ screen.buttons.add(3, mods_btn);
+ screen.buttons.add(3, mods_btn);
+ screen.children.add(3, mods_btn);
+ screen.children.add(3, mods_btn);
+ }
+ }
+
+ @SubscribeEvent
public void onWorldLoad(WorldEvent.Load event) {
// TEMPORARY! add command to regenerate suggestions
ClientPlayerEntity player = MC.player;