mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 20:31:30 +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.character.*: true
|
||||||
citizens.npc.create: true
|
citizens.npc.create: true
|
||||||
citizens.npc.despawn: 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.help: true
|
||||||
citizens.npc.path: true
|
|
||||||
citizens.npc.remove: true
|
citizens.npc.remove: true
|
||||||
citizens.npc.remove.all: true
|
citizens.npc.remove.all: true
|
||||||
citizens.npc.rename: true
|
citizens.npc.rename: true
|
||||||
citizens.npc.select: true
|
citizens.npc.select: true
|
||||||
citizens.npc.spawn: true
|
citizens.npc.spawn: true
|
||||||
citizens.npc.text: true
|
|
||||||
citizens.npc.tp: true
|
citizens.npc.tp: true
|
||||||
citizens.npc.tphere: true
|
citizens.npc.tphere: true
|
||||||
citizens.npc.lookclose: true
|
citizens.npc.lookclose: true
|
@ -6,7 +6,6 @@ import net.citizensnpcs.Citizens;
|
|||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.command.Command;
|
import net.citizensnpcs.command.Command;
|
||||||
import net.citizensnpcs.command.CommandContext;
|
import net.citizensnpcs.command.CommandContext;
|
||||||
import net.citizensnpcs.util.Messaging;
|
|
||||||
|
|
||||||
public class EditorCommands {
|
public class EditorCommands {
|
||||||
|
|
||||||
@ -15,40 +14,11 @@ public class EditorCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
aliases = { "npc" },
|
||||||
usage = "equip",
|
usage = "edit (editor)",
|
||||||
desc = "Toggle equipment editor",
|
desc = "Toggle an NPC editor",
|
||||||
modifiers = { "equip" },
|
modifiers = { "edit" },
|
||||||
min = 1,
|
min = 2,
|
||||||
max = 1,
|
max = 2)
|
||||||
permission = "npc.equip")
|
|
||||||
public void toggleEquipEditor(CommandContext args, Player player, NPC npc) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (!player.hasPermission("citizens.npc.character." + character.getName())
|
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.");
|
Messaging.sendError(player, "You don't have permission to execute that command.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.citizensnpcs.editor;
|
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;
|
package net.citizensnpcs.editor;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
public class EquipmentEditor extends Editor {
|
||||||
|
|
||||||
public class EquipmentEditor implements Editor {
|
|
||||||
private Player player;
|
|
||||||
|
|
||||||
public EquipmentEditor(Player player) {
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void begin() {
|
public void begin() {
|
||||||
|
@ -1,23 +1,12 @@
|
|||||||
package net.citizensnpcs.editor;
|
package net.citizensnpcs.editor;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
public class PathEditor extends Editor {
|
||||||
|
|
||||||
public class PathEditor implements Editor {
|
|
||||||
private final Player player;
|
|
||||||
|
|
||||||
public PathEditor(Player player) {
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void begin() {
|
public void begin() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void end() {
|
public void end() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,6 @@
|
|||||||
package net.citizensnpcs.editor;
|
package net.citizensnpcs.editor;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
public class TextEditor extends Editor {
|
||||||
|
|
||||||
public class TextEditor implements Editor {
|
|
||||||
private Player player;
|
|
||||||
|
|
||||||
public TextEditor(Player player) {
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void begin() {
|
public void begin() {
|
||||||
|
Loading…
Reference in New Issue
Block a user