Skip to content

Instantly share code, notes, and snippets.

import argparse
parser = argparse.ArgumentParser(description='maizzle izzle ain\'tizzle beizzle lostizzle.\
Itizzle justizzle tookizzle itselfizzle onizzle aizzle breakizzle \
tizzle Newizzle Yorkizzle tizzle seeizzle thizzle bigizzle cityizzle')
parser.add_argument('izzleitup', default='fo shiz', help='You best be needin\' a lot of it.', nargs='*')
parser.add_argument('-d', '--debug', action='count', help='various debug shizzle')
args=parser.parse_args()
if(args.debug>0){
@nightpool
nightpool / PlayerSampleTestPlugin.java
Created December 12, 2013 03:39
Test class for Server list Player sample
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
SkullMeta sm = ((SkullMeta) skull.getItemMeta()).clone();
sm.setOwner(player.getName());
skull.setItemMeta(sm);
@nightpool
nightpool / RuntimeCommands.java
Created December 26, 2013 04:10
Runtime Bukkit Commands
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandMap;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.SimplePluginManager;
fn random_num<T: num::NumCast + num::Num>(n: T) -> T {
let rand::Closed01(val) = random::<rand::Closed01<f32>>();
num::cast(val * num::cast(n).unwrap()).unwrap()
}
int main() {
// So this is my main function
// it gets called automatically, but otherwise its no different then any other function
int number_of_tates = 0; // I take inspiration from my enviroment ;)
number_of_tates = work_on_song(number_of_tates); // Now I'm going to call my function, which I define down below.
// It takes an integer, the old amount, and returns an integer (the new amount).
// After calling the function, I assign it to the variable "number_of_tates",
int main() {
// So this is my main function
// it gets called automatically, but otherwise its no different then any other function
int number_of_tates = 0; // I take inspiration from my enviroment ;)
number_of_tates = work_on_song(number_of_tates); // Now I'm going to call my function, which I define down below.
// It takes an integer, the old amount, and returns an integer (the new amount).
// After calling the function, I assign it to the variable "number_of_tates",
int main() {
// So this is my main function
// it gets called automatically, but otherwise its no different then any other function
int number_of_tates = 0; // I take inspiration from my enviroment ;)
number_of_tates = work_on_song(number_of_tates); // Now I'm going to call my function, which I define down below.
// It takes an integer, the old amount, and returns an integer (the new amount).
// After calling the function, I assign it to the variable "number_of_tates",
// overwriting the old value.
@nightpool
nightpool / ColorConversationPlugin.java
Created March 25, 2014 05:56
Test plugin for BUKKIT-5487
package net.nightpool.bukkit.ccp;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.conversations.Conversable;
import org.bukkit.conversations.Conversation;
import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
@nightpool
nightpool / tempate.xml
Created May 2, 2014 20:44
Bukkit template pom
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>{{package name}}</groupId>
<artifactId>{{name}}</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name></name>
<description></description>
<repositories>
<repository>