add item descriptions

This commit is contained in:
Sen 2025-08-04 00:29:41 +02:00
parent 1d19cddcef
commit 1c33159e64
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3 changed files with 25 additions and 1 deletions

View file

@ -126,6 +126,8 @@ public abstract class GuiContainer extends Gui
s = Color.YELLOW + "" + stack.getSize() + " " + Color.RESET + s;
s = s + Color.RESET;
list.add(s);
if(stack.getItem().getDescription() != null)
list.add(stack.getItem().getDescription());
stack.getItem().addInformation(stack, this.gm.player, list);
if(stack.getItem().isAdminItem())
list.add(Color.RED + "Admin-Gegenstand");

View file

@ -192,6 +192,7 @@ public class Block {
protected double maxZ;
private State defaultState;
private String display;
private String description;
private CheatTab tab;
private SoundType sound;
private Equipment miningTool;
@ -419,6 +420,12 @@ public class Block {
return this;
}
public final Block setDisplay(String name, String desc) {
this.display = name;
this.description = desc;
return this;
}
public final Block setTab(CheatTab tab) {
this.tab = tab;
return this;
@ -609,6 +616,10 @@ public class Block {
public final String getDisplay() {
return this.display;
}
public final String getDescription() {
return this.description;
}
protected Property[] getProperties() {

View file

@ -32,6 +32,7 @@ public class Item {
private int maxDamage = 0;
private Item containerItem;
private String display;
private String description;
private CheatTab tab;
private Color color = null;
private int defColor = 0xffffffff;
@ -47,7 +48,7 @@ public class Item {
public Item(Block block) {
this.block = block;
this.setDisplay(this.block.getDisplay());
this.setDisplay(this.block.getDisplay(), this.block.getDescription());
this.setTab(this.block.getTab());
if(this.block.isMagnetic())
this.setMagnetic();
@ -84,6 +85,12 @@ public class Item {
return this;
}
public final Item setDisplay(String name, String desc) {
this.display = name;
this.description = desc;
return this;
}
public final Item setContainerItem(Item containerItem) {
this.containerItem = containerItem;
return this;
@ -153,6 +160,10 @@ public class Item {
return this.display;
}
public final String getDescription() {
return this.description;
}
public final Item getContainerItem() {
return this.containerItem;
}