Fixed Invincible Visitors still using "general.errors.you-need".

This commit is contained in:
Florian CUNY 2018-08-31 21:06:18 +02:00
parent 63e004415b
commit ea1fea66ff

View File

@ -42,8 +42,7 @@ public class InvincibleVisitorsListener extends AbstractFlagListener implements
} }
String reqPerm = getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".admin.settings.INVINCIBLE_VISITORS"; String reqPerm = getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".admin.settings.INVINCIBLE_VISITORS";
if (!user.hasPermission(reqPerm)) { if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission", "[permission]", reqPerm);
user.sendMessage("general.errors.you-need", "[permission]", reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F); user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true; return true;
} }
@ -76,7 +75,6 @@ public class InvincibleVisitorsListener extends AbstractFlagListener implements
// Make panel items // Make panel items
Arrays.stream(EntityDamageEvent.DamageCause.values()).forEach(c -> pb.item(getPanelItem(c, user))); Arrays.stream(EntityDamageEvent.DamageCause.values()).forEach(c -> pb.item(getPanelItem(c, user)));
pb.build(); pb.build();
} }
private PanelItem getPanelItem(DamageCause c, User user) { private PanelItem getPanelItem(DamageCause c, User user) {
@ -116,8 +114,5 @@ public class InvincibleVisitorsListener extends AbstractFlagListener implements
getIslands().getIslandAt(p.getLocation()).ifPresent(i -> new SafeTeleportBuilder(getPlugin()).entity(p).island(i).build()); getIslands().getIslandAt(p.getLocation()).ifPresent(i -> new SafeTeleportBuilder(getPlugin()).entity(p).island(i).build());
} }
} }
} }