Skip to content

Commit

Permalink
Initially initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamarine committed Jul 16, 2022
1 parent 7bddac8 commit 8151a5a
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 70 deletions.
23 changes: 2 additions & 21 deletions README.md
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.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ repositories {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url 'https://jitpack.io' }
}

// We use shadow here to avoid the following dependencies being shadowed.
Expand All @@ -41,6 +42,9 @@ dependencies {

shadow "org.slf4j:slf4j-api:1.8.0-beta4"
shadow 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2'

implementation("com.github.LlamaLad7:MixinExtras:0.0.11")
annotationProcessor("com.github.LlamaLad7:MixinExtras:0.0.11")
}

java {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ loader_version=0.14.6-babric.1

# Mod
mod_version=1.0.0
mod_group=com.example
mod_name=BTAExampleMod-babric
mod_group=io.github,pkstdev
mod_name=InventoryPausing-bta
14 changes: 0 additions & 14 deletions src/main/java/com/example/examplemod/ExampleMod.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/com/example/examplemod/mixin/ExampleMixin.java

This file was deleted.

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();
}
}
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;
}
}
}
23 changes: 8 additions & 15 deletions src/main/resources/fabric.mod.json
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": "*"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"package": "io.github.pkstdev.invpausing.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
],
"client": [
"ExampleMixin"
"GuiContainerMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 8151a5a

Please sign in to comment.