Now using item titles where it's appropriate

This commit is contained in:
kuroppoi 2021-04-24 23:18:51 +02:00
parent b1a728acf4
commit 6370457be7
2 changed files with 11 additions and 4 deletions

View file

@ -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()));
}
}

View file

@ -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;
}