Refactored Generation and class structure

This commit is contained in:
2023-11-11 22:13:58 +01:00
parent d9bbaf9865
commit 6dc4269367
53 changed files with 1049 additions and 72 deletions

View File

@@ -1,5 +1,6 @@
package eu.mhsl.minenet.minigames.command;
import eu.mhsl.minenet.minigames.command.anonymous.SkinCommand;
import eu.mhsl.minenet.minigames.command.privileged.*;
import eu.mhsl.minenet.minigames.command.anonymous.HubCommand;
import eu.mhsl.minenet.minigames.command.anonymous.LeaveCommand;
@@ -22,6 +23,7 @@ public enum Commands {
OP(new OpCommand()),
FAKEPLAYER(new FakeplayerCommand()),
KICK(new KickCommand()),
SKIN(new SkinCommand()),
SETOWNER(new SetRoomOwnerCommand());
Commands(Command handler) {

View File

@@ -0,0 +1,18 @@
package eu.mhsl.minenet.minigames.command.anonymous;
import net.minestom.server.command.builder.Command;
import net.minestom.server.command.builder.arguments.ArgumentType;
import net.minestom.server.entity.Player;
import net.minestom.server.entity.PlayerSkin;
public class SkinCommand extends Command {
public SkinCommand() {
super("skin");
addSyntax((sender, context) -> {
if(sender instanceof Player p) {
p.setSkin(PlayerSkin.fromUsername(context.getRaw("target")));
}
}, ArgumentType.Entity("target").onlyPlayers(true).onlyPlayers(true));
}
}