changed Item to be an enum abstract

This commit is contained in:
Niklas Kapelle 2024-05-02 15:03:51 +02:00
parent 4e69bda3c8
commit 757d7098cf
Signed by: niklas
GPG Key ID: 4EB651B36D841D16

View File

@ -3,7 +3,7 @@ package lib;
/** /**
Represents an item in the game. Represents an item in the game.
**/ **/
abstract Item(String) to String { enum abstract Item(String) to String {
public inline function new(name:String) { public inline function new(name:String) {
// Check if the name is valid. in the format `mod:item_name` e.g. `minecraft:apple` // Check if the name is valid. in the format `mod:item_name` e.g. `minecraft:apple`
// TODO: implement // TODO: implement
@ -19,4 +19,7 @@ abstract Item(String) to String {
function getBase():String { function getBase():String {
return this.split(":")[0]; return this.split(":")[0];
} }
var Coal = "minecraft:coal";
var Charcoal = "minecraft:charcoal";
} }