Skip to content

Commit 77a190c

Browse files
committed
Added Favorite Abiphone Contacts and Power stones keybinds. First Version of the mod! 0.0.1
1 parent c482a6d commit 77a190c

25 files changed

+448
-304
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ yarn_mappings = "1.21.4+build.8"
44
loader_version = "0.16.10"
55
fabric_version = "0.119.2+1.21.4"
66
kotlin = "2.1.0"
7-
fabric_kotlin = "1.13.2+kotlin.2.1.20"
7+
fabric_kotlin = "1.13.3+kotlin.2.1.21"
88
modmenu = "13.0.3"
9-
moulconfig = "3.7.0"
9+
moulconfig = "3.8.0"
1010
gson = "2.11.0"
1111
devauth = "1.2.1"
1212
#TODO: Add Jarvis support https://github.com/nea89o/jarvis
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.github.frostzie.skyfall
2+
3+
class ConfigAccessors {
4+
companion object {
5+
@JvmStatic
6+
fun hideBlockBreakingParticles(): Boolean {
7+
return SkyFall.Companion.feature.miscFeatures.blockBreakingParticles
8+
}
9+
10+
@JvmStatic
11+
fun hidePotionEffectsHud(): Boolean {
12+
return SkyFall.Companion.feature.miscFeatures.hidePotionHud
13+
}
14+
}
15+
}

src/main/java/io/github/frostzie/skyfall/mixin/MixinBlockParticles.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.github.frostzie.skyfall.mixin;
22

3-
import io.github.frostzie.skyfall.utils.ConfigAccessors;
3+
import io.github.frostzie.skyfall.ConfigAccessors;
44
import net.minecraft.block.BlockState;
55
import net.minecraft.client.particle.ParticleManager;
66
import net.minecraft.util.math.BlockPos;
@@ -14,7 +14,7 @@
1414
public abstract class MixinBlockParticles {
1515
@Inject(method = "addBlockBreakParticles", at = @At("HEAD"), cancellable = true)
1616
private void onAddBlockDestroyEffects(BlockPos pos, BlockState state, CallbackInfo ci) {
17-
if (ConfigAccessors.hideBlockBreakingParticles()) { // Use class name
17+
if (ConfigAccessors.hideBlockBreakingParticles()) {
1818
ci.cancel();
1919
}
2020
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package io.github.frostzie.skyfall.mixin;
2+
3+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
4+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
5+
import io.github.frostzie.skyfall.utils.events.SlotRenderEvents;
6+
import net.minecraft.client.gui.DrawContext;
7+
import net.minecraft.client.gui.screen.ingame.HandledScreen;
8+
import net.minecraft.screen.ScreenHandler;
9+
import net.minecraft.screen.slot.Slot;
10+
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.injection.At;
12+
13+
@Mixin(HandledScreen.class)
14+
public class MixinHandledScreen<T extends ScreenHandler> {
15+
16+
@WrapOperation(method = "drawSlots", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlot(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/screen/slot/Slot;)V"))
17+
public void onDrawSlots(HandledScreen<T> instance, DrawContext context, Slot slot, Operation<Void> original) {
18+
var before = new SlotRenderEvents.Before(context, slot);
19+
SlotRenderEvents.INSTANCE.publish(before);
20+
original.call(instance, context, slot);
21+
}
22+
}

src/main/java/io/github/frostzie/skyfall/mixin/MixinHidePotionHud.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.github.frostzie.skyfall.mixin;
22

3-
import io.github.frostzie.skyfall.utils.ConfigAccessors;
3+
import io.github.frostzie.skyfall.ConfigAccessors;
44
import net.minecraft.client.gui.DrawContext;
55
import net.minecraft.client.gui.screen.ingame.StatusEffectsDisplay;
66
import org.spongepowered.asm.mixin.Mixin;
@@ -17,8 +17,7 @@ private MixinHidePotionHud()
1717
}
1818

1919
@Inject(method = "drawStatusEffects(Lnet/minecraft/client/gui/DrawContext;II)V", at = @At("HEAD"), cancellable = true)
20-
private void disableStatusEffectRendering(DrawContext context, int mouseX, int mouseY, CallbackInfo ci)
21-
{
20+
private void disableStatusEffectRendering(DrawContext context, int mouseX, int mouseY, CallbackInfo ci) {
2221
if (ConfigAccessors.hidePotionEffectsHud()) {
2322
ci.cancel();
2423
}

src/main/java/io/github/frostzie/skyfall/mixin/accessor/MouseAccessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public interface MouseAccessor {
1414
@Mutable
1515
@Accessor("y")
1616
void skyfall_setMouseY(double yPos);
17+
1718
@Mutable
1819
@Accessor("cursorDeltaX")
1920
void skyfall_setCursorDeltaX(double deltaX);

src/main/kotlin/io/github/frostzie/skyfall/commands/AlwaysOnCommands.kt

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.github.frostzie.skyfall.commands
22

3-
import io.github.frostzie.skyfall.config.gui.ConfigGuiManager
3+
import io.github.frostzie.skyfall.config.ConfigGuiManager
44
import io.github.frostzie.skyfall.utils.ChatUtils
55
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal
66
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback
@@ -37,55 +37,7 @@ object AlwaysOnCommands {
3737
"§f&o = §oItalic §f&n = §nUnderline\n" +
3838
"§f&r = Reset\n" +
3939
"§c==================================================="
40-
).send()
41-
1
42-
})
43-
}
44-
}
45-
46-
fun sfHelp() { //TODO: Later on improve the look of this and add all the other cmds that come along
47-
Command.register { a, _ ->
48-
a.register(literal("sfhelp").executes {
49-
ChatUtils.messageToChat(
50-
"§9---------------------------------------------------\n" +
51-
"§f/sf - Open the SkyFall config GUI\n" +
52-
"§f/sfcolor - Display the color codes\n" +
53-
"§f/sfhelp - Display this help message\n" +
54-
"§9---------------------------------------------------"
55-
).send()
56-
1
57-
})
58-
}
59-
}
60-
61-
fun sfcommandtest() {
62-
63-
Command.register { dispatcher, _ ->
64-
dispatcher.register(literal("sfcommandtest").executes { context ->
65-
66-
println("Executing /sfcommandtest for player: ${context.source.player}")
67-
68-
ChatUtils.messageToChat("This is an info message example.")
69-
70-
ChatUtils.warning("This is a warning message example. Be aware!")
71-
72-
ChatUtils.error("This is an error message. Click me to copy this text.")
73-
74-
ChatUtils.error(
75-
errorMessage = "Another error. Click to copy '/skyfall help errors'.",
76-
copyableText = "/skyfall help errors"
7740
)
78-
79-
ChatUtils.messageToChat("All test messages have been sent successfully!")
80-
81-
ChatUtils.messageToChat("Click me to copy!")
82-
.copyContent("This is the text to copy")
83-
.send()
84-
85-
ChatUtils.messageToChat("Click me to run a command!")
86-
.clickToRun("/help")
87-
.send()
88-
8941
1
9042
})
9143
}

src/main/kotlin/io/github/frostzie/skyfall/commands/CommandManager.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ object CommandManager {
77
// Always On Commands
88
AlwaysOnCommands.openConfig()
99
AlwaysOnCommands.sfColor()
10-
AlwaysOnCommands.sfHelp()
11-
AlwaysOnCommands.sfcommandtest()
1210

1311
// Dungeon Commands
1412
ShortCommands.registerCommands()

src/main/kotlin/io/github/frostzie/skyfall/config/gui/ConfigGuiManager.kt renamed to src/main/kotlin/io/github/frostzie/skyfall/config/ConfigGuiManager.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package io.github.frostzie.skyfall.config.gui
1+
package io.github.frostzie.skyfall.config
22

33
import io.github.frostzie.skyfall.SkyFall
4-
import io.github.frostzie.skyfall.config.Features
54
import io.github.notenoughupdates.moulconfig.gui.GuiElementWrapper
65
import io.github.notenoughupdates.moulconfig.gui.MoulConfigEditor
76
import net.minecraft.client.gui.screen.Screen
@@ -11,7 +10,7 @@ object ConfigGuiManager {
1110

1211
fun getEditorInstance(): MoulConfigEditor<Features> {
1312
if (editor == null) {
14-
editor = MoulConfigEditor(SkyFall.configManager.processor)
13+
editor = MoulConfigEditor(SkyFall.Companion.configManager.processor)
1514
}
1615
return editor!!
1716
}
@@ -21,7 +20,7 @@ object ConfigGuiManager {
2120
if (search != null) {
2221
currentEditor.search(search)
2322
}
24-
SkyFall.screenToOpen = GuiElementWrapper(currentEditor)
23+
SkyFall.Companion.screenToOpen = GuiElementWrapper(currentEditor)
2524
}
2625

2726
fun createModMenuScreen(parentScreenFromModMenu: Screen): Screen {

src/main/kotlin/io/github/frostzie/skyfall/config/Features.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import io.github.frostzie.skyfall.config.features.dev.DevConfig
66
import io.github.frostzie.skyfall.config.features.dungeon.DungeonConfig
77
import io.github.frostzie.skyfall.config.features.garden.GardenConfig
88
import io.github.frostzie.skyfall.config.features.gui.GuiConfig
9+
import io.github.frostzie.skyfall.config.features.inventory.InventoryConfig
910
import io.github.frostzie.skyfall.config.features.misc.MiscConfig
1011
import io.github.notenoughupdates.moulconfig.Config
1112
import io.github.notenoughupdates.moulconfig.Social
@@ -48,6 +49,10 @@ class Features : Config() {
4849
@Category(name = "Garden", desc = "Garden related features")
4950
var garden: GardenConfig = GardenConfig()
5051

52+
@Expose
53+
@Category(name = "Inventory", desc = "Inventory related features")
54+
var inventory: InventoryConfig = InventoryConfig()
55+
5156
@Expose
5257
@Category(name = "Misc", desc = "Miscellaneous features")
5358
var miscFeatures: MiscConfig = MiscConfig()

0 commit comments

Comments
 (0)