Initial commit

This commit is contained in:
Adam Macdonald
2023-03-18 22:29:58 +00:00
commit 8ecde6254f
14 changed files with 564 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package today.theladpack.HotbarReplace;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HotbarReplace implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("hotbarreplace");
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
LOGGER.info("Hello from the main class");
}
}

View File

@@ -0,0 +1,16 @@
package today.theladpack.HotbarReplace.mixin;
import net.minecraft.client.gui.screen.TitleScreen;
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;
import today.theladpack.HotbarReplace.HotbarReplace;
@Mixin(TitleScreen.class)
public class HotbarReplaceMixin {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
HotbarReplace.LOGGER.info("Hello from the HotbarReplace mixin");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,35 @@
{
"schemaVersion": 1,
"id": "hotbarreplace",
"version": "${version}",
"name": "HotbarReplace",
"description": "Replace blocks in your hotbar when you run out with blocks from your inventory",
"authors": [
"Adam Macdonald"
],
"contact": {
"homepage": "https://theladpack.today/",
"sources": "https://theladpack.today/"
},
"license": "GPLv3",
"icon": "assets/hotbarreplace/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"today.theladpack.HotbarReplace.HotbarReplace"
]
},
"mixins": [
"hotbarreplace.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.17",
"fabric-api": "*",
"minecraft": "~1.19.3",
"java": ">=17"
}
}

View File

@@ -0,0 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "today.theladpack.HotbarReplace.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"HotbarReplaceMixin"
],
"injectors": {
"defaultRequire": 1
}
}