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) { if(quantity > 0) {
target.getInventory().addItem(item, quantity); target.getInventory().addItem(item, quantity);
target.alert(String.format("You received %s %s from an administrator.", quantity, item.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.getName(), target.getName())); executor.sendMessage(String.format("Gave %s %s to %s", quantity, item.getTitle(), target.getName()));
} else { } else {
target.getInventory().removeItem(item, -quantity); target.getInventory().removeItem(item, -quantity);
target.alert(String.format("%s %s was taken from your inventory.", -quantity, item.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.getName(), target.getName())); 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") @JacksonInject("name")
private String name; private String name;
@JsonProperty("title")
private String title;
@JsonProperty("layer") @JsonProperty("layer")
private Layer layer = Layer.NONE; private Layer layer = Layer.NONE;
@ -97,6 +100,10 @@ public class Item {
return name; return name;
} }
public String getTitle() {
return title;
}
public boolean isAir() { public boolean isAir() {
return id == 0; return id == 0;
} }