Repository navigation
Conversation
|
Need to handle the existing |
| // @name powered | ||
| // @input ElementTag(Boolean) | ||
| // @description | ||
| // Controls whether the material is powered. |
There was a problem hiding this comment.
I would say something about redstone, both for ease of searching and to make it clearer - redstone powered, is powered (receiving a redstone signal of above 0). or something like that
| public MaterialPowerable(MaterialTag material) { | ||
| super(material); | ||
| } |
There was a problem hiding this comment.
This shouldn't be needed with the modern property syntax?
|
finally addressed the issues, forgot about it lol |
| if (getBlockData() instanceof Powerable powerable) { | ||
| return new ElementTag(powerable.isPowered()); | ||
| } | ||
| return null; |
There was a problem hiding this comment.
This could be replaced with as(Powerable.class), since nothing else should make it past the describes function.
| import com.denizenscript.denizencore.objects.core.ElementTag; | ||
| import org.bukkit.block.data.Powerable; | ||
|
|
||
| public class MaterialPowerable extends MaterialProperty<ElementTag> { |
There was a problem hiding this comment.
This could maybe be named MaterialPowered to match up with the property name? Powerable is just the type of material that it controls.
| PropertyParser.registerProperty(MaterialOminous.class, MaterialTag.class); | ||
| } | ||
| PropertyParser.registerProperty(MaterialPersistent.class, MaterialTag.class); | ||
| PropertyParser.registerProperty(MaterialPowerable.class, MaterialTag.class); |
This adds proper support for controlling powerable materials.
Requested at https://discord.com/channels/315163488085475337/1049298571742158848