Skip to content

Instantly share code, notes, and snippets.

import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class AIUtils {
private static Field fromMobSpawner;
private static Method getHandle;
@vemacs
vemacs / vcrules.md
Last active November 22, 2015 21:26

VikkCraft Rules

There has been a bit of confusion between Staff and Players about what is acceptable and what isn't on VikkCraft. Whether it be right here on our forums or on the server itself, we do have rules that you all must follow in order to keep VikkCraft a friendly place for everyone!

Server Rules

No Hacked Clients

No use of hacked clients or any client for that matter that gives you an advantage over anyone else. This also extends to using external programs that interact with the Minecraft client to provide an unfair advantage. Examples of this include macros or autoclickers or increase your click speed. If we have evidence of you doing this on our server you will be banned. If you see anyone in game who you think is using a hacked client then please either notify a staff member to take a look or if you can, record the offender in action and post a player report here.

No Trolling

We consider a few things to be trolling here at VikkCraft, let's go through it.

SimpleDateFormat inputFormat = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
SimpleDateFormat outputFormat = new SimpleDateFormat("dd MMM yyyy 'at' hh:mm:ss");
@Data
public class NameMatch {
private final String username;
private final Date date;
@Override
@SuppressWarnings("deprecation")
private UUID getIdFromBukkit(String name) {
Bukkit.getLogger().warning("Using potentially blocking Bukkit UUID lookup for: " + name);
UUID uuid = Bukkit.getOfflinePlayer(name).getUniqueId();
// If the uuid matches the fake one from Bukkit, return it as fake
if (uuid.equals(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)))) {
return null;
} else {
return uuid;
}
@vemacs
vemacs / debian-install-zram.sh
Created December 4, 2015 17:16
Install zRAM on Debian(8)
#!/bin/bash
#
not_root() {
echo "ERROR: You have to be root to execute this script"
exit 1
}
zram_exists() {
echo "ERROR: /etc/init.d/zram already exists"
#!/bin/sh
# Install zram
wget -O - https://gist.githubusercontent.com/vemacs/6ec150e86329f3151b52/raw/af5d82461e62ed1033b2a58e0e960eb3bea8d4f1/debian-install-zram.sh | bash
# Other packages
apt-get install -y netfilter-persistent git tmux emacs-nox htop python-pip python-dev libssl-dev sudo
# Java 8
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
#!/bin/sh
sudo apt-get install -y cpufrequtils
numcores=$(expr `cpufreq-info | grep -c driver` - 1)
for f in `seq 0 $numcores`
do
sudo cpufreq-set -g performance -c $f
done
$status = get-service -name "XTU3SERVICE" | Select-Object {$_.status} | format-wide
if ($status -ne "Running") { start-service -name "XTU3SERVICE"}
& 'C:\Program Files (x86)\Intel\Intel(R) Extreme Tuning Utility\Client\XTUCli.exe' -t -id 34 -v -100.58593750000
sleep 3
& 'C:\Program Files (x86)\Intel\Intel(R) Extreme Tuning Utility\Client\XTUCli.exe' -t -id 83 -v -100.58593750000
sleep 4
stop-process -id $PID -force
package org.arkhamnnetwork.libs.item;
import net.minecraft.server.v1_8_R3.NBTTagCompound;
import net.minecraft.server.v1_8_R3.NBTTagList;
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
public class Glow {
public static ItemStack addGlow(ItemStack item){
net.minecraft.server.v1_8_R3.ItemStack nmsStack = CraftItemStack.asNMSCopy(item);
Field listenerMap;
Runnable relogRunnable;
ErrorHandler errorHandler;
public void loadSkype() {
try {
listenerMap = SkypeEventDispatcher.class.getDeclaredField("listeners");
listenerMap.setAccessible(true);
} catch (NoSuchFieldException e) {
e.printStackTrace();