#Type erasure issues

22 messages · Page 1 of 1 (latest)

swift pewter
#
package com.example.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.jetbrains.annotations.NotNull;
import thunder.hack.ThunderHack;
import thunder.hack.cmd.Command;

import java.util.concurrent.atomic.AtomicBoolean;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;

public abstract class ExampleCommand extends Command {
    public ExampleCommand() {
        super("help");
    }

    @Override
    public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder) {
        builder.executes(context -> {
            sendMessage("Commands: \n");

            AtomicBoolean flip = new AtomicBoolean(false);

            ThunderHack.commandManager.getCommands().forEach(command -> {
                        context.getSource().getPlayer().sendMessage(Text.of(
                                (flip.get() ? Formatting.LIGHT_PURPLE : Formatting.DARK_PURPLE)
                                        + ThunderHack.commandManager.getPrefix()
                                        + (flip.get() ? Formatting.AQUA : Formatting.DARK_AQUA)
                                        + command.getName()
                                        + (command.getAliases().isEmpty() ? "" : " (" + command.getAliases() + ")")
                                        + Formatting.DARK_GRAY + " -> "
                                        + (flip.get() ? Formatting.WHITE : Formatting.GRAY)
                                        + command.getDescription()
                        ));
                        flip.set(!flip.get());
                    }
            );

            return SINGLE_SUCCESS;
        });
    }
}
#

I have this command

#

and its superclass

#

Command

#

is from a different mod

#

heres the code for the superclass

gentle dust
swift pewter
#

Utility mod 😉

gentle dust
#

right...

#

!!cheats

mental prismBOT
#

We do not support hacked clients, cheats, or modifications that are intended to give you the upper hand in a server, competitive or otherwise.
See rule 1 in #welcome and the Discord TOS: https://discordapp.com/terms

gentle dust
#

sorry man

swift pewter
#

Its not a cheat

#

its for a help command

novel cedar
#

That's why you named a variable ThunderHack

#

Or a class

swift pewter
#

🤷‍♂️

swift pewter
#

there is no part of this that gives you and upper hand

#

its just a command

swift pewter
#

oh cmon