43 lines
1.2 KiB
Java
43 lines
1.2 KiB
Java
package eu.oskar3123.tapemouse;
|
|
|
|
import net.fabricmc.api.ModInitializer;
|
|
import net.minecraft.client.MinecraftClient;
|
|
import net.minecraft.text.TranslatableTextComponent;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
public class TapeMouse implements ModInitializer
|
|
{
|
|
|
|
private static final Logger LOGGER = LogManager.getLogger();
|
|
private static boolean enabled = false;
|
|
|
|
public static boolean isEnabled()
|
|
{
|
|
return TapeMouse.enabled;
|
|
}
|
|
|
|
public static void toggle()
|
|
{
|
|
TapeMouse.enabled = !TapeMouse.enabled;
|
|
LOGGER.info("Tape Mouse toggled, enabled: " + TapeMouse.enabled);
|
|
MinecraftClient client = MinecraftClient.getInstance();
|
|
if (TapeMouse.isEnabled())
|
|
{
|
|
client.player.addChatMessage(new TranslatableTextComponent("commands.tapemouse.enabled"), false);
|
|
}
|
|
else
|
|
{
|
|
client.player.addChatMessage(new TranslatableTextComponent("commands.tapemouse.disabled"), false);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onInitialize()
|
|
{
|
|
new KeyBindingHandler();
|
|
LOGGER.info("Initialized Tape Mouse");
|
|
}
|
|
|
|
}
|