All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.shynixn.blockball.api.business.proxy.BallProxy.kt Maven / Gradle / Ivy

package com.github.shynixn.blockball.api.business.proxy

import com.github.shynixn.blockball.api.persistence.entity.BallMeta
import java.util.*

/**
 * Created by Shynixn 2018.
 * 

* Version 1.2 *

* MIT License *

* Copyright (c) 2018 by Shynixn *

* Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: *

* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. *

* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS Oo89R * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ interface BallProxy { /** * Gets the meta data. */ val meta: BallMeta /** * Runnable Value yaw change which reprents internal yaw change calculation. * Returns below 0 if yaw did not change. */ var yawChange: Float /** * Is the ball currently grabbed by some entity? */ val isGrabbed: Boolean /** * Is the entity dead? */ val isDead: Boolean /** * Unique id. */ val uuid: UUID /** * Is the entity persistent and can be stored. */ var persistent: Boolean /** * Current spinning force value. */ var spinningForce: Double /** * Returns the armorstand for the design. */ fun getDesignArmorstand(): A /** * Returns the armorstand for the hitbox. */ fun getHitboxArmorstand(): A /** * Gets the optional living entity owner of the ball. */ fun getOwner(): Optional /** * Gets the last interaction entity. */ fun getLastInteractionEntity(): Optional /** * Teleports the ball to the given [location]. */ fun teleport(location: L) /** * Gets the location of the ball. */ fun getLocation(): L /** * Sets the velocity of the ball. */ fun setVelocity(vector: V) /** * Gets the velocity of the ball. */ fun getVelocity(): V /** * Kicks the ball by the given entity. * The calculated velocity can be manipulated by the BallKickEvent. * * @param entity entity */ fun kickByEntity(entity: E) /** * Throws the ball by the given entity. * The calculated velocity can be manipulated by the BallThrowEvent. * * @param entity entity */ fun throwByEntity(entity: E) /** * Lets the given living entity grab the ball. */ fun grab(entity: L) /** * Lets the ball spin to the player direction. */ fun spin(playerDirection: V, resultVelocity: V) /** * DeGrabs the ball. */ fun deGrab() /** * Removes the ball. */ fun remove() /** * Calculates post movement. */ fun calculatePostMovement() /** * Calculates the movement vectors. */ fun calculateMoveSourceVectors(movementVector: V, motionVector: V, onGround: Boolean): Optional /** * Calculates the knockback for the given [sourceVector] and [sourceBlock]. Uses the motion values to correctly adjust the * wall. */ fun calculateKnockBack(sourceVector: V, sourceBlock: B, mot0: Double, mot2: Double, mot6: Double, mot8: Double) }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy