mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-02 16:49:34 +01:00
Edit command fixed.
This commit is contained in:
parent
e02b6bc8cc
commit
8edbdceef9
@ -4,6 +4,7 @@ import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.command.AbstractCommand;
|
||||
import com.songoda.ultimatekits.gui.GUIBlockEditor;
|
||||
import com.songoda.ultimatekits.gui.GUIKitEditor;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -19,11 +20,11 @@ public class CommandEdit extends AbstractCommand {
|
||||
protected ReturnType runCommand(UltimateKits instance, CommandSender sender, String... args) {
|
||||
Player player = (Player) sender;
|
||||
Block block = player.getTargetBlock(null, 200);
|
||||
String loc = Methods.serializeLocation(block);
|
||||
KitBlockData kitBlockData = instance.getKitManager().getKit(block.getLocation());
|
||||
if (args.length > 2) return ReturnType.SYNTAX_ERROR;
|
||||
|
||||
if (args.length == 1) {
|
||||
if (instance.getConfig().getString("data.block." + loc) == null) {
|
||||
if (kitBlockData == null) {
|
||||
player.sendMessage(Methods.formatText(instance.getReferences().getPrefix() + "&8This block does not contain a kit."));
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user