forked from Flamarine/InventoryPausing-bta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
49 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
# BTA Example Mod - Babric | ||
# Inventory Pausing - BTA | ||
|
||
A simple mod template for Better Than Adventure, yet this template is for Babric. | ||
|
||
Original version: https://github.com/pkstDev/BTAExampleMod | ||
|
||
### Setup (Same as the original one) | ||
|
||
1. Grab a full BTA jar from the MultiMC instance (or anywhere else you want) and rename it to "bta.jar". | ||
|
||
2. Place the jar in the "libs" folder in your project. | ||
|
||
3. Run the following command: | ||
```shell | ||
gradlew build | ||
``` | ||
|
||
4. Start your modding trip! | ||
|
||
### Extra Tips | ||
|
||
Since BTA is distributed without obfuscation, all Mixin classes must set the 'remap' option to false! | ||
Pauses the game when in inventory screen. Multiplayer safe. |
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 was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/main/java/com/example/examplemod/mixin/ExampleMixin.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
src/main/java/io/github/pkstdev/invpausing/InventoryPausingPreLaunch.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,11 @@ | ||
package io.github.pkstdev.invpausing; | ||
|
||
import com.llamalad7.mixinextras.MixinExtrasBootstrap; | ||
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; | ||
|
||
public class InventoryPausingPreLaunch implements PreLaunchEntrypoint { | ||
@Override | ||
public void onPreLaunch() { | ||
MixinExtrasBootstrap.init(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/io/github/pkstdev/invpausing/mixin/GuiContainerMixin.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,20 @@ | ||
package io.github.pkstdev.invpausing.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReturnValue; | ||
import net.minecraft.src.GuiContainer; | ||
import net.minecraft.src.GuiInventory; | ||
import net.minecraft.src.GuiScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(value = GuiContainer.class, remap = false) | ||
public class GuiContainerMixin extends GuiScreen { | ||
@ModifyReturnValue(method = "doesGuiPauseGame", at = @At("RETURN")) | ||
private boolean onDoesGuiPauseGame(boolean original) { | ||
if (!this.mc.isMultiplayerWorld()) { | ||
return ((GuiScreen)this) instanceof GuiInventory; | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,34 +1,27 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "modid", | ||
"id": "invpausing", | ||
"version": "${version}", | ||
|
||
"name": "Example Mod", | ||
"description": "This is an example description! Tell everyone what your mod is about!", | ||
"name": "Inventory Pausing", | ||
"description": "Pause the game when displaying player inventory, for Better than Adventure", | ||
"authors": [ | ||
"Me!" | ||
"pkstDev" | ||
], | ||
"contact": { | ||
"homepage": "https://fabricmc.net/", | ||
"sources": "https://github.com/FabricMC/fabric-example-mod" | ||
}, | ||
|
||
"license": "CC0-1.0", | ||
|
||
"environment": "*", | ||
"environment": "client", | ||
"entrypoints": { | ||
"main": [ | ||
"com.example.examplemod.ExampleMod" | ||
"preLaunch": [ | ||
"io.github.pkstdev.invpausing.InventoryPausingPreLaunch" | ||
] | ||
}, | ||
"mixins": [ | ||
"modid.mixins.json" | ||
"invpausing.mixins.json" | ||
], | ||
|
||
"depends": { | ||
"fabricloader": ">=0.13.3" | ||
}, | ||
"suggests": { | ||
"another-mod": "*" | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/resources/modid.mixins.json → src/main/resources/invpausing.mixins.json
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