VehicleUpdate, getHighestBlockAt

Discussion in 'Plugin Development' started by CXdur, Mar 4, 2015.

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

    CXdur

    Hey guys,

    I was wondering about the "VehicleUpdateEvent" function, and I was wondering about a couple of things:

    * How often does it actually update?
    * If I want to check for blocks below the vehicle, is this event more efficient than vehiclemoveevent?
    * What event is the best to pick? VehicleUpdate or VehicleMove

    I just want to get block below a boat, which is why I'm wondering which to pick. I couldn't find any documentation with answers to my questions:

    As for the getHighestBlockAt, I was wondering if there's an easy way to get the block of the ocean floor.

    I simply just want to get the highest block that isn't water, but I couldn't really find any easy way to do this. I tried to do it by using a while loop from the highest block and down but realized that this will be very inefficient since I need to check the block very often.

    I simply want to create some block station system, but I don't really want to get the block below water either because it looks terrible, but I also don't want it to be very inefficient and lag causing either, so what do you guys think is the best?

    Thank you
     
  2. Offline

    mine-care

    @CXdur hm, not really sure when it updates to be honest.
    And therefore I can't know the difference between the two events, mabe some tracking will show when each event is called but ill need to be on my pc to do that.
    To get block on ocean floor, try to loop through all locations under boat, and if the block at this location is not water, that means you found the floor :) I can't think of a more efficient way and yes it will be inefficient in close calls. If you implement this method you will have to be CAREFULL on the calls so if you use move event, you need to execute the code only if the boat changes block...
    Good luck.
     
  3. Offline

    CXdur

    Well thanks, but I'll wait for some other answers as well, hopefully someone who knows a bit more about these things can answer us hehe.

    I guess I should start trying soon though.
     
    mine-care likes this.
Thread Status:
Not open for further replies.

Share This Page