From 757d7098cf0c8e028fa09f91e0a76005cc74c0bc Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Thu, 2 May 2024 15:03:51 +0200 Subject: [PATCH] changed Item to be an enum abstract --- src/lib/Item.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/Item.hx b/src/lib/Item.hx index 8b7770c..876fca0 100644 --- a/src/lib/Item.hx +++ b/src/lib/Item.hx @@ -3,7 +3,7 @@ package lib; /** Represents an item in the game. **/ -abstract Item(String) to String { +enum abstract Item(String) to String { public inline function new(name:String) { // Check if the name is valid. in the format `mod:item_name` e.g. `minecraft:apple` // TODO: implement @@ -19,4 +19,7 @@ abstract Item(String) to String { function getBase():String { return this.split(":")[0]; } + + var Coal = "minecraft:coal"; + var Charcoal = "minecraft:charcoal"; }