mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 15:08:29 +01:00
Added isLiquid utility method in Block
This commit is contained in:
parent
bf6313659e
commit
4ffde8feed
@ -1160,6 +1160,10 @@ public enum Block {
|
||||
return isSolid;
|
||||
}
|
||||
|
||||
public boolean isLiquid() {
|
||||
return this == WATER || this == LAVA;
|
||||
}
|
||||
|
||||
public double getHardness() {
|
||||
return hardness;
|
||||
}
|
||||
|
@ -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;");
|
||||
|
Loading…
Reference in New Issue
Block a user