Skip to content

Instantly share code, notes, and snippets.

public static class ActionBlock
{
private static readonly Dictionary<string, List<Action<Level, Player>>> Hooks = new Dictionary<string, List<Action<Level, Player>>>();
private static readonly ReaderWriterLockSlim RwLock = new ReaderWriterLockSlim();
// returns true if an interaction took place
public static bool InteractHook(this Block block, Level level, Player player, BlockFace face)
{
string hash = GetHash(level, block);
List<Action<Level, Player>> hooks;
package net.minikloon.glowbuster
import com.flowpowered.network.util.ByteBufUtils.writeVarInt
import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled
import net.glowstone.net.codec.handshake.HandshakeCodec
import net.glowstone.net.message.handshake.HandshakeMessage
import java.net.Socket
fun main(args: Array<String>) {
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class Main {
private static Set<Character> vowels = new HashSet<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));
public static void main(String[] args) {
String input = "abcdefghijklmnopqrstuvwxyz";
int vowelsCount = countVowels(input);
package me.rwd.funevents.items;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.*;
package net.minikloon;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@Minikloon
Minikloon / Usage.kt
Created March 24, 2017 12:17
Vertx async wrappers
import io.vertx.core.AbstractVerticle
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
class VerticleWithAsync : AbstractVerticle() {
override fun start() {
val eb = vertx.eventBus()
launch(CurrentVertx) { // requires to be inside a vertx-supplied thread
println("ayy")
delay(1000)
@Minikloon
Minikloon / StateInJava.java
Created April 30, 2017 21:40
StateInJava
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
import java.time.Instant;
public abstract class StateInJava {
private static final Logger logger = LoggerFactory.getLogger(StateInJava.class);
private boolean started = false;
package net.minikloon.worktime
import edu.nyu.cs.javagit.api.DotGit
import edu.nyu.cs.javagit.api.commands.GitLogResponse
import java.text.SimpleDateFormat
import java.util.*
val gitDateFormat = SimpleDateFormat("EEE MMM d HH:mm:ss yyyy Z")
fun main(args: Array<String>) {
val git = DotGit.getInstance("Skywars")
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 14/06/18 6:29 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at ciq.P(SourceFile:2151)
at dix.Y_(SourceFile:26)
at ciq.m(SourceFile:1252)
@Minikloon
Minikloon / Colors.kt
Created July 13, 2018 18:28
Color distribution formatting
fun main(args: Array<String>) {
val colors = listOf(
"#ff0000",
"#ffff00",
"#0000ff",
"#ff8000",
"#00ff00"
)
val sb = StringBuilder()