From 810a8f8e00ee0ca97d22177f0034824710c8ead5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 14 Apr 2020 02:27:05 +1200 Subject: [PATCH] Don't let certain types of blocks be used in falling block disguises in 1.12, fixes #446 --- .../types/custom/ParamInfoItemBlock.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java b/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java index 25e02c46..341e89a5 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java @@ -13,8 +13,23 @@ import java.util.Arrays; public class ParamInfoItemBlock extends ParamInfoItemStack { public ParamInfoItemBlock(Class paramClass, String name, String valueType, String description, Material[] possibleValues) { - super(paramClass, name, valueType, description, - Arrays.stream(possibleValues).filter(Material::isBlock).toArray(Material[]::new)); + super(paramClass, name, valueType, description, Arrays.stream(possibleValues).filter(m -> { + 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