mirror of
https://github.com/songoda/UltimateKits.git
synced 2025-02-16 19:31:25 +01:00
Merge branch 'development'
This commit is contained in:
commit
da7d7056ec
157
pom.xml
157
pom.xml
@ -1,104 +1,119 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>UltimateKits</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>2.7.0</version>
|
||||
<version>2.7.1</version>
|
||||
|
||||
<name>UltimateKits</name>
|
||||
<description>Creating and displaying your servers kits has never been easier</description>
|
||||
<url>https://songoda.com/marketplace/product/14</url>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<java.release>8</java.release>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<issueManagement>
|
||||
<url>https://support.songoda.com/servicedesk/customer/portal/3</url>
|
||||
<system>Jira Service Desk</system>
|
||||
</issueManagement>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/songoda/UltimateKits</url>
|
||||
<connection>scm:git:git:github.com/songoda/UltimateKits.git</connection>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>UltimateKits-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.8.1</version>
|
||||
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
||||
<artifactId>replacer</artifactId>
|
||||
<version>1.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>replace</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<file>${project.build.directory}/classes/plugin.yml</file>
|
||||
<replacements>
|
||||
<replacement>
|
||||
<token>maven-version-number</token>
|
||||
<value>${project.version}</value>
|
||||
</replacement>
|
||||
</replacements>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
|
||||
<release>${java.release}</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0-SNAPSHOT</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shaded</id>
|
||||
<phase>package</phase>
|
||||
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<finalName>${project.name}-${project.version}</finalName>
|
||||
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>com.songoda:SongodaCore</include>
|
||||
<include>com.zaxxer:HikariCP</include>
|
||||
<include>org.slf4j:slf4j-api</include>
|
||||
<include>org.slf4j:slf4j-nop</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.songoda.core</pattern>
|
||||
<shadedPattern>${project.groupId}.ultimatekits.core</shadedPattern>
|
||||
<shadedPattern>com.songoda.epicanchors.core</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
|
||||
<excludes>
|
||||
<exclude>META-INF/**</exclude>
|
||||
<exclude>LICENSE</exclude>
|
||||
<exclude>LICENSE.**</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<id>spigotmc-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>songoda-public</id>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
@ -106,52 +121,40 @@
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore</artifactId>
|
||||
<version>2.6.9</version>
|
||||
<version>2.6.12</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.earth2me</groupId>
|
||||
<artifactId>essentials</artifactId>
|
||||
<version>2.17.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>bammerbom</groupId>
|
||||
<artifactId>UltimateCore</artifactId>
|
||||
<version>2.1.26</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.Zrips</groupId>
|
||||
<artifactId>CMI-API</artifactId>
|
||||
<version>7.6.2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>3.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-nop</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -394,9 +394,9 @@ public class KitEditorGui extends DoubleGui {
|
||||
AnvilGui gui = new AnvilGui(player, this);
|
||||
gui.setTitle("Enter a Material");
|
||||
gui.setAction(event -> {
|
||||
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(gui.getInputText());
|
||||
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(gui.getInputText().trim());
|
||||
if (compatibleMaterial == null) {
|
||||
player.sendMessage(gui.getInputText() + " is not a valid material.");
|
||||
player.sendMessage("'" + gui.getInputText().trim() + "' is not a valid material.");
|
||||
} else {
|
||||
Material material = compatibleMaterial.getMaterial();
|
||||
KitItem newItem = new KitItem(itemStack);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.ultimatekits.handlers;
|
||||
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
@ -15,7 +14,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@ -65,8 +63,8 @@ public class DisplayItemHandler {
|
||||
if (!kitBlockData.isDisplayingItems()) e.remove();
|
||||
|
||||
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(i.getItemStack());
|
||||
int inum = nbtItem.has("num") ? nbtItem.getNBTObject("num").asInt() + 1 : 0;
|
||||
NBTItem nbtItem = new NBTItem(i.getItemStack());
|
||||
int inum = nbtItem.hasKey("num") ? nbtItem.getInteger("num") + 1 : 0;
|
||||
|
||||
int size = list.size();
|
||||
if (inum > size || inum <= 0) inum = 1;
|
||||
@ -81,9 +79,9 @@ public class DisplayItemHandler {
|
||||
meta.setDisplayName(null);
|
||||
meta.setLore(Collections.singletonList("Some lore stuff man."));
|
||||
is.setItemMeta(meta);
|
||||
nbtItem = NmsManager.getNbt().of(is);
|
||||
nbtItem.set("num", inum);
|
||||
i.setItemStack(nbtItem.finish());
|
||||
nbtItem = new NBTItem(is);
|
||||
nbtItem.setInteger("num", inum);
|
||||
i.setItemStack(nbtItem.getItem());
|
||||
i.setPickupDelay(9999);
|
||||
return;
|
||||
}
|
||||
@ -95,11 +93,11 @@ public class DisplayItemHandler {
|
||||
meta.setLore(Collections.singletonList("Display Item"));
|
||||
is.setItemMeta(meta);
|
||||
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(is);
|
||||
nbtItem.set("num", 0);
|
||||
NBTItem nbtItem = new NBTItem(is);
|
||||
nbtItem.setInteger("num", 0);
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
Item item = location.getWorld().dropItem(location.add(0, 1, 0), nbtItem.finish());
|
||||
Item item = location.getWorld().dropItem(location.add(0, 1, 0), nbtItem.getItem());
|
||||
Vector vec = new Vector(0, 0, 0);
|
||||
item.setVelocity(vec);
|
||||
item.setPickupDelay(9999);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.ultimatekits.key;
|
||||
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
@ -73,11 +72,11 @@ public class Key {
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(item);
|
||||
nbtItem.set("key", name);
|
||||
nbtItem.set("kit", kit == null ? "ANY" : kit.getName());
|
||||
NBTItem nbtItem = new NBTItem(item);
|
||||
nbtItem.setString("key", name);
|
||||
nbtItem.setString("kit", kit == null ? "ANY" : kit.getName());
|
||||
|
||||
return nbtItem.finish();
|
||||
return nbtItem.getItem();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
@ -1,14 +1,12 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleHand;
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.CompatibleSound;
|
||||
import com.songoda.core.configuration.Config;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
@ -105,13 +103,13 @@ public class Kit implements Cloneable {
|
||||
|
||||
public void processKeyUse(Player player) {
|
||||
ItemStack item = player.getItemInHand();
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(item);
|
||||
NBTItem nbtItem = new NBTItem(item);
|
||||
|
||||
if (!nbtItem.has("key") || !nbtItem.has("kit"))
|
||||
if (!nbtItem.hasKey("key") || !nbtItem.hasKey("kit"))
|
||||
return;
|
||||
|
||||
String keyName = nbtItem.getNBTObject("key").asString();
|
||||
String kitName = nbtItem.getNBTObject("kit").asString();
|
||||
String keyName = nbtItem.getString("key");
|
||||
String kitName = nbtItem.getString("kit");
|
||||
|
||||
boolean any = kitName.equals("ANY");
|
||||
Key key = plugin.getKeyManager().getKey(keyName);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.type.KitContent;
|
||||
@ -61,15 +60,15 @@ public class KitItem implements Cloneable {
|
||||
|
||||
private void translateTags(ItemStack item) {
|
||||
if (item == null) return;
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(item);
|
||||
if (nbtItem.has("chance"))
|
||||
chance = nbtItem.getNBTObject("chance").asDouble();
|
||||
if (nbtItem.has("display-item"))
|
||||
displayItem = Material.valueOf(nbtItem.getNBTObject("display-item").asString());
|
||||
if (nbtItem.has("display-name"))
|
||||
displayName = nbtItem.getNBTObject("display-name").asString();
|
||||
if (nbtItem.has("display-lore"))
|
||||
displayLore = nbtItem.getNBTObject("display-lore").asString();
|
||||
NBTItem nbtItem = new NBTItem(item);
|
||||
if (nbtItem.hasKey("chance"))
|
||||
chance = nbtItem.getDouble("chance");
|
||||
if (nbtItem.hasKey("display-item"))
|
||||
displayItem = Material.valueOf(nbtItem.getString("display-item"));
|
||||
if (nbtItem.hasKey("display-name"))
|
||||
displayName = nbtItem.getString("display-name");
|
||||
if (nbtItem.hasKey("display-lore"))
|
||||
displayLore = nbtItem.getString("display-lore");
|
||||
}
|
||||
|
||||
private String translateLine(String line) {
|
||||
@ -102,16 +101,16 @@ public class KitItem implements Cloneable {
|
||||
}
|
||||
|
||||
private ItemStack compileOptions(ItemStack item) {
|
||||
NBTItem nbtItem = NmsManager.getNbt().of(item);
|
||||
NBTItem nbtItem = new NBTItem(item);
|
||||
if (chance != 0)
|
||||
nbtItem.set("chance", chance);
|
||||
nbtItem.setDouble("chance", chance);
|
||||
if (displayItem != null)
|
||||
nbtItem.set("display-item", displayItem.name());
|
||||
nbtItem.setString("display-item", displayItem.name());
|
||||
if (displayName != null)
|
||||
nbtItem.set("display-name", displayName);
|
||||
nbtItem.setString("display-name", displayName);
|
||||
if (displayLore != null)
|
||||
nbtItem.set("display-lore", displayLore);
|
||||
return nbtItem.finish();
|
||||
nbtItem.setString("display-lore", displayLore);
|
||||
return nbtItem.getItem();
|
||||
}
|
||||
|
||||
private String compileOptionsText() {
|
||||
@ -224,7 +223,7 @@ public class KitItem implements Cloneable {
|
||||
}
|
||||
|
||||
public KitItem clone() throws CloneNotSupportedException {
|
||||
return (KitItem)super.clone();
|
||||
return (KitItem) super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,29 +1,53 @@
|
||||
name: UltimateKits
|
||||
main: com.songoda.ultimatekits.UltimateKits
|
||||
version: maven-version-number
|
||||
softdepend: [HolographicDisplays, Holograms, CMI, Vault, PlayerPoints, Reserve, PlaceholderAPI, UltimateCore, Essentials, MiniKitPvP]
|
||||
description: View a kit before you purchase it!
|
||||
author: Songoda
|
||||
name: ${project.name}
|
||||
description: ${project.description}
|
||||
version: ${project.version}
|
||||
api-version: 1.13
|
||||
|
||||
main: com.songoda.ultimatekits.UltimateKits
|
||||
softdepend:
|
||||
- CMI
|
||||
- Essentials
|
||||
- Holograms
|
||||
- HolographicDisplays
|
||||
- MiniKitPvP
|
||||
- PlaceholderAPI
|
||||
- PlayerPoints
|
||||
- Reserve
|
||||
- UltimateCore
|
||||
- Vault
|
||||
|
||||
author: Songoda
|
||||
website: ${project.url}
|
||||
|
||||
commands:
|
||||
kitadmin:
|
||||
description: View information on this plugin.
|
||||
default: true
|
||||
aliases: [ultimatekits, kp, uk]
|
||||
usage: /<command> [reload]
|
||||
aliases:
|
||||
- kp
|
||||
- uk
|
||||
- ultimatekits
|
||||
|
||||
kit:
|
||||
description: Preview a kit
|
||||
default: true
|
||||
aliases: [kits]
|
||||
usage: /<commands>
|
||||
aliases:
|
||||
- kits
|
||||
|
||||
previewkit:
|
||||
description: Preview a kit
|
||||
default: true
|
||||
aliases: [pk, preview]
|
||||
usage: /<command> [kit]
|
||||
aliases:
|
||||
- pk
|
||||
- preview
|
||||
|
||||
permissions:
|
||||
ultimatekits.use:
|
||||
description: allows the user to preview kit
|
||||
default: true
|
||||
|
||||
ultimatekits.admin:
|
||||
description: Gives access to admin commands.
|
||||
description: Gives access to admin commands.
|
||||
|
Loading…
Reference in New Issue
Block a user