@@ -0,0 +1,29 @@
|
||||
package skybot;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
|
||||
public class SkybotClient implements ClientModInitializer {
|
||||
public static final String HYPIXEL_URL = "hypixel.net";
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> {
|
||||
client.execute(() -> {
|
||||
if (client.player == null)
|
||||
return;
|
||||
|
||||
ServerInfo server = client.getCurrentServerEntry();
|
||||
if (server == null || !server.address.contains(HYPIXEL_URL))
|
||||
return;
|
||||
});
|
||||
});
|
||||
|
||||
ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> {
|
||||
ServerInfo server = client.getCurrentServerEntry();
|
||||
if (server == null || !server.address.contains(HYPIXEL_URL))
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package skybot;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
|
||||
public class SkybotDataGenerator implements DataGeneratorEntrypoint {
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package skybot.mixin.client;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public class ExampleClientMixin {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package skybot.mixin.client;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(HandledScreen.class)
|
||||
public interface HandledScreenAccessor {
|
||||
@Accessor("x")
|
||||
int getGuiLeft();
|
||||
|
||||
@Accessor("y")
|
||||
int getGuiTop();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package skybot.utilities;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class ChatMenu {
|
||||
private static final String PREFIX = "§d[Skybot]§r ";
|
||||
|
||||
public static void send(String message) {
|
||||
MinecraftClient client = MinecraftClient.getInstance();
|
||||
if (client.player == null)
|
||||
return;
|
||||
|
||||
client.player.sendMessage(Text.literal(PREFIX + message), false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "skybot.mixin.client",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"ExampleClientMixin",
|
||||
"HandledScreenAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package skybot;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Skybot implements ModInitializer {
|
||||
public static final String MOD_ID = "skybot";
|
||||
|
||||
// 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(MOD_ID);
|
||||
|
||||
@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 Fabric world!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package skybot.mixin;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public class ExampleMixin {
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 453 B |
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "skybot",
|
||||
"version": "${version}",
|
||||
"name": "Skybot",
|
||||
"description": "This is an example description! Tell everyone what your mod is about!",
|
||||
"authors": [
|
||||
"Caleb Burke"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://fabricmc.net/",
|
||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
||||
},
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/skybot/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"skybot.Skybot"
|
||||
],
|
||||
"client": [
|
||||
"skybot.SkybotClient"
|
||||
],
|
||||
"fabric-datagen": [
|
||||
"skybot.SkybotDataGenerator"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"skybot.mixins.json",
|
||||
{
|
||||
"config": "skybot.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.19.2",
|
||||
"minecraft": "~1.21.11",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "skybot.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"ExampleMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user