Skip to content

Instantly share code, notes, and snippets.

@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:
@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 / 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 / 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 / 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 / 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 / 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>
<?php
/*
* Installation:
* require_once("extensions/MantisIntegration/MantisIntegration.php"); in LocalSettings.php
* update $mantisDBSERVER, $mantisDBUSER, $mantisDBUSERPW, $mantisDBNAME, $mantis_home
* Usage:
* <mantis>#bugid</mantis>
*
* @version 0.2 schke 2008-10-31
* -change data input from php implode of bugsite to direct database access
@TerrorBite
TerrorBite / gist:8311290
Last active January 2, 2016 13:39
Stuff for secret stuff
enum rarities {
VERY_COMMON,
COMMON,
LESS_COMMON,
RARE,
VERY_RARE,
EXTRA_RARE
}
// 50, 25, 15, 7, 2, 1
@TerrorBite
TerrorBite / homes.md
Last active January 2, 2016 16:19
How homes will work in Vanilla (completely doable in CH)

##The /home Command

This command won't actually do any teleporting. Instead, it will alias to /help home which will give them information on how to teleport.

##Teleporting home

To teleport home (actually, to the last bed they slept in - no /sethome), the player must possess an Ender Pearl and then throw it directly up into the sky. The player will be teleported home assuming they fulfil the following conditions:

  • The pearl must come down and strike within a few blocks of the player. This means they have to do it out in the open.
  • The player must not have moved since they threw the pearl.