mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
2.1.226
This commit is contained in:
@ -22,6 +22,9 @@ import java.util.HashSet;
|
||||
|
||||
public final class BlockUtils {
|
||||
|
||||
public static final String SHORT_GRASS = "SHORT_GRASS";
|
||||
public static final String GRASS = "GRASS";
|
||||
|
||||
private BlockUtils() {
|
||||
}
|
||||
|
||||
@ -38,6 +41,21 @@ public final class BlockUtils {
|
||||
blockState.setMetadata(MetadataConstants.METADATA_KEY_BONUS_DROPS, new BonusDropMeta(1, mcMMO.p));
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method for compatibility across Minecraft versions, grabs the {@link Material} enum for short_grass
|
||||
*
|
||||
* @return the {@link Material} enum for short_grass
|
||||
*/
|
||||
public static Material getShortGrass() {
|
||||
if (Material.getMaterial(SHORT_GRASS) != null) {
|
||||
return Material.getMaterial(SHORT_GRASS);
|
||||
} else if (Material.getMaterial(GRASS) != null) {
|
||||
return Material.getMaterial(GRASS);
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Unable to find short grass material");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the state for a block to be seen as unnatural and cleanup any unwanted metadata from the block
|
||||
* @param block target block
|
||||
|
@ -996,8 +996,8 @@ public class MaterialMapStore {
|
||||
private void fillShroomyWhiteList()
|
||||
{
|
||||
canMakeShroomyWhiteList.add("dirt");
|
||||
canMakeShroomyWhiteList.add("grass");
|
||||
canMakeShroomyWhiteList.add("grass_path");
|
||||
canMakeShroomyWhiteList.add("grass_block");
|
||||
canMakeShroomyWhiteList.add("dirt_path");
|
||||
}
|
||||
|
||||
private void fillBlockCrackerWhiteList()
|
||||
@ -1010,8 +1010,8 @@ public class MaterialMapStore {
|
||||
private void fillHerbalismAbilityBlackList()
|
||||
{
|
||||
herbalismAbilityBlackList.add("dirt");
|
||||
herbalismAbilityBlackList.add("grass");
|
||||
herbalismAbilityBlackList.add("grass_path");
|
||||
herbalismAbilityBlackList.add("grass_block");
|
||||
herbalismAbilityBlackList.add("dirt_path");
|
||||
herbalismAbilityBlackList.add("farmland");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user