001    package org.bukkit.entity;
002    
003    import org.bukkit.util.Vector;
004    
005    /**
006     * Represents a minecart entity.
007     */
008    public interface Minecart extends Vehicle {
009    
010        /**
011         * This method exists for legacy reasons to provide backwards
012         * compatibility. It will not exist at runtime and should not be used
013         * under any circumstances.
014         */
015        @Deprecated
016        public void _INVALID_setDamage(int damage);
017    
018        /**
019         * Sets a minecart's damage.
020         *
021         * @param damage over 40 to "kill" a minecart
022         */
023        public void setDamage(double damage);
024    
025        /**
026         * This method exists for legacy reasons to provide backwards
027         * compatibility. It will not exist at runtime and should not be used
028         * under any circumstances.
029         */
030        @Deprecated
031        public int _INVALID_getDamage();
032    
033        /**
034         * Gets a minecart's damage.
035         *
036         * @return The damage
037         */
038        public double getDamage();
039    
040        /**
041         * Gets the maximum speed of a minecart. The speed is unrelated to the
042         * velocity.
043         *
044         * @return The max speed
045         */
046        public double getMaxSpeed();
047    
048        /**
049         * Sets the maximum speed of a minecart. Must be nonnegative. Default is
050         * 0.4D.
051         *
052         * @param speed The max speed
053         */
054        public void setMaxSpeed(double speed);
055    
056        /**
057         * Returns whether this minecart will slow down faster without a passenger
058         * occupying it
059         *
060         * @return Whether it decelerates faster
061         */
062        public boolean isSlowWhenEmpty();
063    
064        /**
065         * Sets whether this minecart will slow down faster without a passenger
066         * occupying it
067         *
068         * @param slow Whether it will decelerate faster
069         */
070        public void setSlowWhenEmpty(boolean slow);
071    
072        /**
073         * Gets the flying velocity modifier. Used for minecarts that are in
074         * mid-air. A flying minecart's velocity is multiplied by this factor each
075         * tick.
076         *
077         * @return The vector factor
078         */
079        public Vector getFlyingVelocityMod();
080    
081        /**
082         * Sets the flying velocity modifier. Used for minecarts that are in
083         * mid-air. A flying minecart's velocity is multiplied by this factor each
084         * tick.
085         *
086         * @param flying velocity modifier vector
087         */
088        public void setFlyingVelocityMod(Vector flying);
089    
090        /**
091         * Gets the derailed velocity modifier. Used for minecarts that are on the
092         * ground, but not on rails.
093         * <p>
094         * A derailed minecart's velocity is multiplied by this factor each tick.
095         *
096         * @return derailed visible speed
097         */
098        public Vector getDerailedVelocityMod();
099    
100        /**
101         * Sets the derailed velocity modifier. Used for minecarts that are on the
102         * ground, but not on rails. A derailed minecart's velocity is multiplied
103         * by this factor each tick.
104         *
105         * @param derailed visible speed
106         */
107        public void setDerailedVelocityMod(Vector derailed);
108    }