BlockData Support - #8836
Conversation
AnOwlBe
left a comment
There was a problem hiding this comment.
from a quick glance (mostly just my thoughts)
nothing major though
| } | ||
|
|
||
| @Override | ||
| public BlockData getBlockData(ItemType itemType) { |
There was a problem hiding this comment.
is this a safe cast 100% of the time? I didn't really look into it too much though
| CondBlockDataTag::new, | ||
| types + " (has|have) [the] block[ ]data [tag[s]] %strings%", | ||
| types + " (is|are) tagged with [the] block[ ]data [tag[s]] %strings%", | ||
| types + "(is|are) tagged with %strings% block[ ]data", |
There was a problem hiding this comment.
this pattern in specific is confusing to me
would it not be better to say if {b} has "axis" block data? I think you are over-emphasizing "tags" in these patterns
There was a problem hiding this comment.
I was just adding more options, as Mug had preferred the "is tagged" and Pickle said both would be fine.
| import java.util.Arrays; | ||
|
|
||
| @Name("Has Block Data") | ||
| @Description("Whether the blockdata of a block or block related object has the specified tag.") |
There was a problem hiding this comment.
| @Description("Whether the blockdata of a block or block related object has the specified tag.") | |
| @Description("Whether the blockdata of a block or block-related object has the specified tag.") |
| CondBlockDataTag::new, | ||
| types + " (has|have) [the] block[ ]data [tag[s]] %strings%", | ||
| types + " (is|are) tagged with [the] block[ ]data [tag[s]] %strings%", | ||
| types + "(is|are) tagged with %strings% block[ ]data", |
There was a problem hiding this comment.
| types + "(is|are) tagged with %strings% block[ ]data", | |
| types + " (is|are) tagged with %strings% block[ ]data", |
| - tag "pickles" will always return an integer value, and can be changed to an integer value or string of an integer: "1" | ||
| """) | ||
| @Example(""" | ||
| set blockdata "waterlogged" of {_campfire} to false |
There was a problem hiding this comment.
| set blockdata "waterlogged" of {_campfire} to false | |
| set blockdata "waterlogged" of {_campfire} to false |
|
|
||
| @Override | ||
| public @Nullable Integer parse(String string) { | ||
| return string.matches("\\d+") ? Integer.parseInt(string) : null; |
There was a problem hiding this comment.
shouldn't this also accept negative values?
| /** | ||
| * @author Peter Güttinger | ||
| */ |
There was a problem hiding this comment.
| /** | |
| * @author Peter Güttinger | |
| */ |
Problem
Skript currently does not support retrieving, changing, and resetting blockdata tags of blocks
Solution
ExprBlockDataTags:
ExprBlockDataValues:
ExprBlockData (Updated):
BlockDataHolder:
BlockDataValueType:
Testing Completed
quickTest, manual testing
Supporting Information
N/A
Completes: none
Related: none
AI assistance: none