Skip to content
Permalink
Browse files

Add /sentinel forgive, fixes #17

  • Loading branch information...
mcmonkey4eva committed Apr 19, 2016
1 parent 5673c10 commit e4e99363896182ee6d0365cb2c4388ba650df29e
Showing with 16 additions and 18 deletions.
  1. +1 −15 README.md
  2. +13 −3 src/main/java/org/mcmonkey/sentinel/SentinelPlugin.java
  3. +2 −0 src/main/resources/plugin.yml
@@ -56,6 +56,7 @@ Created by mcmonkey4eva on behalf of the Citizens and Denizen teams.
- /sentinel chaseranged - Toggles whether the NPC will chase while in ranged fights.
- /sentinel drops - Changes the drops of the current NPC.
- /sentinel spawnpoint - Changes the NPC's spawn point to its current location, or removes it if it's already there.
- /sentinel forgive - Forgives all current targets.
- /sentinel info - Shows info on the current NPC.
- /sentinel stats - Shows statistics about the current NPC.
- /sentinel targets - Shows the targets of the current NPC.
@@ -85,21 +86,6 @@ These are all valid targets and ignores:
- (To make a target glow ++ damage it, equip a bow + arm it with spectral arrows!)
- Respawning can be set to "-1" to cause the NPC to delete itself on death, or "0" to prevent respawn.

### TODO

**Beta**:

- Commands:
- `/sentinel forgive PLAYERNAME/all` forgives attackers
- Other:
- old Sentry saves importer?

**Future**:

- Events
- Java and Denizen level events
- Denizen tags

### Need help using Sentinel? Try one of these places:

**IRC** (Modern): http://webchat.esper.net/?channels=citizens
@@ -596,6 +596,10 @@ else if (arg0.equals("guard") && sender.hasPermission("sentinel.guard")) {
return true;
}
else if (arg0.equals("drops") && sender.hasPermission("sentinel.drops")) {
if (!(sender instanceof Player)) {
sender.sendMessage(prefixBad + "Players only!");
return true;
}
Inventory inv = Bukkit.createInventory(null, 9 * 4, InvPrefix + sentinel.getNPC().getId());
ItemStack[] items = new ItemStack[sentinel.drops.size()];
inv.addItem(sentinel.drops.toArray(items));
@@ -604,7 +608,7 @@ else if (arg0.equals("drops") && sender.hasPermission("sentinel.drops")) {
}
else if (arg0.equals("spawnpoint") && sender.hasPermission("sentinel.spawnpoint")) {
if (!sentinel.getNPC().isSpawned()) {
sender.sendMessage("NPC must be spawned for this command!");
sender.sendMessage(prefixBad + "NPC must be spawned for this command!");
}
else {
Location pos = sentinel.getLivingEntity().getLocation().getBlock().getLocation();
@@ -614,15 +618,20 @@ else if (arg0.equals("spawnpoint") && sender.hasPermission("sentinel.spawnpoint"
&& pos.getBlockZ() == sentinel.spawnPoint.getBlockZ()
&& pos.getWorld().getName().equals(sentinel.spawnPoint.getWorld().getName())) {
sentinel.spawnPoint = null;
sender.sendMessage("Spawn point removed!");
sender.sendMessage(prefixGood + "Spawn point removed!");
}
else {
sentinel.spawnPoint = pos;
sender.sendMessage("Spawn point updated!");
sender.sendMessage(prefixGood + "Spawn point updated!");
}
}
return true;
}
else if (arg0.equals("forgive") && sender.hasPermission("sentinel.forgive")) {
sentinel.targets.clear();
sender.sendMessage(prefixGood + "Targets forgiven.");
return true;
}
else if (arg0.equals("targets") && sender.hasPermission("sentinel.info")) {
sender.sendMessage(prefixGood + ChatColor.RESET + sentinel.getNPC().getFullName() + ColorBasic
+ ": owned by " + ChatColor.RESET + getOwner(sentinel.getNPC()));
@@ -697,6 +706,7 @@ else if (arg0.equals("stats") && sender.hasPermission("sentinel.info")) {
if (sender.hasPermission("sentinel.chase")) sender.sendMessage(prefixGood + "/sentinel chaseranged - Toggles whether the NPC will chase while in ranged fights.");
if (sender.hasPermission("sentinel.drops")) sender.sendMessage(prefixGood + "/sentinel drops - Changes the drops of the current NPC.");
if (sender.hasPermission("sentinel.spawnpoint")) sender.sendMessage(prefixGood + "/sentinel spawnpoint - Changes the NPC's spawn point to its current location, or removes it if it's already there.");
if (sender.hasPermission("sentinel.forgive")) sender.sendMessage(prefixGood + "/sentinel forgive - Forgives all current targets.");
if (sender.hasPermission("sentinel.info")) sender.sendMessage(prefixGood + "/sentinel info - Shows info on the current NPC.");
if (sender.hasPermission("sentinel.info")) sender.sendMessage(prefixGood + "/sentinel targets - Shows the targets of the current NPC.");
if (sender.hasPermission("sentinel.info")) sender.sendMessage(prefixGood + "/sentinel stats - Shows statistics about the current NPC.");
@@ -58,6 +58,8 @@ permissions:
sentinel.drops: true
# /sentinel spawnpoint
sentinel.spawnpoint: true
# /sentinel forgive
sentinel.forgive: true
# /sentinel info, /sentinel targets, /sentinel stats
sentinel.info: true
# Edit other people's NPCs

0 comments on commit e4e9936

Please sign in to comment.
You can’t perform that action at this time.