Merge pull request #23 from YellowZaki/patch-3
Personalize messages differencing between block an entities
This commit is contained in:
commit
e5f900a193
|
@ -94,7 +94,7 @@ public class LimitPanel {
|
||||||
}
|
}
|
||||||
IslandBlockCount ibc = addon.getBlockLimitListener().getIsland(island.getUniqueId());
|
IslandBlockCount ibc = addon.getBlockLimitListener().getIsland(island.getUniqueId());
|
||||||
Map<Material, Integer> matLimits = addon.getBlockLimitListener().getMaterialLimits(world, island.getUniqueId());
|
Map<Material, Integer> matLimits = addon.getBlockLimitListener().getMaterialLimits(world, island.getUniqueId());
|
||||||
if (matLimits.isEmpty()) {
|
if (matLimits.isEmpty() && addon.getSettings().getLimits().isEmpty()) {
|
||||||
user.sendMessage("island.limits.no-limits");
|
user.sendMessage("island.limits.no-limits");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class BlockLimitsListener implements Listener {
|
||||||
|
|
||||||
private void notify(Cancellable e, User user, int limit, Material m) {
|
private void notify(Cancellable e, User user, int limit, Material m) {
|
||||||
if (limit > -1) {
|
if (limit > -1) {
|
||||||
user.sendMessage("limits.hit-limit",
|
user.sendMessage("block-limits.hit-limit",
|
||||||
"[material]", Util.prettifyText(m.toString()),
|
"[material]", Util.prettifyText(m.toString()),
|
||||||
TextVariables.NUMBER, String.valueOf(limit));
|
TextVariables.NUMBER, String.valueOf(limit));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class EntityLimitListener implements Listener {
|
||||||
for (Entity ent : e.getVehicle().getLocation().getWorld().getNearbyEntities(e.getVehicle().getLocation(), 5, 5, 5)) {
|
for (Entity ent : e.getVehicle().getLocation().getWorld().getNearbyEntities(e.getVehicle().getLocation(), 5, 5, 5)) {
|
||||||
if (ent instanceof Player) {
|
if (ent instanceof Player) {
|
||||||
((Player) ent).updateInventory();
|
((Player) ent).updateInventory();
|
||||||
User.getInstance(ent).sendMessage("limits.hit-limit", "[material]",
|
User.getInstance(ent).sendMessage("entity-limits.hit-limit", "[entity]",
|
||||||
Util.prettifyText(e.getVehicle().getType().toString())
|
Util.prettifyText(e.getVehicle().getType().toString())
|
||||||
,"[number]", String.valueOf(addon.getSettings().getLimits().get(e.getVehicle().getType())));
|
,"[number]", String.valueOf(addon.getSettings().getLimits().get(e.getVehicle().getType())));
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public class EntityLimitListener implements Listener {
|
||||||
if (!e.getSpawnReason().equals(SpawnReason.SPAWNER)) {
|
if (!e.getSpawnReason().equals(SpawnReason.SPAWNER)) {
|
||||||
for (Entity ent : e.getLocation().getWorld().getNearbyEntities(e.getLocation(), 5, 5, 5)) {
|
for (Entity ent : e.getLocation().getWorld().getNearbyEntities(e.getLocation(), 5, 5, 5)) {
|
||||||
if (ent instanceof Player) {
|
if (ent instanceof Player) {
|
||||||
User.getInstance(ent).sendMessage("limits.hit-limit", "[material]",
|
User.getInstance(ent).sendMessage("entity-limits.hit-limit", "[entity]",
|
||||||
Util.prettifyText(e.getEntityType().toString()),
|
Util.prettifyText(e.getEntityType().toString()),
|
||||||
"[number]", String.valueOf(addon.getSettings().getLimits().get(e.getEntityType())));
|
"[number]", String.valueOf(addon.getSettings().getLimits().get(e.getEntityType())));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
|
|
||||||
limits:
|
limits:
|
||||||
hit-limit: "&c[material] limited to [number]!"
|
entity-hit-limit: "&c[entity] spawning limited to [number]!"
|
||||||
|
block-hit-limit: "&c[material] limited to [number]!"
|
||||||
panel-title: "Island limits"
|
panel-title: "Island limits"
|
||||||
|
|
||||||
admin:
|
admin:
|
||||||
|
@ -26,4 +27,4 @@ island:
|
||||||
block-limit-syntax: "[number]/[limit]"
|
block-limit-syntax: "[number]/[limit]"
|
||||||
no-limits: "&cNo limits set in this world"
|
no-limits: "&cNo limits set in this world"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue