Skip to content

Instantly share code, notes, and snippets.

@tehbeard
tehbeard / gist:1150541
Created August 17, 2011 00:43
YML backend storage for BeardStats
stats:
players:
Tehbeard:
teleports: 20
PLACE_GRASS: 8
PLACE_REDSTONE_TORCH_ON: 1
logins: 7
kicks: 1
getServer().getPluginManager().registerEvent(Type.BLOCK_BREAK, sbl,Priority.Monitor,this);
getServer().getPluginManager().registerEvent(Type.BLOCK_PLACE, sbl,Priority.Monitor,this);
//player listener
StatPlayerListener spl = new StatPlayerListener();
getServer().getPluginManager().registerEvent(Type.PLAYER_CHAT, spl,Priority.Monitor,this);
getServer().getPluginManager().registerEvent(Type.PLAYER_DROP_ITEM, spl,Priority.Monitor,this);
getServer().getPluginManager().registerEvent(Type.PLAYER_FISH, spl,Priority.Monitor,this);
getServer().getPluginManager().registerEvent(Type.PLAYER_INTERACT_ENTITY, spl,Priority.Monitor,this);
getServer().getPluginManager().registerEvent(Type.PLAYER_INTERACT, spl,Priority.Monitor,this);
@tehbeard
tehbeard / gist:1166394
Created August 23, 2011 20:22
json php functions
function json_decode ($json)
{
$json = str_replace(array("\\\\", "\\\""), array("\", """), $json);
$parts = preg_split("@(\"[^\"]*\")|([\[\]\{\},:])|\s@is", $json, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
foreach ($parts as $index => $part)
{
if (strlen($part) == 1)
{
switch ($part)
{
tracks:
veteran:
nobility:nobilityv
artisan:artisanv
royalty:royaltyv
vip:vetvip
builder:veteran
default:builder
Options FollowSymLinks
RewriteEngine On
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
2011-10-08 08:17:03 [INFO] [FalseBook IC] Loaded selftriggered ICs: 28 done
2011-10-08 08:17:03 [INFO] [FalseBook IC] Loaded selftriggered ICs: 20 failed
2011-10-08 08:17:03 [INFO] [FalseBook IC] List of failed ICs:
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 2, [MC0272] @ Location - World: survival , X: -2590 , Y: 70 , Z: -2820
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 3, [MC0271] @ Location - World: survival , X: 2270 , Y: 51 , Z: 5202
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 4, [MC0272] @ Location - World: survival , X: -361 , Y: 64 , Z: 1155
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 5, [MC0272] @ Location - World: survival , X: -363 , Y: 64 , Z: 1155
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 6, [MC0272] @ Location - World: survival , X: 2694 , Y: 71 , Z: 2358
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 13, [MC0420] @ Location - World: survival , X: -355 , Y: 64 , Z: 1159
2011-10-08 08:17:03 [INFO] [FalseBook IC] ID: 14, [MC0271] @ Location - World: survival , X: -2806 , Y: 67 , Z: -3
///YML FILE EXTRACT
ach:
database:
username: "beardstat"
host: "localhost"
type: mysql
password: *******
database: "stats"
ach:
database:
username: "beardstat"
host: "localhost"
type: mysql
password: "******"
database: "stats"
msg:
person: "Achievement Unlocked: <ACH>"
broadcast: "<PLAYER> Unlocked: <ACH>"
{ach=MemorySection[path='ach', root='YamlConfiguration'],
ach.database=MemorySection[path='ach.database', root='YamlConfiguration'],
ach.database.username=beardstat, ach.database.host=localhost,
ach.database.type=mysql, ach.database.password=beardstat,
ach.database.database=stats, ach.msg=MemorySection[path='ach.msg', root='YamlConfiguration'],
ach.msg.person=Achievement Unlocked: <ACH>,
ach.msg.broadcast=<PLAYER> Unlocked: <ACH>,
ach.msg.send=MemorySection[path='ach.msg.send',
root='YamlConfiguration'], ach.msg.send.person=true,
ach.msg.send.broadcast=true,
@tehbeard
tehbeard / gist:1292348
Created October 17, 2011 10:24
MC RCON (1.9pr4)
<?php
/*
RCON remote console class, modified for minecraft compability by Tehbeard.
!!!YOU MUST CONFIGURE RCON ON YOUR MINECRAFT SERVER FOR THIS TO WORK
AT TIME OF WRITING ONLY 1.9pr4+ HAVE BUILTIN RCON SUPPORT!!!
Example Code:
============
include_once("rcon.class.php"); //Include this file