From 0e8e97662c538e8078ca3c23c12363ebc8c3d0f9 Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Fri, 16 Aug 2019 16:36:12 -0400 Subject: [PATCH 1/7] Implement BlockData.Type interfaces, part 1 Covers everything from bamboo leaves to end portal frame eyes --- .../objects/properties/PropertyRegistry.java | 17 ++ .../material/MaterialBambooLeaves.java | 109 ++++++++++ .../properties/material/MaterialBedSide.java | 120 +++++++++++ .../material/MaterialBellAttachment.java | 109 ++++++++++ .../material/MaterialBrewingStandBottles.java | 186 ++++++++++++++++++ .../material/MaterialBubbleColumnDrag.java | 110 +++++++++++ .../material/MaterialCakeBites.java | 132 +++++++++++++ .../material/MaterialCampfireSignal.java | 108 ++++++++++ .../material/MaterialChestType.java | 110 +++++++++++ .../MaterialCommandBlockConditional.java | 108 ++++++++++ .../material/MaterialComparatorMode.java | 110 +++++++++++ .../MaterialDaylightDetectorInverted.java | 112 +++++++++++ .../material/MaterialDispenserTriggered.java | 108 ++++++++++ .../material/MaterialDoorHinge.java | 110 +++++++++++ .../material/MaterialEndPortalFrameEye.java | 108 ++++++++++ 15 files changed, 1657 insertions(+) create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java create mode 100644 plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java index 9cdd68fd02..489fdbeb2c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java @@ -161,7 +161,19 @@ public static void registermainProperties() { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13)) { PropertyParser.registerProperty(MaterialAge.class, MaterialTag.class); PropertyParser.registerProperty(MaterialAttached.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialBambooLeaves.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialBedSide.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialBrewingStandBottles.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialBubbleColumnDrag.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialCakeBites.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialChestType.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialCommandBlockConditional.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialComparatorMode.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialDaylightDetectorInverted.class, MaterialTag.class); PropertyParser.registerProperty(MaterialDirectional.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialDispenserTriggered.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialDoorHinge.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialEndPortalFrameEye.class, MaterialTag.class); PropertyParser.registerProperty(MaterialHalf.class, MaterialTag.class); PropertyParser.registerProperty(MaterialSlab.class, MaterialTag.class); PropertyParser.registerProperty(MaterialLeaves.class, MaterialTag.class); @@ -177,6 +189,11 @@ public static void registermainProperties() { PropertyParser.registerProperty(MaterialSwitchFace.class, MaterialTag.class); PropertyParser.registerProperty(MaterialWaterlogged.class, MaterialTag.class); } + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14_R1)) { + PropertyParser.registerProperty(MaterialBambooLeaves.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialBellAttachment.class, MaterialTag.class); + PropertyParser.registerProperty(MaterialCampfireSignal.class, MaterialTag.class); + } // register core TradeTag properties PropertyParser.registerProperty(TradeHasXp.class, TradeTag.class); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java new file mode 100644 index 0000000000..03952ff98b --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java @@ -0,0 +1,109 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Bamboo; + +public class MaterialBambooLeaves implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Bamboo; + } + + public static MaterialBambooLeaves getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialBambooLeaves((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "bamboo_leaves" + }; + + public static final String[] handledMechs = new String[] { + "bamboo_leaves" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialBambooLeaves(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Bamboo getBamboo() { + return (Bamboo) material.getModernData().data; + } + + private String getLeaves() { + return getBamboo().getLeaves().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getBamboo().getLeaves() != Bamboo.Leaves.NONE ? getLeaves() : null; + } + + @Override + public String getPropertyId() { + return "bamboo_leaves"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.bamboo_leaves + // @group properties + // @description + // Returns the size of the leaves on this material, if the material is a bamboo block. + // --> + if (attribute.startsWith("bamboo_leaves")) { + return new ElementTag(getLeaves()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name bamboo_leaves + // @input ElementTag + // @description + // Sets the size of the leaves on this bamboo material. + // Can be any of: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/Bamboo.Leaves.html> + // @tags + // + // --> + if (mechanism.matches("bamboo_leaves") && mechanism.requireEnum(false, Bamboo.Leaves.values())) { + getBamboo().setLeaves(Bamboo.Leaves.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java new file mode 100644 index 0000000000..8923049149 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java @@ -0,0 +1,120 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Bed; + +public class MaterialBedSide implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData() instanceof Bed; + } + + public static MaterialBedSide getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialBedSide((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "bed_side", "is_occupied" + }; + + public static final String[] handledMechs = new String[] { + "bed_side" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialBedSide(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Bed getBed() { + return (Bed) material.getModernData().data; + } + + private String getSide() { + return getBed().getPart().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getSide(); + } + + @Override + public String getPropertyId() { + return "bed_side"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.bed_side + // @group properties + // @description + // If the material is a bed, returns which side of the bed it is. + // Can be either HEAD or FOOT. + // --> + if (attribute.startsWith("bed_side")) { + return new ElementTag(getSide()).getAttribute(attribute.fulfill(1)); + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @group properties + // @description + // If the material is a bed, returns whether it is occupied. + // --> + if (attribute.startsWith("is_occupied")) { + return new ElementTag(getBed().isOccupied()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name bed_side + // @input ElementTag + // @description + // If the material is a bed, sets which side of the bed the material is. + // @tags + // + // --> + if (mechanism.matches("bed_side") && mechanism.requireEnum(false, Bed.Part.values())) { + getBed().setPart(Bed.Part.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java new file mode 100644 index 0000000000..aedd999476 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java @@ -0,0 +1,109 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Bell; + +public class MaterialBellAttachment implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Bell; + } + + public static MaterialBellAttachment getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialBellAttachment((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "bell_attachment" + }; + + public static final String[] handledMechs = new String[] { + "bell_attachment" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialBellAttachment(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Bell getBell() { + return (Bell) material.getModernData().data; + } + + private String getAttachment() { + return getBell().getAttachment().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getBell().getAttachment() != Bell.Attachment.FLOOR ? getAttachment() : null; + } + + @Override + public String getPropertyId() { + return "bell_attachment"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.bell_attachment + // @group properties + // @description + // If the material is a bell, returns the kind of attachment the material is using. + // Can be one of: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/Bell.Attachment.html> + // --> + if (attribute.startsWith("bell_attachment")) { + return new ElementTag(getAttachment()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name bell_attachment + // @input ElementTag + // @description + // If the material is a bell, sets the kind of attachment the material will use. + // @tags + // + // --> + if (mechanism.matches("bell_attachment") && mechanism.requireEnum(false, Bell.Attachment.values())) { + getBell().setAttachment(Bell.Attachment.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java new file mode 100644 index 0000000000..343d1c40b7 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java @@ -0,0 +1,186 @@ +package com.denizenscript.denizen.objects.properties.material; + +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.utilities.debugging.Debug; +import com.denizenscript.denizencore.objects.Mechanism; +import com.denizenscript.denizencore.objects.ObjectTag; +import com.denizenscript.denizencore.objects.core.ElementTag; +import com.denizenscript.denizencore.objects.core.ListTag; +import com.denizenscript.denizencore.objects.properties.Property; +import com.denizenscript.denizencore.tags.Attribute; +import org.bukkit.block.data.type.BrewingStand; + +public class MaterialBrewingStandBottles implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof BrewingStand; + } + + public static MaterialBrewingStandBottles getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialBrewingStandBottles((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "bottles", "has_bottles", "has_bottle", "max_bottles" + }; + + public static final String[] handledMechs = new String[] { + "bottles" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialBrewingStandBottles(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private BrewingStand getStand() { + return (BrewingStand) material.getModernData().data; + } + + private boolean hasBottles() { + return !getStand().getBottles().isEmpty(); + } + + private ListTag getBottles() { + return new ListTag(getStand().getBottles()); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return hasBottles() ? getBottles().identify() : null; + } + + @Override + public String getPropertyId() { + return "bottles"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Number) + // @group properties + // @description + // Returns the maximum number of bottles that can be on this brewing stand material. + // Currently, the maximum number of bottles a brewing stand can hold is 3. + // --> + if (attribute.startsWith("max_bottles")) { + return new ElementTag(getStand().getMaximumBottles()).getAttribute(attribute.fulfill(1)); + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.bottles + // @group properties + // @description + // Returns whether this brewing stand material has any bottles in it. + // --> + if (attribute.startsWith("has_bottles")) { + return new ElementTag(hasBottles()).getAttribute(attribute.fulfill(1)); + } + + // <--[tag] + // @attribute ]> + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.bottles + // @group properties + // @description + // Returns whether this brewing stand material has the specified bottle. + // The specified bottle can be either 1, 2, or 3. + // --> + if (attribute.startsWith("has_bottle") && attribute.hasContext(1)) { + ElementTag context = new ElementTag(attribute.getContext(1)); + if (!context.isInt()) { + Debug.echoError("The specified bottle must be 1, 2, or 3!"); + return null; + } + int bottle = context.asInt(); + if (bottle < 1 || bottle > 3) { + Debug.echoError("The specified bottle must be 1, 2, or 3!"); + return null; + } + return new ElementTag(getStand().hasBottle(bottle - 1)).getAttribute(attribute.fulfill(1)); + } + + // <--[tag] + // @attribute + // @returns ListTag(Number) + // @mechanism MaterialTag.bottles + // @group properties + // @description + // Returns the indexes of all bottles present on this brewing stand material. + // --> + if (attribute.startsWith("bottles")) { + return new ListTag(getBottles()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name bottles + // @input ListTag(Number) + // @description + // If the material is a brewing stand, sets which bottles are present on it. + // The list must only contain the numbers 1, 2, and/or 3! + // @tags + // + // ]> + // + // + // --> + if (mechanism.matches("bottles") && mechanism.requireObject(ListTag.class)) { + boolean bottle1 = false; + boolean bottle2 = false; + boolean bottle3 = false; + for (String input : mechanism.valueAsType(ListTag.class)) { + ElementTag parsedInput = new ElementTag(input); + if (parsedInput.isInt()) { + switch (parsedInput.asInt()) { + case 1: + bottle1 = true; + break; + case 2: + bottle2 = true; + break; + case 3: + bottle3 = true; + break; + } + } + } + getStand().setBottle(0, bottle1); + getStand().setBottle(1, bottle2); + getStand().setBottle(2, bottle3); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java new file mode 100644 index 0000000000..ac07bcbeaf --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java @@ -0,0 +1,110 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.BubbleColumn; + +public class MaterialBubbleColumnDrag implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof BubbleColumn; + } + + public static MaterialBubbleColumnDrag getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialBubbleColumnDrag((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "drags_down" + }; + + public static final String[] handledMechs = new String[] { + "drags_down" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialBubbleColumnDrag(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private BubbleColumn getBubbleColumn() { + return (BubbleColumn) material.getModernData().data; + } + + private boolean isDragging() { + return getBubbleColumn().isDrag(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return !isDragging() ? "false" : null; + } + + @Override + public String getPropertyId() { + return "drags_down"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.drags_down + // @group properties + // @description + // Returns whether this bubble column material is dragging the player down. + // If false, then the material is pushing the player up. + // --> + if (attribute.startsWith("drags_down")) { + return new ElementTag(isDragging()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name drags_down + // @input ElementTag(Boolean) + // @description + // If the material is a bubble column, sets whether the material is dragging the player down. + // If false, then the material is pushing the player up. + // @tags + // + // --> + if (mechanism.matches("drags_down") && mechanism.requireBoolean()) { + getBubbleColumn().setDrag(mechanism.getValue().asBoolean()); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java new file mode 100644 index 0000000000..c2a2b053d9 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java @@ -0,0 +1,132 @@ +package com.denizenscript.denizen.objects.properties.material; + +import com.denizenscript.denizen.objects.MaterialTag; +import com.denizenscript.denizen.utilities.debugging.Debug; +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.tags.Attribute; +import org.bukkit.block.data.type.Cake; + +public class MaterialCakeBites implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Cake; + } + + public static MaterialCakeBites getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialCakeBites((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "bites", "max_bites" + }; + + public static final String[] handledMechs = new String[] { + "bites" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialCakeBites(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Cake getCake() { + return (Cake) material.getModernData().data; + } + + private int getBites() { + return getCake().getBites(); + } + + private int getMaxBites() { + return getCake().getMaximumBites(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getBites() != 0 ? String.valueOf(getBites()) : null; + } + + @Override + public String getPropertyId() { + return "bites"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Number) + // @group properties + // @description + // If the material is a cake, returns the maximum number of bites the material can have. + // --> + if (attribute.startsWith("max_bites")) { + return new ElementTag(getMaxBites()).getAttribute(attribute.fulfill(1)); + } + + // <--[tag] + // @attribute + // @returns ElementTag(Number) + // @mechanism MaterialTag.bites + // @group properties + // @description + // If the material is a cake, returns the number of bites the material has. + // 0 bites means the cake is untouched. + // --> + if (attribute.startsWith("bites")) { + return new ElementTag(getBites()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name bites + // @input ElementTag(Number) + // @description + // If the material is a cake, sets the number of bites the material has. + // 0 means the material is untouched. + // @tags + // + // + // --> + if (mechanism.matches("bites") && mechanism.requireInteger()) { + int value = mechanism.getValue().asInt(); + if (value < 0 || value > getMaxBites()) { + Debug.echoError("The number of cake bites must be between 0 and " + getMaxBites() + "!"); + return; + } + getCake().setBites(value); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java new file mode 100644 index 0000000000..be4663a48f --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java @@ -0,0 +1,108 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Campfire; + +public class MaterialCampfireSignal implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Campfire; + } + + public static MaterialCampfireSignal getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialCampfireSignal((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "is_signal" + }; + + public static final String[] handledMechs = new String[] { + "is_signal" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialCampfireSignal(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Campfire getCampfire() { + return (Campfire) material.getModernData().data; + } + + private boolean isSignal() { + return getCampfire().isSignalFire(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return isSignal() ? "true" : null; + } + + @Override + public String getPropertyId() { + return "is_signal"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.is_signal + // @group properties + // @description + // If the material is a campfire, returns if the material is a signal fire. + // --> + if (attribute.startsWith("is_signal")) { + return new ElementTag(isSignal()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name is_signal + // @input ElementTag(Boolean) + // @description + // If the material is a campfire, sets if the material is a signal fire. + // @tags + // + // --> + if (mechanism.matches("is_signal") && mechanism.requireBoolean()) { + getCampfire().setSignalFire(mechanism.getValue().asBoolean()); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java new file mode 100644 index 0000000000..2770075cce --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java @@ -0,0 +1,110 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Chest; + +public class MaterialChestType implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Chest; + } + + public static MaterialChestType getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialChestType((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "chest_type" + }; + + public static final String[] handledMechs = new String[] { + "chest_type" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialChestType(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Chest getChest() { + return (Chest) material.getModernData().data; + } + + private String getType() { + return getChest().getType().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getChest().getType() != Chest.Type.SINGLE ? getType() : null; + } + + @Override + public String getPropertyId() { + return "chest_type"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.chest_type + // @group properties + // @description + // If the material is a chest, returns what kind of chest it is. + // Can be SINGLE, LEFT, or RIGHT, with LEFT and RIGHT indicating that the material is a half of a double chest. + // --> + if (attribute.startsWith("chest_type")) { + return new ElementTag(getType()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name chest_type + // @input ElementTag + // @description + // If the material is a chest, sets what kind of chest it is. + // Can be SINGLE, LEFT, or RIGHT, with LEFT and RIGHT indicating that the material is a half of a double chest. + // @tags + // + // --> + if (mechanism.matches("chest_type") && mechanism.requireEnum(false, Chest.Type.values())) { + getChest().setType(Chest.Type.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java new file mode 100644 index 0000000000..71070778fe --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java @@ -0,0 +1,108 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.CommandBlock; + +public class MaterialCommandBlockConditional implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof CommandBlock; + } + + public static MaterialCommandBlockConditional getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialCommandBlockConditional((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "conditional" + }; + + public static final String[] handledMechs = new String[] { + "conditional" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialCommandBlockConditional(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private CommandBlock getCmdBlock() { + return (CommandBlock) material.getModernData().data; + } + + private boolean isConditional() { + return getCmdBlock().isConditional(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return isConditional() ? "true" : null; + } + + @Override + public String getPropertyId() { + return "conditional"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.conditional + // @group properties + // @description + // If the material is a command block, returns whether this command block is conditional. + // --> + if (attribute.startsWith("conditional")) { + return new ElementTag(isConditional()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name conditional + // @input ElementTag(Boolean) + // @description + // If the material is a command block, sets whether this material is conditional. + // @tags + // + // --> + if (mechanism.matches("conditional") && mechanism.requireBoolean()) { + getCmdBlock().setConditional(mechanism.getValue().asBoolean()); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java new file mode 100644 index 0000000000..cc35fa1c72 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java @@ -0,0 +1,110 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Comparator; + +public class MaterialComparatorMode implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Comparator; + } + + public static MaterialComparatorMode getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialComparatorMode((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "comparator_mode" + }; + + public static final String[] handledMechs = new String[] { + "comparator_mode" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialComparatorMode(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Comparator getComparator() { + return (Comparator) material.getModernData().data; + } + + private String getMode() { + return getComparator().getMode().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getComparator().getMode() != Comparator.Mode.COMPARE ? getMode() : null; + } + + @Override + public String getPropertyId() { + return "comparator_mode"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.comparator_mode + // @group properties + // @description + // If the material is a redstone comparator, returns the mode the material is in. + // Can be either COMPARE or SUBTRACT. + // --> + if (attribute.startsWith("comparator_mode")) { + return new ElementTag(getMode()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name comparator_mode + // @input ElementTag + // @description + // If the material is a redstone comparator, sets the mode the material is in. + // Can be either COMPARE or SUBTRACT. + // @tags + // + // --> + if (mechanism.matches("comparator_mode") && mechanism.requireEnum(false, Comparator.Mode.values())) { + getComparator().setMode(Comparator.Mode.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java new file mode 100644 index 0000000000..fa8cac1efc --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java @@ -0,0 +1,112 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.DaylightDetector; + +public class MaterialDaylightDetectorInverted implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof DaylightDetector; + } + + public static MaterialDaylightDetectorInverted getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialDaylightDetectorInverted((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "inverted" + }; + + public static final String[] handledMechs = new String[] { + "inverted" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialDaylightDetectorInverted(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private DaylightDetector getDetector() { + return (DaylightDetector) material.getModernData().data; + } + + private boolean isInverted() { + return getDetector().isInverted(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return isInverted() ? "true" : null; + } + + @Override + public String getPropertyId() { + return "inverted"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.inverted + // @group properties + // @description + // Returns whether the daylight detector material is inverted. + // If the material is inverted, it will activate in the absence of light. + // Otherwise, it activates in the presence of light. + // --> + if (attribute.startsWith("inverted")) { + return new ElementTag(isInverted()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name inverted + // @input ElementTag(Boolean) + // @description + // Sets whether the daylight detector material is inverted. + // If the material is inverted, it will activate in the absence of light. + // Otherwise, it activates in the presence of light. + // @tags + // + // --> + if (mechanism.matches("inverted") && mechanism.requireBoolean()) { + getDetector().setInverted(mechanism.getValue().asBoolean()); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java new file mode 100644 index 0000000000..8312eac0f8 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java @@ -0,0 +1,108 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Dispenser; + +public class MaterialDispenserTriggered implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Dispenser; + } + + public static MaterialDispenserTriggered getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialDispenserTriggered((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "triggered" + }; + + public static final String[] handledMechs = new String[] { + "triggered" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialDispenserTriggered(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Dispenser getDispenser() { + return (Dispenser) material.getModernData().data; + } + + private boolean triggered() { + return getDispenser().isTriggered(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return triggered() ? "true" : null; + } + + @Override + public String getPropertyId() { + return "triggered"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.triggered + // @group properties + // @description + // Returns whether the dispenser material is triggered. + // --> + if (attribute.startsWith("triggered")) { + return new ElementTag(triggered()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name triggered + // @input ElementTag(Boolean) + // @description + // Sets whether the dispenser material is triggered. + // @tags + // + // --> + if (mechanism.matches("triggered") && mechanism.requireBoolean()) { + getDispenser().setTriggered(mechanism.getValue().asBoolean()); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java new file mode 100644 index 0000000000..6f38f37dce --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java @@ -0,0 +1,110 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.Door; + +public class MaterialDoorHinge implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof Door; + } + + public static MaterialDoorHinge getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialDoorHinge((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "hinge" + }; + + public static final String[] handledMechs = new String[] { + "hinge" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialDoorHinge(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private Door getDoor() { + return (Door) material.getModernData().data; + } + + private String getHinge() { + return getDoor().getHinge().name(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return getDoor().getHinge() != Door.Hinge.LEFT ? getHinge() : null; + } + + @Override + public String getPropertyId() { + return "hinge"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag + // @mechanism MaterialTag.hinge + // @group properties + // @description + // Returns which hinge the door material is using. + // Can be either LEFT or RIGHT. + // --> + if (attribute.startsWith("hinge")) { + return new ElementTag(getHinge()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name hinge + // @input ElementTag + // @description + // Sets the hinge the door material is using. + // Can be either LEFT or RIGHT. + // @tags + // + // --> + if (mechanism.matches("hinge") && mechanism.requireEnum(false, Door.Hinge.values())) { + getDoor().setHinge(Door.Hinge.valueOf(mechanism.getValue().asString().toUpperCase())); + } + } +} diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java new file mode 100644 index 0000000000..0b00698918 --- /dev/null +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java @@ -0,0 +1,108 @@ +package com.denizenscript.denizen.objects.properties.material; + +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.tags.Attribute; +import org.bukkit.block.data.type.EndPortalFrame; + +public class MaterialEndPortalFrameEye implements Property { + + public static boolean describes(ObjectTag material) { + return material instanceof MaterialTag + && ((MaterialTag) material).hasModernData() + && ((MaterialTag) material).getModernData().data instanceof EndPortalFrame; + } + + public static MaterialEndPortalFrameEye getFrom(ObjectTag material) { + if (!describes(material)) { + return null; + } + return new MaterialEndPortalFrameEye((MaterialTag) material); + } + + public static final String[] handledTags = new String[] { + "has_eye" + }; + + public static final String[] handledMechs = new String[] { + "has_eye" + }; + + + /////////////////// + // Instance Fields and Methods + ///////////// + + private MaterialEndPortalFrameEye(MaterialTag material) { + this.material = material; + } + + private MaterialTag material; + + private EndPortalFrame getFrame() { + return (EndPortalFrame) material.getModernData().data; + } + + private boolean hasEye() { + return getFrame().hasEye(); + } + + ///////// + // Property Methods + /////// + + @Override + public String getPropertyString() { + return hasEye() ? "true" : null; + } + + @Override + public String getPropertyId() { + return "has_eye"; + } + + /////////// + // ObjectTag Attributes + //////// + + @Override + public String getAttribute(Attribute attribute) { + if (attribute == null) { + return null; + } + + // <--[tag] + // @attribute + // @returns ElementTag(Boolean) + // @mechanism MaterialTag.has_eye + // @group properties + // @description + // Returns whether this end portal frame material has an eye of ender in it. + // --> + if (attribute.startsWith("has_eye")) { + return new ElementTag(hasEye()).getAttribute(attribute.fulfill(1)); + } + + return null; + } + + @Override + public void adjust(Mechanism mechanism) { + + // <--[mechanism] + // @object MaterialTag + // @name has_eye + // @input ElementTag(Boolean) + // @description + // Sets whether this end portal frame material has an eye of ender in it. + // @tags + // + // --> + if (mechanism.matches("has_eye") && mechanism.requireBoolean()) { + getFrame().setEye(mechanism.getValue().asBoolean()); + } + } +} From cc491fdae933099813d66835ac4a89c51de7eea6 Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:26:50 -0400 Subject: [PATCH 2/7] Fix NMSVersion enum in PropertyRegistry class --- .../denizen/objects/properties/PropertyRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java index 489fdbeb2c..0f473b6baf 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java @@ -189,7 +189,7 @@ public static void registermainProperties() { PropertyParser.registerProperty(MaterialSwitchFace.class, MaterialTag.class); PropertyParser.registerProperty(MaterialWaterlogged.class, MaterialTag.class); } - if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14_R1)) { + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14)) { PropertyParser.registerProperty(MaterialBambooLeaves.class, MaterialTag.class); PropertyParser.registerProperty(MaterialBellAttachment.class, MaterialTag.class); PropertyParser.registerProperty(MaterialCampfireSignal.class, MaterialTag.class); From bc0b54b9b9db4274d2cbd7278c1bf2f7566ab17e Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:28:55 -0400 Subject: [PATCH 3/7] Fix/modify meta documentation and some property names Removed instances of the "is_" prefix. Those are mostly unnecessary Made some of the meta documentation clearer, and capitalized "Eye of Ender" --- .../material/MaterialBambooLeaves.java | 3 ++- .../properties/material/MaterialBedSide.java | 6 +++--- .../material/MaterialBellAttachment.java | 1 + .../material/MaterialCampfireSignal.java | 18 +++++++++--------- .../properties/material/MaterialChestType.java | 4 ++-- .../material/MaterialEndPortalFrameEye.java | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java index 03952ff98b..f6f3df5082 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java @@ -81,6 +81,7 @@ public String getAttribute(Attribute attribute) { // @group properties // @description // Returns the size of the leaves on this material, if the material is a bamboo block. + // Can be NONE, SMALL, or LARGE. // --> if (attribute.startsWith("bamboo_leaves")) { return new ElementTag(getLeaves()).getAttribute(attribute.fulfill(1)); @@ -98,7 +99,7 @@ public void adjust(Mechanism mechanism) { // @input ElementTag // @description // Sets the size of the leaves on this bamboo material. - // Can be any of: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/Bamboo.Leaves.html> + // Can be NONE, SMALL, or LARGE. // @tags // // --> diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java index 8923049149..833def785c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java @@ -24,7 +24,7 @@ public static MaterialBedSide getFrom(ObjectTag material) { } public static final String[] handledTags = new String[] { - "bed_side", "is_occupied" + "bed_side", "occupied" }; public static final String[] handledMechs = new String[] { @@ -88,13 +88,13 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) // @group properties // @description // If the material is a bed, returns whether it is occupied. // --> - if (attribute.startsWith("is_occupied")) { + if (attribute.startsWith("occupied")) { return new ElementTag(getBed().isOccupied()).getAttribute(attribute.fulfill(1)); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java index aedd999476..7dde880f66 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java @@ -99,6 +99,7 @@ public void adjust(Mechanism mechanism) { // @input ElementTag // @description // If the material is a bell, sets the kind of attachment the material will use. + // Can be one of: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/Bell.Attachment.html> // @tags // // --> diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java index be4663a48f..3f5e99c05a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java @@ -24,11 +24,11 @@ public static MaterialCampfireSignal getFrom(ObjectTag material) { } public static final String[] handledTags = new String[] { - "is_signal" + "signal" }; public static final String[] handledMechs = new String[] { - "is_signal" + "signal" }; @@ -61,7 +61,7 @@ public String getPropertyString() { @Override public String getPropertyId() { - return "is_signal"; + return "signal"; } /////////// @@ -75,14 +75,14 @@ public String getAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Boolean) - // @mechanism MaterialTag.is_signal + // @mechanism MaterialTag.signal // @group properties // @description // If the material is a campfire, returns if the material is a signal fire. // --> - if (attribute.startsWith("is_signal")) { + if (attribute.startsWith("signal")) { return new ElementTag(isSignal()).getAttribute(attribute.fulfill(1)); } @@ -94,14 +94,14 @@ public void adjust(Mechanism mechanism) { // <--[mechanism] // @object MaterialTag - // @name is_signal + // @name signal // @input ElementTag(Boolean) // @description // If the material is a campfire, sets if the material is a signal fire. // @tags - // + // // --> - if (mechanism.matches("is_signal") && mechanism.requireBoolean()) { + if (mechanism.matches("signal") && mechanism.requireBoolean()) { getCampfire().setSignalFire(mechanism.getValue().asBoolean()); } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java index 2770075cce..6ac254104e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java @@ -81,7 +81,7 @@ public String getAttribute(Attribute attribute) { // @group properties // @description // If the material is a chest, returns what kind of chest it is. - // Can be SINGLE, LEFT, or RIGHT, with LEFT and RIGHT indicating that the material is a half of a double chest. + // Can be SINGLE, LEFT, or RIGHT. If the type is LEFT or RIGHT, then the chest material is a half of a double chest. // --> if (attribute.startsWith("chest_type")) { return new ElementTag(getType()).getAttribute(attribute.fulfill(1)); @@ -99,7 +99,7 @@ public void adjust(Mechanism mechanism) { // @input ElementTag // @description // If the material is a chest, sets what kind of chest it is. - // Can be SINGLE, LEFT, or RIGHT, with LEFT and RIGHT indicating that the material is a half of a double chest. + // Can be SINGLE, LEFT, or RIGHT. If the type is LEFT or RIGHT, then the chest material is a half of a double chest. // @tags // // --> diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java index 0b00698918..9e1f0a437e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java @@ -80,7 +80,7 @@ public String getAttribute(Attribute attribute) { // @mechanism MaterialTag.has_eye // @group properties // @description - // Returns whether this end portal frame material has an eye of ender in it. + // Returns whether this end portal frame material has an Eye of Ender in it. // --> if (attribute.startsWith("has_eye")) { return new ElementTag(hasEye()).getAttribute(attribute.fulfill(1)); @@ -97,7 +97,7 @@ public void adjust(Mechanism mechanism) { // @name has_eye // @input ElementTag(Boolean) // @description - // Sets whether this end portal frame material has an eye of ender in it. + // Sets whether this end portal frame material has an Eye of Ender in it. // @tags // // --> From 69f8ef216e195c3a099960bb528d4115086a4746 Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:29:32 -0400 Subject: [PATCH 4/7] Allow "max_" and "maximum_" prefixes for applicable properties --- .../properties/material/MaterialBrewingStandBottles.java | 2 +- .../denizen/objects/properties/material/MaterialCakeBites.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java index 343d1c40b7..10ab1f7e13 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java @@ -88,7 +88,7 @@ public String getAttribute(Attribute attribute) { // Returns the maximum number of bottles that can be on this brewing stand material. // Currently, the maximum number of bottles a brewing stand can hold is 3. // --> - if (attribute.startsWith("max_bottles")) { + if (attribute.startsWith("max_bottles") || attribute.startsWith("maximum_bottles")) { return new ElementTag(getStand().getMaximumBottles()).getAttribute(attribute.fulfill(1)); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java index c2a2b053d9..6e4aa8b997 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java @@ -86,7 +86,7 @@ public String getAttribute(Attribute attribute) { // @description // If the material is a cake, returns the maximum number of bites the material can have. // --> - if (attribute.startsWith("max_bites")) { + if (attribute.startsWith("max_bites") || attribute.startsWith("maximum_bites")) { return new ElementTag(getMaxBites()).getAttribute(attribute.fulfill(1)); } From cf763b40a023229e7b59e0b9c3de07bb820eefa9 Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:32:12 -0400 Subject: [PATCH 5/7] Modify MaterialLevel property Disable direct property output for cake materials (e.g. m@cake[level=0] will not be seen). Determining the bites a cake has left is not in the scope of the MaterialLevel property Add additional meta to clarify that we have a dedicated property for cake bites Allow both "max_" and "maximum_" prefixes Disable property output for when the level is 0. The level being 0 is a trivial case --- .../objects/properties/material/MaterialLevel.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java index 52881cbc4b..3ce307feb4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialLevel.java @@ -51,13 +51,14 @@ public ObjectTag getObjectAttribute(Attribute attribute) { } // <--[tag] - // @attribute + // @attribute // @returns ElementTag(Number) // @group properties // @description // Returns the maximum level for a levelable material (like water, lava, and Cauldrons), or a cake. + // NOTE: For cake materials, you may also use . // --> - if (attribute.startsWith("maximum_level")) { + if (attribute.startsWith("max_level") || attribute.startsWith("maximum_level")) { return new ElementTag(getMax()).getObjectAttribute(attribute.fulfill(1)); } @@ -68,6 +69,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) { // @group properties // @description // Returns the current level for a levelable material (like water, lava, and Cauldrons), or a cake. + // NOTE: For cake materials, you may also use . // --> if (attribute.startsWith("level")) { return new ElementTag(getCurrent()).getObjectAttribute(attribute.fulfill(1)); @@ -112,7 +114,10 @@ public void setCurrent(int level) { @Override public String getPropertyString() { - return String.valueOf(getCurrent()); + if (isCake()) { + return null; + } + return getCurrent() != 0 ? String.valueOf(getCurrent()) : null; } @Override @@ -131,7 +136,7 @@ public void adjust(Mechanism mechanism) { // Sets the current level for a levelable material (like water, lava, and Cauldrons), or a cake. // @tags // - // + // // --> if (mechanism.matches("level") && mechanism.requireInteger()) { int level = mechanism.getValue().asInt(); From 1ea9ebfe414929fb955e9ebc9c2f04e7b21d07b6 Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Sun, 1 Sep 2019 21:35:15 -0400 Subject: [PATCH 6/7] Minor fixes Fix the MaterialBedSide property not registering Correct the property output for MaterialBrewingStandBottles, and allow single-item inputs for MaterialTag.bottles mechanism Fix MaterialBambooLeaves property registering twice --- .../denizen/objects/properties/PropertyRegistry.java | 1 - .../objects/properties/material/MaterialBedSide.java | 2 +- .../properties/material/MaterialBrewingStandBottles.java | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java index 0f473b6baf..9ef89c4aee 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java @@ -161,7 +161,6 @@ public static void registermainProperties() { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13)) { PropertyParser.registerProperty(MaterialAge.class, MaterialTag.class); PropertyParser.registerProperty(MaterialAttached.class, MaterialTag.class); - PropertyParser.registerProperty(MaterialBambooLeaves.class, MaterialTag.class); PropertyParser.registerProperty(MaterialBedSide.class, MaterialTag.class); PropertyParser.registerProperty(MaterialBrewingStandBottles.class, MaterialTag.class); PropertyParser.registerProperty(MaterialBubbleColumnDrag.class, MaterialTag.class); diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java index 833def785c..922837fad7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java @@ -13,7 +13,7 @@ public class MaterialBedSide implements Property { public static boolean describes(ObjectTag material) { return material instanceof MaterialTag && ((MaterialTag) material).hasModernData() - && ((MaterialTag) material).getModernData() instanceof Bed; + && ((MaterialTag) material).getModernData().data instanceof Bed; } public static MaterialBedSide getFrom(ObjectTag material) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java index 10ab1f7e13..e3496d7024 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java @@ -53,7 +53,11 @@ private boolean hasBottles() { } private ListTag getBottles() { - return new ListTag(getStand().getBottles()); + ListTag output = new ListTag(); + for (int bottle : getStand().getBottles()) { + output.add(String.valueOf(bottle + 1)); + } + return output; } ///////// @@ -158,7 +162,7 @@ public void adjust(Mechanism mechanism) { // // // --> - if (mechanism.matches("bottles") && mechanism.requireObject(ListTag.class)) { + if (mechanism.matches("bottles")) { boolean bottle1 = false; boolean bottle2 = false; boolean bottle3 = false; From d27927a7d2769100cb16f2cdd60e6c9ac32e695a Mon Sep 17 00:00:00 2001 From: MusicScore <16635607+MusicScore@users.noreply.github.com> Date: Tue, 15 Oct 2019 12:07:32 -0400 Subject: [PATCH 7/7] Move new files to new package --- .../denizen/objects/properties/PropertyRegistry.java | 1 - .../objects/properties/material/MaterialBambooLeaves.java | 2 +- .../denizen/objects/properties/material/MaterialBedSide.java | 2 +- .../objects/properties/material/MaterialBellAttachment.java | 2 +- .../properties/material/MaterialBrewingStandBottles.java | 2 +- .../objects/properties/material/MaterialBubbleColumnDrag.java | 2 +- .../denizen/objects/properties/material/MaterialCakeBites.java | 2 +- .../objects/properties/material/MaterialCampfireSignal.java | 2 +- .../denizen/objects/properties/material/MaterialChestType.java | 2 +- .../properties/material/MaterialCommandBlockConditional.java | 2 +- .../objects/properties/material/MaterialComparatorMode.java | 2 +- .../properties/material/MaterialDaylightDetectorInverted.java | 2 +- .../objects/properties/material/MaterialDispenserTriggered.java | 2 +- .../denizen/objects/properties/material/MaterialDoorHinge.java | 2 +- .../objects/properties/material/MaterialEndPortalFrameEye.java | 2 +- 15 files changed, 14 insertions(+), 15 deletions(-) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialBambooLeaves.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialBedSide.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialBellAttachment.java (95%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialBrewingStandBottles.java (96%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialBubbleColumnDrag.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialCakeBites.java (95%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialCampfireSignal.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialChestType.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialCommandBlockConditional.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialComparatorMode.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialDispenserTriggered.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialDoorHinge.java (94%) rename plugin/src/main/java/{com/denizenscript => dev/unizen}/denizen/objects/properties/material/MaterialEndPortalFrameEye.java (94%) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java index 9ef89c4aee..f9d5521453 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/PropertyRegistry.java @@ -16,7 +16,6 @@ import com.denizenscript.denizencore.objects.core.ListTag; import com.denizenscript.denizencore.objects.core.QueueTag; import com.denizenscript.denizencore.objects.core.ScriptTag; -import com.denizenscript.denizencore.objects.properties.Property; import com.denizenscript.denizencore.objects.properties.PropertyParser; import dev.unizen.denizen.objects.properties.entity.*; import dev.unizen.denizen.objects.properties.material.*; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBambooLeaves.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBambooLeaves.java index f6f3df5082..82279c8f1a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBambooLeaves.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBambooLeaves.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBedSide.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBedSide.java index 922837fad7..452cb3a8e8 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBedSide.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBedSide.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBellAttachment.java similarity index 95% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBellAttachment.java index 7dde880f66..d2473f0a65 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBellAttachment.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBellAttachment.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBrewingStandBottles.java similarity index 96% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBrewingStandBottles.java index e3496d7024..ff89c4fdc1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBrewingStandBottles.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBrewingStandBottles.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.debugging.Debug; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBubbleColumnDrag.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBubbleColumnDrag.java index ac07bcbeaf..227cf85714 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialBubbleColumnDrag.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialBubbleColumnDrag.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCakeBites.java similarity index 95% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCakeBites.java index 6e4aa8b997..0a187d6413 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCakeBites.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCakeBites.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizen.utilities.debugging.Debug; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCampfireSignal.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCampfireSignal.java index 3f5e99c05a..4d74c68567 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCampfireSignal.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCampfireSignal.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialChestType.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialChestType.java index 6ac254104e..5f8773e52e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialChestType.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialChestType.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCommandBlockConditional.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCommandBlockConditional.java index 71070778fe..ad08d0fd28 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialCommandBlockConditional.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialCommandBlockConditional.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialComparatorMode.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialComparatorMode.java index cc35fa1c72..f10f6b1fa3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialComparatorMode.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialComparatorMode.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java index fa8cac1efc..d714fbd14e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDaylightDetectorInverted.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDispenserTriggered.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDispenserTriggered.java index 8312eac0f8..3043ebd949 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDispenserTriggered.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDispenserTriggered.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDoorHinge.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDoorHinge.java index 6f38f37dce..40bd6a2f9a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialDoorHinge.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialDoorHinge.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialEndPortalFrameEye.java similarity index 94% rename from plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java rename to plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialEndPortalFrameEye.java index 9e1f0a437e..c3632dd8ee 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/material/MaterialEndPortalFrameEye.java +++ b/plugin/src/main/java/dev/unizen/denizen/objects/properties/material/MaterialEndPortalFrameEye.java @@ -1,4 +1,4 @@ -package com.denizenscript.denizen.objects.properties.material; +package dev.unizen.denizen.objects.properties.material; import com.denizenscript.denizen.objects.MaterialTag; import com.denizenscript.denizencore.objects.Mechanism;