Closed FrankHeijden closed 3 years ago
No one should be making any significant changes to anything at the Monitor level. You can use the TownyExplodingBlocksEvent to change what is being blown up. We have to change the block to air in order to reliably prevent blocks from dropping, because the Bukkit API does not allow the drops to be cleared reliably.
I wasn't referring to making changes on the monitor level, I am monitoring the event to determine the exact outcome of the event -- but due to how towny sets the blocks to AIR this becomes impossible to check solely from this event phase.
Ah yes sorry. You could use the same event to get the blocklist involved. Towny will reliably revert those blocks.
but this requires plugins to explicitly hook into towny to fix the event -- something which I can see other plugins could also have problems with.
Towny wouldn't have to do it if Bukkit could reliably set the explosion yield to 0/clear the drops.
The BlockExplodeEvent does have a setYield(float)
method, if setting the yield to 0 doesn't work, shouldn't this be brought up to the spigot team instead?
Reported by a Towny team member already: https://hub.spigotmc.org/jira/browse/SPIGOT-5155
But the issue was marked as fixed?
It would appear that it does work now. That's good news.
In the regenerationtask of towny, when a bed is exploded in the nether, towny sets the blocks in the
BlockExplodeEvent#blockList()
to AIR, making it impossible for other plugins after Towny to monitor block changes on the MONITOR event phase. It might be better to remove the block from theblockList()
in combination with setting it to AIR, if towny can guarantee the block will be regenerated.https://github.com/TownyAdvanced/Towny/blob/7b6a020c1ccc7c354bf28973ff2103f46cb7eab1/src/com/palmergames/bukkit/towny/regen/TownyRegenAPI.java#L524