Fàmmelo in file jàr
📎
1 file
2,698 chars
📄
pasted-code-1792255097267.txt
txt
73 lines
▶
pasted-code-1792255097267.txt
txt
73 lines
package com.kodari.smoothaimassist;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;
public final class SmoothAimAssistClient implements ClientModInitializer {
public static final KeyBinding TOGGLE_KEY = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.smoothaimassist.toggle",
GLFW.GLFW_KEY_R,
KeyBinding.Category.create(Identifier.of(SmoothAimAssist.MOD_ID, "keybinds"))
));
private static int notificationTicks;
private static boolean notificationState;
@Override
public void onInitializeClient() {
AimConfig.load();
applyConfiguredKey();
ClientTickEvents.END_CLIENT_TICK.register(client -> {
while (TOGGLE_KEY.wasPressed()) {
toggleAimAssist();
}
if (notificationTicks > 0) {
notificationTicks--;
}
AimController.tick(client);
});
HudElementRegistry.addLast(Identifier.of(SmoothAimAssist.MOD_ID, "toggle_notification"),
(drawContext, tickCounter) -> renderNotification(drawContext));
}
public static void applyConfiguredKey() {
TOGGLE_KEY.setBoundKey(AimConfig.get().toggleInputKey());
}
public static void toggleAimAssist() {
AimConfig config = AimConfig.get();
config.enabled = !config.enabled;
AimConfig.save();
notificationState = config.enabled;
notificationTicks = 50;
}
private static void renderNotification(DrawContext drawContext) {
if (notificationTicks <= 0) {
return;
}
MinecraftClient client = MinecraftClient.getInstance();
Text message = Text.translatable(notificationState
? "message.smoothaimassist.enabled"
: "message.smoothaimassist.disabled");
int width = client.textRenderer.getWidth(message) + 16;
int x = (client.getWindow().getScaledWidth() - width) / 2;
int y = client.getWindow().getScaledHeight() - 60;
drawContext.fill(x, y, x + width, y + 20, 0xB0101010);
drawContext.drawTextWithShadow(client.textRenderer, message, x + 8, y + 6,
notificationState ? 0x7CFF8A : 0xFF7777);
}
}
KodariOct 17 at 4:39 pm 1
SmoothAimAssist
A Minecraft client-side mod that provides smooth aim assistance for players. Features a toggleable aim assist system activated via a configurable keybinding (default R key). Includes a visual notification HUD element displaying the current state (enabled/disabled) with color-coded feedback. The mod integrates with Fabric's client tick events for continuous aim control, supports keybinding customization through configuration, and displays a temporary on-screen notification when toggled. Built using Fabric API's client lifecycle, keybinding, and HUD rendering systems for seamless integration with Minecraft's modern rendering pipeline.
Il file allegato è una classe per una mod client Fabric, non un plugin Bukkit/Paper. Da solo non può diventare un .jar: mancano SmoothAimAssist, AimConfig, AimController e la configurazione del progetto Fabric.
Carica gli altri file sorgente del progetto; con quelli potrò prepararlo per la compilazione e il download del .jar.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code