mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Add getName to get id of block
This commit is contained in:
parent
82c2af88a0
commit
288a835a82
@ -1144,6 +1144,10 @@ public enum Block {
|
||||
return defaultID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return namespaceID;
|
||||
}
|
||||
|
||||
public boolean isAir() {
|
||||
return isAir;
|
||||
}
|
||||
|
@ -250,6 +250,7 @@ public class BlockEnumGenerator extends MinestomEnumGenerator<BlockContainer> {
|
||||
generator.addHardcodedField("List<BlockAlternative>", "alternatives", "new ArrayList<BlockAlternative>()");
|
||||
generator.setParams("String namespaceID", "short defaultID", "double hardness", "double resistance", "boolean isAir", "boolean isSolid", "NamespaceID blockEntity", "boolean singleState");
|
||||
generator.addMethod("getBlockId", "()", "short", "return defaultID;");
|
||||
generator.addMethod("getName", "()", "String", "return namespaceID;");
|
||||
generator.addMethod("isAir", "()", "boolean", "return isAir;");
|
||||
generator.addMethod("hasBlockEntity", "()", "boolean", "return blockEntity != null;");
|
||||
generator.addMethod("getBlockEntityName", "()", "NamespaceID", "return blockEntity;");
|
||||
|
Loading…
Reference in New Issue
Block a user