Continuing to port my plugin from Bukkit to Sponge, how to deny lava or water flow, and blockspread. On Bukkit, a can cancell the event BlockFromToEvent and BlockSpreadEvent, and here?
Thanks
Continuing to port my plugin from Bukkit to Sponge, how to deny lava or water flow, and blockspread. On Bukkit, a can cancell the event BlockFromToEvent and BlockSpreadEvent, and here?
Thanks
It would be cased with ChangeBlockEvent
or some sub event thereof and NotifyBlockEvent
. We can’t have specific events like BlockFromToEvent
etc because mods prevent the possibility of knowing what blocks are spreading.
I can not find BlockFromToEvent and BlockSpreadEvent. I need help deny lava and water flow?
Use ChangeBlockEvent.Place
and/or ChangeBlockEvent.Modify
such that if the new snapshot’s BlockType
is either BlockTypes.WATER
or BlockTypes.LAVA
, cancel the event. You could also listen for a post event and/or make sure that no liquid spreads by checking for the MatterProperty
.
Take a look into my code i using: https://github.com/FabioZumbi12/Sponge-RedProtect/blob/master/src/main/java/br/net/fabiozumbi12/redprotect/listeners/RPBlockListener.java#L395
I think helps you.