Changed to use notify instead of sendmessage to avoid spam

https://github.com/BentoBoxWorld/Limits/issues/75
This commit is contained in:
tastybento 2020-03-28 11:15:29 -07:00
parent e9784b508c
commit 086d251d3f
2 changed files with 4 additions and 4 deletions

View File

@ -210,7 +210,7 @@ public class BlockLimitsListener implements Listener {
private void notify(Cancellable e, User user, int limit, Material m) {
if (limit > -1) {
user.sendMessage("block-limits.hit-limit",
user.notify("block-limits.hit-limit",
"[material]", Util.prettifyText(m.toString()),
TextVariables.NUMBER, String.valueOf(limit));
e.setCancelled(true);

View File

@ -59,7 +59,7 @@ public class EntityLimitListener implements Listener {
for (Entity ent : e.getVehicle().getLocation().getWorld().getNearbyEntities(e.getVehicle().getLocation(), 5, 5, 5)) {
if (ent instanceof Player) {
((Player) ent).updateInventory();
User.getInstance(ent).sendMessage("entity-limits.hit-limit", "[entity]",
User.getInstance(ent).notify("entity-limits.hit-limit", "[entity]",
Util.prettifyText(e.getVehicle().getType().toString())
, TextVariables.NUMBER, String.valueOf(addon.getSettings().getLimits().get(e.getVehicle().getType())));
}
@ -125,7 +125,7 @@ public class EntityLimitListener implements Listener {
if (!bypass && !island.isSpawn() && atLimit(island, e.getEntity())) {
// Not allowed
e.setCancelled(true);
User.getInstance(player).sendMessage("block-limits.hit-limit", "[material]",
User.getInstance(player).notify("block-limits.hit-limit", "[material]",
Util.prettifyText(e.getEntity().getType().toString()),
TextVariables.NUMBER, String.valueOf(addon.getSettings().getLimits().getOrDefault(e.getEntity().getType(), -1)));
@ -145,7 +145,7 @@ public class EntityLimitListener implements Listener {
if (w == null) return;
for (Entity ent : w.getNearbyEntities(e.getLocation(), 5, 5, 5)) {
if (ent instanceof Player) {
User.getInstance(ent).sendMessage("entity-limits.hit-limit", "[entity]",
User.getInstance(ent).notify("entity-limits.hit-limit", "[entity]",
Util.prettifyText(e.getEntityType().toString()),
TextVariables.NUMBER, String.valueOf(addon.getSettings().getLimits().get(e.getEntityType())));
}