mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Now using item titles where it's appropriate
This commit is contained in:
parent
b1a728acf4
commit
6370457be7
2 changed files with 11 additions and 4 deletions
|
@ -49,12 +49,12 @@ public class GiveCommand extends Command {
|
|||
|
||||
if(quantity > 0) {
|
||||
target.getInventory().addItem(item, quantity);
|
||||
target.alert(String.format("You received %s %s from an administrator.", quantity, item.getName()));
|
||||
executor.sendMessage(String.format("Gave %s %s to %s", quantity, item.getName(), target.getName()));
|
||||
target.alert(String.format("You received %s %s from an administrator.", quantity, item.getTitle()));
|
||||
executor.sendMessage(String.format("Gave %s %s to %s", quantity, item.getTitle(), target.getName()));
|
||||
} else {
|
||||
target.getInventory().removeItem(item, -quantity);
|
||||
target.alert(String.format("%s %s was taken from your inventory.", -quantity, item.getName()));
|
||||
executor.sendMessage(String.format("Took %s %s from %s", quantity, item.getName(), target.getName()));
|
||||
target.alert(String.format("%s %s was taken from your inventory.", -quantity, item.getTitle()));
|
||||
executor.sendMessage(String.format("Took %s %s from %s", quantity, item.getTitle(), target.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@ public class Item {
|
|||
@JacksonInject("name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
@JsonProperty("layer")
|
||||
private Layer layer = Layer.NONE;
|
||||
|
||||
|
@ -97,6 +100,10 @@ public class Item {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public boolean isAir() {
|
||||
return id == 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue