[SPIGOT-466] Event fired on blockplaceevent doesnt properly listen to plugins when modifying the itemstack being placed Created: 23/Jan/15 Updated: 20/Mar/18 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | rourke | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 1 |
Labels: | Craftbukkit, bug |
Plugin: | Citadel |
Description |
When using citadel I noticed the bug. What happens in the plugin is a block is placed and then it takes a specified block out of your inventory as well which acts as a reinforcement. So lets say you need diamonds in your inventory when placing a stone block which is in your hotbar and placing a stone block. It removes the stone block and removes the diamond. Now lets say you are placing stone and need stone for it. You have two item stacks of Stone, one in the 1 hotbar postion and another one is the second. You are placing from the second. It currently takes from the first position and the stone being placed is gone as well as the additional stone. The bug happens when you modify the itemstack that is currently being placed. So if you have stone in your first place hotbar and you need stone and then you place the block, the plugin removes the one stone but only one stone is removed from the player's hotbar. |
Comments |
Comment by Stuperfied [ 20/Mar/18 ] |
Appears intentional by design. There is a check in;
219 // Change the stack to its new contents if it hasn't been tampered with. 220 if (this.getCount() == oldCount && this.getData() == oldData) {
Possibly a workaround for a block or duplication glitch. What if; An alternate method could be to gather data from the event and effect changes on a subsequent tick.
|
Comment by rourke [ 22/May/15 ] |
So any news on this? |
Comment by md_5 [ 30/Jan/15 ] |
It will be fixed when we are able to. |
Comment by rourke [ 29/Jan/15 ] |
Have you confirmed this or do I need to modify my plugin? |
Comment by rourke [ 25/Jan/15 ] |
I found a link to part of the old thread: https://gist.github.com/turt2live/9568ad7daae3ab137d60 |
Comment by rourke [ 25/Jan/15 ] |
That's what it should be. |
Comment by md_5 [ 25/Jan/15 ] |
The expected result would be: [19:51:45 INFO]: In current hand: 27 Right? |
Comment by rourke [ 25/Jan/15 ] |
Lol, I went through this process with craftbukkit too. Then as soon as it gets acknowledged the whole dmca thing happens. Gimme a minute to write something up. |
Comment by md_5 [ 25/Jan/15 ] |
Lets try another approach: write the smallest plugin you can to reproduce this issue. |
Comment by rourke [ 25/Jan/15 ] |
Sorry I suck at trying to describe, lets try this imgur link: http://imgur.com/a/oocWi |
Comment by md_5 [ 24/Jan/15 ] |
Can you please try and explain this more clearly using a format such as. Something else should happen instead... I don't understand what the issue you are trying to articulate is, sorry |