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 / ChunkStateFix.patch
Last active Jan 10, 2021
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 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/')
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/')
View light.patch
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java
index 721f86a5405..e8223670017 100644
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
@@ -17,9 +17,10 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
private final ThreadedMailbox<Runnable> b; ThreadedMailbox<Runnable> mailbox; // Paper
// Paper start
private static final int MAX_PRIORITIES = PlayerChunkMap.GOLDEN_TICKET + 2;
+ private final java.util.concurrent.ConcurrentLinkedQueue<Runnable> priorityChanges = new java.util.concurrent.ConcurrentLinkedQueue<>();
View redirect_out_of_order.patch
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
index 2d512aa4f9a..34454a8efa6 100644
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Maps;
import com.mojang.brigadier.ParseResults;
View optimizeblock.diff
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index b39554faf23..2c128feb0f8 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -72,6 +72,7 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
return this.c != null ? this.c.d : this.getBlock().b(this, iblockaccess, blockposition);
}
+ public final int getBlockedLight() { return this.c.e; } // Paper - OBFHELPER - trimmed as its cached
public int b(IBlockAccess iblockaccess, BlockPosition blockposition) {
View gist:b70f65e0c55ca447ba750ef9d5640f78
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index 2c128feb0f8..b39554faf23 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -72,7 +72,6 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
return this.c != null ? this.c.d : this.getBlock().b(this, iblockaccess, blockposition);
}
- public final int getBlockedLight() { return this.c.e; } // Paper - OBFHELPER - trimmed as its cached
public int b(IBlockAccess iblockaccess, BlockPosition blockposition) {
View PooledObjects.java
package com.destroystokyo.paper.util.pooled;
import net.minecraft.server.MCUtil;
import org.apache.commons.lang3.mutable.MutableInt;
import java.util.ArrayDeque;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
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/')