mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-05 14:05:26 +02:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into endgame
This commit is contained in:
@@ -21,6 +21,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() {
|
||||
}
|
||||
|
||||
@@ -37,6 +40,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
|
||||
|
Reference in New Issue
Block a user