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.nio.charset.StandardCharsets; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Base64; | |
public final class ChannelPasswordTest { | |
private static final String PASSWORD = "Testificate"; | |
private static final String KEYPAIR = "MG0DAgeAAgEgAiBHF7Me8LnrIDDDs+M+7HzWOB6GlVBCICOD82dH3q1LDQIgGP2zYHxKbvA7NvCk2sLXr3k/+fHR+RNNGaNaUCPZ0jQCIAOR+91qkDvwc3nZ7yTrVwPBMaoynnqb5AP1x2HWpIP9"; | |
private static final String TARGET = "2YalQTjyjAY728jPorU9A36YLEI="; |
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
// Default package for convenience | |
// package me.firedroide.einf.crypto; | |
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.nio.charset.Charset; | |
import java.util.Scanner; |
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 class EventManager { | |
private interface EventFactory { | |
TS3Event createEvent(HashMap<String, String> eventData); | |
} | |
/* | |
* Single-line EventFactory | |
*/ | |
private static final HashMap<String, EventFactory> EVENT_FACTORIES_1 = new HashMap<String, EventFactory>() {{ |
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
private static final boolean seesMoon(LivingEntity e) { | |
final BlockIterator bi = new BlockIterator(e.getWorld(), e.getEyeLocation().toVector(), | |
e.getLocation().getDirection(), 0.0, 200); | |
while (bi.hasNext()) { | |
final Block block = bi.next(); | |
if (block.getType() != Material.AIR) { | |
if (block.getType() != Material.BEDROCK || bi.hasNext()) { | |
return false; | |
} |