|
| 1 | +package gg.itzkatze.thehypixelrecreationmod; |
| 2 | + |
| 3 | +import gg.itzkatze.thehypixelrecreationmod.commands.*; |
| 4 | +import gg.itzkatze.thehypixelrecreationmod.features.KeybindRegistry; |
| 5 | +import gg.itzkatze.thehypixelrecreationmod.features.SpraySchemaRecorder; |
| 6 | +import gg.itzkatze.thehypixelrecreationmod.features.guicapture.GuiCaptureRecorder; |
| 7 | +import gg.itzkatze.thehypixelrecreationmod.features.packetlog.EntityPacketLogger; |
| 8 | +import gg.itzkatze.thehypixelrecreationmod.features.worldexport.ChunkExportRecorder; |
| 9 | +import net.fabricmc.api.ClientModInitializer; |
| 10 | +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; |
| 11 | +import net.hypixel.modapi.HypixelModAPI; |
| 12 | +import net.hypixel.modapi.fabric.event.HypixelModAPICallback; |
| 13 | +import net.hypixel.modapi.packet.impl.clientbound.event.ClientboundLocationPacket; |
| 14 | +import org.slf4j.Logger; |
| 15 | +import org.slf4j.LoggerFactory; |
| 16 | + |
| 17 | +public final class TheHypixelRecreationMod implements ClientModInitializer { |
| 18 | + public static final String MOD_ID = "thehypixelrecreationmod"; |
| 19 | + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); |
| 20 | + |
| 21 | + @Override |
| 22 | + public void onInitializeClient() { |
| 23 | + LOGGER.info("Initialized"); |
| 24 | + |
| 25 | + registerCommands(); |
| 26 | + KeybindRegistry.register(); |
| 27 | + registerTickHandlers(); |
| 28 | + registerHypixelApiHandlers(); |
| 29 | + } |
| 30 | + |
| 31 | + private static void registerCommands() { |
| 32 | + PlayerSkinCommand.register(); |
| 33 | + RavengardNPCCommand.register(); |
| 34 | + GetArmorStandArmorColorsCommand.register(); |
| 35 | + GetArmorStandInfos.register(); |
| 36 | + GetScoreboardInfo.register(); |
| 37 | + ChunkExporterCommand.register(); |
| 38 | + CopyMapTextureCommand.register(); |
| 39 | + CopyBiomeData.register(); |
| 40 | + FetchBlockDisplaysCommand.register(); |
| 41 | + SpraySchemaRecorderCommand.register(); |
| 42 | + SoundNbsRecorderCommand.register(); |
| 43 | + HeldItemDataCommand.register(); |
| 44 | + NearbyEntitiesCommand.register(); |
| 45 | + CopyTabBossbarCommand.register(); |
| 46 | + CopyAdvancementsCommand.register(); |
| 47 | + LogPacketsCommand.register(); |
| 48 | + RavengardSessionCommand.register(); |
| 49 | + HudCaptureCommand.register(); |
| 50 | + } |
| 51 | + |
| 52 | + private static void registerTickHandlers() { |
| 53 | + ClientTickEvents.END_CLIENT_TICK.register(_ -> { |
| 54 | + ChunkExportRecorder.tick(); |
| 55 | + SpraySchemaRecorder.tick(); |
| 56 | + EntityPacketLogger.tick(); |
| 57 | + gg.itzkatze.thehypixelrecreationmod.features.packetlog.RavengardSessionLogger.tick(); |
| 58 | + GuiCaptureRecorder.tick(net.minecraft.client.Minecraft.getInstance()); |
| 59 | + }); |
| 60 | + } |
| 61 | + |
| 62 | + private static void registerHypixelApiHandlers() { |
| 63 | + HypixelModAPI.getInstance().subscribeToEventPacket(ClientboundLocationPacket.class); |
| 64 | + |
| 65 | + HypixelModAPICallback.EVENT.register(clientboundHypixelPacket -> |
| 66 | + LOGGER.info("ClientboundHypixelPacket: {}", clientboundHypixelPacket)); |
| 67 | + |
| 68 | + HypixelModAPI.getInstance().createHandler(ClientboundLocationPacket.class, packet -> |
| 69 | + LOGGER.info("ClientboundLocationPacket: {}", packet)); |
| 70 | + } |
| 71 | +} |
0 commit comments