Skip to content

Instantly share code, notes, and snippets.

@TerrorBite
TerrorBite / mcping.c
Last active July 18, 2020 22:41
MCPing Minecraft ping utility
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/time.h>
#include <iconv.h>
@TerrorBite
TerrorBite / HuntContest.md
Created November 24, 2012 01:54
Planning document for the HuntContest plugin

HuntContest

This plugin was heavily inspired by Matejdro's MonsterHunt plugin. It is a complete rewrite from the ground up, introducing a fairer and more advanced style of play that hopefully brings more fun.

Features

There are 3 play modes, depending how many players joined:

  • Singleplayer - Beat your high score to win!
  • This gamemode is activated if only one player is signed up for a hunt.
@TerrorBite
TerrorBite / gist:3615555
Created September 4, 2012 01:22 — forked from anonymous/gist:3615358
minmax
//This code works. Put in the commented out statements, doesn't work anymore.
#include<stdio.h>
#include<limits.h>
#include<ctype.h>
int main()
{
int number=0;
int min=INT_MAX;
@TerrorBite
TerrorBite / ChatListener.java
Created June 24, 2012 13:35
Player connection/chat/command logging plugin for Bukkit
package org.mcau.plugins.logmcau;
import java.util.logging.Logger;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
public class ChatListener implements Listener {
@TerrorBite
TerrorBite / DCPU.cpp
Created April 23, 2012 05:30
DCPU-16 emulator written in C++
#include "DCPU.h"
using namespace std;
DCPU::DCPU(void) {
// Allocate memory space
mem = new uint16_t[0x10000];
cout << "Allocated 128k memory" << endl;
}
@TerrorBite
TerrorBite / assembler.py
Created April 22, 2012 15:43
DCPU-16 Assembler written in Python
import struct, re, argparse
# This regex matches lines that look vaguely like assembly code
re_prelim = re.compile(r'(?:[A-Z]{3}|[a-z]{3})\s')
# This regex is used to parse the data from a line of assembly code
re_line = re.compile(
r'^(?:\S+\s+)?(?P<instr>[A-Z]{3}|[a-z]{3})\s+(?P<arga>[A-Za-z0-9_\[\]+]+)\s*(?:,\s*(?P<argb>[A-Za-z0-9_\[\]+]+))?'
)
@TerrorBite
TerrorBite / storage.yml
Created March 25, 2012 15:03
TradingPost storage format
storage:
==: net.lethargiclion.tradingpost.TradeStorage
currentId: 1
trades:
- ==: net.lethargiclion.tradingpost.TradeOffer
id: 0
owner: TerrorBite
status: open
timestamp: 2012-02-21T13:07:40.100Z
items: