mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-02-13 21:32:53 +08:00
fix World level not in 0-8
This commit is contained in:
parent
fba26d2da9
commit
186c6bcf89
@ -3,7 +3,6 @@ package emu.grasscutter.command.commands;
|
|||||||
import emu.grasscutter.command.Command;
|
import emu.grasscutter.command.Command;
|
||||||
import emu.grasscutter.command.CommandHandler;
|
import emu.grasscutter.command.CommandHandler;
|
||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.game.props.PlayerProperty;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -26,6 +25,10 @@ public final class SetWorldLevelCommand implements CommandHandler {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
int level = Integer.parseInt(args.get(0));
|
int level = Integer.parseInt(args.get(0));
|
||||||
|
if (level > 8 || level < 0) {
|
||||||
|
sender.dropMessage("World level must be between 0-8");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Set in both world and player props
|
// Set in both world and player props
|
||||||
sender.getWorld().setWorldLevel(level);
|
sender.getWorld().setWorldLevel(level);
|
||||||
|
Loading…
Reference in New Issue
Block a user