Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:
Powered by Steak

Daniel Ennis aikar

:atom:
Powered by Steak
View GitHub Profile
View paper.yml
# This is the main configuration file for Paper.
# As you can see, there's tons to configure. Some options may impact gameplay, so use
# with caution, and make sure you know what each option does before configuring.
#
# If you need help with the configuration or have any questions related to Paper,
# join us in our IRC channel.
#
# IRC: #paper @ irc.spi.gt ( http://irc.spi.gt/iris/?channels=paper )
# Wiki: https://paper.readthedocs.org/
# Paper Forums: https://aquifermc.org/
@aikar
aikar / macros.conf
Last active May 30, 2022
Example of Apache mod_macro
View macros.conf
<Macro Site $domain>
Use Log $domain
Use ForceDomain $domain
Use GrantAccess /
</Macro>
<Macro Domain $domain>
ServerName $domain
ServerAlias www.$domain
</Macro>
View 0001-Async-Chunk-Loading-and-Generation.patch
From da976f7ed15b762ef138b55b9c711184363cf364 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 30 Aug 2018 22:38:31 -0400
Subject: [PATCH] Async Chunk Loading and Generation
---
.../java/net/minecraft/server/ChunkMap.java | 3 +-
.../minecraft/server/ChunkProviderServer.java | 24 +-
.../minecraft/server/ChunkRegionLoader.java | 2 +-
.../minecraft/server/DataPaletteBlock.java | 4 +
@aikar
aikar / apatch.sh
Created Oct 19, 2015
apt-get install wiggle
View apatch.sh
#!/bin/bash
applied=$(echo $1 | sed 's/.patch$/-applied\.patch/g')
if [ "$1" == "--reset" ]; then
git am --abort
git reset --hard
git clean -f
exit 0
fi
if [ ! -f "$1" ]; then
echo "No patch found $1";
@aikar
aikar / nodejs-minecraft-colors.js
Created Jul 29, 2015
node.js / javascript Methods to convert section symbol minecraft color codes into Bash Color sequences, for use in shell output. Credits to mcrcon for the color code map.
View nodejs-minecraft-colors.js
var colors = {
0: "\033[0;30m", /* 00 BLACK 0x30 */
1: "\033[0;34m", /* 01 BLUE 0x31 */
2: "\033[0;32m", /* 02 GREEN 0x32 */
3: "\033[0;36m", /* 03 CYAN 0x33 */
4: "\033[0;31m", /* 04 RED 0x34 */
5: "\033[0;35m", /* 05 PURPLE 0x35 */
6: "\033[0;33m", /* 06 GOLD 0x36 */
7: "\033[0;37m", /* 07 GREY 0x37 */
8: "\033[1;30m", /* 08 DGREY 0x38 */
@aikar
aikar / ChunkStateFix.patch
Last active Jan 18, 2022
Fixes the dupe exploit caused by chunks being oversized more than the RegionFile format can support. Patch is licensed under MIT or Public Domain. Anyone (hopefully Mojang) is free to use it.
View ChunkStateFix.patch
commit ba4afed44f76c2d0b8ba63439ecc28b6c2212d05
Author: Aikar <aikar@aikar.co>
Date: Fri Feb 15 01:08:19 2019 -0500
Allow Saving of Oversized Chunks
The Minecraft World Region File format has a hard cap of 1MB per chunk.
This is due to the fact that the header of the file format only allocates
a single byte for sector count, meaning a maximum of 256 sectors, at 4k per sector.
View Serialization.java
/*
* Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.util.serialization;
import com.empireminecraft.util.Util;
View apatch
#!/bin/bash
noapply=1
if [ $1 == "--noapplied" ]; then
noapply=1
shift
fi
applied=$(echo $1 | sed 's/.patch$/-applied\.patch/g')
if [ "$1" == "--reset" ]; then
git am --abort
git reset --hard
View Base64.java
package com.empireminecraft.util;
import java.util.Arrays;
/**
* A very fast and memory efficient class to encode and decode to and from BASE64 in full accordance
* with RFC 2045.<br><br>
* On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is about 10 times faster
* on small arrays (10 - 1000 bytes) and 2-3 times as fast on larger arrays (10000 - 1000000 bytes)
* compared to <code>sun.misc.Encoder()/Decoder()</code>.<br><br>
View checkout-pr.sh
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "$0 <prID>"
exit 1;
fi
repo=$(git remote get-url origin | sed -E 's/(.*@)?github.com(:|\/)//g' | sed 's/.git$//g')
data=$(curl -q https://api.github.com/repos/$repo/pulls/$1 2>/dev/null)
url=$(echo -e "$data" | grep --color=none ssh_url | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g')
ref=$(echo -e "$data" | grep --color=none '"head":' -A 3 | grep ref | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g')
prevbranch=$(\git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')