Skip to content

Instantly share code, notes, and snippets.

View Ribesg's full-sized avatar
🇫🇷

Gael Ribes Ribesg

🇫🇷
View GitHub Profile
#############################################################################
## Config file for NTheEndAgain plugin. If you don't understand something, ##
## please ask on dev.bukkit.org or on forum post. Ribesg ##
#############################################################################
# This config file is about the world "world_the_end"
###########################
## GENERAL CONFIGURATION ##
###########################
#####################################################################
## Config file for NTheEndAgain plugin ##
## If you don't understand something, please ask on dev.bukkit.org ##
## Ribesg ##
#####################################################################
# This config file is about the world "world_the_end"
###########################
## GENERAL CONFIGURATION ##
#####################################################################
## Config file for NWorld plugin ##
## If you don't understand something, please ask on dev.bukkit.org ##
## Ribesg ##
#####################################################################
#############
## General ##
#############
#####################################################################
## Config file for NEnchantingEgg plugin ##
## If you don't understand something, please ask on dev.bukkit.org ##
## Ribesg ##
#####################################################################
# The minimum distance between 2 altars. Default: 500
# Note: You can't use a value under 35.
minimumDistanceBetweenTwoAltars: 500
# The coefficient applied to durability boost on repair. Default: 2.5
@Ribesg
Ribesg / 42.java
Last active December 21, 2015 05:48
// You may do this in PlayerMoveEvent or somewhere else.
// So you have those
final Player player;
final Location targetLocation;
// You get this one
final Location playerLocation = player.getLocation();
// You want the player to look at target
// !gstats
private class GlobalStats {
public String serversAmount;
public String serversDiff;
public String serversMax;
public String serversMin;
public String serversAvg;
public String playersAmount;
public class TestClass {
public void method() {
// 1
}
public void someOtherMethod() {
new Runnable() {
@Override
public void run() {
/**
* Parses an original args array provided to a CommandExecutor to support quotes.
* If the parameter array is malformed, then this method returns the parameter array as-is.
*
* @param args The original args array. Ex: ['A', '"B', 'C', 'D"', 'E']
*
* @return The resulting args array, if valid. Ex: ['A', 'B C D', 'E']
*/
public static String[] parseArgumentsWithQuotes(String[] args) {
final List<String> resultList = new ArrayList<>();
@Ribesg
Ribesg / Utils.java
Last active December 21, 2015 17:39
/**
* Parses an original args array provided to a CommandExecutor to support quotes.
* If the parameter array is malformed, then this method returns the parameter array as-is.
*
* @param args The original args array. Ex: ['A', '"B', 'C', 'D"', 'E']
*
* @return The resulting args array, if valid. Ex: ['A', 'B C D', 'E']
*/
public static String[] parseArgumentsWithQuotes(String[] args) {
final List<String> resultList = new ArrayList<>();
import java.util.ArrayList;
import java.util.List;
/** @author dumptruckman, Ribesg */
public class ArgumentParser {
/**
* Transform a Bukkit-provided args array, considering quotes in the original String.
* Example:
* - Input = { a | 'b | c | d' | "e | f | g" | h"i | j" | "k | l'm | n" | 'o | p | q }