Update to 1.17

This commit is contained in:
Sn0wStorm
2021-06-14 16:39:29 +02:00
parent da9f84acb4
commit b43c647c5f
8 changed files with 102 additions and 52 deletions
+9 -1
View File
@@ -78,6 +78,7 @@ public class LegacyUtil {
FENCES = fences;
}
public static final Material WATER_CAULDRON = get("WATER_CAULDRON");
public static final Material MAGMA_BLOCK = get("MAGMA_BLOCK", "MAGMA");
public static final Material CAMPFIRE = get("CAMPFIRE");
public static final Material SOUL_CAMPFIRE = get("SOUL_CAMPFIRE");
@@ -220,13 +221,20 @@ public class LegacyUtil {
}
}
/**
* Test if this Material Type is a Cauldron filled with water, or any cauldron in 1.16 and lower
*/
public static boolean isWaterCauldron(Material type) {
return WATER_CAULDRON != null ? type == WATER_CAULDRON : type == Material.CAULDRON;
}
/**
* Get The Fill Level of a Cauldron Block, 0 = empty, 1 = something in, 2 = full
*
* @return 0 = empty, 1 = something in, 2 = full
*/
public static byte getFillLevel(Block block) {
if (block.getType() != Material.CAULDRON) {
if (!isWaterCauldron(block.getType())) {
return EMPTY;
}