This file contains 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.bukkit.Bukkit; | |
import org.bukkit.event.Event; | |
import org.bukkit.event.EventPriority; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.HandlerList; | |
import org.bukkit.plugin.Plugin; | |
import org.bukkit.plugin.EventExecutor; | |
import java.util.function.Consumer; | |
public interface Events extends Listener, EventExecutor { |
This file contains 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 com.mynt.backend.alpha; | |
import sun.misc.Unsafe; | |
import java.lang.reflect.Field; | |
import java.nio.ByteBuffer; | |
import static java.lang.Long.SIZE; | |
This file contains 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
name: ${project.name} | |
version: ${project.version} | |
#Might need to change this depending on your package structure, but it's standard not to. | |
main: ${project.groupId}.${project.artifactId} |
This file contains 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 Pathfinder { | |
//boolean canStart() | |
default boolean a() { return false; } | |
//boolean canTick() | |
default boolean b() { return a(); } | |
//boolean canStop() | |
default boolean f() { return true; } | |
//void onStart() | |
default void c() {} |
This file contains 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 java.util.NoSuchElementException; | |
import org.bukkit.ChatColor; | |
import org.bukkit.scoreboard.Objective; | |
import org.bukkit.scoreboard.Team; | |
import org.bukkit.scoreboard.Scoreboard; | |
import org.bukkit.scoreboard.Score; | |
import static org.bukkit.Bukkit.getScoreboardManager; | |
import static org.bukkit.Bukkit.getServer; |
This file contains 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
typealias Event<Listener> = Toggled.(Listener) -> (Unit) | |
open class TreeEvent<Listener> : (Toggled, Listener) -> (Unit), Iterable<Listener> { | |
protected val listeners = TreeMap<Int, Listener>() | |
protected var index = 0 | |
override fun iterator() = listeners.values.iterator() | |
override fun invoke(scope: Toggled, listener: Listener) = scope.run { | |
val current = index++ |
This file contains 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 com.gitlab.avelyn.core.utilities; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Server; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.configuration.file.FileConfiguration; | |
import org.bukkit.generator.ChunkGenerator; | |
import org.bukkit.plugin.Plugin; | |
import org.bukkit.plugin.PluginDescriptionFile; |
This file contains 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
<repositories> | |
<repository> | |
<id>spigot-repo</id> | |
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | |
</repository> | |
</repositories> | |
<dependencies> | |
<dependency> | |
<groupId>org.spigotmc</groupId> |
This file contains 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
//Downloads the Spigot API but does not include NMS. | |
//Add the java plugin so gradle knows how to compile and create a jar. | |
plugins { id('java') } | |
group = 'me.exerosis.example' | |
version = '1.0.0' | |
repositories { | |
//Add the maven.org repository in case we additional depedencies. |
This file contains 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 com.esotericsoftware.kryo.Kryo; | |
import com.esotericsoftware.kryo.Serializer; | |
import com.esotericsoftware.kryo.io.Input; | |
import com.esotericsoftware.kryo.io.Output; | |
import org.bukkit.entity.Entity; | |
import org.bukkit.WorldCreator; | |
import org.bukkit.World; | |
import org.bukkit.entity.EntityType; | |
import org.bukkit.inventory.ItemStack; |
NewerOlder