Skip to content

Instantly share code, notes, and snippets.

package me.YourName.tutorial.utils;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@rbrick
rbrick / claims.json
Created October 16, 2014 20:43
Team claim format. Contains two possible formats: One the claims are stored in the team file, the other it is stored in a separate file that stores a serialized TeamClaim object
{
"team_claims": [
{
"owning_team": "Xetha",
"maxX": 10,
"minX": -10,
"maxY": 256,
"minY": 0,
"maxZ": 10,
"minZ": -10,
@rbrick
rbrick / CommandContext.java
Created October 22, 2014 21:02
Improvement ideas for Zeus
public class CommandContext<T extends CommandSender> {
}
@rbrick
rbrick / NameTahgMinified.java
Last active August 29, 2015 14:08
A simple class that lets you edit players name tags using the bukkit api
/**
* Created by Ryan on 11/2/2014
* <p/>
* Project: NameTahg
*
* About: This is a minified version of NameTahg. This contains everything needed in one class.
* You can then shade this class into your plugin for any of your needs with ease.
* Enjoy, rbrick :)
*/
public class NameTahgMinified {
@rbrick
rbrick / Reflection.java
Created November 3, 2014 02:59
Reflection Utilities
/**
* Created by Ryan on 11/2/2014
* <p/>
* Project: Phenomenon
*
* About: Various reflection utilities created by @rbrick(Ryan)
*/
public class Reflection {
private static String VERSION = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
@rbrick
rbrick / ReflectionUtils.java
Created December 1, 2014 04:46
Tab & Chat utils for 1.8
package me.rbrickis.testing;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
@rbrick
rbrick / Archer.gy
Created January 15, 2015 06:36
AdvKits Archer Kit
import com.breakmc.kitpvp.AbstractKit
import com.breakmc.kitpvp.Action
import com.breakmc.kitpvp.utils.Utils
import org.bukkit.ChatColor
import org.bukkit.Material
import org.bukkit.inventory.ItemStack
import org.bukkit.potion.PotionEffect
public class Archer extends AbstractKit {
@rbrick
rbrick / Binder.java
Last active August 29, 2015 14:24
Parse strings and inject them as parameters into methods
public interface Binder<B, T> {
Binder<B, T> bind(B bind);
void to(T to);
}
@rbrick
rbrick / Hello.java
Created November 11, 2015 04:00
Something that does something that i think looks cool
public class Hello {
public static void main(String[] args) {
Grid grid = new Grid(9);
int fixedGridSize = grid.getSize() - 1;
for (int i = 0; i < grid.getSize(); i++) {
grid.set(i, i, 1);
grid.set(i, fixedGridSize - i, 1);
@rbrick
rbrick / JavaPGP.java
Created January 20, 2016 20:57
Simple Java implementation of PGP (Pretty Good Privacy)
import javax.crypto.Cipher;
import java.nio.ByteBuffer;
import java.security.GeneralSecurityException;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;