Skip to content

Instantly share code, notes, and snippets.

View astei's full-sized avatar

Andrew Steinborn astei

View GitHub Profile
@astei
astei / creation.md
Last active May 3, 2018 22:18
When the world was created, and when it will end, from the perspectives of others

Fundamentalist Christians

The world was created by God 6,000 to 10,000 years ago over a period of a week. And in His hands, it was perfect.

Last Thursdayism

The world was created last Thursday. It just looks like it’s billions of years old.

Geologist

The world was created approximately 4.3 billion years ago. That’s the age of the oldest rocks we’ve found.

Astronomist

@astei
astei / velocity.toml
Created July 27, 2018 15:50
Proposed Velocity configuration
# This is Velocity's default configuration.
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577.
bind = "0.0.0.0:25577"
# What should be the MOTD? Legacy color codes and JSON are accepted.
motd = "&3A Velocity Server"
# What should we display for the maximum number of players? (Velocity does not support a cap
# on the number of players online.)
/**
* A linked list implementation.
*
* Iteration is done by deferencing the head (or tail) of the list.
* Insertions at the front or back of the list will be O(1) (which
* is the only insertion operation supported), iteration is O(n),
* and removal is O(n) (unless the node being removed is the head or
* tail, which is O(1)).
*
* This implementation is a doubly-linked list. It is not thread safe.
func getFlags(desiredHeap int64) string {
asKb := desiredHeap / units.KiB
// the following is specific to OpenJ9 and is based on Aikar's flags:
// https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
// The equivalent of -XX:G1NewSizePercent/-XX:G1MaxNewSizePercent in OpenJ9's gencon policy is -Xmns/-Xmnx.
// We have to manually compute these values ourselves. By default, the gencon policy assumes 25% of Xms, which is
// simply not sufficient for Minecraft (and Aikar can tell you).
xmns := asKb / 2
Creeper
Good man
Then we go back to the mine
Turn our cockroaches aside
On the other hand
This task is exhausting
I hope to find some diamonds tonight.
Diamond tonight
package com.velocitypowered.proxy.protocol.util;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.IOException;
/**
* A wrapper around {@link io.netty.buffer.ByteBuf} that implements the exception-free
package us.myles.ViaVersion.bukkit.handlers;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.bukkit.util.NMSUtil;
import us.myles.ViaVersion.exception.CancelException;
---- Minecraft Crash Report ----
// I blame Dinnerbone.
Time: 11/25/19 7:04 PM
Description: keyPressed event handler
java.lang.StringIndexOutOfBoundsException: String index out of range: 10
at java.lang.String.substring(String.java:1963)
at com.mojang.brigadier.suggestion.Suggestion.apply(Suggestion.java:44)
at dbl$a.b(SourceFile:581)
From 06233f3598074f1287db92610b96bb5b88b21c4c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 27 Mar 2019 21:58:55 -0400
Subject: [PATCH] Backport Server Tick Events
Fires event at start and end of a server tick
---
.../event/server/ServerTickEndEvent.java | 56 +++++++++++++++++++
.../event/server/ServerTickStartEvent.java | 29 ++++++++++
2 files changed, 85 insertions(+)
/*
* Configurate
* Copyright (C) zml and Configurate contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*