UltimateKits inital finished.

This commit is contained in:
Brianna O'Keefe 2018-04-11 16:37:03 -04:00
parent 5706ce07d2
commit b43e5d899d
61 changed files with 13 additions and 231 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@
out/
KitPreview\.iml
UltimateKits\.iml

View File

@ -1,4 +1,4 @@
# KitPreview
# UltimateKits
KitPreview introduces a powerful, yet intuitive system to your server that allows players and administrators to preview and purchase your delicately crafted in-game kits. Kits can be easily assigned to any block and configured to sell for either kit keys or economy balance. That, along with it's unique, one-of-a kind kit editor makes it a must have for server owners looking to add something to their server in order to boost profit and keep players motivated! Have questions? Check out our support page [here](http://songoda.com/support.php?a=product&id=KitPreview.2 "http://songoda.com/support.php?a=product&id=KitPreview.2").
UltimateKits introduces a powerful, yet intuitive system to your server that allows players and administrators to preview and purchase your delicately crafted in-game kits. Kits can be easily assigned to any block and configured to sell for either kit keys or economy balance. That, along with it's unique, one-of-a kind kit editor makes it a must have for server owners looking to add something to their server in order to boost profit and keep players motivated! Have questions? Check out our support page [here](http://songoda.com/support.php?a=product&id=UltimateKits.2 "http://songoda.com/support.php?a=product&id=UltimateKits.2").
![N|Solid](https://i.imgur.com/jKtE7ZM.png)

View File

@ -1,5 +1,5 @@
EnableSound: 'This will enable sounds in KitPreview'
Sound: 'This is the sound made when clicking in a KitPreview GUI.'
EnableSound: 'This will enable sounds in UltimateKits'
Sound: 'This is the sound made when clicking in a UltimateKits GUI.'
Lock-KP-Commands: 'Setting this to true will prevent players from using any /KP commands (They never need them)'
Exit-Icon: 'This is the icon for exiting in kitPreview'
Buy-Icon: 'This is the icon for buying things in kitPreview'
@ -7,5 +7,5 @@ Debug-Mode: 'If this is enabled bugs will output to the console.'
Glass-Type: 'This is the id of the glass used for the background in the guis .'
Rainbow-Glass: 'If this is enabled the glass background will be randomized colors.'
Only-Show-Kits-With-Perms: 'If this is set to true kits in the /kits gui will only show up if the user has perms for them.'
Dont-Preview-Commands: 'When enabled this will prevent commands from being previewed in KitPreview'
Dont-Preview-Commands: 'When enabled this will prevent commands from being previewed in UltimateKits'
Kits-Free-With-Perms: 'If this is enabled players will be able to get a kit free through kit preview if they have perms for the kit in essentials/ultimatecore'

Binary file not shown.

View File

@ -1,6 +0,0 @@
package com.songoda.ultimatekits.kits.object;
public class keyData {
String name = "";
}

View File

@ -1,4 +0,0 @@
package com.songoda.ultimatekits.kits.object;
public class KeyManager {
}

View File

@ -1,208 +0,0 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.songoda.ultimatekits.utils;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
public class ReflUtil {
private static String nmsVersion;
private static Map<String, Class<?>> classCache = new HashMap();
private static Table<Class<?>, String, Method> methodCache = HashBasedTable.create();
private static Table<Class<?>, ReflUtil.MethodParams, Method> methodParamCache = HashBasedTable.create();
private static Table<Class<?>, String, Field> fieldCache = HashBasedTable.create();
private static Map<Class<?>, Constructor<?>> constructorCache = new HashMap();
private static Table<Class<?>, ReflUtil.ConstructorParams, Constructor<?>> constructorParamCache = HashBasedTable.create();
public ReflUtil() {
}
public static String getNMSVersion() {
if (nmsVersion == null) {
String name = Bukkit.getServer().getClass().getName();
String[] parts = name.split("\\.");
nmsVersion = parts[3];
}
return nmsVersion;
}
public static Class<?> getNMSClass(String className) {
return getClassCached("net.minecraft.server." + getNMSVersion() + "." + className);
}
public static Class<?> getOBCClass(String className) {
return getClassCached("org.bukkit.craftbukkit." + getNMSVersion() + "." + className);
}
public static Class<?> getClassCached(String className) {
if (classCache.containsKey(className)) {
return (Class)classCache.get(className);
} else {
try {
Class<?> classForName = Class.forName(className);
classCache.put(className, classForName);
return classForName;
} catch (ClassNotFoundException var2) {
return null;
}
}
}
public static Method getMethodCached(Class<?> clazz, String methodName) {
if (methodCache.contains(clazz, methodName)) {
return (Method)methodCache.get(clazz, methodName);
} else {
try {
Method method = clazz.getDeclaredMethod(methodName);
method.setAccessible(true);
methodCache.put(clazz, methodName, method);
return method;
} catch (NoSuchMethodException var3) {
return null;
}
}
}
public static Method getMethodCached(Class<?> clazz, String methodName, Class... params) {
ReflUtil.MethodParams methodParams = new ReflUtil.MethodParams(methodName, params);
if (methodParamCache.contains(clazz, methodParams)) {
return (Method)methodParamCache.get(clazz, methodParams);
} else {
try {
Method method = clazz.getDeclaredMethod(methodName, params);
method.setAccessible(true);
methodParamCache.put(clazz, methodParams, method);
return method;
} catch (NoSuchMethodException var5) {
return null;
}
}
}
public static Field getFieldCached(Class<?> clazz, String fieldName) {
if (fieldCache.contains(clazz, fieldName)) {
return (Field)fieldCache.get(clazz, fieldName);
} else {
try {
Field field = clazz.getDeclaredField(fieldName);
field.setAccessible(true);
fieldCache.put(clazz, fieldName, field);
return field;
} catch (NoSuchFieldException var3) {
return null;
}
}
}
public static Constructor<?> getConstructorCached(Class<?> clazz) {
if (constructorCache.containsKey(clazz)) {
return (Constructor)constructorCache.get(clazz);
} else {
try {
Constructor<?> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
constructorCache.put(clazz, constructor);
return constructor;
} catch (NoSuchMethodException var2) {
return null;
}
}
}
public static Constructor<?> getConstructorCached(Class<?> clazz, Class... params) {
ReflUtil.ConstructorParams constructorParams = new ReflUtil.ConstructorParams(params);
if (constructorParamCache.contains(clazz, constructorParams)) {
return (Constructor)constructorParamCache.get(clazz, constructorParams);
} else {
try {
Constructor<?> constructor = clazz.getDeclaredConstructor(params);
constructor.setAccessible(true);
constructorParamCache.put(clazz, constructorParams, constructor);
return constructor;
} catch (NoSuchMethodException var4) {
return null;
}
}
}
private static class ConstructorParams {
private final Class<?>[] params;
public ConstructorParams(Class<?>[] params) {
this.params = params;
}
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o != null && this.getClass() == o.getClass()) {
ReflUtil.ConstructorParams that = (ReflUtil.ConstructorParams)o;
return Arrays.deepEquals(this.params, that.params);
} else {
return false;
}
}
public int hashCode() {
return Arrays.deepHashCode(this.params);
}
}
private static class MethodParams {
private final String name;
private final Class<?>[] params;
public MethodParams(String name, Class<?>[] params) {
this.name = name;
this.params = params;
}
public boolean equals(Object o) {
if (o == this) {
return true;
} else if (!(o instanceof ReflUtil.MethodParams)) {
return false;
} else {
ReflUtil.MethodParams that = (ReflUtil.MethodParams)o;
if (!that.canEqual(this)) {
return false;
} else {
Object thisName = this.name;
Object thatName = that.name;
if (thisName == null) {
if (thatName == null) {
return Arrays.deepEquals(this.params, that.params);
}
} else if (thisName.equals(thatName)) {
return Arrays.deepEquals(this.params, that.params);
}
return false;
}
}
}
boolean canEqual(Object that) {
return that instanceof ReflUtil.MethodParams;
}
public int hashCode() {
int result = 1;
Object thisName = this.name;
result = result * 31 + (thisName == null ? 0 : thisName.hashCode());
result = result * 31 + Arrays.deepHashCode(this.params);
return result;
}
}
}

View File

@ -1,15 +1,15 @@
name: KitPreview
main: com.songoda.kitpreview.KitPreview
version: 5.5.1
name: UltimateKits
main: com.songoda.ultimatekits.UltimateKits
version: 1
depend: [Arconix]
softdepend: [PlaceholderAPI, Vault, UltimateCore, Essentials, MiniKitPvP]
description: View a kit before you purchase it!
author: songoda
commands:
kitpreview:
ultimatekits:
description: View information on this plugin.
default: true
aliases: [kp]
aliases: [kp, uk]
usage: /<command> [reload]
previewkit:
description: Preview a kit
@ -17,8 +17,8 @@ commands:
aliases: [pk, preview]
usage: /<command> [kit]
permissions:
kitpreview.use:
ultimatekits.use:
description: allows the user to preview kits
default: true
kitpreview.admin:
ultimatekits.admin:
description: Gives access to admin commands.