Solved "Stoplag" like effect.

Discussion in 'Plugin Development' started by mineman117, Feb 19, 2014.

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

    mineman117

    Hello all, and thanks in advance for reading and helping me on this problem. I have been trying to get the same affect that happens with the /stoplag command from World Guard. E.g. things like signs can float in mid-air even thought they need a block connected to them or like snow floating in mid-air or redstone lamps remaining powered. In the World Guard source they did this by cancelling a BlockFromTo Event. I have tried the same method and don't know why it isn't working. I don't know if this is really needed but here is my code:
    Code:java
    1. @EventHandler(priority=EventPriority.HIGH, ignoreCancelled=true)
    2. public void onBlockFromTo(BlockFromToEvent event)
    3. {
    4. event.setCancelled(true);
    5. return;
    6. }
     
  2. Offline

    Nateb1121

    mineman117
    Out of curiosity what priority is WG event? Have you try adding like a "getLogger().info("I WORK!");" type thing to make sure it's firing?
     
  3. Offline

    mineman117

    Nateb1121
    No Idk why but testing to see if it was firing didn't even occur to me. And the WG event is default priority.

    EDIT: The event is not firing.
    EDIT AGAIN: The BlockFromToEvent only applies to liquids apparently. I will inspect how World Guard does /stoplag again.
    EDIT AGAIN AGAIN: Fixed problem lol. It was the BlockPhysicsEvent.
     
Thread Status:
Not open for further replies.

Share This Page