Move the old stuff out of the way, begin fixing one by one
This commit is contained in:
parent
abfaa02ace
commit
6ccef8275c
1579 changed files with 252390 additions and 76 deletions
|
@ -1,40 +0,0 @@
|
|||
package com.zontreck.commands.spawn;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.zontreck.configs.server.AEServerConfig;
|
||||
import com.zontreck.libzontreck.vectors.WorldPosition;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.server.commands.OpCommand;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.players.PlayerList;
|
||||
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||
|
||||
public class SetSpawnCommand {
|
||||
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
{
|
||||
dispatcher.register(Commands.literal("shareitem").executes(c->setspawn(c.getSource())));
|
||||
|
||||
//dispatcher.register(Commands.literal("sethome").then(Commands.argument("nickname", StringArgumentType.string())).executes(command -> {
|
||||
//String arg = StringArgumentType.getString(command, "nickname");
|
||||
//return setHome(command.getSource(), arg);
|
||||
//}));
|
||||
}
|
||||
|
||||
private static int setspawn(CommandSourceStack ctx) {
|
||||
ServerPlayer player = ctx.getPlayer();
|
||||
|
||||
PlayerList playerList = ServerLifecycleHooks.getCurrentServer().getPlayerList();
|
||||
if(playerList.isOp(player.getGameProfile())) {
|
||||
// Player is op, spawn can now be set
|
||||
WorldPosition WP = new WorldPosition(player);
|
||||
ServerLevel level = player.getLevel();
|
||||
AEServerConfig.getInstance().worldSpawn = WP;
|
||||
AEServerConfig.save();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue