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

walkmc.block.Click.kt Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package walkmc.block

import org.bukkit.event.block.*

/**
 * Represents a click type.
 *
 * Can be left click or right click.
 */
enum class Click {
	LEFT,
	RIGHT;
	
	val isLeft get() = this == LEFT
	val isRight get() = this == RIGHT
	
	companion object {
		fun from(action: Action) = when (action) {
			Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK -> LEFT
			else -> RIGHT
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy