Skip to content

Instantly share code, notes, and snippets.

# ---
# name: ParticleTest
# version: 1.0
# author: SpaceManiac
# commands:
# part:
# description: Particle testing
# ---
import quick
@SpaceManiac
SpaceManiac / CONTRIBUTING.md
Last active August 29, 2015 14:06
Draft of Glowstone contributing & PR handling guidelines

Contributing to Glowstone

Glowstone is a lightweight, open source Minecraft server written in Java. For those who wish to contribute, we encourage you to fork the repository and submit pull requests. Below you will find guidelines that will explain this process in further detail.

Quick Guide

  1. Create or find an issue on the issue tracker.
  2. Fork Glowstone if you haven't done so already.
  3. Create a branch dedicated to your change.
  4. Write code addressing your feature or bug.
@SpaceManiac
SpaceManiac / InvSerialize.java
Last active August 29, 2015 14:01
Serialization/deserialization of entire inventories
// Usage:
inv.setContents(deserializeAll(config.getMapList("xyz")));
config.set("xyz", serializeAll(inv.getContents()));
// Methods:
private ArrayList<Map<String, Object>> serializeAll(ItemStack[] contents) {
ArrayList<Map<String, Object>> items = new ArrayList<Map<String, Object>>();
if (contents == null) return items;
@SpaceManiac
SpaceManiac / chunk-send-event.txt
Last active November 13, 2017 17:35
Chunk Send Event / Send Chunk Update API rough sketch & notes
Chunk Send Event / Send Chunk Update API rough sketch & notes
<Wolvereness> SpaceManiac: 1/3 of the problem is addresssing where to hook this, 1/3 of the problem
is addressing how to have a mutable block of memory with sensible API, 1/3 of the problem is
address performance concerns like bulk and compression
JIRA Ticket: BUKKIT-5642 Chunk Send Event and Methods
Vaguely related tickets:
BUKKIT-4114: Fast mass block update API
@SpaceManiac
SpaceManiac / BlockPlacementHandler.java
Created February 28, 2014 00:29
Comment on BlockPlacementHandler regarding double-packet behavior
/**
* The client sends this packet for the following cases:
* Right click air:
* - Send direction=-1 packet for any non-null item
* Right click block:
* - Send packet with all values filled
* - If client DOES NOT expect a block placement to result:
* - Send direction=-1 packet (unless item is null)
*
* Client will expect a block placement to result from blocks and from
@SpaceManiac
SpaceManiac / ParticleTestPlugin.java
Created February 6, 2014 03:26
Testing materials for Bukkit Particles PR
package particletest;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.material.MaterialData;
@SpaceManiac
SpaceManiac / bytebuf-leaks.log
Created January 31, 2014 07:47
Trace of ByteBuf leaks in flow-networking in Glowstone usage.
"C:\Program Files\Java\jdk1.7.0_25\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:52963,suspend=y,server=n -Dio.netty.leakDetectionLevel=advanced -javaagent:C:\Users\Tad\.IdeaIC13\system\groovyHotSwap\gragent.jar -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_25\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\jaccess
@SpaceManiac
SpaceManiac / varint.java
Last active January 3, 2016 17:49
VarInt reading/writing from Glowstone
/**
* The bit flag indicating a varint continues.
*/
public static final byte VARINT_MORE_FLAG = (byte) (1 << 7);
/**
* Read a protobuf varint from the buffer.
* @param buf The buffer.
* @return The value read.
*/
@SpaceManiac
SpaceManiac / champs.py
Created July 23, 2013 00:27
League of Legends game log analyzer
# -*- coding: utf-8 -*-
# champs.py
from __future__ import print_function
import os, os.path
import sys
import re
# log processing
@SpaceManiac
SpaceManiac / utils.py
Created December 27, 2012 11:33
Utils.py from Profile Master for use in formats
# utils.py
# common utilities for profile master format files
from construct import *
from PyQt4 import QtCore, QtGui
import functools
# qt utilities
class Dialog(QtGui.QDialog):