From fe3b3d2905043cd18c7b659796b34f97530b89ca Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sat, 26 Sep 2026 17:19:52 +1200 Subject: commands are overrated anyway (purge all commands because fabric 26.2 doesnt have another handler) --- .../arslaansmagichax/commands/HackGive.java | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/main/java/com/arslaancodes/arslaansmagichax/commands/HackGive.java (limited to 'src/main/java/com/arslaancodes/arslaansmagichax/commands/HackGive.java') diff --git a/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackGive.java b/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackGive.java deleted file mode 100644 index db36136..0000000 --- a/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackGive.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.arslaancodes.arslaansmagichax.commands; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.IntegerArgumentType; -import com.mojang.brigadier.arguments.StringArgumentType; -import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.client.Minecraft; -import net.minecraft.commands.CommandBuildContext; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -public class HackGive { - public static void register(CommandDispatcher dispatcher, CommandBuildContext access) { - dispatcher.register(ClientCommandManager.literal("hackgive") - .then(ClientCommandManager.argument("item", StringArgumentType.string()) - .then(ClientCommandManager.argument("amount", IntegerArgumentType.integer(1)) - .executes(HackGive::run) - ) - ) - ); - } - - private static int run(CommandContext context) throws CommandSyntaxException { - Minecraft client = Minecraft.getInstance(); - if (client.level == null || client.player == null) return 0; - - String itemId = StringArgumentType.getString(context, "item"); - int amount = IntegerArgumentType.getInteger(context, "amount"); - Item item = BuiltInRegistries.ITEM.getValue(ResourceLocation.parse(itemId)); - if (item == null) { - context.getSource().sendError(Component.literal("Unknown item: " + itemId)); - return 0; - } - - ItemStack stack = new ItemStack(item, amount); - client.player.getInventory().add(stack); - return 1; - } -} -- cgit v1.2.3