From 0e496dd5821772b92316fcbc3f4015cc3797ed98 Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Wed, 22 Oct 2025 11:52:20 -0700 Subject: [PATCH 1/6] CreakingHeartState tag and mechanism --- .../denizen/objects/LocationTag.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java index e686ef7c92..11c653cd3b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java @@ -40,6 +40,7 @@ import org.bukkit.block.banner.PatternType; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Directional; +import org.bukkit.block.data.type.CreakingHeart; import org.bukkit.block.structure.Mirror; import org.bukkit.block.structure.StructureRotation; import org.bukkit.block.structure.UsageMode; @@ -4509,6 +4510,48 @@ else if (material.hasModernData() && material.getModernData() instanceof org.buk }); } + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism LocationTag.heart_state + // @group world + // @description + // Returns the state of a creaking heart. + // Valid values are "AWAKE", "DORMANT", and "UPROOTED". + // --> + tagProcessor.registerTag(ElementTag.class, "heart_state", (attribute, object) -> { + if (!(object.getBlockState().getBlockData() instanceof CreakingHeart heart)) { + Debug.echoError("The 'LocationTag.heart_state' tag can only be called on a creaking heart block."); + return null; + } + return Utilities.enumlikeToElement(heart.getCreakingHeartState()); + }); + + // <--[mechanism] + // @object LocationTag + // @name heart_state + // @input ElementTag + // @description + // Sets the state of a creaking heart. + // Valid values are "AWAKE", "DORMANT", and "UPROOTED". + // @tags + // + // --> + tagProcessor.registerMechanism("heart_state", false, ElementTag.class, (object, mechanism, input) -> { + if (!(object.getBlockState().getBlockData() instanceof CreakingHeart heart)) { + mechanism.echoError("The 'LocationTag.heart_state' mechanism can only be called on a creaking heart block."); + return; + } + CreakingHeart.State heartState = Utilities.elementToRequiredEnumLike(input, CreakingHeart.State.class, mechanism); + if (heartState != null) { + heart.setCreakingHeartState(heartState); + object.getBlock().setBlockData(heart); + } + }); + } + // <--[mechanism] // @object LocationTag // @name spawner_type From 67b6ed6b5f40463073a896b46fcfd252565e9276 Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Fri, 21 Nov 2025 18:37:07 -0800 Subject: [PATCH 2/6] moved creaking heart state setting to the MaterialTag.mode property --- .../denizen/objects/LocationTag.java | 42 --- .../properties/material/MaterialMode.java | 337 ++++++------------ 2 files changed, 110 insertions(+), 269 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java index 11c653cd3b..6e1b6415a9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java @@ -4510,48 +4510,6 @@ else if (material.hasModernData() && material.getModernData() instanceof org.buk }); } - if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { - - // <--[tag] - // @attribute - // @returns ElementTag - // @mechanism LocationTag.heart_state - // @group world - // @description - // Returns the state of a creaking heart. - // Valid values are "AWAKE", "DORMANT", and "UPROOTED". - // --> - tagProcessor.registerTag(ElementTag.class, "heart_state", (attribute, object) -> { - if (!(object.getBlockState().getBlockData() instanceof CreakingHeart heart)) { - Debug.echoError("The 'LocationTag.heart_state' tag can only be called on a creaking heart block."); - return null; - } - return Utilities.enumlikeToElement(heart.getCreakingHeartState()); - }); - - // <--[mechanism] - // @object LocationTag - // @name heart_state - // @input ElementTag - // @description - // Sets the state of a creaking heart. - // Valid values are "AWAKE", "DORMANT", and "UPROOTED". - // @tags - // - // --> - tagProcessor.registerMechanism("heart_state", false, ElementTag.class, (object, mechanism, input) -> { - if (!(object.getBlockState().getBlockData() instanceof CreakingHeart heart)) { - mechanism.echoError("The 'LocationTag.heart_state' mechanism can only be called on a creaking heart block."); - return; - } - CreakingHeart.State heartState = Utilities.elementToRequiredEnumLike(input, CreakingHeart.State.class, mechanism); - if (heartState != null) { - heart.setCreakingHeartState(heartState); - object.getBlock().setBlockData(heart); - } - }); - } - // <--[mechanism] // @object LocationTag // @name spawner_type diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java index 3dfb61c2cc..3c673c593e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java @@ -4,25 +4,35 @@ import com.denizenscript.denizen.nms.NMSVersion; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; -import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.core.ElementTag; -import com.denizenscript.denizencore.objects.properties.Property; -import com.denizenscript.denizencore.objects.properties.PropertyParser; import com.denizenscript.denizencore.utilities.CoreUtilities; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.type.*; -public class MaterialMode implements Property { - - public static boolean describes(ObjectTag material) { - if (!(material instanceof MaterialTag)) { - return false; - } - MaterialTag mat = (MaterialTag) material; - if (!mat.hasModernData()) { - return false; - } - BlockData data = mat.getModernData(); +public class MaterialMode extends MaterialProperty { + + // <--[property] + // @object MaterialTag + // @name mode + // @input ElementTag + // @description + // Controls a block's mode. + // For comparators, options are COMPARE and SUBTRACT. + // For piston_heads, options are NORMAL or SHORT. + // For bubble_columns, options are NORMAL or DRAG. + // For structure_blocks, options are CORNER, DATA, LOAD, or SAVE. + // For sculk_sensors, options are ACTIVE, COOLDOWN, or INACTIVE. + // For daylight_detectors, options are INVERTED or NORMAL. + // For command_blocks, options are CONDITIONAL or NORMAL. + // For big_dripleafs, options are FULL, NONE, PARTIAL, or UNSTABLE. + // For sculk_catalysts, options are BLOOM or NORMAL. + // For sculk_shriekers, options are SHRIEKING or NORMAL. + // For tripwires, options are ARMED or DISARMED. + // For creaking_hearts, options are AWAKE, DORMANT, or UPROOTED. + // --> + + public static boolean describes(MaterialTag material) { + BlockData data = material.getModernData(); return data instanceof Comparator || data instanceof PistonHead || data instanceof BubbleColumn @@ -33,242 +43,115 @@ public static boolean describes(ObjectTag material) { || data instanceof BigDripleaf || data instanceof Tripwire || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && (data instanceof SculkCatalyst - || data instanceof SculkShrieker)); - } - - public static MaterialMode getFrom(ObjectTag _material) { - if (!describes(_material)) { - return null; - } - else { - return new MaterialMode((MaterialTag) _material); - } - } - - public static final String[] handledMechs = new String[] { - "mode" - }; - - public MaterialMode(MaterialTag _material) { - material = _material; - } - - public MaterialTag material; - - public static void register() { - - // <--[tag] - // @attribute - // @returns ElementTag - // @mechanism MaterialTag.mode - // @group properties - // @description - // Returns a block's mode. - // For comparators, output is COMPARE or SUBTRACT. - // For piston_heads, output is NORMAL or SHORT. - // For bubble_columns, output is NORMAL or DRAG. - // For structure_blocks, output is CORNER, DATA, LOAD, or SAVE. - // For sculk_sensors, output is ACTIVE, COOLDOWN, or INACTIVE. - // For daylight_detectors, output is INVERTED or NORMAL. - // For command_blocks, output is CONDITIONAL or NORMAL. - // For big_dripleafs, output is FULL, NONE, PARTIAL, or UNSTABLE. - // For sculk_catalysts, output is BLOOM or NORMAL. - // For sculk_shriekers, output is SHRIEKING or NORMAL. - // For tripwires, output is ARMED or DISARMED. - // --> - PropertyParser.registerStaticTag(MaterialMode.class, ElementTag.class, "mode", (attribute, material) -> { - return new ElementTag(material.getPropertyString()); - }); - } - - public boolean isComparator() { - return material.getModernData() instanceof Comparator; - } - - public boolean isPistonHead() { - return material.getModernData() instanceof PistonHead; - } - - public boolean isBubbleColumn() { - return material.getModernData() instanceof BubbleColumn; - } - - public boolean isStructureBlock() { - return material.getModernData() instanceof StructureBlock; - } - - public boolean isDaylightDetector() { - return material.getModernData() instanceof DaylightDetector; - } - - public boolean isCommandBlock() { - return material.getModernData() instanceof CommandBlock; - } - - public boolean isSculkSensor() { - return material.getModernData() instanceof SculkSensor; - } - - public boolean isBigDripleaf() { - return material.getModernData() instanceof BigDripleaf; - } - - public boolean isTripwire() { - return material.getModernData() instanceof Tripwire; - } - - public boolean isSculkCatalyst() { - return NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && material.getModernData() instanceof SculkCatalyst; - } - - public boolean isSculkShrieker() { - return NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && material.getModernData() instanceof SculkShrieker; - } - - public Comparator getComparator() { - return (Comparator) material.getModernData(); - } - - public PistonHead getPistonHead() { - return (PistonHead) material.getModernData(); - } - - public BubbleColumn getBubbleColumn() { - return (BubbleColumn) material.getModernData(); - } - - public StructureBlock getStructureBlock() { - return (StructureBlock) material.getModernData(); + || data instanceof SculkShrieker)) + || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21) && data instanceof CreakingHeart); } - public DaylightDetector getDaylightDetector() { - return (DaylightDetector) material.getModernData(); - } - - public CommandBlock getCommandBlock() { - return (CommandBlock) material.getModernData(); - } - - public SculkSensor getSculkSensor() { - return (SculkSensor) material.getModernData(); - } - - public BigDripleaf getBigDripleaf() { - return (BigDripleaf) material.getModernData(); - } - - public Tripwire getTripwire() { - return (Tripwire) material.getModernData(); - } - - /*public SculkCatalyst getSculkCatalyst() { // TODO: 1.19 - return (SculkCatalyst) material.getModernData(); - } - - public SculkShrieker getSculkShrieker() { - return (SculkShrieker) material.getModernData(); - }*/ - @Override - public String getPropertyString() { - if (isComparator()) { - return getComparator().getMode().name(); - } - else if (isBubbleColumn()) { - return getBubbleColumn().isDrag() ? "DRAG" : "NORMAL"; + public ElementTag getPropertyValue() { + if (getBlockData() instanceof Comparator comparator) { + return new ElementTag(comparator.getMode()); } - else if (isPistonHead()) { - return getPistonHead().isShort() ? "SHORT" : "NORMAL"; + else if (getBlockData() instanceof BubbleColumn bubbleColumn) { + return new ElementTag(bubbleColumn.isDrag() ? "DRAG" : "NORMAL", true); } - else if (isStructureBlock()) { - return getStructureBlock().getMode().name(); + else if (getBlockData() instanceof PistonHead pistonHead) { + return new ElementTag(pistonHead.isShort() ? "SHORT" : "NORMAL", true); } - else if (isDaylightDetector()) { - return getDaylightDetector().isInverted() ? "INVERTED" : "NORMAL"; + else if (getBlockData() instanceof StructureBlock structureBlock) { + return new ElementTag(structureBlock.getMode()); } - else if (isCommandBlock()) { - return getCommandBlock().isConditional() ? "CONDITIONAL" : "NORMAL"; + else if (getBlockData() instanceof DaylightDetector daylightDetector) { + return new ElementTag(daylightDetector.isInverted() ? "INVERTED" : "NORMAL", true); } - else if (isSculkSensor()) { - return getSculkSensor().getPhase().name(); + else if (getBlockData() instanceof CommandBlock cmdBlock) { + return new ElementTag(cmdBlock.isConditional() ? "CONDITIONAL" : "NORMAL", true); } - else if (isBigDripleaf()) { - return getBigDripleaf().getTilt().name(); + else if (getBlockData() instanceof SculkSensor sculkSensor) { + return new ElementTag(sculkSensor.getPhase()); } - else if (isTripwire()) { - return getTripwire().isDisarmed() ? "DISARMED" : "ARMED"; + else if (getBlockData() instanceof BigDripleaf bigDripleaf) { + return new ElementTag(bigDripleaf.getTilt()); } - else if (isSculkCatalyst()) { - return ((SculkCatalyst) material.getModernData()).isBloom() ? "BLOOM" : "NORMAL"; // TODO: 1.19 + else if (getBlockData() instanceof Tripwire tripwire) { + return new ElementTag(tripwire.isDisarmed() ? "DISARMED" : "ARMED", true); } - else if (isSculkShrieker()) { - return ((SculkShrieker) material.getModernData()).isShrieking() ? "SHRIEKING" : "NORMAL"; // TODO: 1.19 + else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { + if (getBlockData() instanceof SculkCatalyst sculkCatalyst) { + return new ElementTag(sculkCatalyst.isBloom() ? "BLOOM" : "NORMAL", true); + } + else if (getBlockData() instanceof SculkShrieker sculkShrieker) { + return new ElementTag(sculkShrieker.isShrieking() ? "SHRIEKING" : "NORMAL", true); + } + else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { + if (getBlockData() instanceof CreakingHeart creakingHeart) { + return new ElementTag(creakingHeart.getCreakingHeartState()); + } + } } - return null; // Unreachable - } - - @Override - public String getPropertyId() { - return "mode"; + return null; } @Override - public void adjust(Mechanism mechanism) { - - // <--[mechanism] - // @object MaterialTag - // @name mode - // @input ElementTag - // @description - // Set a block's mode. - // For comparators, input is COMPARE or SUBTRACT. - // For piston_heads, input is NORMAL or SHORT. - // For bubble_columns, input is NORMAL or DRAG. - // For structure_blocks, input is CORNER, DATA, LOAD, or SAVE. - // For sculk_sensors, input is ACTIVE, COOLDOWN, or INACTIVE. - // For daylight_detectors, input is INVERTED or NORMAL. - // For command_blocks, input is CONDITIONAL or NORMAL. - // For big_dripleafs, input is FULL, NONE, PARTIAL, or UNSTABLE. - // For sculk_catalysts, input is BLOOM or NORMAL. - // For sculk_shriekers, input is SHRIEKING or NORMAL. - // For tripwires, input is ARMED or DISARMED. - // @tags - // - // --> - if (mechanism.matches("mode")) { - if (isComparator() && mechanism.requireEnum(Comparator.Mode.class)) { - getComparator().setMode(Comparator.Mode.valueOf(mechanism.getValue().asString().toUpperCase())); - } - else if (isBubbleColumn()) { - getBubbleColumn().setDrag(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "drag")); - } - else if (isPistonHead()) { - getPistonHead().setShort(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "short")); + public void setPropertyValue(ElementTag value, Mechanism mechanism) { + if (getBlockData() instanceof Comparator comparator) { + if (mechanism.requireEnum(Comparator.Mode.class)) { + comparator.setMode(value.asEnum(Comparator.Mode.class)); } - else if (isStructureBlock() && mechanism.requireEnum(StructureBlock.Mode.class)) { - getStructureBlock().setMode(StructureBlock.Mode.valueOf(mechanism.getValue().asString().toUpperCase())); - } - else if (isDaylightDetector()) { - getDaylightDetector().setInverted(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "inverted")); - } - else if (isCommandBlock()) { - getCommandBlock().setConditional(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "conditional")); + } + else if (getBlockData() instanceof BubbleColumn bubbleColumn) { + bubbleColumn.setDrag(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "drag")); + } + else if (getBlockData() instanceof PistonHead pistonHead) { + pistonHead.setShort(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "short")); + } + else if (getBlockData() instanceof StructureBlock structureBlock) { + if (mechanism.requireEnum(StructureBlock.Mode.class)) { + structureBlock.setMode(value.asEnum(StructureBlock.Mode.class)); } - else if (isSculkSensor() && mechanism.requireEnum(SculkSensor.Phase.class)) { - getSculkSensor().setPhase(SculkSensor.Phase.valueOf(mechanism.getValue().asString().toUpperCase())); + } + else if (getBlockData() instanceof DaylightDetector daylightDetector) { + daylightDetector.setInverted(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "inverted")); + } + else if (getBlockData() instanceof CommandBlock cmdBlock) { + cmdBlock.setConditional(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "conditional")); + } + else if (getBlockData() instanceof SculkSensor sculkSensor) { + if (mechanism.requireEnum(SculkSensor.Phase.class)) { + sculkSensor.setPhase(value.asEnum(SculkSensor.Phase.class)); } - else if (isBigDripleaf() && mechanism.requireEnum(BigDripleaf.Tilt.class)) { - getBigDripleaf().setTilt(BigDripleaf.Tilt.valueOf(mechanism.getValue().asString().toUpperCase())); + } + else if (getBlockData() instanceof BigDripleaf bigDripleaf) { + if (mechanism.requireEnum(BigDripleaf.Tilt.class)) { + bigDripleaf.setTilt(value.asEnum(BigDripleaf.Tilt.class)); } - else if (isTripwire()) { - getTripwire().setDisarmed(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "disarmed")); + } + else if (getBlockData() instanceof Tripwire tripwire) { + tripwire.setDisarmed(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "disarmed")); + } + else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { + if (getBlockData() instanceof SculkCatalyst sculkCatalyst) { + sculkCatalyst.setBloom(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "bloom")); } - else if (isSculkCatalyst()) { - ((SculkCatalyst) material.getModernData()).setBloom(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "bloom")); // TODO: 1.19 + else if (getBlockData() instanceof SculkShrieker sculkShrieker) { + sculkShrieker.setShrieking(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "shrieking")); } - else if (isSculkShrieker()) { - ((SculkShrieker) material.getModernData()).setShrieking(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "shrieking")); // TODO: 1.19 + else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { + if (getBlockData() instanceof CreakingHeart creakingHeart) { + if (mechanism.requireEnum(CreakingHeart.State.class)) { + creakingHeart.setCreakingHeartState(value.asEnum(CreakingHeart.State.class)); + } + } } } } + + @Override + public String getPropertyId() { + return "mode"; + } + + public static void register() { + autoRegister("mode", MaterialMode.class, ElementTag.class, false); + } } From 835425517eae7dd9125b4f0d908b4b35dd583ce9 Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Fri, 21 Nov 2025 18:37:52 -0800 Subject: [PATCH 3/6] forgotten import --- .../main/java/com/denizenscript/denizen/objects/LocationTag.java | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java index 6e1b6415a9..e686ef7c92 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java @@ -40,7 +40,6 @@ import org.bukkit.block.banner.PatternType; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Directional; -import org.bukkit.block.data.type.CreakingHeart; import org.bukkit.block.structure.Mirror; import org.bukkit.block.structure.StructureRotation; import org.bukkit.block.structure.UsageMode; From 495965ce96b1a1b41fff106a17daa2cf5e92a641 Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Sat, 22 Nov 2025 14:52:01 -0800 Subject: [PATCH 4/6] slight fix --- .../objects/properties/material/MaterialMode.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java index 3c673c593e..10c4719977 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java @@ -100,10 +100,10 @@ public void setPropertyValue(ElementTag value, Mechanism mechanism) { } } else if (getBlockData() instanceof BubbleColumn bubbleColumn) { - bubbleColumn.setDrag(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "drag")); + bubbleColumn.setDrag(CoreUtilities.equalsIgnoreCase(value.toString(), "drag")); } else if (getBlockData() instanceof PistonHead pistonHead) { - pistonHead.setShort(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "short")); + pistonHead.setShort(CoreUtilities.equalsIgnoreCase(value.toString(), "short")); } else if (getBlockData() instanceof StructureBlock structureBlock) { if (mechanism.requireEnum(StructureBlock.Mode.class)) { @@ -111,10 +111,10 @@ else if (getBlockData() instanceof StructureBlock structureBlock) { } } else if (getBlockData() instanceof DaylightDetector daylightDetector) { - daylightDetector.setInverted(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "inverted")); + daylightDetector.setInverted(CoreUtilities.equalsIgnoreCase(value.toString(), "inverted")); } else if (getBlockData() instanceof CommandBlock cmdBlock) { - cmdBlock.setConditional(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "conditional")); + cmdBlock.setConditional(CoreUtilities.equalsIgnoreCase(value.toString(), "conditional")); } else if (getBlockData() instanceof SculkSensor sculkSensor) { if (mechanism.requireEnum(SculkSensor.Phase.class)) { @@ -127,14 +127,14 @@ else if (getBlockData() instanceof BigDripleaf bigDripleaf) { } } else if (getBlockData() instanceof Tripwire tripwire) { - tripwire.setDisarmed(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "disarmed")); + tripwire.setDisarmed(CoreUtilities.equalsIgnoreCase(value.toString(), "disarmed")); } else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { if (getBlockData() instanceof SculkCatalyst sculkCatalyst) { - sculkCatalyst.setBloom(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "bloom")); + sculkCatalyst.setBloom(CoreUtilities.equalsIgnoreCase(value.toString(), "bloom")); } else if (getBlockData() instanceof SculkShrieker sculkShrieker) { - sculkShrieker.setShrieking(CoreUtilities.equalsIgnoreCase(mechanism.getValue().asString(), "shrieking")); + sculkShrieker.setShrieking(CoreUtilities.equalsIgnoreCase(value.toString(), "shrieking")); } else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { if (getBlockData() instanceof CreakingHeart creakingHeart) { From 888b28fad74395497413ed44a7ff9dd5bd7a6ac6 Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Sat, 22 Nov 2025 15:13:09 -0800 Subject: [PATCH 5/6] or < and --- .../properties/material/MaterialMode.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java index 10c4719977..b3b2452fc7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java @@ -18,17 +18,17 @@ public class MaterialMode extends MaterialProperty { // @description // Controls a block's mode. // For comparators, options are COMPARE and SUBTRACT. - // For piston_heads, options are NORMAL or SHORT. - // For bubble_columns, options are NORMAL or DRAG. - // For structure_blocks, options are CORNER, DATA, LOAD, or SAVE. - // For sculk_sensors, options are ACTIVE, COOLDOWN, or INACTIVE. - // For daylight_detectors, options are INVERTED or NORMAL. - // For command_blocks, options are CONDITIONAL or NORMAL. - // For big_dripleafs, options are FULL, NONE, PARTIAL, or UNSTABLE. - // For sculk_catalysts, options are BLOOM or NORMAL. - // For sculk_shriekers, options are SHRIEKING or NORMAL. - // For tripwires, options are ARMED or DISARMED. - // For creaking_hearts, options are AWAKE, DORMANT, or UPROOTED. + // For piston_heads, options are NORMAL and SHORT. + // For bubble_columns, options are NORMAL and DRAG. + // For structure_blocks, options are CORNER, DATA, LOAD, and SAVE. + // For sculk_sensors, options are ACTIVE, COOLDOWN, and INACTIVE. + // For daylight_detectors, options are INVERTED and NORMAL. + // For command_blocks, options are CONDITIONAL and NORMAL. + // For big_dripleafs, options are FULL, NONE, PARTIAL, and UNSTABLE. + // For sculk_catalysts, options are BLOOM and NORMAL. + // For sculk_shriekers, options are SHRIEKING and NORMAL. + // For tripwires, options are ARMED and DISARMED. + // For creaking_hearts, options are AWAKE, DORMANT, and UPROOTED. // --> public static boolean describes(MaterialTag material) { From 8ceffae5be5c375d1bedc7a349550c19b755657a Mon Sep 17 00:00:00 2001 From: MCSamuel Date: Sat, 22 Nov 2025 15:14:35 -0800 Subject: [PATCH 6/6] options -> modes --- .../properties/material/MaterialMode.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java index b3b2452fc7..074429633c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialMode.java @@ -17,18 +17,18 @@ public class MaterialMode extends MaterialProperty { // @input ElementTag // @description // Controls a block's mode. - // For comparators, options are COMPARE and SUBTRACT. - // For piston_heads, options are NORMAL and SHORT. - // For bubble_columns, options are NORMAL and DRAG. - // For structure_blocks, options are CORNER, DATA, LOAD, and SAVE. - // For sculk_sensors, options are ACTIVE, COOLDOWN, and INACTIVE. - // For daylight_detectors, options are INVERTED and NORMAL. - // For command_blocks, options are CONDITIONAL and NORMAL. - // For big_dripleafs, options are FULL, NONE, PARTIAL, and UNSTABLE. - // For sculk_catalysts, options are BLOOM and NORMAL. - // For sculk_shriekers, options are SHRIEKING and NORMAL. - // For tripwires, options are ARMED and DISARMED. - // For creaking_hearts, options are AWAKE, DORMANT, and UPROOTED. + // For comparators, modes are COMPARE and SUBTRACT. + // For piston_heads, modes are NORMAL and SHORT. + // For bubble_columns, modes are NORMAL and DRAG. + // For structure_blocks, modes are CORNER, DATA, LOAD, and SAVE. + // For sculk_sensors, modes are ACTIVE, COOLDOWN, and INACTIVE. + // For daylight_detectors, modes are INVERTED and NORMAL. + // For command_blocks, modes are CONDITIONAL and NORMAL. + // For big_dripleafs, modes are FULL, NONE, PARTIAL, and UNSTABLE. + // For sculk_catalysts, modes are BLOOM and NORMAL. + // For sculk_shriekers, modes are SHRIEKING and NORMAL. + // For tripwires, modes are ARMED and DISARMED. + // For creaking_hearts, modes are AWAKE, DORMANT, and UPROOTED. // --> public static boolean describes(MaterialTag material) {