Image placing item
wtlgo opened this issue ยท 8 comments
Hello, I would like to suggest a feature.
It would be nice to have the ability to create an item that will place the image without the usage of commands and make images placed by this item breakable. Would it be very difficult to implement?
Ah, I mean that player has the item, right clicks on the solid block, the image which is assigned to the item appears on that block, and the item disappears from the players' inventory.
Then he left clicks the image or breaks the block beneath, the image gets removed and the item is dropped back to the player.
More like normal map-arts work, but without placing frames in advance, I guess.
I hope I was clear this time.
Hi, @wtlgo!
This looks like an interesting concept. Could you explain it a bit further? Do you mean creating an "image" item that can be placed and broken like a in-game block, for instance?
Got it! Not the easiest thing to implement but it's probably feasible.
Here's the spec I'm aiming for:
- A new command (let's say "/yamipa give [...]") will be added to allow issuing image items to a player.
- This image items have a predefined set of attributes (image file, width and height) that are defined when the "give" command is called, and are stackable as long as they have the same attributes tuple.
- Image items can be placed on block surfaces using the interact button (right click by default). After placing an image item, it gets removed from the player's inventory.
- Unlike images placed using commands, images which originated from an image item can be removed by any player with the attack/destroy button (left click by default), dropping the original image item in the process.
- Destroying the block an image item was placed upon will not remove the image to allow the placing of floating images.
In the meantime I'll focus on the next Yamipa release (animated images + 1.18 compatibility), this if implemented will be released later.
Yeah, of course, take your time, I just gave an idea. Initially, I planned to implement this by myself and just make a pull request but sadly turned out that I'm not as good at Java as I thought, so the only option I had is to tell you what I tried to make and failed. Thank you very much for listening!
Good news!
Placeable items has landed in pre-release v1.2.1-SNAPSHOT. You can find the documentation at this link.
Let me know if you find any bugs.
Hello, so after using this version on my server for a while, I think it works very well!
There is a minor issue though. Sometimes when the item is dropped it spawns inside of the block, and clips into a random location behind the wall or in the cave below.
I'm not sure, but I think its because of what happens here, where it takes the exact location of the attacked block
and then, if I understand correctly, tries to spawn it inside of this block.
Maybe moving the location one block towards the attacked face would make things better?