Paper
Paper copied to clipboard
Add clear boolean to Block#setType
So I tested this and didnt run into any issues, but since it's dealing with part of the code base I'm not entirely comfortable with yet, the whole changing block state part, I probably put the clear in the wrong place in CraftBlock#setTypeAndData.
Also, if it is a bug that the existing setType doesn't clear inventories, this can easily be refactored to just fix that instead of adding a new parameter to clear tile entities.
Fixes SPIGOT-3725
this is how setType has always worked, why is it considered a bug
bug = "undocumented behaviour I didn't realise", Not really a bug as bukkit does not say that it won't run block removal logic, i guess it's something that you can be unaware of, this somewhat seems like the fact that removal logic is ran maaaybe should be documented?
this is how setType has always worked, why is it considered a bug
yeah, I didn’t think it was, but since there is a spigot bug report for it, and I was unsure if it has always done this or not, I just wanted to check.
this has definitely been the behavior forever. here's old WE code: https://github.com/EngineHub/WorldEdit/blob/3.0/src/com/sk89q/worldedit/EditSession.java#L160-L161
Ok great, then adding a new method is the way to go. The old methods already default to false for that Boolean argument, so should be all good. Just concerned with the location of the actually clearing.
So... you know how it's always been this way? Well spigot just changed the behavior to wipe the tile entity when using Block#seType. Unsure if this is even needed then anymore. Unless the old behavior should be kept.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/8d244b0b7e35596b160452c1aa7ec4fc21de4d50
So now that this has been the behavior for a while, should this be closed? Doesn't seem like there is much input for this behavior to be kept.