Don't let certain types of blocks be used in falling block disguises in 1.12, fixes #446
This commit is contained in:
parent
3c40a27c8f
commit
810a8f8e00
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user