This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
generated from Flamarine/BTAExampleMod-babric
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility with Vanilla Fix, optimization
Bump version to 1.0.1
- Loading branch information
Showing
6 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/io/github/pkstdev/btamodlist/mixin/GuiIngameMenuMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.pkstdev.btamodlist.mixin; | ||
|
||
import io.github.pkstdev.btamodlist.screen.ScreenModList; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.src.GuiButton; | ||
import net.minecraft.src.GuiIngameMenu; | ||
import net.minecraft.src.GuiScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(GuiIngameMenu.class) | ||
public class GuiIngameMenuMixin extends GuiScreen { | ||
@Inject(method = "initGui", at = @At("RETURN")) | ||
public void onInitGui(CallbackInfo ci) { | ||
byte byte1 = -16; | ||
this.controlList.add(new GuiButton(9999, this.width / 2 - 100, this.height / 4 + 72 + byte1, "Mods (" + FabricLoader.getInstance().getAllMods().size() + " Loaded)")); | ||
} | ||
|
||
@Inject(method = "actionPerformed", at = @At("RETURN")) | ||
public void onActionPerformed(GuiButton button, CallbackInfo ci) { | ||
if (button.id == 9999) { | ||
this.mc.displayGuiScreen(new ScreenModList(this)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters