Skip to content

Instantly share code, notes, and snippets.

@vemacs
vemacs / NoAI.java
Last active January 15, 2023 16:48
View NoAI.java
private static String serverVersion;
private static Method getHandle;
private static Method getNBTTag;
private static Class<?> nmsEntityClass;
private static Class<?> nbtTagClass;
private static Method c;
private static Method setInt;
private static Method f;
public static void setAiEnabled(Entity entity, boolean enabled) {
View gotty.service
# systemd unit file
# place in /etc/systemd/system
# systemctl enable gotty.service
# systemctl start gotty.service
[Unit]
Description=Gotty Web Terminal
After=network.target
[Service]
@vemacs
vemacs / Tutorial.md
Last active July 29, 2022 10:00
Instructions for setting up a Spigot server using mark2 on a fresh Ubuntu Server 14.04 LTS install.
View Tutorial.md

This guide is outdated

Please check out the official installation guide here: https://github.com/mark2devel/mark2/blob/master/INSTALL.md

Prerequisites

  • a vswap OpenVZ VPS or a KVM/Xen/VMware VPS with Ubuntu Server 14.04 LTS installed (architecture doesn't matter), or a dedicated server
  • patience and a willingness to learn
  • approximately 10 minutes of time
@vemacs
vemacs / compton.conf
Last active June 25, 2022 17:11
Reasonable compton.conf (fixes shadows in the stock desktop environment) for Xubuntu 16.04
View compton.conf
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
@vemacs
vemacs / scripts.txt
Created June 5, 2013 01:29
easy mark2 scripts.txt setup
View scripts.txt
# Saves the map every 15 minutes
*/15 * * * * ~save
# Restarts Spigot every 24 hours
0 12 * * * ~restart
# Warns 5 minutes before restart
55 11 * * * /say Server restarting in 5 minutes
@vemacs
vemacs / gist:8869a099bae834cf7f70
Created November 26, 2014 20:07
Drama generator output
View gist:8869a099bae834cf7f70
Alblaka removes compatibility between Too Many Items and BuildCraft by request of Direwolf20
SpaceToad plays OpenPeripheral on Twitch
MachineMuse confirms that OpenBlocks should be less like Chisel
kirindave threatens to complain about Shukaro until they remove Natura from Resonant Rise
nallar adds compatibility between ExtraBiomesXL and VoxelMap by request of kakermix
Sengir denies OpenPeripheral is faster than RedPower 3
MamiyaOtaru steals code from Highlands
Alblaka decides to base their entire modpack on Pixelmon
Vswe says PowerCrystals did not steal 5 lines of code from RealSketch
RWTema tweets tgame14 stole 5 lines of code from Reika
@vemacs
vemacs / wemuxcord.md
Last active January 31, 2020 19:21
Simple guide for using wemux for BungeeCord
View wemuxcord.md

I really should script a wrapper or something over this, but it's so simple, there's no real point.

  1. Install wemux (install git if your distro doesn't have it):

     sudo apt-get install git tmux
     sudo git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux
     sudo ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux
     sudo cp /usr/local/share/wemux/wemux.conf.example /usr/local/etc/wemux.conf
     sudo sed -i -e s/change_this/minecraft/g /usr/local/etc/wemux.conf
    
  2. Create a separate minecraft user if you care, and add their home dir to a group called mcadmin:

View SimpleScoreboard.java
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;
import java.lang.reflect.Constructor;
View OfflinePlayerWorkaround.java
@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;
}
View Triangle.java
/*
Enter height of triangle: 10
*
**
***
****
*****
******
*******
********