001/*
002 * This file is part of Baritone.
003 *
004 * Baritone is free software: you can redistribute it and/or modify
005 * it under the terms of the GNU Lesser General Public License as published by
006 * the Free Software Foundation, either version 3 of the License, or
007 * (at your option) any later version.
008 *
009 * Baritone is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU Lesser General Public License for more details.
013 *
014 * You should have received a copy of the GNU Lesser General Public License
015 * along with Baritone.  If not, see <https://www.gnu.org/licenses/>.
016 */
017
018package baritone.api.event.events;
019
020import net.minecraft.entity.Entity;
021import net.minecraft.entity.EntityLivingBase;
022
023/**
024 * @author Brady
025 * @since 8/21/2018
026 */
027public final class RotationMoveEvent {
028
029    /**
030     * The type of event
031     */
032    private final Type type;
033
034    /**
035     * The yaw rotation
036     */
037    private float yaw;
038
039    public RotationMoveEvent(Type type, float yaw) {
040        this.type = type;
041        this.yaw = yaw;
042    }
043
044    /**
045     * Set the yaw movement rotation
046     *
047     * @param yaw Yaw rotation
048     */
049    public final void setYaw(float yaw) {
050        this.yaw = yaw;
051    }
052
053    /**
054     * @return The yaw rotation
055     */
056    public final float getYaw() {
057        return this.yaw;
058    }
059
060    /**
061     * @return The type of the event
062     */
063    public final Type getType() {
064        return this.type;
065    }
066
067    public enum Type {
068
069        /**
070         * Called when the player's motion is updated.
071         *
072         * @see Entity#moveRelative(float, float, float, float)
073         */
074        MOTION_UPDATE,
075
076        /**
077         * Called when the player jumps.
078         *
079         * @see EntityLivingBase#jump
080         */
081        JUMP
082    }
083}