Minecart.setPassenger() doesn't work properly

Discussion in 'Plugin Development' started by Fipil, Jan 29, 2014.

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

    Fipil

    I've a plugin for better minecarts which works perfectly for years (of course I'm sometimes updating it for each new bukkit version). One of feature is automatic passenger loading: when a player steps to pressure plate next to station, my plugin spawns a new minecart, loads the player into the minecart and sets velocity of the minecart so player begins traveling to some target station.
    My plugin uses the following code for loading of passenger:
    Code:
    Minecart cart=w.spawn(railsBlock.getLocation(), Minecart.class);
    if(player!=null)
        cart.setPassenger(player);
    cart.setVelocity(calculateLaunchSpeed());
    
    This worked perfectly up to the bukkit 1.5.2 version.
    Now I'm trying to update it for the bukkit 1.7.2R0.2 and I've the following issues:
    1. The player is loaded to the minecart, but he's not sitting in the minecart, but he's sitting on the left or right side inside of the minecart's wall and on the ground.
    2. My plugin is catching passenger's interaction with minecart like clicking by left and right mouse to the minecart - as a reaction to these events my plugin does some operations for example if user clicks to the minecarts by right mouse, plugin plans eject of passenger at the next station. The events doesn't work anymore.
    I noticed that Mojang probably changed something on minecarts, for example leaving of minecart is now binded to the L-MENU key. So they probably changes something in the setPassenger() method?
    Can anyone help me to solve these 1.7.2 -related issues, please?
    Thanks a lot!
     
  2. Offline

    The_Doctor_123

    Report as bug?
     
  3. Offline

    Fipil

    Ok, I did it. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page