Refactored Generation and class structure
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user