Added isLiquid utility method in Block

This commit is contained in:
jglrxavpok 2020-06-30 14:49:53 +02:00
parent bf6313659e
commit 4ffde8feed
2 changed files with 5 additions and 0 deletions

View File

@ -1160,6 +1160,10 @@ public enum Block {
return isSolid;
}
public boolean isLiquid() {
return this == WATER || this == LAVA;
}
public double getHardness() {
return hardness;
}

View File

@ -254,6 +254,7 @@ public class BlockEnumGenerator extends MinestomEnumGenerator<BlockContainer> {
generator.addMethod("hasBlockEntity", "()", "boolean", "return blockEntity != null;");
generator.addMethod("getBlockEntityName", "()", "NamespaceID", "return blockEntity;");
generator.addMethod("isSolid", "()", "boolean", "return isSolid;");
generator.addMethod("isLiquid", "()", "boolean", "return this == WATER || this == LAVA;");
generator.addMethod("getHardness", "()", "double", "return hardness;");
generator.addMethod("getResistance", "()", "double", "return resistance;");
generator.addMethod("breaksInstantaneously", "()", "boolean", "return hardness == 0;");