Added Invalid Location to checkpoint
Fixed Checkpoint cooldown Made it so you have to buy vaults from /f getvault, and buy banners from /f banner Particle based seechunk that works when moving between chunks Particle support for 1.7-1.12 Made fly particles mode subtle
This commit is contained in:
parent
3d2bf73497
commit
cdf870b782
9
pom.xml
9
pom.xml
@ -62,6 +62,11 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.inventivetalent</groupId>
|
||||||
|
<artifactId>particleapi</artifactId>
|
||||||
|
<version>2.1.1</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
@ -321,6 +326,10 @@
|
|||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>inventive-repo</id>
|
||||||
|
<url>https://repo.inventivetalent.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>ess-repo</id>
|
<id>ess-repo</id>
|
||||||
<url>http://ci.ender.zone/plugin/repository/everything/</url>
|
<url>http://ci.ender.zone/plugin/repository/everything/</url>
|
||||||
|
@ -155,6 +155,9 @@ public interface FPlayer extends EconomyParticipator {
|
|||||||
|
|
||||||
public int getDeaths();
|
public int getDeaths();
|
||||||
|
|
||||||
|
public void takeMoney(int amt);
|
||||||
|
|
||||||
|
public boolean hasMoney(int amt);
|
||||||
|
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
// Relation and relation colors
|
// Relation and relation colors
|
||||||
|
@ -1,663 +0,0 @@
|
|||||||
package com.massivecraft.factions;
|
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
|
||||||
import org.bukkit.plugin.ServicePriority;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import org.json.simple.JSONArray;
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.zip.GZIPOutputStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* bStats collects some data for plugin authors.
|
|
||||||
* <p>
|
|
||||||
* Check out https://bStats.org/ to learn more about bStats!
|
|
||||||
*/
|
|
||||||
public class Metrics {
|
|
||||||
|
|
||||||
// The version of this bStats class
|
|
||||||
public static final int B_STATS_VERSION = 1;
|
|
||||||
// The url to which the data is sent
|
|
||||||
private static final String URL = "https://bStats.org/submitData/bukkit";
|
|
||||||
// Should failed requests be logged?
|
|
||||||
private static boolean logFailedRequests;
|
|
||||||
// The uuid of the server
|
|
||||||
private static String serverUUID;
|
|
||||||
|
|
||||||
static {
|
|
||||||
// You can use the property to disable the check in your test environment
|
|
||||||
if (System.getProperty("bstats.relocatecheck") == null || !System.getProperty("bstats.relocatecheck").equals("false")) {
|
|
||||||
// Maven's Relocate is clever and changes strings, too. So we have to use this little "trick" ... :D
|
|
||||||
final String defaultPackage = new String(
|
|
||||||
new byte[]{'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's', '.', 'b', 'u', 'k', 'k', 'i', 't'});
|
|
||||||
final String examplePackage = new String(new byte[]{'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
|
|
||||||
// We want to make sure nobody just copy & pastes the example and use the wrong package names
|
|
||||||
if (Metrics.class.getPackage().getName().equals(defaultPackage) || Metrics.class.getPackage().getName().equals(examplePackage)) {
|
|
||||||
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// The plugin
|
|
||||||
private final JavaPlugin plugin;
|
|
||||||
|
|
||||||
// A list with all custom charts
|
|
||||||
private final List<CustomChart> charts = new ArrayList<>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param plugin The plugin which stats should be submitted.
|
|
||||||
*/
|
|
||||||
public Metrics(JavaPlugin plugin) {
|
|
||||||
if (plugin == null) {
|
|
||||||
throw new IllegalArgumentException("Plugin cannot be null!");
|
|
||||||
}
|
|
||||||
this.plugin = plugin;
|
|
||||||
|
|
||||||
// Get the config file
|
|
||||||
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
|
||||||
File configFile = new File(bStatsFolder, "config.yml");
|
|
||||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
|
|
||||||
|
|
||||||
// Check if the config file exists
|
|
||||||
if (!config.isSet("serverUuid")) {
|
|
||||||
|
|
||||||
// Add default values
|
|
||||||
config.addDefault("enabled", true);
|
|
||||||
// Every server gets it's unique random id.
|
|
||||||
config.addDefault("serverUuid", UUID.randomUUID().toString());
|
|
||||||
// Should failed request be logged?
|
|
||||||
config.addDefault("logFailedRequests", false);
|
|
||||||
|
|
||||||
// Inform the server owners about bStats
|
|
||||||
config.options().header(
|
|
||||||
"bStats collects some data for plugin authors like how many servers are using their plugins.\n" +
|
|
||||||
"To honor their work, you should not disable it.\n" +
|
|
||||||
"This has nearly no effect on the server performance!\n" +
|
|
||||||
"Check out https://bStats.org/ to learn more :)"
|
|
||||||
).copyDefaults(true);
|
|
||||||
try {
|
|
||||||
config.save(configFile);
|
|
||||||
} catch (IOException ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the data
|
|
||||||
serverUUID = config.getString("serverUuid");
|
|
||||||
logFailedRequests = config.getBoolean("logFailedRequests", false);
|
|
||||||
if (config.getBoolean("enabled", true)) {
|
|
||||||
boolean found = false;
|
|
||||||
// Search for all other bStats Metrics classes to see if we are the first one
|
|
||||||
for (Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
|
||||||
try {
|
|
||||||
service.getField("B_STATS_VERSION"); // Our identifier :)
|
|
||||||
found = true; // We aren't the first
|
|
||||||
break;
|
|
||||||
} catch (NoSuchFieldException ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Register our service
|
|
||||||
Bukkit.getServicesManager().register(Metrics.class, this, plugin, ServicePriority.Normal);
|
|
||||||
if (!found) {
|
|
||||||
// We are the first!
|
|
||||||
startSubmitting();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends the data to the bStats server.
|
|
||||||
*
|
|
||||||
* @param data The data to send.
|
|
||||||
* @throws Exception If the request failed.
|
|
||||||
*/
|
|
||||||
private static void sendData(JSONObject data) throws Exception {
|
|
||||||
if (data == null) {
|
|
||||||
throw new IllegalArgumentException("Data cannot be null!");
|
|
||||||
}
|
|
||||||
if (Bukkit.isPrimaryThread()) {
|
|
||||||
throw new IllegalAccessException("This method must not be called from the main thread!");
|
|
||||||
}
|
|
||||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
|
|
||||||
|
|
||||||
// Compress the data to save bandwidth
|
|
||||||
byte[] compressedData = compress(data.toString());
|
|
||||||
|
|
||||||
// Add headers
|
|
||||||
connection.setRequestMethod("POST");
|
|
||||||
connection.addRequestProperty("Accept", "application/json");
|
|
||||||
connection.addRequestProperty("Connection", "close");
|
|
||||||
connection.addRequestProperty("Content-Encoding", "gzip"); // We gzip our request
|
|
||||||
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
|
|
||||||
connection.setRequestProperty("Content-Type", "application/json"); // We send our data in JSON format
|
|
||||||
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
|
|
||||||
|
|
||||||
// Send data
|
|
||||||
connection.setDoOutput(true);
|
|
||||||
DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
|
|
||||||
outputStream.write(compressedData);
|
|
||||||
outputStream.flush();
|
|
||||||
outputStream.close();
|
|
||||||
|
|
||||||
connection.getInputStream().close(); // We don't care about the response - Just send our data :)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gzips the given String.
|
|
||||||
*
|
|
||||||
* @param str The string to gzip.
|
|
||||||
* @return The gzipped String.
|
|
||||||
* @throws IOException If the compression failed.
|
|
||||||
*/
|
|
||||||
private static byte[] compress(final String str) throws IOException {
|
|
||||||
if (str == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
||||||
GZIPOutputStream gzip = new GZIPOutputStream(outputStream);
|
|
||||||
gzip.write(str.getBytes("UTF-8"));
|
|
||||||
gzip.close();
|
|
||||||
return outputStream.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a custom chart.
|
|
||||||
*
|
|
||||||
* @param chart The chart to add.
|
|
||||||
*/
|
|
||||||
public void addCustomChart(CustomChart chart) {
|
|
||||||
if (chart == null) {
|
|
||||||
throw new IllegalArgumentException("Chart cannot be null!");
|
|
||||||
}
|
|
||||||
charts.add(chart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts the Scheduler which submits our data every 30 minutes.
|
|
||||||
*/
|
|
||||||
private void startSubmitting() {
|
|
||||||
final Timer timer = new Timer(true); // We use a timer cause the Bukkit scheduler is affected by server lags
|
|
||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (!plugin.isEnabled()) { // Plugin was disabled
|
|
||||||
timer.cancel();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Nevertheless we want our code to run in the Bukkit main thread, so we have to use the Bukkit scheduler
|
|
||||||
// Don't be afraid! The connection to the bStats server is still async, only the stats collection is sync ;)
|
|
||||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
submitData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 1000 * 60 * 5, 1000 * 60 * 30);
|
|
||||||
// Submit the data every 30 minutes, first time after 5 minutes to give other plugins enough time to start
|
|
||||||
// WARNING: Changing the frequency has no effect but your plugin WILL be blocked/deleted!
|
|
||||||
// WARNING: Just don't do it!
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the plugin specific data.
|
|
||||||
* This method is called using Reflection.
|
|
||||||
*
|
|
||||||
* @return The plugin specific data.
|
|
||||||
*/
|
|
||||||
public JSONObject getPluginData() {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
|
|
||||||
String pluginName = plugin.getDescription().getName();
|
|
||||||
String pluginVersion = plugin.getDescription().getVersion();
|
|
||||||
|
|
||||||
data.put("pluginName", pluginName); // Append the name of the plugin
|
|
||||||
data.put("pluginVersion", pluginVersion); // Append the version of the plugin
|
|
||||||
JSONArray customCharts = new JSONArray();
|
|
||||||
for (CustomChart customChart : charts) {
|
|
||||||
// Add the data of the custom charts
|
|
||||||
JSONObject chart = customChart.getRequestJsonObject();
|
|
||||||
if (chart == null) { // If the chart is null, we skip it
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
customCharts.add(chart);
|
|
||||||
}
|
|
||||||
data.put("customCharts", customCharts);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the server specific data.
|
|
||||||
*
|
|
||||||
* @return The server specific data.
|
|
||||||
*/
|
|
||||||
private JSONObject getServerData() {
|
|
||||||
// Minecraft specific data
|
|
||||||
int playerAmount;
|
|
||||||
try {
|
|
||||||
// Around MC 1.8 the return type was changed to a collection from an array,
|
|
||||||
// This fixes java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
|
|
||||||
Method onlinePlayersMethod = Class.forName("org.bukkit.Server").getMethod("getOnlinePlayers");
|
|
||||||
playerAmount = onlinePlayersMethod.getReturnType().equals(Collection.class)
|
|
||||||
? ((Collection<?>) onlinePlayersMethod.invoke(Bukkit.getServer())).size()
|
|
||||||
: ((Player[]) onlinePlayersMethod.invoke(Bukkit.getServer())).length;
|
|
||||||
} catch (Exception e) {
|
|
||||||
playerAmount = Bukkit.getOnlinePlayers().size(); // Just use the new method if the Reflection failed
|
|
||||||
}
|
|
||||||
int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
|
|
||||||
String bukkitVersion = org.bukkit.Bukkit.getVersion();
|
|
||||||
bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
|
|
||||||
|
|
||||||
// OS/Java specific data
|
|
||||||
String javaVersion = System.getProperty("java.version");
|
|
||||||
String osName = System.getProperty("os.name");
|
|
||||||
String osArch = System.getProperty("os.arch");
|
|
||||||
String osVersion = System.getProperty("os.version");
|
|
||||||
int coreCount = Runtime.getRuntime().availableProcessors();
|
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
|
|
||||||
data.put("serverUUID", serverUUID);
|
|
||||||
|
|
||||||
data.put("playerAmount", playerAmount);
|
|
||||||
data.put("onlineMode", onlineMode);
|
|
||||||
data.put("bukkitVersion", bukkitVersion);
|
|
||||||
|
|
||||||
data.put("javaVersion", javaVersion);
|
|
||||||
data.put("osName", osName);
|
|
||||||
data.put("osArch", osArch);
|
|
||||||
data.put("osVersion", osVersion);
|
|
||||||
data.put("coreCount", coreCount);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Collects the data and sends it afterwards.
|
|
||||||
*/
|
|
||||||
private void submitData() {
|
|
||||||
final JSONObject data = getServerData();
|
|
||||||
|
|
||||||
JSONArray pluginData = new JSONArray();
|
|
||||||
// Search for all other bStats Metrics classes to get their plugin data
|
|
||||||
for (Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
|
|
||||||
try {
|
|
||||||
service.getField("B_STATS_VERSION"); // Our identifier :)
|
|
||||||
|
|
||||||
for (RegisteredServiceProvider<?> provider : Bukkit.getServicesManager().getRegistrations(service)) {
|
|
||||||
try {
|
|
||||||
pluginData.add(provider.getService().getMethod("getPluginData").invoke(provider.getProvider()));
|
|
||||||
} catch (NullPointerException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (NoSuchFieldException ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.put("plugins", pluginData);
|
|
||||||
|
|
||||||
// Create a new thread for the connection to the bStats server
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
// Send the data
|
|
||||||
sendData(data);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// Something went wrong! :(
|
|
||||||
if (logFailedRequests) {
|
|
||||||
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom chart.
|
|
||||||
*/
|
|
||||||
public static abstract class CustomChart {
|
|
||||||
|
|
||||||
// The id of the chart
|
|
||||||
final String chartId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
*/
|
|
||||||
CustomChart(String chartId) {
|
|
||||||
if (chartId == null || chartId.isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("ChartId cannot be null or empty!");
|
|
||||||
}
|
|
||||||
this.chartId = chartId;
|
|
||||||
}
|
|
||||||
|
|
||||||
private JSONObject getRequestJsonObject() {
|
|
||||||
JSONObject chart = new JSONObject();
|
|
||||||
chart.put("chartId", chartId);
|
|
||||||
try {
|
|
||||||
JSONObject data = getChartData();
|
|
||||||
if (data == null) {
|
|
||||||
// If the data is null we don't send the chart.
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
chart.put("data", data);
|
|
||||||
} catch (Throwable t) {
|
|
||||||
if (logFailedRequests) {
|
|
||||||
Bukkit.getLogger().log(Level.WARNING, "Failed to get data for custom chart with id " + chartId, t);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return chart;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract JSONObject getChartData() throws Exception;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom simple pie.
|
|
||||||
*/
|
|
||||||
public static class SimplePie extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<String> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public SimplePie(String chartId, Callable<String> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
String value = callable.call();
|
|
||||||
if (value == null || value.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("value", value);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom advanced pie.
|
|
||||||
*/
|
|
||||||
public static class AdvancedPie extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Map<String, Integer>> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
JSONObject values = new JSONObject();
|
|
||||||
Map<String, Integer> map = callable.call();
|
|
||||||
if (map == null || map.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
boolean allSkipped = true;
|
|
||||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
|
||||||
if (entry.getValue() == 0) {
|
|
||||||
continue; // Skip this invalid
|
|
||||||
}
|
|
||||||
allSkipped = false;
|
|
||||||
values.put(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
if (allSkipped) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("values", values);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom drilldown pie.
|
|
||||||
*/
|
|
||||||
public static class DrilldownPie extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Map<String, Map<String, Integer>>> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
JSONObject values = new JSONObject();
|
|
||||||
Map<String, Map<String, Integer>> map = callable.call();
|
|
||||||
if (map == null || map.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
boolean reallyAllSkipped = true;
|
|
||||||
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
|
|
||||||
JSONObject value = new JSONObject();
|
|
||||||
boolean allSkipped = true;
|
|
||||||
for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) {
|
|
||||||
value.put(valueEntry.getKey(), valueEntry.getValue());
|
|
||||||
allSkipped = false;
|
|
||||||
}
|
|
||||||
if (!allSkipped) {
|
|
||||||
reallyAllSkipped = false;
|
|
||||||
values.put(entryValues.getKey(), value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (reallyAllSkipped) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("values", values);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom single line chart.
|
|
||||||
*/
|
|
||||||
public static class SingleLineChart extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Integer> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public SingleLineChart(String chartId, Callable<Integer> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
int value = callable.call();
|
|
||||||
if (value == 0) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("value", value);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom multi line chart.
|
|
||||||
*/
|
|
||||||
public static class MultiLineChart extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Map<String, Integer>> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
JSONObject values = new JSONObject();
|
|
||||||
Map<String, Integer> map = callable.call();
|
|
||||||
if (map == null || map.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
boolean allSkipped = true;
|
|
||||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
|
||||||
if (entry.getValue() == 0) {
|
|
||||||
continue; // Skip this invalid
|
|
||||||
}
|
|
||||||
allSkipped = false;
|
|
||||||
values.put(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
if (allSkipped) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("values", values);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom simple bar chart.
|
|
||||||
*/
|
|
||||||
public static class SimpleBarChart extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Map<String, Integer>> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
JSONObject values = new JSONObject();
|
|
||||||
Map<String, Integer> map = callable.call();
|
|
||||||
if (map == null || map.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
|
||||||
JSONArray categoryValues = new JSONArray();
|
|
||||||
categoryValues.add(entry.getValue());
|
|
||||||
values.put(entry.getKey(), categoryValues);
|
|
||||||
}
|
|
||||||
data.put("values", values);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a custom advanced bar chart.
|
|
||||||
*/
|
|
||||||
public static class AdvancedBarChart extends CustomChart {
|
|
||||||
|
|
||||||
private final Callable<Map<String, int[]>> callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @param chartId The id of the chart.
|
|
||||||
* @param callable The callable which is used to request the chart data.
|
|
||||||
*/
|
|
||||||
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
|
|
||||||
super(chartId);
|
|
||||||
this.callable = callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject getChartData() throws Exception {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
JSONObject values = new JSONObject();
|
|
||||||
Map<String, int[]> map = callable.call();
|
|
||||||
if (map == null || map.isEmpty()) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
boolean allSkipped = true;
|
|
||||||
for (Map.Entry<String, int[]> entry : map.entrySet()) {
|
|
||||||
if (entry.getValue().length == 0) {
|
|
||||||
continue; // Skip this invalid
|
|
||||||
}
|
|
||||||
allSkipped = false;
|
|
||||||
JSONArray categoryValues = new JSONArray();
|
|
||||||
for (int categoryValue : entry.getValue()) {
|
|
||||||
categoryValues.add(categoryValue);
|
|
||||||
}
|
|
||||||
values.put(entry.getKey(), categoryValues);
|
|
||||||
}
|
|
||||||
if (allSkipped) {
|
|
||||||
// Null = skip the chart
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
data.put("values", values);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -139,9 +139,6 @@ public class P extends MPlugin {
|
|||||||
// start up task which runs the autoLeaveAfterDaysOfInactivity routine
|
// start up task which runs the autoLeaveAfterDaysOfInactivity routine
|
||||||
startAutoLeaveTask(false);
|
startAutoLeaveTask(false);
|
||||||
|
|
||||||
//bStats
|
|
||||||
Metrics metrics = new Metrics(this);
|
|
||||||
|
|
||||||
|
|
||||||
mc17 = Bukkit.getServer().getClass().getPackage().getName().contains("1.7");
|
mc17 = Bukkit.getServer().getClass().getPackage().getName().contains("1.7");
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ public class CmdAutoHelp extends MCommand<P> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
|
|
||||||
if (this.commandChain.size() == 0) {
|
if (this.commandChain.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,23 +30,14 @@ public class CmdBanner extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
if (me.getItemInHand().getType() == Material.BANNER) {
|
if (!fme.hasMoney(P.p.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
|
||||||
if (hasMoney(fme, P.p.getConfig().getInt("fbanners.Banner-Cost"))) {
|
msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
|
||||||
if (me.getItemInHand().getAmount() != 1) {
|
return;
|
||||||
me.getItemInHand().setAmount(me.getItemInHand().getAmount() - 1);
|
|
||||||
}
|
}
|
||||||
ItemStack bannerInHand = me.getItemInHand();
|
takeMoney(fme, P.p.getConfig().getInt("fbanners.Banner-Cost", 5000));
|
||||||
bannerInHand.setAmount(1);
|
ItemStack warBanner = P.p.createItem(Material.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
|
||||||
removeFromInventory(me.getInventory(), bannerInHand);
|
|
||||||
takeMoney(fme, P.p.getConfig().getInt("fbanners.Banner-Cost"));
|
|
||||||
ItemStack warBanner = P.p.createItem(bannerInHand.getType(), 1, bannerInHand.getDurability(), P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
|
|
||||||
me.getInventory().addItem(warBanner);
|
me.getInventory().addItem(warBanner);
|
||||||
fme.msg(TL.COMMAND_BANNER_SUCCESS);
|
fme.msg(TL.COMMAND_BANNER_SUCCESS);
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
fme.msg(TL.COMMAND_BANNER_WRONGITEM);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasMoney(FPlayer fme, int amt) {
|
public boolean hasMoney(FPlayer fme, int amt) {
|
||||||
|
@ -37,6 +37,9 @@ public class CmdCheckpoint extends FCommand {
|
|||||||
fme.getFaction().setCheckpoint(fme.getPlayer().getLocation());
|
fme.getFaction().setCheckpoint(fme.getPlayer().getLocation());
|
||||||
fme.msg(TL.COMMAND_CHECKPOINT_SET);
|
fme.msg(TL.COMMAND_CHECKPOINT_SET);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
fme.msg(TL.COMMAND_CHECKPOINT_INVALIDLOCATION);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fme.getFaction().getCheckpoint() == null) {
|
if (fme.getFaction().getCheckpoint() == null) {
|
||||||
@ -48,16 +51,16 @@ public class CmdCheckpoint extends FCommand {
|
|||||||
|
|
||||||
if (checkfaction.getId().equals(Factions.getInstance().getWilderness().getId()) || checkfaction.getId().equals(fme.getFaction().getId())) {
|
if (checkfaction.getId().equals(Factions.getInstance().getWilderness().getId()) || checkfaction.getId().equals(fme.getFaction().getId())) {
|
||||||
fme.msg(TL.COMMAND_CHECKPOINT_GO);
|
fme.msg(TL.COMMAND_CHECKPOINT_GO);
|
||||||
fme.getPlayer().teleport(fme.getFaction().getCheckpoint());
|
|
||||||
} else {
|
|
||||||
fme.msg(TL.COMMAND_CHECKPOINT_CLAIMED);
|
|
||||||
}
|
|
||||||
this.doWarmUp(WarmUpUtil.Warmup.CHECKPOINT, TL.WARMUPS_NOTIFY_TELEPORT, "Checkpoint", new Runnable() {
|
this.doWarmUp(WarmUpUtil.Warmup.CHECKPOINT, TL.WARMUPS_NOTIFY_TELEPORT, "Checkpoint", new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
fme.getPlayer().teleport(fme.getFaction().getCheckpoint());
|
||||||
}
|
}
|
||||||
}, this.p.getConfig().getLong("warmups.f-checkpoint", 10));
|
}, this.p.getConfig().getLong("warmups.f-checkpoint", 0));
|
||||||
|
} else {
|
||||||
|
fme.msg(TL.COMMAND_CHECKPOINT_CLAIMED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.*;
|
import com.massivecraft.factions.*;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.util.Particle.ParticleEffect;
|
|
||||||
import com.massivecraft.factions.util.WarmUpUtil;
|
import com.massivecraft.factions.util.WarmUpUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.inventivetalent.particle.ParticleEffect;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -168,7 +168,8 @@ public class CmdFly extends FCommand {
|
|||||||
if (!player.isFlying()){
|
if (!player.isFlying()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ParticleEffect.CLOUD.display((float) 0.1,(float) 0.1,(float) 0.1,(float) 0.1,3,player.getLocation(),32);
|
|
||||||
|
ParticleEffect.CLOUD.send(Bukkit.getOnlinePlayers(), player.getLocation().add(0, -0.35, 0), 0, 0, 0, 0, 3, 16);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (flyMap.keySet().size() == 0){
|
if (flyMap.keySet().size() == 0){
|
||||||
@ -176,7 +177,7 @@ public class CmdFly extends FCommand {
|
|||||||
id = -1;
|
id = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},20L,40L);
|
}, 10L, 10L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFlyCheck(){
|
public void startFlyCheck(){
|
||||||
|
@ -33,17 +33,23 @@ public class CmdGetVault extends FCommand {
|
|||||||
Location vaultLocation = fme.getFaction().getVault();
|
Location vaultLocation = fme.getFaction().getVault();
|
||||||
ItemStack vault = P.p.createItem(Material.CHEST, 1, (short) 0, P.p.color(P.p.getConfig().getString("fvault.Item.Name")), P.p.colorList(P.p.getConfig().getStringList("fvault.Item.Lore")));
|
ItemStack vault = P.p.createItem(Material.CHEST, 1, (short) 0, P.p.color(P.p.getConfig().getString("fvault.Item.Name")), P.p.colorList(P.p.getConfig().getStringList("fvault.Item.Lore")));
|
||||||
|
|
||||||
if (inventoryContains(me.getInventory(), vault)) {
|
|
||||||
fme.msg(TL.COMMAND_GETVAULT_ALREADYHAVE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//check if vault is set
|
||||||
if (vaultLocation != null) {
|
if (vaultLocation != null) {
|
||||||
fme.msg(TL.COMMAND_GETVAULT_ALREADYSET);
|
fme.msg(TL.COMMAND_GETVAULT_ALREADYSET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//has enough money?
|
||||||
|
int amount = P.p.getConfig().getInt("fvault.Price");
|
||||||
|
if (!fme.hasMoney(amount)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//success :)
|
||||||
|
fme.takeMoney(amount);
|
||||||
me.getInventory().addItem(vault);
|
me.getInventory().addItem(vault);
|
||||||
fme.msg(TL.COMMAND_GETVAULT_RECEIVE);
|
fme.msg(TL.COMMAND_GETVAULT_RECEIVE);
|
||||||
|
|
||||||
|
@ -2,22 +2,35 @@ package com.massivecraft.factions.cmd;
|
|||||||
|
|
||||||
|
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
|
import com.massivecraft.factions.P;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.util.Particle.ParticleEffect;
|
|
||||||
import com.massivecraft.factions.util.VisualizeUtil;
|
import com.massivecraft.factions.util.VisualizeUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.inventivetalent.particle.ParticleEffect;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdSeeChunk extends FCommand {
|
public class CmdSeeChunk extends FCommand {
|
||||||
|
|
||||||
private boolean useParticles;
|
private boolean useParticles;
|
||||||
private int length;
|
private int length;
|
||||||
private ParticleEffect effect;
|
private ParticleEffect effect;
|
||||||
|
//Used a hashmap cuz imma make a particle selection gui later, will store it where the boolean is rn.
|
||||||
|
public static HashMap<String, Boolean> seeChunkMap = new HashMap<>();
|
||||||
|
Long interval = 10L;
|
||||||
|
private int taskID = -1;
|
||||||
|
|
||||||
|
|
||||||
|
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||||
|
|
||||||
|
|
||||||
public CmdSeeChunk() {
|
public CmdSeeChunk() {
|
||||||
super();
|
super();
|
||||||
@ -32,18 +45,50 @@ public class CmdSeeChunk extends FCommand {
|
|||||||
senderMustBeAdmin = false;
|
senderMustBeAdmin = false;
|
||||||
|
|
||||||
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
|
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
|
||||||
this.length = p.getConfig().getInt("see-chunk.length", 10);
|
interval = P.p.getConfig().getLong("see-chunk.interval", 10L);
|
||||||
String effectName = p.getConfig().getString("see-chunk.particle", "BARRIER");
|
effect = ParticleEffect.valueOf(P.p.getConfig().getString("see-chunk.particle", "REDSTONE"));
|
||||||
this.effect = ParticleEffect.fromName(effectName.toUpperCase());
|
|
||||||
if (this.effect == null) {
|
|
||||||
this.effect = ParticleEffect.BARRIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.log(Level.INFO, "Using %s as the ParticleEffect for /f sc", effect.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
|
if (seeChunkMap.containsKey(me.getName())) {
|
||||||
|
seeChunkMap.remove(me.getName());
|
||||||
|
msg(TL.COMMAND_SEECHUNK_DISABLED);
|
||||||
|
} else {
|
||||||
|
seeChunkMap.put(me.getName(), true);
|
||||||
|
msg(TL.COMMAND_SEECHUNK_ENABLED);
|
||||||
|
manageTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void manageTask() {
|
||||||
|
if (taskID != -1) {
|
||||||
|
if (seeChunkMap.keySet().size() == 0) {
|
||||||
|
Bukkit.getScheduler().cancelTask(taskID);
|
||||||
|
taskID = -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
startTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startTask() {
|
||||||
|
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Iterator itr = seeChunkMap.keySet().iterator();
|
||||||
|
while (itr.hasNext()) {
|
||||||
|
Object nameObject = itr.next();
|
||||||
|
String name = nameObject + "";
|
||||||
|
Player player = Bukkit.getPlayer(name);
|
||||||
|
showBorders(player);
|
||||||
|
}
|
||||||
|
manageTask();
|
||||||
|
}
|
||||||
|
}, 0, interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showBorders(Player me) {
|
||||||
World world = me.getWorld();
|
World world = me.getWorld();
|
||||||
FLocation flocation = new FLocation(me);
|
FLocation flocation = new FLocation(me);
|
||||||
int chunkX = (int) flocation.getX();
|
int chunkX = (int) flocation.getX();
|
||||||
@ -70,14 +115,16 @@ public class CmdSeeChunk extends FCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showPillar(Player player, World world, int blockX, int blockZ) {
|
private void showPillar(Player player, World world, int blockX, int blockZ) {
|
||||||
|
List<Player> onePlayer = Arrays.asList(player);
|
||||||
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
||||||
Location loc = new Location(world, blockX, blockY, blockZ);
|
Location loc = new Location(world, blockX, blockY, blockZ).add(0.5, 0, 0.5);
|
||||||
if (loc.getBlock().getType() != Material.AIR) {
|
if (loc.getBlock().getType() != Material.AIR) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useParticles) {
|
if (useParticles) {
|
||||||
this.effect.display(0, 0, 0, 10, 1, loc, player);
|
//api didnt seem to have anything for a single player, so I used a one player list :P
|
||||||
|
effect.send(onePlayer, loc, 0, 0, 0, 0, 1, 50);
|
||||||
} else {
|
} else {
|
||||||
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
|
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
|
||||||
VisualizeUtil.addLocation(player, loc, typeId);
|
VisualizeUtil.addLocation(player, loc, typeId);
|
||||||
|
@ -2,6 +2,7 @@ package com.massivecraft.factions.listeners;
|
|||||||
|
|
||||||
import com.massivecraft.factions.*;
|
import com.massivecraft.factions.*;
|
||||||
import com.massivecraft.factions.cmd.CmdFly;
|
import com.massivecraft.factions.cmd.CmdFly;
|
||||||
|
import com.massivecraft.factions.cmd.CmdSeeChunk;
|
||||||
import com.massivecraft.factions.event.FPlayerEnteredFactionEvent;
|
import com.massivecraft.factions.event.FPlayerEnteredFactionEvent;
|
||||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||||
@ -11,24 +12,26 @@ import com.massivecraft.factions.scoreboards.sidebar.FDefaultSidebar;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.util.Particle.ParticleEffect;
|
import com.massivecraft.factions.util.FactionGUI;
|
||||||
import com.massivecraft.factions.util.VisualizeUtil;
|
import com.massivecraft.factions.util.VisualizeUtil;
|
||||||
import com.massivecraft.factions.zcore.fperms.Access;
|
import com.massivecraft.factions.zcore.fperms.Access;
|
||||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||||
import com.massivecraft.factions.util.FactionGUI;
|
|
||||||
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
|
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
import com.sun.org.apache.xerces.internal.xs.StringList;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.*;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
@ -38,6 +41,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.NumberConversions;
|
import org.bukkit.util.NumberConversions;
|
||||||
|
import org.inventivetalent.particle.ParticleEffect;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -142,6 +146,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fallMap.put(me.getPlayer(), false);
|
fallMap.put(me.getPlayer(), false);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -215,9 +220,14 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CmdSeeChunk.seeChunkMap.containsKey(event.getPlayer().getName())) {
|
||||||
|
CmdSeeChunk.seeChunkMap.remove(event.getPlayer().getName());
|
||||||
|
}
|
||||||
|
|
||||||
FScoreboard.remove(me);
|
FScoreboard.remove(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String parseAllPlaceholders(String string, Faction faction) {
|
public String parseAllPlaceholders(String string, Faction faction) {
|
||||||
string = string.replace("{Faction}", faction.getTag())
|
string = string.replace("{Faction}", faction.getTag())
|
||||||
.replace("{online}", faction.getOnlinePlayers().size() + "")
|
.replace("{online}", faction.getOnlinePlayers().size() + "")
|
||||||
@ -392,7 +402,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
bannerCooldownMap.put(fme.getTag(),true);
|
bannerCooldownMap.put(fme.getTag(),true);
|
||||||
bannerLocations.put(fme.getTag(),e.getBlockPlaced().getLocation());
|
bannerLocations.put(fme.getTag(),e.getBlockPlaced().getLocation());
|
||||||
int bannerCooldown = P.p.getConfig().getInt("fbanners.Banner-Place-Cooldown");
|
final int bannerCooldown = P.p.getConfig().getInt("fbanners.Banner-Place-Cooldown");
|
||||||
final ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5,1,0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5,1,0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand
|
final ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5,1,0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5,1,0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand
|
||||||
as.setVisible(false); //Makes the ArmorStand invisible
|
as.setVisible(false); //Makes the ArmorStand invisible
|
||||||
as.setGravity(false); //Make sure it doesn't fall
|
as.setGravity(false); //Make sure it doesn't fall
|
||||||
@ -427,8 +437,9 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
String[] components = effect.split(":");
|
String[] components = effect.split(":");
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(components[0]),100,Integer.parseInt(components[1])));
|
player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(components[0]),100,Integer.parseInt(components[1])));
|
||||||
}
|
}
|
||||||
ParticleEffect.FLAME.display(1,1,1,1,10,banner.getLocation(),16);
|
ParticleEffect.FLAME.send(Bukkit.getOnlinePlayers(), banner.getLocation(), 1, 1, 1, 1, 10, 16);
|
||||||
ParticleEffect.LAVA.display(1,1,1,1,10,banner.getLocation(),16);
|
ParticleEffect.LAVA.send(Bukkit.getOnlinePlayers(), banner.getLocation(), 1, 1, 1, 1, 10, 16);
|
||||||
|
|
||||||
if (banner.getType() != bannerType){
|
if (banner.getType() != bannerType){
|
||||||
banner.setType(bannerType);
|
banner.setType(bannerType);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,605 +0,0 @@
|
|||||||
package com.massivecraft.factions.util.Particle;
|
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <b>com.prosavage.savagecore.particle.ReflectionUtils</b>
|
|
||||||
* <p>
|
|
||||||
* This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit
|
|
||||||
* <p>
|
|
||||||
* You are welcome to use it, modify it and redistribute it under the following conditions:
|
|
||||||
* <ul>
|
|
||||||
* <li>Don't claim this class as your own
|
|
||||||
* <li>Don't remove this disclaimer
|
|
||||||
* </ul>
|
|
||||||
* <p>
|
|
||||||
* <i>It would be nice if you provide credit to me if you use this class in a published project</i>
|
|
||||||
*
|
|
||||||
* @author Araos
|
|
||||||
* @version 1.1
|
|
||||||
*/
|
|
||||||
public final class ReflectionUtils {
|
|
||||||
// Prevent accidental construction
|
|
||||||
private ReflectionUtils() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the constructor of a given class with the given parameter types
|
|
||||||
*
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param parameterTypes Parameter types of the desired constructor
|
|
||||||
* @return The constructor of the target class with the specified parameter types
|
|
||||||
* @throws NoSuchMethodException If the desired constructor with the specified parameter types cannot be found
|
|
||||||
* @see DataType
|
|
||||||
* @see DataType#getPrimitive(Class[])
|
|
||||||
* @see DataType#compare(Class[], Class[])
|
|
||||||
*/
|
|
||||||
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes) throws NoSuchMethodException {
|
|
||||||
Class<?>[] primitiveTypes = DataType.getPrimitive(parameterTypes);
|
|
||||||
for (Constructor<?> constructor : clazz.getConstructors()) {
|
|
||||||
if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return constructor;
|
|
||||||
}
|
|
||||||
throw new NoSuchMethodException("There is no such constructor in this class with the specified parameter types");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the constructor of a desired class with the given parameter types
|
|
||||||
*
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param parameterTypes Parameter types of the desired constructor
|
|
||||||
* @return The constructor of the desired target class with the specified parameter types
|
|
||||||
* @throws NoSuchMethodException If the desired constructor with the specified parameter types cannot be found
|
|
||||||
* @throws ClassNotFoundException ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #getConstructor(Class, Class...)
|
|
||||||
*/
|
|
||||||
public static Constructor<?> getConstructor(String className, PackageType packageType, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException {
|
|
||||||
return getConstructor(packageType.getClass(className), parameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an instance of a class with the given arguments
|
|
||||||
*
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param arguments Arguments which are used to construct an object of the target class
|
|
||||||
* @return The instance of the target class with the specified arguments
|
|
||||||
* @throws InstantiationException If you cannot create an instance of the target class due to certain circumstances
|
|
||||||
* @throws IllegalAccessException If the desired constructor cannot be accessed due to certain circumstances
|
|
||||||
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the constructor (this should not occur since it searches for a constructor with the types of the arguments)
|
|
||||||
* @throws InvocationTargetException If the desired constructor cannot be invoked
|
|
||||||
* @throws NoSuchMethodException If the desired constructor with the specified arguments cannot be found
|
|
||||||
*/
|
|
||||||
public static Object instantiateObject(Class<?> clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException {
|
|
||||||
return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an instance of a desired class with the given arguments
|
|
||||||
*
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param arguments Arguments which are used to construct an object of the desired target class
|
|
||||||
* @return The instance of the desired target class with the specified arguments
|
|
||||||
* @throws InstantiationException If you cannot create an instance of the desired target class due to certain circumstances
|
|
||||||
* @throws IllegalAccessException If the desired constructor cannot be accessed due to certain circumstances
|
|
||||||
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the constructor (this should not occur since it searches for a constructor with the types of the arguments)
|
|
||||||
* @throws InvocationTargetException If the desired constructor cannot be invoked
|
|
||||||
* @throws NoSuchMethodException If the desired constructor with the specified arguments cannot be found
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #instantiateObject(Class, Object...)
|
|
||||||
*/
|
|
||||||
public static Object instantiateObject(String className, PackageType packageType, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
|
|
||||||
return instantiateObject(packageType.getClass(className), arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a method of a class with the given parameter types
|
|
||||||
*
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param methodName Name of the desired method
|
|
||||||
* @param parameterTypes Parameter types of the desired method
|
|
||||||
* @return The method of the target class with the specified name and parameter types
|
|
||||||
* @throws NoSuchMethodException If the desired method of the target class with the specified name and parameter types cannot be found
|
|
||||||
* @see DataType#getPrimitive(Class[])
|
|
||||||
* @see DataType#compare(Class[], Class[])
|
|
||||||
*/
|
|
||||||
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException {
|
|
||||||
Class<?>[] primitiveTypes = DataType.getPrimitive(parameterTypes);
|
|
||||||
for (Method method : clazz.getMethods()) {
|
|
||||||
if (!method.getName().equals(methodName) || !DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return method;
|
|
||||||
}
|
|
||||||
throw new NoSuchMethodException("There is no such method in this class with the specified name and parameter types");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a method of a desired class with the given parameter types
|
|
||||||
*
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param methodName Name of the desired method
|
|
||||||
* @param parameterTypes Parameter types of the desired method
|
|
||||||
* @return The method of the desired target class with the specified name and parameter types
|
|
||||||
* @throws NoSuchMethodException If the desired method of the desired target class with the specified name and parameter types cannot be found
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #getMethod(Class, String, Class...)
|
|
||||||
*/
|
|
||||||
public static Method getMethod(String className, PackageType packageType, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException {
|
|
||||||
return getMethod(packageType.getClass(className), methodName, parameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invokes a method on an object with the given arguments
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param methodName Name of the desired method
|
|
||||||
* @param arguments Arguments which are used to invoke the desired method
|
|
||||||
* @return The result of invoking the desired method on the target object
|
|
||||||
* @throws IllegalAccessException If the desired method cannot be accessed due to certain circumstances
|
|
||||||
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the method (this should not occur since it searches for a method with the types of the arguments)
|
|
||||||
* @throws InvocationTargetException If the desired method cannot be invoked on the target object
|
|
||||||
* @throws NoSuchMethodException If the desired method of the class of the target object with the specified name and arguments cannot be found
|
|
||||||
* @see #getMethod(Class, String, Class...)
|
|
||||||
* @see DataType#getPrimitive(Object[])
|
|
||||||
*/
|
|
||||||
public static Object invokeMethod(Object instance, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException {
|
|
||||||
return getMethod(instance.getClass(), methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invokes a method of the target class on an object with the given arguments
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param methodName Name of the desired method
|
|
||||||
* @param arguments Arguments which are used to invoke the desired method
|
|
||||||
* @return The result of invoking the desired method on the target object
|
|
||||||
* @throws IllegalAccessException If the desired method cannot be accessed due to certain circumstances
|
|
||||||
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the method (this should not occur since it searches for a method with the types of the arguments)
|
|
||||||
* @throws InvocationTargetException If the desired method cannot be invoked on the target object
|
|
||||||
* @throws NoSuchMethodException If the desired method of the target class with the specified name and arguments cannot be found
|
|
||||||
* @see #getMethod(Class, String, Class...)
|
|
||||||
* @see DataType#getPrimitive(Object[])
|
|
||||||
*/
|
|
||||||
public static Object invokeMethod(Object instance, Class<?> clazz, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException {
|
|
||||||
return getMethod(clazz, methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invokes a method of a desired class on an object with the given arguments
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param methodName Name of the desired method
|
|
||||||
* @param arguments Arguments which are used to invoke the desired method
|
|
||||||
* @return The result of invoking the desired method on the target object
|
|
||||||
* @throws IllegalAccessException If the desired method cannot be accessed due to certain circumstances
|
|
||||||
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the method (this should not occur since it searches for a method with the types of the arguments)
|
|
||||||
* @throws InvocationTargetException If the desired method cannot be invoked on the target object
|
|
||||||
* @throws NoSuchMethodException If the desired method of the desired target class with the specified name and arguments cannot be found
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #invokeMethod(Object, Class, String, Object...)
|
|
||||||
*/
|
|
||||||
public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
|
|
||||||
return invokeMethod(instance, packageType.getClass(className), methodName, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a field of the target class with the given name
|
|
||||||
*
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @return The field of the target class with the specified name
|
|
||||||
* @throws NoSuchFieldException If the desired field of the given class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
*/
|
|
||||||
public static Field getField(Class<?> clazz, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException {
|
|
||||||
Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName);
|
|
||||||
field.setAccessible(true);
|
|
||||||
return field;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a field of a desired class with the given name
|
|
||||||
*
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @return The field of the desired target class with the specified name
|
|
||||||
* @throws NoSuchFieldException If the desired field of the desired class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #getField(Class, boolean, String)
|
|
||||||
*/
|
|
||||||
public static Field getField(String className, PackageType packageType, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException, ClassNotFoundException {
|
|
||||||
return getField(packageType.getClass(className), declared, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the value of a field of the given class of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @return The value of field of the target object
|
|
||||||
* @throws IllegalArgumentException If the target object does not feature the desired field
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the target class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @see #getField(Class, boolean, String)
|
|
||||||
*/
|
|
||||||
public static Object getValue(Object instance, Class<?> clazz, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
|
|
||||||
return getField(clazz, declared, fieldName).get(instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the value of a field of a desired class of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @return The value of field of the target object
|
|
||||||
* @throws IllegalArgumentException If the target object does not feature the desired field
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the desired class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #getValue(Object, Class, boolean, String)
|
|
||||||
*/
|
|
||||||
public static Object getValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException {
|
|
||||||
return getValue(instance, packageType.getClass(className), declared, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the value of a field with the given name of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @return The value of field of the target object
|
|
||||||
* @throws IllegalArgumentException If the target object does not feature the desired field (should not occur since it searches for a field with the given name in the class of the object)
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the target object cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @see #getValue(Object, Class, boolean, String)
|
|
||||||
*/
|
|
||||||
public static Object getValue(Object instance, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
|
|
||||||
return getValue(instance, instance.getClass(), declared, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of a field of the given class of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param clazz Target class
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @param value New value
|
|
||||||
* @throws IllegalArgumentException If the type of the value does not match the type of the desired field
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the target class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @see #getField(Class, boolean, String)
|
|
||||||
*/
|
|
||||||
public static void setValue(Object instance, Class<?> clazz, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
|
|
||||||
getField(clazz, declared, fieldName).set(instance, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of a field of a desired class of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param className Name of the desired target class
|
|
||||||
* @param packageType Package where the desired target class is located
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @param value New value
|
|
||||||
* @throws IllegalArgumentException If the type of the value does not match the type of the desired field
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the desired class cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found
|
|
||||||
* @see #setValue(Object, Class, boolean, String, Object)
|
|
||||||
*/
|
|
||||||
public static void setValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException {
|
|
||||||
setValue(instance, packageType.getClass(className), declared, fieldName, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of a field with the given name of an object
|
|
||||||
*
|
|
||||||
* @param instance Target object
|
|
||||||
* @param declared Whether the desired field is declared or not
|
|
||||||
* @param fieldName Name of the desired field
|
|
||||||
* @param value New value
|
|
||||||
* @throws IllegalArgumentException If the type of the value does not match the type of the desired field
|
|
||||||
* @throws IllegalAccessException If the desired field cannot be accessed
|
|
||||||
* @throws NoSuchFieldException If the desired field of the target object cannot be found
|
|
||||||
* @throws SecurityException If the desired field cannot be made accessible
|
|
||||||
* @see #setValue(Object, Class, boolean, String, Object)
|
|
||||||
*/
|
|
||||||
public static void setValue(Object instance, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
|
|
||||||
setValue(instance, instance.getClass(), declared, fieldName, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an enumeration of dynamic packages of NMS and CraftBukkit
|
|
||||||
* <p>
|
|
||||||
* This class is part of the <b>com.prosavage.savagecore.particle.ReflectionUtils</b> and follows the same usage conditions
|
|
||||||
*
|
|
||||||
* @author DarkBlade12
|
|
||||||
* @since 1.0
|
|
||||||
*/
|
|
||||||
public enum PackageType {
|
|
||||||
MINECRAFT_SERVER("net.minecraft.server." + getServerVersion()),
|
|
||||||
CRAFTBUKKIT("org.bukkit.craftbukkit." + getServerVersion()),
|
|
||||||
CRAFTBUKKIT_BLOCK(CRAFTBUKKIT, "block"),
|
|
||||||
CRAFTBUKKIT_CHUNKIO(CRAFTBUKKIT, "chunkio"),
|
|
||||||
CRAFTBUKKIT_COMMAND(CRAFTBUKKIT, "command"),
|
|
||||||
CRAFTBUKKIT_CONVERSATIONS(CRAFTBUKKIT, "conversations"),
|
|
||||||
CRAFTBUKKIT_ENCHANTMENS(CRAFTBUKKIT, "enchantments"),
|
|
||||||
CRAFTBUKKIT_ENTITY(CRAFTBUKKIT, "entity"),
|
|
||||||
CRAFTBUKKIT_EVENT(CRAFTBUKKIT, "event"),
|
|
||||||
CRAFTBUKKIT_GENERATOR(CRAFTBUKKIT, "generator"),
|
|
||||||
CRAFTBUKKIT_HELP(CRAFTBUKKIT, "help"),
|
|
||||||
CRAFTBUKKIT_INVENTORY(CRAFTBUKKIT, "inventory"),
|
|
||||||
CRAFTBUKKIT_MAP(CRAFTBUKKIT, "map"),
|
|
||||||
CRAFTBUKKIT_METADATA(CRAFTBUKKIT, "metadata"),
|
|
||||||
CRAFTBUKKIT_POTION(CRAFTBUKKIT, "potion"),
|
|
||||||
CRAFTBUKKIT_PROJECTILES(CRAFTBUKKIT, "projectiles"),
|
|
||||||
CRAFTBUKKIT_SCHEDULER(CRAFTBUKKIT, "scheduler"),
|
|
||||||
CRAFTBUKKIT_SCOREBOARD(CRAFTBUKKIT, "scoreboard"),
|
|
||||||
CRAFTBUKKIT_UPDATER(CRAFTBUKKIT, "updater"),
|
|
||||||
CRAFTBUKKIT_UTIL(CRAFTBUKKIT, "util");
|
|
||||||
|
|
||||||
private final String path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct a new package type
|
|
||||||
*
|
|
||||||
* @param path Path of the package
|
|
||||||
*/
|
|
||||||
private PackageType(String path) {
|
|
||||||
this.path = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct a new package type
|
|
||||||
*
|
|
||||||
* @param parent Parent package of the package
|
|
||||||
* @param path Path of the package
|
|
||||||
*/
|
|
||||||
private PackageType(PackageType parent, String path) {
|
|
||||||
this(parent + "." + path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the version of your server
|
|
||||||
*
|
|
||||||
* @return The server version
|
|
||||||
*/
|
|
||||||
public static String getServerVersion() {
|
|
||||||
return Bukkit.getServer().getClass().getPackage().getName().substring(23);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the path of this package type
|
|
||||||
*
|
|
||||||
* @return The path
|
|
||||||
*/
|
|
||||||
public String getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the class with the given name
|
|
||||||
*
|
|
||||||
* @param className Name of the desired class
|
|
||||||
* @return The class with the specified name
|
|
||||||
* @throws ClassNotFoundException If the desired class with the specified name and package cannot be found
|
|
||||||
*/
|
|
||||||
public Class<?> getClass(String className) throws ClassNotFoundException {
|
|
||||||
return Class.forName(this + "." + className);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override for convenience
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an enumeration of Java data types with corresponding classes
|
|
||||||
* <p>
|
|
||||||
* This class is part of the <b>com.prosavage.savagecore.particle.ReflectionUtils</b> and follows the same usage conditions
|
|
||||||
*
|
|
||||||
* @author DarkBlade12
|
|
||||||
* @since 1.0
|
|
||||||
*/
|
|
||||||
public enum DataType {
|
|
||||||
BYTE(byte.class, Byte.class),
|
|
||||||
SHORT(short.class, Short.class),
|
|
||||||
INTEGER(int.class, Integer.class),
|
|
||||||
LONG(long.class, Long.class),
|
|
||||||
CHARACTER(char.class, Character.class),
|
|
||||||
FLOAT(float.class, Float.class),
|
|
||||||
DOUBLE(double.class, Double.class),
|
|
||||||
BOOLEAN(boolean.class, Boolean.class);
|
|
||||||
|
|
||||||
private static final Map<Class<?>, DataType> CLASS_MAP = new HashMap<Class<?>, DataType>();
|
|
||||||
|
|
||||||
// Initialize map for quick class lookup
|
|
||||||
static {
|
|
||||||
for (DataType type : values()) {
|
|
||||||
CLASS_MAP.put(type.primitive, type);
|
|
||||||
CLASS_MAP.put(type.reference, type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Class<?> primitive;
|
|
||||||
private final Class<?> reference;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct a new data type
|
|
||||||
*
|
|
||||||
* @param primitive Primitive class of this data type
|
|
||||||
* @param reference Reference class of this data type
|
|
||||||
*/
|
|
||||||
private DataType(Class<?> primitive, Class<?> reference) {
|
|
||||||
this.primitive = primitive;
|
|
||||||
this.reference = reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the data type with the given primitive/reference class
|
|
||||||
*
|
|
||||||
* @param clazz Primitive/Reference class of the data type
|
|
||||||
* @return The data type
|
|
||||||
*/
|
|
||||||
public static DataType fromClass(Class<?> clazz) {
|
|
||||||
return CLASS_MAP.get(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primitive class of the data type with the given reference class
|
|
||||||
*
|
|
||||||
* @param clazz Reference class of the data type
|
|
||||||
* @return The primitive class
|
|
||||||
*/
|
|
||||||
public static Class<?> getPrimitive(Class<?> clazz) {
|
|
||||||
DataType type = fromClass(clazz);
|
|
||||||
return type == null ? clazz : type.getPrimitive();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the reference class of the data type with the given primitive class
|
|
||||||
*
|
|
||||||
* @param clazz Primitive class of the data type
|
|
||||||
* @return The reference class
|
|
||||||
*/
|
|
||||||
public static Class<?> getReference(Class<?> clazz) {
|
|
||||||
DataType type = fromClass(clazz);
|
|
||||||
return type == null ? clazz : type.getReference();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primitive class array of the given class array
|
|
||||||
*
|
|
||||||
* @param classes Given class array
|
|
||||||
* @return The primitive class array
|
|
||||||
*/
|
|
||||||
public static Class<?>[] getPrimitive(Class<?>[] classes) {
|
|
||||||
int length = classes == null ? 0 : classes.length;
|
|
||||||
Class<?>[] types = new Class<?>[length];
|
|
||||||
for (int index = 0; index < length; index++) {
|
|
||||||
types[index] = getPrimitive(classes[index]);
|
|
||||||
}
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the reference class array of the given class array
|
|
||||||
*
|
|
||||||
* @param classes Given class array
|
|
||||||
* @return The reference class array
|
|
||||||
*/
|
|
||||||
public static Class<?>[] getReference(Class<?>[] classes) {
|
|
||||||
int length = classes == null ? 0 : classes.length;
|
|
||||||
Class<?>[] types = new Class<?>[length];
|
|
||||||
for (int index = 0; index < length; index++) {
|
|
||||||
types[index] = getReference(classes[index]);
|
|
||||||
}
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primitive class array of the given object array
|
|
||||||
*
|
|
||||||
* @param objects Given object array
|
|
||||||
* @return The primitive class array
|
|
||||||
*/
|
|
||||||
public static Class<?>[] getPrimitive(Object[] objects) {
|
|
||||||
int length = objects == null ? 0 : objects.length;
|
|
||||||
Class<?>[] types = new Class<?>[length];
|
|
||||||
for (int index = 0; index < length; index++) {
|
|
||||||
types[index] = getPrimitive(objects[index].getClass());
|
|
||||||
}
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the reference class array of the given object array
|
|
||||||
*
|
|
||||||
* @param objects Given object array
|
|
||||||
* @return The reference class array
|
|
||||||
*/
|
|
||||||
public static Class<?>[] getReference(Object[] objects) {
|
|
||||||
int length = objects == null ? 0 : objects.length;
|
|
||||||
Class<?>[] types = new Class<?>[length];
|
|
||||||
for (int index = 0; index < length; index++) {
|
|
||||||
types[index] = getReference(objects[index].getClass());
|
|
||||||
}
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compares two class arrays on equivalence
|
|
||||||
*
|
|
||||||
* @param primary Primary class array
|
|
||||||
* @param secondary Class array which is compared to the primary array
|
|
||||||
* @return Whether these arrays are equal or not
|
|
||||||
*/
|
|
||||||
public static boolean compare(Class<?>[] primary, Class<?>[] secondary) {
|
|
||||||
if (primary == null || secondary == null || primary.length != secondary.length) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (int index = 0; index < primary.length; index++) {
|
|
||||||
Class<?> primaryClass = primary[index];
|
|
||||||
Class<?> secondaryClass = secondary[index];
|
|
||||||
if (primaryClass.equals(secondaryClass) || primaryClass.isAssignableFrom(secondaryClass)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primitive class of this data type
|
|
||||||
*
|
|
||||||
* @return The primitive class
|
|
||||||
*/
|
|
||||||
public Class<?> getPrimitive() {
|
|
||||||
return primitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the reference class of this data type
|
|
||||||
*
|
|
||||||
* @return The reference class
|
|
||||||
*/
|
|
||||||
public Class<?> getReference() {
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,6 +22,7 @@ import com.massivecraft.factions.zcore.fperms.Access;
|
|||||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -1149,4 +1150,25 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasMoney(int amt) {
|
||||||
|
Economy econ = P.p.getEcon();
|
||||||
|
if (econ.getBalance((Player) getPlayer()) >= amt) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
msg(TL.COMMAND_UPGRADES_NOTENOUGHMONEY);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void takeMoney(int amt) {
|
||||||
|
if (hasMoney(amt)) {
|
||||||
|
Economy econ = P.p.getEcon();
|
||||||
|
econ.withdrawPlayer(getPlayer(), amt);
|
||||||
|
sendMessage(TL.COMMAND_UPGRADES_MONEYTAKE.toString().replace("{amount}", amt + ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -234,6 +234,7 @@ public enum TL {
|
|||||||
COMMAND_CHECKPOINT_DISABLED("You cannot use checkpoint while disabled!"),
|
COMMAND_CHECKPOINT_DISABLED("You cannot use checkpoint while disabled!"),
|
||||||
COMMAND_CHECKPOINT_SET("&cYou have set the faction checkpoint at your Location."),
|
COMMAND_CHECKPOINT_SET("&cYou have set the faction checkpoint at your Location."),
|
||||||
COMMAND_CHECKPOINT_GO("&cTeleporting to faction checkpoint"),
|
COMMAND_CHECKPOINT_GO("&cTeleporting to faction checkpoint"),
|
||||||
|
COMMAND_CHECKPOINT_INVALIDLOCATION("&cInvalid Location! You can set checkpoints in your claims or wilderness."),
|
||||||
COMMAND_CHECKPOINT_NOT_SET("&cYou have to set the faction checkpoint first."),
|
COMMAND_CHECKPOINT_NOT_SET("&cYou have to set the faction checkpoint first."),
|
||||||
COMMAND_CHECKPOINT_CLAIMED("&cYour current faction checkpoint is claimed, set a new one!"),
|
COMMAND_CHECKPOINT_CLAIMED("&cYour current faction checkpoint is claimed, set a new one!"),
|
||||||
COMMAND_CHECKPOINT_DESCRIPTION("Set or go to your faction checkpoint!"),
|
COMMAND_CHECKPOINT_DESCRIPTION("Set or go to your faction checkpoint!"),
|
||||||
@ -561,6 +562,8 @@ public enum TL {
|
|||||||
COMMAND_GETVAULT_INVALIDLOCATION("&cVault can only be placed in faction land!"),
|
COMMAND_GETVAULT_INVALIDLOCATION("&cVault can only be placed in faction land!"),
|
||||||
COMMAND_GETVAULT_DESCRIPTION("Get the faction vault item!"),
|
COMMAND_GETVAULT_DESCRIPTION("Get the faction vault item!"),
|
||||||
COMMAND_GETVAULT_RECEIVE("&cYou have recieved a faction vault!"),
|
COMMAND_GETVAULT_RECEIVE("&cYou have recieved a faction vault!"),
|
||||||
|
COMMAND_GETVAULT_NOMONEY("&cYou do not have enough money"),
|
||||||
|
COMMAND_GETVAULT_MONEYTAKE("&c{amount} has been taken from your account"),
|
||||||
|
|
||||||
COMMAND_SHOW_NOFACTION_SELF("You are not in a faction"),
|
COMMAND_SHOW_NOFACTION_SELF("You are not in a faction"),
|
||||||
COMMAND_SHOW_NOFACTION_OTHER("That's not a faction"),
|
COMMAND_SHOW_NOFACTION_OTHER("That's not a faction"),
|
||||||
@ -607,6 +610,10 @@ public enum TL {
|
|||||||
COMMAND_STUCK_FORSTUCK("for %1$s initiating a safe teleport out"),
|
COMMAND_STUCK_FORSTUCK("for %1$s initiating a safe teleport out"),
|
||||||
COMMAND_STUCK_DESCRIPTION("Safely teleports you out of enemy faction"),
|
COMMAND_STUCK_DESCRIPTION("Safely teleports you out of enemy faction"),
|
||||||
|
|
||||||
|
COMMAND_SEECHUNK_ENABLED("&cSee chunk enabled!"),
|
||||||
|
COMMAND_SEECHUNK_DISABLED("&cSeechunk disbaled!"),
|
||||||
|
|
||||||
|
|
||||||
COMMAND_TAG_TAKEN("<b>That tag is already taken"),
|
COMMAND_TAG_TAKEN("<b>That tag is already taken"),
|
||||||
COMMAND_TAG_TOCHANGE("to change the faction tag"),
|
COMMAND_TAG_TOCHANGE("to change the faction tag"),
|
||||||
COMMAND_TAG_FORCHANGE("for changing the faction tag"),
|
COMMAND_TAG_FORCHANGE("for changing the faction tag"),
|
||||||
|
@ -193,7 +193,7 @@ warmups:
|
|||||||
# Delay for /f warp
|
# Delay for /f warp
|
||||||
f-warp: 10
|
f-warp: 10
|
||||||
# Delay for /f fly
|
# Delay for /f fly
|
||||||
f-fly: 10
|
f-fly: 0
|
||||||
#Delay for /f checkpoint's teleport
|
#Delay for /f checkpoint's teleport
|
||||||
f-checkpoint: 10
|
f-checkpoint: 10
|
||||||
#Delay for /f tpbanner
|
#Delay for /f tpbanner
|
||||||
@ -669,6 +669,7 @@ fnear:
|
|||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
fvault:
|
fvault:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
Price: 5000
|
||||||
Item:
|
Item:
|
||||||
Name: '&e&l*&f&l*&e&l* &e&lFaction Vault &7(Place) &e&l*&f&l*&e&l*'
|
Name: '&e&l*&f&l*&e&l* &e&lFaction Vault &7(Place) &e&l*&f&l*&e&l*'
|
||||||
Lore:
|
Lore:
|
||||||
@ -853,8 +854,11 @@ see-chunk:
|
|||||||
# If disabled, it will use fake blocks like before (can cause client side lag)
|
# If disabled, it will use fake blocks like before (can cause client side lag)
|
||||||
particles: true
|
particles: true
|
||||||
particle: "BARRIER"
|
particle: "BARRIER"
|
||||||
# How long should we show these particles? No idea the units, 10 just seemed good.
|
# For Particle types like barrier, the interval can be much higher. but for redstone etc it has to be low, like 10
|
||||||
length: 10
|
# Interval between when particles are sent
|
||||||
|
# setting to 10 makes it a constant heartbeat effect
|
||||||
|
# setting to 5, makes it almost solid ( looks better imo but is more intensive)
|
||||||
|
interval: 10
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: Factions
|
name: Factions
|
||||||
version: ${project.version}-SF-1.0.18
|
version: ${project.version}-SF-1.0.19
|
||||||
main: com.massivecraft.factions.P
|
main: com.massivecraft.factions.P
|
||||||
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
|
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
|
||||||
softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]
|
softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]
|
||||||
|
Loading…
Reference in New Issue
Block a user