๐
1 file
3,579 chars
๐
pasted-code-1795004310303.txt
txt
84 lines
โถ
pasted-code-1795004310303.txt
txt
84 lines
package com.kodari.uhcpvp;
import com.kodari.uhcpvp.combat.WebActions;
import com.kodari.uhcpvp.command.FriendCommands;
import com.kodari.uhcpvp.config.ConfigManager;
import com.kodari.uhcpvp.config.UhcConfig;
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.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;
public final class UhcPvPClient implements ClientModInitializer {
private static KeyBinding autoWebKey;
private static KeyBinding autoCobwebKey;
private static KeyBinding webModeKey;
private static KeyBinding stunSlamKey;
private static KeyBinding headWebKey;
private static KeyBinding pressurePlateWebKey;
private static KeyBinding autoDrainKey;
@Override
public void onInitializeClient() {
KeyBinding.Category category = KeyBinding.Category.create(Identifier.of(UhcPvPMod.MOD_ID, "controls"));
autoWebKey = register("key.uhcpvp.auto_web", GLFW.GLFW_KEY_G, category);
autoCobwebKey = register("key.uhcpvp.auto_cobweb", GLFW.GLFW_KEY_H, category);
webModeKey = register("key.uhcpvp.web_mode", GLFW.GLFW_KEY_J, category);
stunSlamKey = register("key.uhcpvp.stun_slam", GLFW.GLFW_KEY_K, category);
headWebKey = register("key.uhcpvp.head_web", GLFW.GLFW_KEY_L, category);
pressurePlateWebKey = register("key.uhcpvp.pressure_plate_web", GLFW.GLFW_KEY_O, category);
autoDrainKey = register("key.uhcpvp.auto_drain", GLFW.GLFW_KEY_P, category);
FriendCommands.register();
ClientTickEvents.END_CLIENT_TICK.register(UhcPvPClient::tick);
}
private static KeyBinding register(String translationKey, int keyCode, KeyBinding.Category category) {
return KeyBindingHelper.registerKeyBinding(new KeyBinding(translationKey, keyCode, category));
}
private static void tick(MinecraftClient client) {
if (client.player == null || client.world == null || client.currentScreen != null) {
return;
}
UhcConfig config = ConfigManager.get();
if (autoWebKey.wasPressed()) {
config.autoWebEnabled = !config.autoWebEnabled;
ConfigManager.save();
}
if (autoCobwebKey.wasPressed()) {
config.autoCobwebEnabled = !config.autoCobwebEnabled;
ConfigManager.save();
}
if (webModeKey.wasPressed()) {
config.webMode = config.webMode == UhcConfig.WebMode.MANUAL
? UhcConfig.WebMode.AUTOMATIC
: UhcConfig.WebMode.MANUAL;
ConfigManager.save();
}
if (autoDrainKey.wasPressed()) {
config.autoDrainEnabled = !config.autoDrainEnabled;
ConfigManager.save();
}
if (stunSlamKey.wasPressed()) {
WebActions.stunSlam(client, config);
}
if (headWebKey.wasPressed()) {
WebActions.headWeb(client, config);
}
if (pressurePlateWebKey.wasPressed()) {
WebActions.pressurePlateWeb(client, config);
}
if (config.autoWebEnabled || config.autoCobwebEnabled) {
WebActions.tickWeb(client, config);
}
if (config.autoDrainEnabled) {
WebActions.tickDrain(client, config);
}
}
}
KodariWed at 12:20 pm 1
UhcPvPCombatMod
A Fabric client-side PvP utility mod for UHC gameplay, providing automated combat assistance through configurable hotkeys. Features include auto-web placement, auto-cobweb deployment, toggleable web modes (manual/automatic), stun slam attacks, head web targeting, pressure plate web traps, and auto-drain mechanics. All features are bound to customizable keybindings and persist settings through a configuration manager. The mod integrates with the game tick system to continuously execute active combat actions, enhancing player efficiency during PvP encounters. Includes friend command support for managing allied players during matches.
What would you like me to do with UhcPvPClient? The snippet references several missing classes, so please share those files or describe the features you want built.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code