-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
148 additions
and
108 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
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
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
File renamed without changes
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,35 +1,18 @@ | ||
package com.girafi.minemenu; | ||
|
||
import com.girafi.minemenu.client.KeyHelper; | ||
import com.girafi.minemenu.client.PingHandlerHelper; | ||
import com.girafi.minemenu.client.PingKeybinds; | ||
import com.girafi.minemenu.client.gui.PingSelectGui; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; | ||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
|
||
public class MineMenu implements ModInitializer { | ||
|
||
@Override | ||
public void onInitialize() { | ||
MineMenuCommon.loadCommon(); | ||
MineMenuCommon.loadCommon(FabricLoader.getInstance().getGameDir().toFile()); | ||
|
||
//Register keybinds | ||
KeyBindingHelper.registerKeyBinding(PingKeybinds.KEY_BINDING); | ||
KeyBindingHelper.registerKeyBinding(PingKeybinds.PING_ALERT); | ||
KeyBindingHelper.registerKeyBinding(PingKeybinds.PING_MINE); | ||
KeyBindingHelper.registerKeyBinding(PingKeybinds.PING_LOOK); | ||
KeyBindingHelper.registerKeyBinding(PingKeybinds.PING_GOTO); | ||
|
||
//TODO Register Shader Instance (Probably not here, but somehow somewhere) | ||
|
||
ClientTickEvents.END_CLIENT_TICK.register((mc) -> { | ||
PingHandlerHelper.pingTimer(); | ||
KeyHelper.onTick(); | ||
|
||
if ((mc.level == null || mc.isPaused()) && PingSelectGui.active) { | ||
PingSelectGui.deactivate(); | ||
} | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.girafi; | ||
|
||
import com.girafi.minemenu.Constants; | ||
import com.girafi.minemenu.MineMenuCommon; | ||
import com.girafi.minemenu.util.Config; | ||
import net.minecraftforge.client.event.RegisterKeyMappingsEvent; | ||
import net.minecraftforge.eventbus.api.EventPriority; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.fml.ModLoadingContext; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; | ||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; | ||
import net.minecraftforge.fml.loading.FMLPaths; | ||
import net.neoforged.fml.config.ModConfig; | ||
|
||
@Mod(Constants.MOD_ID) | ||
public class MineMenu { | ||
|
||
public MineMenu() { | ||
final IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); | ||
modBus.addListener(EventPriority.LOWEST, this::loadMenuLoader); | ||
modBus.addListener(this::registerKeybind); | ||
|
||
MineMenuCommon.loadCommon(FMLPaths.GAMEDIR.get().toFile()); | ||
|
||
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.spec); | ||
} | ||
|
||
public void loadMenuLoader(final FMLClientSetupEvent event) { | ||
MineMenuCommon.setupMenuLoader(); | ||
} | ||
|
||
public void registerKeybind(RegisterKeyMappingsEvent event) { | ||
event.register(MineMenuCommon.WHEEL); | ||
} | ||
} |
Oops, something went wrong.