303 |
|
|
304 |
|
|
305 |
int diff = Math.abs( savedcount - count); |
int diff = Math.abs( savedcount - count); |
|
String msg = null; |
|
|
if (count > savedcount) { |
|
|
msg = player.getName() + " added " + diff + " units of " + item + " to " + owner.getName() + "'s chest"; |
|
|
} |
|
|
if (count < savedcount) { |
|
|
msg = player.getName() + " removed " + diff + " units of " + item + " from " + owner.getName() + "'s chest"; |
|
|
} |
|
306 |
|
|
307 |
if (msg != null) { |
if (diff > 0) { |
308 |
|
String material = Material.getMaterial(item).name(); |
309 |
|
String msg = null; |
310 |
|
|
311 |
|
if (count > savedcount) { |
312 |
|
msg = player.getName() + " added " + diff + " units of " + material + "(" +item + ") to " + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ(); |
313 |
|
} else { //(count < savedcount) |
314 |
|
msg = player.getName() + " removed " + diff + " units of " + material + "(" +item + ") from " + owner.getName() + "'s chest at " + loc.getWorld().getName() + "," + loc.getBlockX() + "," +loc.getBlockY() + "," + loc.getBlockZ(); |
315 |
|
} |
316 |
|
|
317 |
|
|
318 |
plugin.getLogger().info(msg); |
plugin.getLogger().info(msg); |
319 |
plugin.getMessageWrapper().sendMessage(owner, msg); |
plugin.getMessageWrapper().sendMessage(owner, msg); |
320 |
} |
} |