Don't let certain types of blocks be used in falling block disguises in 1.12, fixes #446

This commit is contained in:
libraryaddict 2020-04-14 02:27:05 +12:00
parent 3c40a27c8f
commit 810a8f8e00
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -13,8 +13,23 @@ import java.util.Arrays;
public class ParamInfoItemBlock extends ParamInfoItemStack { public class ParamInfoItemBlock extends ParamInfoItemStack {
public ParamInfoItemBlock(Class paramClass, String name, String valueType, String description, public ParamInfoItemBlock(Class paramClass, String name, String valueType, String description,
Material[] possibleValues) { Material[] possibleValues) {
super(paramClass, name, valueType, description, super(paramClass, name, valueType, description, Arrays.stream(possibleValues).filter(m -> {
Arrays.stream(possibleValues).filter(Material::isBlock).toArray(Material[]::new)); if (!m.isBlock())
return false;
if (NmsVersion.v1_13.isSupported())
return true;
switch (m) {
case CAKE:
case FLOWER_POT:
case CAULDRON:
case BREWING_STAND:
return false;
default:
return true;
}
}).toArray(Material[]::new));
} }
@Override @Override