mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-25 02:27:41 +01:00
changes to editors
This commit is contained in:
parent
7dcb76d755
commit
100f256dcc
@ -19,15 +19,17 @@ permissions:
|
||||
citizens.npc.character.*: true
|
||||
citizens.npc.create: true
|
||||
citizens.npc.despawn: true
|
||||
citizens.npc.equip: true
|
||||
citizens.npc.edit.*:
|
||||
children:
|
||||
citizens.npc.edit.equip: true
|
||||
citizens.npc.edit.path: true
|
||||
citizens.npc.edit.text: true
|
||||
citizens.npc.help: true
|
||||
citizens.npc.path: true
|
||||
citizens.npc.remove: true
|
||||
citizens.npc.remove.all: true
|
||||
citizens.npc.rename: true
|
||||
citizens.npc.select: true
|
||||
citizens.npc.spawn: true
|
||||
citizens.npc.text: true
|
||||
citizens.npc.tp: true
|
||||
citizens.npc.tphere: true
|
||||
citizens.npc.lookclose: true
|
@ -6,7 +6,6 @@ import net.citizensnpcs.Citizens;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.command.Command;
|
||||
import net.citizensnpcs.command.CommandContext;
|
||||
import net.citizensnpcs.util.Messaging;
|
||||
|
||||
public class EditorCommands {
|
||||
|
||||
@ -15,40 +14,11 @@ public class EditorCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "equip",
|
||||
desc = "Toggle equipment editor",
|
||||
modifiers = { "equip" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "npc.equip")
|
||||
usage = "edit (editor)",
|
||||
desc = "Toggle an NPC editor",
|
||||
modifiers = { "edit" },
|
||||
min = 2,
|
||||
max = 2)
|
||||
public void toggleEquipEditor(CommandContext args, Player player, NPC npc) {
|
||||
if (!(npc instanceof Player)) {
|
||||
Messaging.sendError(player, "The NPC must be a human to equip armor and items.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "path",
|
||||
desc = "Toggle path editor",
|
||||
modifiers = { "path" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "npc.path")
|
||||
public void togglePathEditor(CommandContext args, Player player, NPC npc) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "text",
|
||||
desc = "Toggle text editor",
|
||||
modifiers = { "text" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "npc.text")
|
||||
public void toggleTextEditor(CommandContext args, Player player, NPC npc) {
|
||||
// TODO
|
||||
}
|
||||
}
|
@ -202,7 +202,7 @@ public class NPCCommands {
|
||||
return;
|
||||
}
|
||||
if (!player.hasPermission("citizens.npc.character." + character.getName())
|
||||
&& !player.hasPermission("citizens.npc.character.*")) {
|
||||
&& !player.hasPermission("citizens.npc.character.*") && !player.hasPermission("citizens.admin")) {
|
||||
Messaging.sendError(player, "You don't have permission to execute that command.");
|
||||
return;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.citizensnpcs.editor;
|
||||
|
||||
public interface Editor {
|
||||
public abstract class Editor {
|
||||
|
||||
public void begin();
|
||||
public abstract void begin();
|
||||
|
||||
public void end();
|
||||
public abstract void end();
|
||||
}
|
@ -1,13 +1,6 @@
|
||||
package net.citizensnpcs.editor;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class EquipmentEditor implements Editor {
|
||||
private Player player;
|
||||
|
||||
public EquipmentEditor(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public class EquipmentEditor extends Editor {
|
||||
|
||||
@Override
|
||||
public void begin() {
|
||||
|
@ -1,23 +1,12 @@
|
||||
package net.citizensnpcs.editor;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PathEditor implements Editor {
|
||||
private final Player player;
|
||||
|
||||
public PathEditor(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public class PathEditor extends Editor {
|
||||
|
||||
@Override
|
||||
public void begin() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
@ -1,13 +1,6 @@
|
||||
package net.citizensnpcs.editor;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class TextEditor implements Editor {
|
||||
private Player player;
|
||||
|
||||
public TextEditor(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public class TextEditor extends Editor {
|
||||
|
||||
@Override
|
||||
public void begin() {
|
||||
|
Loading…
Reference in New Issue
Block a user