Problems with BlockFromToEvent

Discussion in 'Plugin Development' started by welsar55, Sep 7, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    welsar55

    I am trying to slow down lava movement with the BlockFromToEvent This code just stops lava completely
    Code:java
    1.  
    2. public HashMap<Location, Integer> Blocks = new HashMap<Location, Integer>();
    3. @EventHandler
    4. public void LavaFlow(BlockPhysicsEvent event)
    5. {
    6. if(Blocks.containsKey(event.getBlock().getLocation()))
    7. {
    8. if(Blocks.get(event.getBlock().getLocation()) == 4)
    9. {
    10. Blocks.remove(event.getBlock().getLocation());
    11. }
    12. else
    13. {
    14. Blocks.put(event.getBlock().getLocation(), Blocks.get(event.getBlock().getLocation()) + 1 );
    15. event.setCancelled(true);
    16. }
    17. }
    18. else
    19. {
    20. Blocks.put(event.getBlock().getLocation(), 1);
    21. event.setCancelled(true);
    22. }
     
  2. Offline

    masons123456

    welsar55 I'm not 100% sure about this, but you might need to give the lava a BlockUpdate to check if it can flow again. Also, your title says "BlockFromToEvent", but you are actually having an issue with the "BlockPhysicsEvent" and aren't even using the "BlockFromToEvent".
     
  3. Offline

    welsar55

    masons123456 Your right my bad I was testing to see if Block Physics worked but it did not.
     
Thread Status:
Not open for further replies.

Share This Page