This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PlayerSetView(private val delegate: MutableSet<UUID>) : MutableSet<Player> { | |
| override val size: Int | |
| get() = delegate.size | |
| override fun isEmpty(): Boolean = | |
| delegate.isEmpty() | |
| override fun contains(element: Player): Boolean = | |
| delegate.contains(element.uniqueId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This file is part of SpongeAPI, licensed under the MIT License (MIT). | |
| * | |
| * Copyright (c) SpongePowered <https://www.spongepowered.org> | |
| * Copyright (c) contributors | |
| * | |
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body, h1, .gh-header, .discussion-timeline-actions, .btn-link.user-has-reacted, p.reason, .pr-toolbar, .diffbar, .conversation-list-heading .inner { | |
| background-color: #eee; | |
| } | |
| code { | |
| background-color: transparent !important; | |
| border-color: transparent !important; | |
| } | |
| .bg-gray, div.dashboard-sidebar, .commit-icon .octicon { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object APCommand { | |
| fun register(plugin: Any) { | |
| val command = CommandRoot("ap", "aperms") { | |
| "collection" then { | |
| "list" execute ::collectionList | |
| subjectCollection("collection") then { | |
| "delete" execute executor(::collectionDelete) | |
| "info" execute executor(::collectionInfo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package frontier.skcexample | |
| import frontier.skc.KClassCallable | |
| import frontier.skc.annotation.Command | |
| import frontier.skc.annotation.Source | |
| import frontier.skc.match.SKCMatcher | |
| import frontier.skc.value.commandSource | |
| import frontier.skc.value.player | |
| import frontier.skc.value.string | |
| import frontier.ske.server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Ability : CatalogType { | |
| override fun getId(): String | |
| override fun getName(): String | |
| // ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package arven.core.api.task | |
| import org.spongepowered.api.scheduler.Task | |
| interface CoroutineTask { | |
| val plugin: Any | |
| val currentTask: Task? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HealArgumentList(ctx: CommandContext) : ArgumentList(ctx) { | |
| val player by ValueParser.PLAYER | |
| companion object { | |
| val command = command(::HealArgumentList) { | |
| player.health().set(player.maxHealth().get()) | |
| player.sendMessage("You have been healed!".green) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| suspend fun AbilityContext.runIt() { | |
| // do stuff... | |
| val event = listenForTargeted<DestructEntityEvent>(player) // Player died! | |
| // end ability since dead | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.spongepowered.api.event.Event; | |
| import org.spongepowered.api.event.Listener; | |
| public class MyEventHandler<T extends Event> { | |
| @Listener | |
| public void onEvent(T event) { | |
| } | |
| } |