This commit is contained in:
extendedclip 2019-06-21 12:30:12 -04:00
parent 21048f83d5
commit 2c0b768774
29 changed files with 108 additions and 69 deletions

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,18 +20,8 @@
*/ */
package me.clip.placeholderapi; package me.clip.placeholderapi;
import static me.clip.placeholderapi.util.Msg.color;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import me.clip.placeholderapi.events.ExpansionRegisterEvent; import me.clip.placeholderapi.events.ExpansionRegisterEvent;
import me.clip.placeholderapi.events.ExpansionUnregisterEvent; import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.PlaceholderExpansion;
@ -42,6 +32,13 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static me.clip.placeholderapi.util.Msg.color;
public class PlaceholderAPI { public class PlaceholderAPI {
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]"); private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,10 +20,6 @@
*/ */
package me.clip.placeholderapi; package me.clip.placeholderapi;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import me.clip.placeholderapi.commands.PlaceholderAPICommands; import me.clip.placeholderapi.commands.PlaceholderAPICommands;
import me.clip.placeholderapi.configuration.PlaceholderAPIConfig; import me.clip.placeholderapi.configuration.PlaceholderAPIConfig;
import me.clip.placeholderapi.expansion.ExpansionManager; import me.clip.placeholderapi.expansion.ExpansionManager;
@ -39,6 +35,11 @@ import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* Yes I have a shit load of work to do... * Yes I have a shit load of work to do...

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,9 +20,6 @@
*/ */
package me.clip.placeholderapi; package me.clip.placeholderapi;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import me.clip.placeholderapi.events.ExpansionUnregisterEvent; import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
import me.clip.placeholderapi.expansion.Cacheable; import me.clip.placeholderapi.expansion.Cacheable;
import me.clip.placeholderapi.expansion.Cleanable; import me.clip.placeholderapi.expansion.Cleanable;
@ -37,6 +34,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginDisableEvent;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class PlaceholderListener implements Listener { public class PlaceholderListener implements Listener {

View File

@ -1,12 +1,32 @@
/*
*
* PlaceholderAPI
* Copyright (C) 2019 Ryan McCarthy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
package me.clip.placeholderapi; package me.clip.placeholderapi;
import java.util.Map;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerLoadEvent; import org.bukkit.event.server.ServerLoadEvent;
import java.util.Map;
public class ServerLoadEventListener implements Listener { public class ServerLoadEventListener implements Listener {
private PlaceholderAPIPlugin plugin; private PlaceholderAPIPlugin plugin;

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,8 +20,6 @@
*/ */
package me.clip.placeholderapi.commands; package me.clip.placeholderapi.commands;
import java.util.Set;
import java.util.stream.Collectors;
import me.clip.placeholderapi.PlaceholderAPI; import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.PlaceholderExpansion;
@ -34,6 +32,9 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.Set;
import java.util.stream.Collectors;
public class PlaceholderAPICommands implements CommandExecutor { public class PlaceholderAPICommands implements CommandExecutor {
private PlaceholderAPIPlugin plugin; private PlaceholderAPIPlugin plugin;

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,7 +20,6 @@
*/ */
package me.clip.placeholderapi.expansion; package me.clip.placeholderapi.expansion;
import java.util.List;
import me.clip.placeholderapi.PlaceholderAPI; import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.PlaceholderHook; import me.clip.placeholderapi.PlaceholderHook;
@ -28,6 +27,8 @@ import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import java.util.List;
public abstract class PlaceholderExpansion extends PlaceholderHook { public abstract class PlaceholderExpansion extends PlaceholderHook {
/** /**

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,10 +20,11 @@
*/ */
package me.clip.placeholderapi.expansion.cloud; package me.clip.placeholderapi.expansion.cloud;
import me.clip.placeholderapi.util.TimeUtil;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import me.clip.placeholderapi.util.TimeUtil;
public class CloudExpansion { public class CloudExpansion {

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,19 +21,6 @@
package me.clip.placeholderapi.expansion.cloud; package me.clip.placeholderapi.expansion.cloud;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import me.clip.placeholderapi.PlaceholderAPI; import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.PlaceholderAPIPlugin;
@ -42,6 +29,13 @@ import me.clip.placeholderapi.util.Msg;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class ExpansionCloudManager { public class ExpansionCloudManager {
private static final String API_URL = "http://api.extendedclip.com/v2/"; private static final String API_URL = "http://api.extendedclip.com/v2/";

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,9 +1,25 @@
/*
*
* PlaceholderAPI
* Copyright (C) 2019 Ryan McCarthy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
package me.clip.placeholderapi.updatechecker; package me.clip.placeholderapi.updatechecker;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.util.Msg; import me.clip.placeholderapi.util.Msg;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -12,6 +28,11 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import javax.net.ssl.HttpsURLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
public class UpdateChecker implements Listener { public class UpdateChecker implements Listener {
private final int RESOURCE_ID = 6245; private final int RESOURCE_ID = 6245;

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,6 +20,8 @@
*/ */
package me.clip.placeholderapi.util; package me.clip.placeholderapi.util;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
import java.net.URL; import java.net.URL;
@ -28,7 +30,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarInputStream; import java.util.jar.JarInputStream;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
public class FileUtil { public class FileUtil {

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,11 +20,12 @@
*/ */
package me.clip.placeholderapi.util; package me.clip.placeholderapi.util;
import java.util.Arrays;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import java.util.Arrays;
public class Msg { public class Msg {
public static void msg(CommandSender s, String... msg) { public static void msg(CommandSender s, String... msg) {

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* /*
* *
* PlaceholderAPI * PlaceholderAPI
* Copyright (C) 2018 Ryan McCarthy * Copyright (C) 2019 Ryan McCarthy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by