Comments (9)
Seems like something I could do
from skript.
Seems like something I could do
You'd have to expose the data
field in NewBlockValues and only then do something along the lines of:
itemtype.stream(event)
.flatMap(ItemType::getTypes)
.map(item -> {
NewBlockValues blockValues = (NewBlockValues) item.getBlockValues();
return blockValues.getBlockData(); // exposed method
})
.toArray(BlockData[]::new);
from skript.
@nylhus This has been on my todo list, but you can take it.
Essentially you would use the BlockStateMeta in Bukkit and apply it to an itemstack.
I have the exact syntax in Khoryl, and I was planning to add to Skript eventually. https://github.com/TheLimeGlass/Khoryl/blob/master/src/main/java/me/limeglass/khoryl/elements/item/EffApplyBlockStateItem.java
This allows for
set {_shield} to a shield
target block is a lime standing banner #can have banner patterns
apply the block state from the target block of player to {_shield}
set the offhand of the player to {_shield}
Do note that using itemtypes in the pattern does not work properly. I would recommend making it itemstack only!
ItemType's store their ItemMeta until applied to an ItemStack, and when we utilized this syntax, we found out that itemtypes did not save the block state for some reason.
For this reason, I made it an expression which acts just like ExprLore and applies it like an expression returning the ItemStack. (Changes not applied to the Khoryl remote repo yet)
Similarly to BlockStateMeta there is also BlockDataMeta which is essentially the exact same class just for BlockData.
from skript.
I believe the BlockStateMeta is off topic for what I wanted this suggest to be. You're taking it as should we add it to give player westward facing oak stairs
all I want here is send blockdata of westward facing oak stairs
. The addition of that should be left to another issue or pr.
from skript.
I believe the BlockStateMeta is off topic for what I wanted this suggest to be. You're taking it as should we add it to
give player westward facing oak stairs
all I want here issend blockdata of westward facing oak stairs
. The addition of that should be left to another issue or pr.
They're very close to being the same class and the implementation is the same, it's a developer note.
from skript.
I don't see how it's the same class, you're modifying 1 class not multiple. It's just going to ExprBlockData and adding itemtype and it's usage. You're suggesting it being done directly to ItemType class from what I understand
from skript.
I don't see how it's the same class, you're modifying 1 class not multiple. It's just going to ExprBlockData and adding itemtype and it's usage. You're suggesting it being done directly to ItemType class from what I understand
No, I said it shouldn't be done with ItemType.
from skript.
Alright, so now I'm even further confused what you're talking about after rereading it.
- This suggest is to add
block data of %itemtype%
nothing about BlockStates - if any form of change to item meta is to happen it's BlockDataMeta to support
westward facing oak stairs
to also fix issues likegive play oak wall sign
not giving an item, which I repeat is better for a whole other issue and pr. - Your idea is way off of what I want this issue to even do...and am very confused where you got it from this.
from skript.
Alright, so now I'm even further confused what you're talking about after rereading it.
1. This suggest is to add `block data of %itemtype%` nothing about BlockStates 2. if any form of change to item meta is to happen it's BlockDataMeta to support `westward facing oak stairs` to also fix issues like `give play oak wall sign` not giving an item, which I repeat is better for a whole other issue and pr. 3. Your idea is way off of what I want this issue to even do...and am very confused where you got it from this.
BlockStateMeta and BlockDataMeta are very similar classes. I have an existing example using BlockStateMeta for banner data.
I get that this suggestion is BlockDataMeta, I'm helping aid an example of usage, you just swap BlockStateMeta for BlockDataMeta.
from skript.
Related Issues (20)
- ItemType with enchantments expression HOT 3
- Item Builder Section HOT 4
- [SUGGESTION] loop savers HOT 2
- Regions are not Serializable HOT 2
- Add middle click event HOT 7
- %entitytype% may return null HOT 1
- How do I write Hex code in skript!? HOT 1
- An internal error occurred while attempting to perform this command. HOT 3
- Player Teleportation Bug when an entity rides the player HOT 4
- named atribute doesnt work.. HOT 2
- Replace using regex HOT 2
- [SUGGESTION] Functions that return key & value HOT 1
- Set line | doesn't work on: bamboo/cherry sign | and | hanging´s: crimson warped | HOT 1
- Server randomy crashes HOT 5
- NotSerializableException when using "end rod" aliases/visual effect HOT 4
- Multiple Permissions in a command HOT 8
- Extraneous [the] in hotbar slot expression.
- Add dependencies section to skripts HOT 3
- New event "on any event:" HOT 4
- Item Cooldown Event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skript.