Add Weeping Vines and Twisting Vines to vine-growth flag

This commit is contained in:
JOO200 2020-06-27 22:39:46 +02:00 committed by wizjany
parent 66fd84ba2f
commit 613406aab4
2 changed files with 14 additions and 1 deletions

View File

@ -597,7 +597,7 @@ public void onBlockSpread(BlockSpreadEvent event) {
}
}
if (newType == Material.VINE || newType == Material.KELP) {
if (Materials.isVine(newType)) {
if (wcfg.disableVineGrowth) {
event.setCancelled(true);
return;

View File

@ -1286,6 +1286,19 @@ public static boolean isCrop(Material type) {
|| type == Material.BAMBOO_SAPLING;
}
/**
* Test whether the material should be handled as vine. Used by the vine-growth flag
* @param newType the material
* @return true if the material should be handled as vine
*/
public static boolean isVine(Material newType) {
return newType == Material.VINE ||
newType == Material.KELP ||
newType == Material.TWISTING_VINES ||
newType == Material.WEEPING_VINES;
}
/**
* Test whether the given material is affected by
* {@link Flags#USE}.