the_big_one/src/main/java/jesse/keeblarcraft/Utils/PlayerChecks.java
Jkibbels 20e0325493
Some checks are pending
build / build (21) (push) Waiting to run
[factions-and-banking] More work on the faction base block + mixin example of player drop
2024-12-22 22:28:39 -05:00

27 lines
831 B
Java

package jesse.keeblarcraft.Utils;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
public class PlayerChecks {
public static Boolean HasPermission(CommandContext<ServerCommandSource> context) {
if (context.getSource().isExecutedByPlayer() && HasPermission(context.getSource().getPlayer())) {
return true;
} else {
return false;
}
}
public static Boolean HasPermission(ServerPlayerEntity player) {
if (player.hasPermissionLevel(4)) {
return true;
} else {
player.sendMessage(Text.of("You do not have permission to use this command."));
return false;
}
}
}