mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-11-22 10:36:11 +01:00
Changed to use notify instead of sendmessage to avoid spam
https://github.com/BentoBoxWorld/Limits/issues/75
This commit is contained in:
parent
e9784b508c
commit
086d251d3f
@ -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);
|
||||
|
@ -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())));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user