Closed Th3Shadowbroker closed 1 year ago
Remove the custom block then change type using bukkit api https://github.com/LoneDev6/API-ItemsAdder/blob/3ac6df9fdbab1638afba2e5080372852852d3dad/src/main/java/dev/lone/itemsadder/api/CustomBlock.java#L196
Thank you for the blazingly fast support ⚡
That did the trick 👍🏼
I had already combined the remove
and setType
call in a previous try but in the wrong order because I thought of remove
as an actual removal, not a removal of the CustomBlock "claim".
Note: the .remove method is setting the block to AIR and removing it from the ItemsAdder registry completely.
Have a nice day!
Terms
Discord tag (optional)
No response
What happened?
A user of OuroborosMines reported an Issue with custom blocks being unbreakable. I did a few hours of debugging but it seems that the behaviour of IA has changed in regard to handling block-breaking. As OM does some internal handling of the
BlockBreakEvent
the original event is cancelled and the blocks type is set to a specific material. This worked totally fine in the past, however that does not seem to be the case anymore. Changes to the type of custom blocks are getting completely ignored. Is there any IA specific way to do these things via the API?Steps to reproduce the issue
Here's a replication plugin that breaks down the problem, so you don't have to dig trough any OM code. A pre-compiled version can be found here.
BlockBreakEvent
and 1.1 set the blocks type toMaterial.AIR
1.2 cancel theBlockBreakEvent
You'll notice that custom blocks cannot be broken, while vanilla blocks can.
Server version
git-Paper-388 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)
ItemsAdder Version
I tried:
ProtocolLib Version
4.8.0
LoneLibs Version
1.0.21
LightAPI Version (optional)
No response
LibsDisguises Version (optional)
No response
FULL server log
latest.log
Error (optional)
No response
ItemsAdder config.yml
Problematic items yml configuration file (optional)
Other files, you can drag and drop them here to upload. (optional)
No response
Screenshots/Videos (you can drag and drop files or paste links)
Here's the video I received from the user who reported the problem (I were able to replicate the problem and can confirm that non-custom blocks are not affected):
https://user-images.githubusercontent.com/8280615/203302693-72ba4bed-6085-4a38-baf6-9dddad48e621.mp4