Hi i was wondering if someone could make a plugin where lava and water can touch if i want it to in some way. its for a decorative purpose... if a plugin like this already exists please link me
Please don't put simple in the title. If it's so simple, then you can make it yourself, right? And "where lava and water can touch" -- As in without turning into cobble/obsidian?
This is not as simple as it sounds, since there is no easy way to seperate action types from BlockFromToEvent. If there was an enum in that class that could define the different causes, this would be much easier. Sorry
@EventHandler public void waterDest (BlockFromToEvent e) { e.setCancelled(true); } That right there will stop water/lava from interacting. Now obviously this does stop all others things from interacting as well, but you can do some checks for event.getBlock() and event.getToBlock(). So uh yea this is very possible
Check the API docs, my friend. Code: public class BlockFromToEvent extends BlockEvent implements Cancellable Represents events with a source block and a destination block, currently only applies to liquid (lava and water) and teleporting dragon eggs. If a Block From To event is cancelled, the block will not move (the liquid will not flow). This does not only apply for blocks created by water and lava. In fact, this seems it specifically applies to water and lava FLOW. Unless you want nothing flowing in your server, that won't work.
Sigh, like I said you have the getBLock, and the getToBlock - with those two things you can easily makes this work. I was using the e. setCanceled for all of them as an example, you just say if e.getblock is equal to water, and e.gettoblock is equal to lava - then cancel. And if it is lava, to water cancel. You don't HAVE to cancel water to water, which means you can still have it flow.. I think that you don't know too much about what you're talking about in this subject. Edit: So in the plugin you only cancel the ones that are From Lava -> Water or From water -> lava Very simple
Good point, but you would still have an annoying space between water and lava anyways since you canceled the flow action. Replacing the space with more water in the event would cause it to loop. From running a few more checks like what RingOfStorms did, but based on the positions of the water and lava.
There would be obsidian in caves and such from before the plugin? And maybe the plugin dev can add a config for a height setting, like this plugin only takes in affect over so and so height. And by the sound of it, it is a building server, not survival.
I've looked into this and I don't think it is possible because the event fires after the blocks have been changed. Due to the fact this is a minecraft related game mechanic vs. bukkit event setting the event to cancelled does not prevent this. Sorry :/