Tested on
spongeforge-1.12.2-2838-7.1.7-RC3928spongevanilla-1.12.2-7.1.7-RC297spongeforge-1.12.2-2825-7.1.6spongevanilla-1.12-2-7.1.6
Events are listed in the order that they are fired.
- left click
- no held item
| public final class MinecraftConversions { | |
| public static PistonMoveReaction fromMojang(final PushReaction reaction) { | |
| switch (reaction) { | |
| case NORMAL: | |
| return PistonMoveReaction.MOVE; | |
| case DESTROY: | |
| return PistonMoveReaction.BREAK; | |
| case BLOCK: | |
| return PistonMoveReaction.BLOCK; |
| import com.expansemc.township.api.TownshipAPI | |
| import com.expansemc.township.api.claim.Claim | |
| import com.expansemc.township.plugin.util.Texts | |
| import com.expansemc.township.plugin.util.extension.first | |
| import com.expansemc.township.plugin.util.extension.unwrap | |
| import org.spongepowered.api.command.Command | |
| import org.spongepowered.api.command.CommandExecutor | |
| import org.spongepowered.api.command.CommandResult | |
| import org.spongepowered.api.command.exception.CommandException | |
| import org.spongepowered.api.command.parameter.CommandContext |
| private fun mod(a: Double, b: Double): Double { | |
| val mod = a % b | |
| return if (mod >= 0) mod else mod + b | |
| } | |
| private fun differenceModulo(a: Double, b: Double, c: Double): Double { | |
| return mod(mod(a, c) - mod(b, c), c) | |
| } | |
| private fun getProgressionLastElement(start: Double, end: Double, step: Double): Double = when { |
| /** | |
| * Lexer and Parser for the Zest language. | |
| * | |
| * Some notes about the syntax below: | |
| * - `A * B` is used to mean "A then B". | |
| * - `-A` means to parse A and discard its output. | |
| * - `A or B` means to try in order the listed parsers until one succeeds. | |
| * - `!A` means A is optional. | |
| * - `parser { A }` is used to lazily reference A for recursion. | |
| */ |
| package org.spongepowered.api.service.merchant; | |
| import org.spongepowered.api.CatalogType; | |
| import org.spongepowered.api.service.economy.account.Account; | |
| import java.util.Collection; | |
| import java.util.Optional; | |
| import java.util.UUID; | |
| public interface Merchant extends CatalogType { |
| package pw.dotdash.msh.test; | |
| import org.spongepowered.api.text.Text; | |
| import javax.annotation.Nullable; | |
| import java.util.Optional; | |
| /** | |
| * A description object for permissions. | |
| * |
| class RTuple<out A, out B>(val head: A, val tail: B) { | |
| companion object { | |
| operator fun <A, B, C> invoke(a: A, b: B, c: C): RTuple<A, RTuple<B, C>> = | |
| RTuple(a, RTuple(b, c)) | |
| operator fun <A, B, C, D> invoke(a: A, b: B, c: C, d: D): RTuple<A, RTuple<B, RTuple<C, D>>> = | |
| RTuple(a, RTuple(b, RTuple(c, d))) | |
| operator fun <A, B, C, D, E> invoke(a: A, b: B, c: C, d: D, e: E): RTuple<A, RTuple<B, RTuple<C, RTuple<D, E>>>> = |
Tested on
spongeforge-1.12.2-2838-7.1.7-RC3928spongevanilla-1.12.2-7.1.7-RC297spongeforge-1.12.2-2825-7.1.6spongevanilla-1.12-2-7.1.6Events are listed in the order that they are fired.
| import org.spongepowered.api.Sponge; | |
| import org.spongepowered.api.command.CommandResult; | |
| import org.spongepowered.api.command.args.GenericArguments; | |
| import org.spongepowered.api.command.spec.CommandSpec; | |
| import org.spongepowered.api.event.Listener; | |
| import org.spongepowered.api.event.game.GameRegistryEvent; | |
| import org.spongepowered.api.event.game.state.GameConstructionEvent; | |
| import org.spongepowered.api.event.game.state.GameInitializationEvent; | |
| import org.spongepowered.api.event.game.state.GameStartedServerEvent; | |
| import org.spongepowered.api.plugin.Plugin; |
| /** | |
| * @param S The command source type | |
| * @param V The command argument value type | |
| * @param R The command result type | |
| * @param E The command exception type | |
| * @param Text The text type | |
| */ | |
| sealed class CommandTree<in S, in V, out R, E : Exception, Text>( | |
| private val errorType: KClass<out E>, | |
| private val errorFunc: CommandErrorFunction<S, V, R, out E, Text>, |