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
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; |
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 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>) { |
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.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); |
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 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.*; |
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 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; |
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 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) |
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.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; |
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 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") |
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
---- 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) |
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
fun main(args: Array<String>) { | |
val colors = listOf( | |
"#ff0000", | |
"#ffff00", | |
"#0000ff", | |
"#ff8000", | |
"#00ff00" | |
) | |
val sb = StringBuilder() |
OlderNewer