Skip to content

Instantly share code, notes, and snippets.

@PaulBGD
PaulBGD / FuzzySearch.java
Last active December 20, 2015 22:09
Simple Fuzzy Search
public String findMatch(String arg, List<String> words, boolean ignoreRepeat) {
// Where the final word will be stored.
String word = null;
/*
* Sometimes two words will equally match (rarely). If we find one that matches, we
* increase this by one. Just in case the person wants it to return null, we have the
* ignoreRepeat.
*/
int repeated = 0;
@PaulBGD
PaulBGD / OnceWorldKits.java
Last active December 21, 2015 18:28
Plugin for poi
package me.ultimate.OWK;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@PaulBGD
PaulBGD / Arena.java
Created September 26, 2013 00:24
Arena Resource 1
package me.ultimate.Arena;
import org.bukkit.Location;
public class Arena {
private String name; // A spot to store our arena's name
private Location l1, l2; // Our two corners
private Location spawn, stop; // Where we start and stop
@PaulBGD
PaulBGD / Arena.java
Created September 26, 2013 00:37
Arena Resource 2
package me.ultimate.Arena;
import org.bukkit.Location;
public class Arena {
private String name; // A spot to store our arena's name
private Location l1, l2; // Our two corners
private Location spawn, stop; // Where we start and stop
@PaulBGD
PaulBGD / PlayerManager.java
Last active December 23, 2015 23:09
PlayerManager Resource 1
package me.ultimate.Arena;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@PaulBGD
PaulBGD / Arena.java
Created September 28, 2013 15:12
Arena Resource 3
package me.ultimate.Arena;
import org.bukkit.Location;
public class Arena {
private String name; // A spot to store our arena's name
private Location l1, l2; // Our two corners
private Location spawn, stop; // Where we start and stop
@PaulBGD
PaulBGD / ArenaManager.java
Created September 28, 2013 15:12
ArenaManager Resource 1
package me.ultimate.Arena;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
public class ArenaManager {
// An list to hold all of the arenas
@PaulBGD
PaulBGD / LocationUtils.java
Last active December 25, 2015 01:19
LocationUtils Resource 1
package me.ultimate.Arena;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
public class LocationUtils {
public static String fromLocation(Location l, boolean block, boolean yp) {
String world = l.getWorld().getName();
@PaulBGD
PaulBGD / ArenaTutorial.java
Last active December 25, 2015 01:19
ArenaTutorial Resource 1
package me.ultimate.Arena;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
public class ArenaTutorial extends JavaPlugin {
@Override
public void onEnable() {
// Loop through all of our arenas when the plugin starts
@PaulBGD
PaulBGD / Arena.java
Created October 8, 2013 23:44
Arena Resource 4
package me.ultimate.Arena;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
public class Arena {
private String name; // A spot to store our arena's name
private Location l1, l2; // Our two corners
private Location spawn, stop; // Where we start and stop