Skip to content

Instantly share code, notes, and snippets.

@14mRh4X0r
14mRh4X0r / gist:863048
Created March 9, 2011 21:29
Fix for players being able to issue server commands.
diff --git a/src/Player.java b/src/Player.java
index dd52edc..d9ca468 100644
--- a/src/Player.java
+++ b/src/Player.java
@@ -712,7 +712,7 @@ public class Player extends HumanEntity implements MessageRe
log.info(getName() + " created a lighter!");
giveItem(259, 1);
}
- } else if ((command.startsWith("/#")) && (etc.getMCServer().f.g(get
+ } else if ((command.startsWith("/#")) && (etc.getMCServer().f.h(get
/** The {@code BaseCommand} that's handling the command */
private static final BaseCommand tpto = new BaseCommand(
"[x] [y] [z] - Teleports you to the given coordinates",
"Usage: /tpto [x] [y] [z]", 4, 5) {
@Override
void execute(MessageReceiver caller, String[] split) {
Player toWarp;
if (split.length == 5) {
if ((toWarp = etc.getServer().matchPlayer(split[4])) == null) {
caller.notify("Could not find player " + split[4]);
@14mRh4X0r
14mRh4X0r / ServerController.sh
Created November 4, 2011 09:17
Linux script for ServerControl
#!/bin/bash
while [ -e restart.txt ]; do
rm restart.txt
java -Xms1024M -Xmx1024M -jar CanaryMod.jar nogui
done
@14mRh4X0r
14mRh4X0r / Hooked.java
Created December 11, 2011 17:00
General class to call custom hooks, by Nijikokun
/**
* Hooked.java
* <br><br>
* Controls custom hook information by easily helping you figure out what is what without recieving errors on the matter.
*
* @author Nijikokun <nijikokun@gmail.com>
*/
public class Hooked {
public Hooked() {
@14mRh4X0r
14mRh4X0r / ff_first.patch
Created May 1, 2012 20:12
Patch for MCP to only check for wine when necessary
diff --git a/runtime/commands.py b/runtime/commands.py
index f497962..62ec33a 100644
--- a/runtime/commands.py
+++ b/runtime/commands.py
@@ -248,24 +248,30 @@ class Commands(object):
self.has_jad = False
self.has_ff = False
self.has_astyle = False
+
+ self.fernflower = os.path.normpath(self.config.get('COMMANDS', 'Fernflower'))
@14mRh4X0r
14mRh4X0r / fields.sh
Created November 21, 2012 11:28
Files for extracting obfuscation info from MCP
#!/bin/bash
# Debug
function debug() {
oldopts="$-"
function on_exit() {
[[ "$oldopts" =~ .*x.* ]] && set +x
}
set -x
trap on_exit EXIT
function sl () { ls "$@" | perl -lpe "\$_ = reverse" | while read; do printf "%${COLUMNS}s" "$REPLY"; done; }
@14mRh4X0r
14mRh4X0r / watch_anyway.js
Last active June 18, 2022 18:02
Script to replace a youtube.com video with the embed version. Useful when youtube.com complains about the lack of Flash, to get it in HTML5 anyway (hence "watch_anyway.js")
/*
* Copyright © 2013 Willem Mulder
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
(function() {
@14mRh4X0r
14mRh4X0r / filter-prefixmsg.py
Last active December 16, 2015 05:58
Python module for XChat/HexChat to filter messages to @#[channel] into their own tab/window
import hexchat
__module_name__ = "Filter prefix-channel messages"
__module_version__ = "0.3.1"
__module_description__ = "Places messages to [prefix]#[channel] in their own tab"
def filter_atmsg(word, word_eol, userdata, attrs):
if len(word[2]) >= 2 and word[2][1] == '#' and word[2][0] != '#':
user = word[0]
bangind = user.find("!")
@14mRh4X0r
14mRh4X0r / fix_chunks.py
Created July 1, 2014 08:13
Python script to fix Minecraft 14w26a/b snapshots. Needs https://github.com/mcedit/pymclevel to run
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# Unbuffer stdout
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
print "Loading world...",
from pymclevel import mclevel