Skip to content

Instantly share code, notes, and snippets.

@PaulBGD
PaulBGD / FuzzySearch.java
Last active Dec 20, 2015
Simple Fuzzy Search
View FuzzySearch.java
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;
View OnceWorldKits.java
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 Sep 26, 2013
Arena Resource 1
View Arena.java
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 Sep 26, 2013
Arena Resource 2
View Arena.java
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 Dec 23, 2015
PlayerManager Resource 1
View PlayerManager.java
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 Sep 28, 2013
Arena Resource 3
View Arena.java
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 Sep 28, 2013
ArenaManager Resource 1
View ArenaManager.java
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 Dec 25, 2015
LocationUtils Resource 1
View LocationUtils.java
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 Dec 25, 2015
ArenaTutorial Resource 1
View ArenaTutorial.java
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 Oct 8, 2013
Arena Resource 4
View Arena.java
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