mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-26 04:05:26 +01:00
Moved from songoda to craftaro
This commit is contained in:
parent
e018710208
commit
3a652c597d
39
pom.xml
39
pom.xml
@ -4,13 +4,13 @@
|
||||
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>
|
||||
<groupId>com.craftaro</groupId>
|
||||
<artifactId>UltimateKits</artifactId>
|
||||
<version>2.7.7</version>
|
||||
|
||||
<name>UltimateKits</name>
|
||||
<description>Creating and displaying your servers kits has never been easier</description>
|
||||
<url>https://songoda.com/marketplace/product/14</url>
|
||||
<url>https://craftaro.com/marketplace/product/ultimatekits.14</url>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
@ -19,14 +19,9 @@
|
||||
<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>
|
||||
<url>https://github.com/craftaro/UltimateKits</url>
|
||||
<connection>scm:git:git:github.com/craftaro/UltimateKits.git</connection>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
@ -60,13 +55,14 @@
|
||||
<configuration>
|
||||
<finalName>${project.name}-${project.version}</finalName>
|
||||
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<useDependencyReducedPomInJar>true</useDependencyReducedPomInJar>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.songoda.core</pattern>
|
||||
<shadedPattern>com.songoda.epicanchors.core</shadedPattern>
|
||||
<pattern>com.craftaro.core</pattern>
|
||||
<shadedPattern>com.craftaro.ultimatestacker.core</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
|
||||
@ -80,6 +76,15 @@
|
||||
<exclude>LICENSE.**</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<artifact>com.craftaro:CraftaroCore</artifact>
|
||||
<excludeDefaults>false</excludeDefaults>
|
||||
<includes>
|
||||
<include>**/nms/v*/**</include>
|
||||
<include>**/core/third_party/**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -102,7 +107,7 @@
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>songoda-public</id>
|
||||
<id>public</id>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
@ -111,14 +116,14 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore</artifactId>
|
||||
<version>2.6.21</version>
|
||||
<groupId>com.craftaro</groupId>
|
||||
<artifactId>CraftaroCore</artifactId>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -1,56 +1,53 @@
|
||||
package com.songoda.ultimatekits;
|
||||
package com.craftaro.ultimatekits;
|
||||
|
||||
import com.songoda.core.SongodaCore;
|
||||
import com.songoda.core.SongodaPlugin;
|
||||
import com.songoda.core.commands.CommandManager;
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.configuration.Config;
|
||||
import com.songoda.core.database.DataMigrationManager;
|
||||
import com.songoda.core.database.DatabaseConnector;
|
||||
import com.songoda.core.database.MySQLConnector;
|
||||
import com.songoda.core.database.SQLiteConnector;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.HologramManager;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.category.CategoryManager;
|
||||
import com.songoda.ultimatekits.commands.CommandCategories;
|
||||
import com.songoda.ultimatekits.commands.CommandCrate;
|
||||
import com.songoda.ultimatekits.commands.CommandCreatekit;
|
||||
import com.songoda.ultimatekits.commands.CommandEdit;
|
||||
import com.songoda.ultimatekits.commands.CommandKey;
|
||||
import com.songoda.ultimatekits.commands.CommandKit;
|
||||
import com.songoda.ultimatekits.commands.CommandPreviewKit;
|
||||
import com.songoda.ultimatekits.commands.CommandReload;
|
||||
import com.songoda.ultimatekits.commands.CommandRemove;
|
||||
import com.songoda.ultimatekits.commands.CommandSet;
|
||||
import com.songoda.ultimatekits.commands.CommandSettings;
|
||||
import com.songoda.ultimatekits.conversion.Convert;
|
||||
import com.songoda.ultimatekits.crate.Crate;
|
||||
import com.songoda.ultimatekits.crate.CrateManager;
|
||||
import com.songoda.ultimatekits.database.DataManager;
|
||||
import com.songoda.ultimatekits.database.migrations._1_InitialMigration;
|
||||
import com.songoda.ultimatekits.database.migrations._2_DuplicateMigration;
|
||||
import com.songoda.ultimatekits.handlers.DisplayItemHandler;
|
||||
import com.songoda.ultimatekits.handlers.ParticleHandler;
|
||||
import com.songoda.ultimatekits.key.Key;
|
||||
import com.songoda.ultimatekits.key.KeyManager;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitAnimation;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.kit.KitItem;
|
||||
import com.songoda.ultimatekits.kit.KitManager;
|
||||
import com.songoda.ultimatekits.kit.KitType;
|
||||
import com.songoda.ultimatekits.listeners.BlockListeners;
|
||||
import com.songoda.ultimatekits.listeners.ChatListeners;
|
||||
import com.songoda.ultimatekits.listeners.ChunkListeners;
|
||||
import com.songoda.ultimatekits.listeners.EntityListeners;
|
||||
import com.songoda.ultimatekits.listeners.InteractListeners;
|
||||
import com.songoda.ultimatekits.listeners.PlayerListeners;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.ItemSerializer;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.SongodaCore;
|
||||
import com.craftaro.core.SongodaPlugin;
|
||||
import com.craftaro.core.commands.CommandManager;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.configuration.Config;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.core.hooks.HologramManager;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.handlers.DisplayItemHandler;
|
||||
import com.craftaro.ultimatekits.handlers.ParticleHandler;
|
||||
import com.craftaro.ultimatekits.key.KeyManager;
|
||||
import com.craftaro.ultimatekits.kit.KitItem;
|
||||
import com.craftaro.ultimatekits.kit.KitType;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.category.CategoryManager;
|
||||
import com.craftaro.ultimatekits.commands.CommandCategories;
|
||||
import com.craftaro.ultimatekits.commands.CommandCrate;
|
||||
import com.craftaro.ultimatekits.commands.CommandCreatekit;
|
||||
import com.craftaro.ultimatekits.commands.CommandEdit;
|
||||
import com.craftaro.ultimatekits.commands.CommandKey;
|
||||
import com.craftaro.ultimatekits.commands.CommandKit;
|
||||
import com.craftaro.ultimatekits.commands.CommandPreviewKit;
|
||||
import com.craftaro.ultimatekits.commands.CommandReload;
|
||||
import com.craftaro.ultimatekits.commands.CommandRemove;
|
||||
import com.craftaro.ultimatekits.commands.CommandSet;
|
||||
import com.craftaro.ultimatekits.commands.CommandSettings;
|
||||
import com.craftaro.ultimatekits.conversion.Convert;
|
||||
import com.craftaro.ultimatekits.crate.Crate;
|
||||
import com.craftaro.ultimatekits.crate.CrateManager;
|
||||
import com.craftaro.ultimatekits.database.DataManager;
|
||||
import com.craftaro.ultimatekits.database.migrations._1_InitialMigration;
|
||||
import com.craftaro.ultimatekits.database.migrations._2_DuplicateMigration;
|
||||
import com.craftaro.ultimatekits.key.Key;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitAnimation;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.kit.KitManager;
|
||||
import com.craftaro.ultimatekits.listeners.BlockListeners;
|
||||
import com.craftaro.ultimatekits.listeners.ChatListeners;
|
||||
import com.craftaro.ultimatekits.listeners.ChunkListeners;
|
||||
import com.craftaro.ultimatekits.listeners.EntityListeners;
|
||||
import com.craftaro.ultimatekits.listeners.InteractListeners;
|
||||
import com.craftaro.ultimatekits.listeners.PlayerListeners;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.ItemSerializer;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -84,8 +81,6 @@ public class UltimateKits extends SongodaPlugin {
|
||||
private KeyManager keyManager;
|
||||
private CrateManager crateManager;
|
||||
private CategoryManager categoryManager;
|
||||
|
||||
private DatabaseConnector databaseConnector;
|
||||
private DataManager dataManager;
|
||||
|
||||
private boolean loaded = false;
|
||||
@ -101,7 +96,8 @@ public class UltimateKits extends SongodaPlugin {
|
||||
|
||||
@Override
|
||||
public void onPluginEnable() {
|
||||
SongodaCore.registerPlugin(this, 14, CompatibleMaterial.BEACON);
|
||||
initDatabase(Arrays.asList(new _1_InitialMigration(), new _2_DuplicateMigration()));
|
||||
SongodaCore.registerPlugin(this, 14, XMaterial.BEACON);
|
||||
|
||||
// Load Economy
|
||||
EconomyManager.load();
|
||||
@ -115,6 +111,7 @@ public class UltimateKits extends SongodaPlugin {
|
||||
// Set economy preference
|
||||
EconomyManager.getManager().setPreferredHook(Settings.ECONOMY_PLUGIN.getString());
|
||||
|
||||
this.dataManager = new DataManager(this);
|
||||
this.kitManager = new KitManager();
|
||||
this.keyManager = new KeyManager();
|
||||
this.crateManager = new CrateManager();
|
||||
@ -161,35 +158,6 @@ public class UltimateKits extends SongodaPlugin {
|
||||
pluginManager.registerEvents(new InteractListeners(this, this.guiManager), this);
|
||||
pluginManager.registerEvents(new PlayerListeners(), this);
|
||||
|
||||
try {
|
||||
if (Settings.MYSQL_ENABLED.getBoolean()) {
|
||||
String hostname = Settings.MYSQL_HOSTNAME.getString();
|
||||
int port = Settings.MYSQL_PORT.getInt();
|
||||
String database = Settings.MYSQL_DATABASE.getString();
|
||||
String username = Settings.MYSQL_USERNAME.getString();
|
||||
String password = Settings.MYSQL_PASSWORD.getString();
|
||||
boolean useSSL = Settings.MYSQL_USE_SSL.getBoolean();
|
||||
int poolSize = Settings.MYSQL_POOL_SIZE.getInt();
|
||||
|
||||
this.databaseConnector = new MySQLConnector(this, hostname, port, database, username, password, useSSL, poolSize);
|
||||
this.getLogger().info("Data handler connected using MySQL.");
|
||||
} else {
|
||||
this.databaseConnector = new SQLiteConnector(this);
|
||||
this.getLogger().info("Data handler connected using SQLite.");
|
||||
}
|
||||
|
||||
this.dataManager = new DataManager(this.databaseConnector, this);
|
||||
DataMigrationManager dataMigrationManager = new DataMigrationManager(this.databaseConnector, this.dataManager,
|
||||
new _1_InitialMigration(),
|
||||
new _2_DuplicateMigration(this.databaseConnector instanceof SQLiteConnector));
|
||||
dataMigrationManager.runMigrations();
|
||||
} catch (Exception ex) {
|
||||
this.getLogger().severe("Fatal error trying to connect to database. " +
|
||||
"Please make sure all your connection settings are correct and try again. Plugin has been disabled. (" + ex.getMessage() + ")");
|
||||
emergencyStop();
|
||||
return;
|
||||
}
|
||||
|
||||
this.displayItemHandler.start();
|
||||
this.particleHandler.start();
|
||||
}
|
||||
@ -211,7 +179,7 @@ public class UltimateKits extends SongodaPlugin {
|
||||
|
||||
Category category = categoryManager.addCategory(key, section.getString("name"));
|
||||
if (section.contains("material")) {
|
||||
category.setMaterial(CompatibleMaterial.getMaterial(section.getString("material")).getMaterial());
|
||||
category.setMaterial(CompatibleMaterial.getMaterial(section.getString("material")).get().parseMaterial());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -237,7 +205,7 @@ public class UltimateKits extends SongodaPlugin {
|
||||
if (itemString.contains("{")) {
|
||||
item = ItemSerializer.deserializeItemStackFromJson(itemString);
|
||||
} else {
|
||||
item = CompatibleMaterial.getMaterial(itemString).getItem();
|
||||
item = CompatibleMaterial.getMaterial(itemString).get().parseItem();
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,7 +379,7 @@ public class UltimateKits extends SongodaPlugin {
|
||||
}
|
||||
|
||||
private List<String> formatHologram(KitBlockData data) {
|
||||
getDataManager().updateBlockData(data);
|
||||
getKitDataManager().updateBlockData(data);
|
||||
|
||||
List<String> lines = new ArrayList<>();
|
||||
|
||||
@ -599,15 +567,8 @@ public class UltimateKits extends SongodaPlugin {
|
||||
return this.displayItemHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be made private or removed completely in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
public DatabaseConnector getDatabaseConnector() {
|
||||
return this.databaseConnector;
|
||||
}
|
||||
|
||||
public DataManager getDataManager() {
|
||||
public DataManager getKitDataManager() {
|
||||
return this.dataManager;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.category;
|
||||
package com.craftaro.ultimatekits.category;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.category;
|
||||
package com.craftaro.ultimatekits.category;
|
||||
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.LinkedHashMap;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.gui.CategoryEditorGui;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.CategoryEditorGui;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.crate.Crate;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import com.craftaro.ultimatekits.crate.Crate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.gui.KitEditorGui;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.KitEditorGui;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.gui.BlockEditorGui;
|
||||
import com.songoda.ultimatekits.gui.KitEditorGui;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.BlockEditorGui;
|
||||
import com.craftaro.ultimatekits.gui.KitEditorGui;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
@ -1,11 +1,11 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.utils.PlayerUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.key.Key;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.utils.PlayerUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.key.Key;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
@ -1,11 +1,11 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.gui.CategorySelectorGui;
|
||||
import com.songoda.ultimatekits.gui.KitSelectorGui;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.CategorySelectorGui;
|
||||
import com.craftaro.ultimatekits.gui.KitSelectorGui;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.hooks.HologramManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.hooks.HologramManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -34,7 +34,7 @@ public class CommandSet extends AbstractCommand {
|
||||
}
|
||||
Block b = player.getTargetBlock(null, 200);
|
||||
KitBlockData data = plugin.getKitManager().addKitToLocation(kit, b.getLocation());
|
||||
UltimateKits.getInstance().getDataManager().createBlockData(data);
|
||||
UltimateKits.getInstance().getKitDataManager().createBlockData(data);
|
||||
plugin.getLocale().newMessage("&8Kit &a" + kit.getKey() + " &8set to: &a" + b.getType().toString() + "&8.")
|
||||
.sendPrefixedMessage(sender);
|
||||
return ReturnType.SUCCESS;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.commands;
|
||||
package com.craftaro.ultimatekits.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.configuration.editor.PluginConfigGui;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.configuration.editor.PluginConfigGui;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.songoda.ultimatekits.conversion;
|
||||
package com.craftaro.ultimatekits.conversion;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.conversion.hooks.CMIHook;
|
||||
import com.songoda.ultimatekits.conversion.hooks.DefaultHook;
|
||||
import com.songoda.ultimatekits.conversion.hooks.EssentialsHook;
|
||||
import com.songoda.ultimatekits.conversion.hooks.UltimateCoreHook;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitItem;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitItem;
|
||||
import com.craftaro.ultimatekits.conversion.hooks.CMIHook;
|
||||
import com.craftaro.ultimatekits.conversion.hooks.DefaultHook;
|
||||
import com.craftaro.ultimatekits.conversion.hooks.EssentialsHook;
|
||||
import com.craftaro.ultimatekits.conversion.hooks.UltimateCoreHook;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.conversion;
|
||||
package com.craftaro.ultimatekits.conversion;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.ultimatekits.conversion.hooks;
|
||||
package com.craftaro.ultimatekits.conversion.hooks;
|
||||
|
||||
import com.Zrips.CMI.CMI;
|
||||
import com.Zrips.CMI.Modules.Kits.Kit;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.conversion.Hook;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentCommand;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.conversion.Hook;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentCommand;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.HashSet;
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.conversion.hooks;
|
||||
package com.craftaro.ultimatekits.conversion.hooks;
|
||||
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.ultimatekits.conversion.Hook;
|
||||
import com.songoda.ultimatekits.utils.ItemSerializer;
|
||||
import com.craftaro.core.compatibility.ServerVersion;
|
||||
import com.craftaro.ultimatekits.conversion.Hook;
|
||||
import com.craftaro.ultimatekits.utils.ItemSerializer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.HashSet;
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.ultimatekits.conversion.hooks;
|
||||
package com.craftaro.ultimatekits.conversion.hooks;
|
||||
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.conversion.Hook;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.Kit;
|
||||
import com.earth2me.essentials.MetaItemStack;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.conversion.Hook;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.conversion.hooks;
|
||||
package com.craftaro.ultimatekits.conversion.hooks;
|
||||
|
||||
import bammerbom.ultimatecore.bukkit.api.UC;
|
||||
import bammerbom.ultimatecore.bukkit.api.UKit;
|
||||
import com.songoda.ultimatekits.conversion.Hook;
|
||||
import com.craftaro.ultimatekits.conversion.Hook;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.HashSet;
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.crate;
|
||||
package com.craftaro.ultimatekits.crate;
|
||||
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.crate;
|
||||
package com.craftaro.ultimatekits.crate;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
@ -1,15 +1,12 @@
|
||||
package com.songoda.ultimatekits.database;
|
||||
package com.craftaro.ultimatekits.database;
|
||||
|
||||
import com.songoda.core.database.DataManagerAbstract;
|
||||
import com.songoda.core.database.DatabaseConnector;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.kit.KitType;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.kit.KitType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@ -19,15 +16,16 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DataManager extends DataManagerAbstract {
|
||||
public class DataManager {
|
||||
|
||||
public DataManager(DatabaseConnector databaseConnector, Plugin plugin) {
|
||||
super(databaseConnector, plugin);
|
||||
private final UltimateKits plugin;
|
||||
public DataManager(UltimateKits plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void bulkUpdateBlockData(Map<Location, KitBlockData> blockData) {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String updateData = "UPDATE " + this.getTablePrefix() + "blockdata SET type = ?, kit = ?, holograms = ?, " +
|
||||
try (Connection connection = plugin.getDataManager().getDatabaseConnector().getConnection()) {
|
||||
String updateData = "UPDATE " + plugin.getDataManager().getTablePrefix() + "blockdata SET type = ?, kit = ?, holograms = ?, " +
|
||||
"displayItems = ?, particles = ?, itemOverride = ? " +
|
||||
"WHERE world = ? AND x = ? AND y = ? AND z = ?";
|
||||
PreparedStatement statement = connection.prepareStatement(updateData);
|
||||
@ -54,9 +52,10 @@ public class DataManager extends DataManagerAbstract {
|
||||
|
||||
public void updateBlockData(KitBlockData blockData) {
|
||||
if (blockData.getWorld() == null) return;
|
||||
this.runAsync(() -> {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String updateData = "UPDATE " + this.getTablePrefix() + "blockdata SET type = ?, kit = ?, holograms = ?, " +
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try (Connection connection = plugin.getDataManager().getDatabaseConnector().getConnection()) {
|
||||
String updateData = "UPDATE " + plugin.getDataManager().getTablePrefix() + "blockdata SET type = ?, kit = ?, holograms = ?, " +
|
||||
"displayItems = ?, particles = ?, itemOverride = ? " +
|
||||
"WHERE world = ? AND x = ? AND y = ? AND z = ?";
|
||||
PreparedStatement statement = connection.prepareStatement(updateData);
|
||||
@ -79,9 +78,9 @@ public class DataManager extends DataManagerAbstract {
|
||||
|
||||
public void createBlockData(KitBlockData blockData) {
|
||||
if (blockData.getWorld() == null) return;
|
||||
this.runAsync(() -> {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String createData = "INSERT INTO " + this.getTablePrefix() + "blockdata (" +
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try (Connection connection = plugin.getDataManager().getDatabaseConnector().getConnection()) {
|
||||
String createData = "INSERT INTO " + plugin.getDataManager().getTablePrefix() + "blockdata (" +
|
||||
"type, kit, holograms, displayItems, particles, itemOverride, world, x, y, z)" +
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
PreparedStatement statement = connection.prepareStatement(createData);
|
||||
@ -103,9 +102,9 @@ public class DataManager extends DataManagerAbstract {
|
||||
}
|
||||
|
||||
public void deleteBlockData(KitBlockData blockData) {
|
||||
this.runAsync(() -> {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String deleteData = "DELETE FROM " + this.getTablePrefix() + "blockdata WHERE world = ? " +
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try (Connection connection = plugin.getDataManager().getDatabaseConnector().getConnection()) {
|
||||
String deleteData = "DELETE FROM " + plugin.getDataManager().getTablePrefix() + "blockdata WHERE world = ? " +
|
||||
"AND x = ? AND y = ? AND z = ?";
|
||||
PreparedStatement statement = connection.prepareStatement(deleteData);
|
||||
statement.setString(1, blockData.getWorld().getName());
|
||||
@ -120,9 +119,9 @@ public class DataManager extends DataManagerAbstract {
|
||||
}
|
||||
|
||||
public void getBlockData(Consumer<Map<Location, KitBlockData>> callback) {
|
||||
this.runAsync(() -> {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String selectData = "SELECT * FROM " + this.getTablePrefix() + "blockdata";
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try (Connection connection = plugin.getDataManager().getDatabaseConnector().getConnection()) {
|
||||
String selectData = "SELECT * FROM " + plugin.getDataManager().getTablePrefix() + "blockdata";
|
||||
Map<Location, KitBlockData> blockData = new HashMap<>();
|
||||
Statement statement = connection.createStatement();
|
||||
ResultSet result = statement.executeQuery(selectData);
|
||||
@ -147,7 +146,7 @@ public class DataManager extends DataManagerAbstract {
|
||||
blockData.put(location, new KitBlockData(kit, location, type, holograms, particles, displayItems, itemOverride));
|
||||
}
|
||||
|
||||
this.sync(() -> callback.accept(blockData));
|
||||
Bukkit.getScheduler().runTask(plugin, () -> callback.accept(blockData));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.songoda.ultimatekits.database.migrations;
|
||||
package com.craftaro.ultimatekits.database.migrations;
|
||||
|
||||
import com.songoda.core.database.DataMigration;
|
||||
import com.craftaro.core.database.DataMigration;
|
||||
import com.craftaro.core.database.DatabaseConnector;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@ -13,12 +14,8 @@ public class _1_InitialMigration extends DataMigration {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void migrate(Connection connection, String tablePrefix) throws SQLException {
|
||||
// String autoIncrement = UltimateKits.getInstance().getDatabaseConnector() instanceof
|
||||
// MySQLConnector ? " AUTO_INCREMENT" : "";
|
||||
|
||||
// Create plugin settings table
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
public void migrate(DatabaseConnector databaseConnector, String tablePrefix) throws SQLException {
|
||||
try (Statement statement = databaseConnector.getConnection().createStatement()) {
|
||||
statement.execute("CREATE TABLE " + tablePrefix + "blockdata (" +
|
||||
"type TEXT NOT NULL," +
|
||||
"kit TEXT NOT NULL," +
|
@ -1,6 +1,9 @@
|
||||
package com.songoda.ultimatekits.database.migrations;
|
||||
package com.craftaro.ultimatekits.database.migrations;
|
||||
|
||||
import com.songoda.core.database.DataMigration;
|
||||
|
||||
import com.craftaro.core.database.DataMigration;
|
||||
import com.craftaro.core.database.DatabaseConnector;
|
||||
import com.craftaro.core.database.SQLiteConnector;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@ -11,16 +14,16 @@ import java.util.HashMap;
|
||||
|
||||
public class _2_DuplicateMigration extends DataMigration {
|
||||
|
||||
private final boolean sqlite;
|
||||
|
||||
public _2_DuplicateMigration(boolean sqlite) {
|
||||
public _2_DuplicateMigration() {
|
||||
super(2);
|
||||
this.sqlite = sqlite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void migrate(Connection connection, String tablePrefix) throws SQLException {
|
||||
public void migrate(DatabaseConnector databaseConnector, String tablePrefix) throws SQLException {
|
||||
// Fix duplicate data caused by old sqlite data duplication bug
|
||||
Connection connection = databaseConnector.getConnection();
|
||||
boolean sqlite = databaseConnector instanceof SQLiteConnector;
|
||||
if (sqlite) {
|
||||
HashMap<String, TempKitData> data = new HashMap();
|
||||
// grab a copy of the unique data values
|
@ -1,136 +1,137 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.CompatibleSound;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitItem;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.ArmorType;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class AnimatedKitGui extends Gui {
|
||||
|
||||
static final Random rand = new Random();
|
||||
|
||||
private final UltimateKits plugin;
|
||||
private final Player player;
|
||||
private final ItemStack give;
|
||||
private final ArrayDeque<KitItem> items = new ArrayDeque();
|
||||
private boolean finish = false;
|
||||
private boolean done = false;
|
||||
private int tick = 0, updateTick = 0;
|
||||
private int ticksPerUpdate = 3;
|
||||
private int task;
|
||||
|
||||
public AnimatedKitGui(UltimateKits plugin, Player player, Kit kit, ItemStack give) {
|
||||
this.plugin = plugin;
|
||||
this.player = player;
|
||||
this.give = give;
|
||||
setRows(3);
|
||||
setAllowClose(false);
|
||||
setTitle(kit.getName());
|
||||
setDefaultItem(GuiUtils.getBorderItem(CompatibleMaterial.GRAY_STAINED_GLASS_PANE));
|
||||
|
||||
// ideally, we'd populate the items in such a way that the end item isn't far from the center when the animation is complete
|
||||
// would be something to do if people have large kit loot tables.
|
||||
List<KitItem> kitItems = kit.getContents();
|
||||
if (kitItems.isEmpty()) {
|
||||
throw new RuntimeException("Cannot give an empty kit!");
|
||||
}
|
||||
Collections.shuffle(kitItems);
|
||||
this.items.addAll(kitItems);
|
||||
while (this.items.size() < 10) {
|
||||
items.addAll(kitItems);
|
||||
}
|
||||
|
||||
setItem(4, GuiUtils.getBorderItem(CompatibleMaterial.TRIPWIRE_HOOK));
|
||||
setItem(22, GuiUtils.getBorderItem(CompatibleMaterial.TRIPWIRE_HOOK));
|
||||
tick();
|
||||
setOnOpen(event -> {
|
||||
task = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> tick(), 1L, 1L);
|
||||
});
|
||||
}
|
||||
|
||||
private void tick() {
|
||||
if (++tick < ticksPerUpdate) {
|
||||
return;
|
||||
}
|
||||
tick = 0;
|
||||
int updatesPerSlow = 6;
|
||||
if (++updateTick >= updatesPerSlow) {
|
||||
updateTick = 0;
|
||||
int ticksPerUpdateSlow = Settings.ROULETTE_LENGTH_MULTIPLIER.getInt();
|
||||
if (++ticksPerUpdate >= ticksPerUpdateSlow) {
|
||||
finish = true;
|
||||
}
|
||||
}
|
||||
// now update the display
|
||||
// rainbow disco!
|
||||
for (int col = 0; col < 9; ++col) {
|
||||
if (col == 4) continue;
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(2, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
}
|
||||
|
||||
// item slider
|
||||
if (!done) {
|
||||
CompatibleSound.UI_BUTTON_CLICK.play(player, 5F, 5F);
|
||||
items.addFirst(items.getLast());
|
||||
items.removeLast();
|
||||
Iterator<KitItem> itemIter = items.iterator();
|
||||
for (int i = 9; i < 18; i++) {
|
||||
setItem(0, i, itemIter.next().getItem());
|
||||
}
|
||||
}
|
||||
|
||||
// should we try to wrap it up?
|
||||
if (finish) {
|
||||
ItemStack item = getItem(13);
|
||||
KitItem kitItem = items.stream().filter(i -> i.getItem().isSimilar(item)).findFirst().orElse(null);
|
||||
if (item == null) {
|
||||
done = true; // idk.
|
||||
} else if (item.isSimilar(give)) {
|
||||
if (!done) {
|
||||
done = true;
|
||||
if (!Settings.AUTO_EQUIP_ARMOR_ROULETTE.getBoolean() || !ArmorType.equip(player, give)) {
|
||||
|
||||
ItemStack processedItem = kitItem.getContent().process(player);
|
||||
if (processedItem != null) {
|
||||
Map<Integer, ItemStack> overfilled = player.getInventory().addItem(give);
|
||||
for (ItemStack item2 : overfilled.values()) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CompatibleSound.ENTITY_PLAYER_LEVELUP.play(player, 10f, 10f);
|
||||
plugin.getLocale().getMessage("event.create.won")
|
||||
.processPlaceholder("item", WordUtils.capitalize(give.getType().name().toLowerCase().replace("_", " ")))
|
||||
.sendPrefixedMessage(player);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, this::finish, 50);
|
||||
setAllowClose(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void finish() {
|
||||
Bukkit.getScheduler().cancelTask(task);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound;
|
||||
import com.craftaro.core.third_party.org.apache.commons.text.WordUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitItem;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.ArmorType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class AnimatedKitGui extends Gui {
|
||||
|
||||
static final Random rand = new Random();
|
||||
|
||||
private final UltimateKits plugin;
|
||||
private final Player player;
|
||||
private final ItemStack give;
|
||||
private final ArrayDeque<KitItem> items = new ArrayDeque();
|
||||
private boolean finish = false;
|
||||
private boolean done = false;
|
||||
private int tick = 0, updateTick = 0;
|
||||
private int ticksPerUpdate = 3;
|
||||
private int task;
|
||||
|
||||
public AnimatedKitGui(UltimateKits plugin, Player player, Kit kit, ItemStack give) {
|
||||
this.plugin = plugin;
|
||||
this.player = player;
|
||||
this.give = give;
|
||||
setRows(3);
|
||||
setAllowClose(false);
|
||||
setTitle(kit.getName());
|
||||
setDefaultItem(GuiUtils.getBorderItem(XMaterial.GRAY_STAINED_GLASS_PANE));
|
||||
|
||||
// ideally, we'd populate the items in such a way that the end item isn't far from the center when the animation is complete
|
||||
// would be something to do if people have large kit loot tables.
|
||||
List<KitItem> kitItems = kit.getContents();
|
||||
if (kitItems.isEmpty()) {
|
||||
throw new RuntimeException("Cannot give an empty kit!");
|
||||
}
|
||||
Collections.shuffle(kitItems);
|
||||
this.items.addAll(kitItems);
|
||||
while (this.items.size() < 10) {
|
||||
items.addAll(kitItems);
|
||||
}
|
||||
|
||||
setItem(4, GuiUtils.getBorderItem(XMaterial.TRIPWIRE_HOOK));
|
||||
setItem(22, GuiUtils.getBorderItem(XMaterial.TRIPWIRE_HOOK));
|
||||
tick();
|
||||
setOnOpen(event -> {
|
||||
task = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> tick(), 1L, 1L);
|
||||
});
|
||||
}
|
||||
|
||||
private void tick() {
|
||||
if (++tick < ticksPerUpdate) {
|
||||
return;
|
||||
}
|
||||
tick = 0;
|
||||
int updatesPerSlow = 6;
|
||||
if (++updateTick >= updatesPerSlow) {
|
||||
updateTick = 0;
|
||||
int ticksPerUpdateSlow = Settings.ROULETTE_LENGTH_MULTIPLIER.getInt();
|
||||
if (++ticksPerUpdate >= ticksPerUpdateSlow) {
|
||||
finish = true;
|
||||
}
|
||||
}
|
||||
// now update the display
|
||||
// rainbow disco!
|
||||
for (int col = 0; col < 9; ++col) {
|
||||
if (col == 4) continue;
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
setItem(2, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
|
||||
// item slider
|
||||
if (!done) {
|
||||
XSound.UI_BUTTON_CLICK.play(player, 5F, 5F);
|
||||
items.addFirst(items.getLast());
|
||||
items.removeLast();
|
||||
Iterator<KitItem> itemIter = items.iterator();
|
||||
for (int i = 9; i < 18; i++) {
|
||||
setItem(0, i, itemIter.next().getItem());
|
||||
}
|
||||
}
|
||||
|
||||
// should we try to wrap it up?
|
||||
if (finish) {
|
||||
ItemStack item = getItem(13);
|
||||
KitItem kitItem = items.stream().filter(i -> i.getItem().isSimilar(item)).findFirst().orElse(null);
|
||||
if (item == null) {
|
||||
done = true; // idk.
|
||||
} else if (item.isSimilar(give)) {
|
||||
if (!done) {
|
||||
done = true;
|
||||
if (!Settings.AUTO_EQUIP_ARMOR_ROULETTE.getBoolean() || !ArmorType.equip(player, give)) {
|
||||
|
||||
ItemStack processedItem = kitItem.getContent().process(player);
|
||||
if (processedItem != null) {
|
||||
Map<Integer, ItemStack> overfilled = player.getInventory().addItem(give);
|
||||
for (ItemStack item2 : overfilled.values()) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XSound.ENTITY_PLAYER_LEVELUP.play(player, 10f, 10f);
|
||||
plugin.getLocale().getMessage("event.create.won")
|
||||
.processPlaceholder("item", WordUtils.capitalize(give.getType().name().toLowerCase().replace("_", " ")))
|
||||
.sendPrefixedMessage(player);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, this::finish, 50);
|
||||
setAllowClose(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void finish() {
|
||||
Bukkit.getScheduler().cancelTask(task);
|
||||
exit();
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.kit.KitType;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.KitType;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -29,13 +29,13 @@ public class BlockEditorGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> event.player.closeInventory());
|
||||
|
||||
// kit type
|
||||
setButton(1, 2, GuiUtils.createButtonItem(CompatibleMaterial.COMPARATOR,
|
||||
setButton(1, 2, GuiUtils.createButtonItem(XMaterial.COMPARATOR,
|
||||
plugin.getLocale().getMessage("interface.kitblock.switchtype").getMessage(),
|
||||
kitTypeLore(plugin)),
|
||||
ClickType.LEFT,
|
||||
@ -57,14 +57,14 @@ public class BlockEditorGui extends Gui {
|
||||
});
|
||||
|
||||
// decor options
|
||||
setButton(1, 4, GuiUtils.createButtonItem(CompatibleMaterial.POPPY,
|
||||
setButton(1, 4, GuiUtils.createButtonItem(XMaterial.POPPY,
|
||||
plugin.getLocale().getMessage("interface.kitblock.decor").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitblock.decorlore").getMessage().split("\\|")),
|
||||
ClickType.LEFT,
|
||||
event -> event.manager.showGUI(event.player, new KitDecorOptionsGui(plugin, kitBlockData, this)));
|
||||
|
||||
// edit
|
||||
setButton(1, 6, GuiUtils.createButtonItem(CompatibleMaterial.DIAMOND_PICKAXE,
|
||||
setButton(1, 6, GuiUtils.createButtonItem(XMaterial.DIAMOND_PICKAXE,
|
||||
plugin.getLocale().getMessage("interface.kitblock.edit").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitblock.editlore").getMessage().split("\\|")),
|
||||
ClickType.LEFT,
|
@ -1,15 +1,15 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.input.ChatPrompt;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.category.CategoryManager;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.input.ChatPrompt;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.category.CategoryManager;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -34,7 +34,7 @@ public class CategoryEditorGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
mirrorFill(1, 1, false, true, getDefaultItem());
|
||||
|
||||
setButton(4, GuiUtils.createButtonItem(CompatibleMaterial.GREEN_DYE, "Create Category"),
|
||||
setButton(4, GuiUtils.createButtonItem(XMaterial.GREEN_DYE, "Create Category"),
|
||||
(event) -> {
|
||||
if (categoryManager.getCategories().size() >= 7) {
|
||||
plugin.getLocale().newMessage("&cYou already have the maximum amount of categories...").sendPrefixedMessage(player);
|
||||
@ -61,7 +61,7 @@ public class CategoryEditorGui extends Gui {
|
||||
});
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> exit());
|
||||
@ -73,7 +73,7 @@ public class CategoryEditorGui extends Gui {
|
||||
for (int i = 0; i < categories.size(); i++) {
|
||||
Category category = categories.get(i);
|
||||
setButton(i + 10,
|
||||
GuiUtils.createButtonItem(CompatibleMaterial.getMaterial(category.getMaterial()),
|
||||
GuiUtils.createButtonItem(XMaterial.matchXMaterial(category.getMaterial()),
|
||||
TextUtils.formatText(category.getName()),
|
||||
TextUtils.formatText("&6Left click to change name"),
|
||||
"",
|
@ -1,13 +1,14 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -37,12 +38,12 @@ public class CategorySelectorGui extends Gui {
|
||||
int nrows = (int) Math.ceil(categories.size() / (double) showPerRow);
|
||||
setRows(glassless ? nrows : nrows + 2);
|
||||
|
||||
setItem(0, 4, GuiUtils.createButtonItem(CompatibleMaterial.BOOK,
|
||||
setItem(0, 4, GuiUtils.createButtonItem(XMaterial.BOOK,
|
||||
plugin.getLocale().getMessage("interface.categoryselector.details")
|
||||
.processPlaceholder("player", player.getName()).getMessage().split("\\|")));
|
||||
|
||||
if (!glassless) {
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
UltimateKits.getInstance().getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
event -> exit());
|
||||
}
|
||||
@ -72,7 +73,7 @@ public class CategorySelectorGui extends Gui {
|
||||
|
||||
int i = 10;
|
||||
for (Category category : categories) {
|
||||
setButton(i, GuiUtils.createButtonItem(CompatibleMaterial.getMaterial(category.getMaterial()),
|
||||
setButton(i, GuiUtils.createButtonItem(XMaterial.matchXMaterial(category.getMaterial()),
|
||||
TextUtils.formatText(category.getName()),
|
||||
"",
|
||||
plugin.getLocale().getMessage("interface.categoryselector.view").getMessage()),
|
||||
@ -88,13 +89,13 @@ public class CategorySelectorGui extends Gui {
|
||||
for (int col = 1; col < 8; ++col) {
|
||||
ItemStack it;
|
||||
if ((it = getItem(0, col)) == null || it.getType() == Material.AIR || it.getType().name().contains("PANE"))
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
if ((it = getItem(rows - 1, col)) == null || it.getType() == Material.AIR || it.getType().name().contains("PANE"))
|
||||
setItem(rows - 1, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(rows - 1, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
for (int row = 1; row + 1 < rows; ++row) {
|
||||
setItem(row, 0, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(row, 8, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(row, 0, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
setItem(row, 8, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -29,12 +29,12 @@ public class ConfirmBuyGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// Kit information
|
||||
setItem(0, 4, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.DIAMOND_HELMET.getItem(),
|
||||
setItem(0, 4, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : XMaterial.DIAMOND_HELMET.parseItem(),
|
||||
ChatColor.RED + TextUtils.formatText(kit.getKey().toLowerCase(), true),
|
||||
ChatColor.GREEN + Settings.CURRENCY_SYMBOL.getString() + Methods.formatEconomy(cost)));
|
||||
|
||||
// confirm button
|
||||
setButton(1, 2, GuiUtils.createButtonItem(Settings.BUY_ICON.getMaterial(CompatibleMaterial.EMERALD),
|
||||
setButton(1, 2, GuiUtils.createButtonItem(Settings.BUY_ICON.getMaterial(XMaterial.EMERALD),
|
||||
plugin.getLocale().getMessage("interface.yesno.yes").getMessage()),
|
||||
event -> {
|
||||
kit.processPurchaseUse(event.player);
|
||||
@ -42,7 +42,7 @@ public class ConfirmBuyGui extends Gui {
|
||||
});
|
||||
|
||||
// cancel button
|
||||
setButton(1, 6, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(1, 6, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.yesno.no").getMessage()),
|
||||
event -> {
|
||||
plugin.getLocale().getMessage("event.purchase.cancelled").sendPrefixedMessage(event.player);
|
@ -1,14 +1,14 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
public class KitDecorOptionsGui extends Gui {
|
||||
@ -26,7 +26,7 @@ public class KitDecorOptionsGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> exit());
|
||||
@ -41,7 +41,7 @@ public class KitDecorOptionsGui extends Gui {
|
||||
final String disableLore = plugin.getLocale().getMessage("interface.kitdecor.settingoff").getMessage();
|
||||
|
||||
// Hologram
|
||||
setButton(1, 1, GuiUtils.createButtonItem(CompatibleMaterial.NAME_TAG,
|
||||
setButton(1, 1, GuiUtils.createButtonItem(XMaterial.NAME_TAG,
|
||||
plugin.getLocale().getMessage("interface.kitdecor.hologram").getMessage(),
|
||||
kitBlockData.showHologram() ? enableLore : disableLore),
|
||||
event -> {
|
||||
@ -51,7 +51,7 @@ public class KitDecorOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// Particle effects
|
||||
setButton(1, 3, GuiUtils.createButtonItem(CompatibleMaterial.POTION,
|
||||
setButton(1, 3, GuiUtils.createButtonItem(XMaterial.POTION,
|
||||
plugin.getLocale().getMessage("interface.kitdecor.particle").getMessage(),
|
||||
kitBlockData.hasParticles() ? enableLore : disableLore),
|
||||
event -> {
|
||||
@ -60,7 +60,7 @@ public class KitDecorOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// Item Display
|
||||
setButton(1, 5, GuiUtils.createButtonItem(CompatibleMaterial.DIAMOND,
|
||||
setButton(1, 5, GuiUtils.createButtonItem(XMaterial.DIAMOND,
|
||||
plugin.getLocale().getMessage("interface.kitdecor.display").getMessage(),
|
||||
kitBlockData.isDisplayingItems() ? enableLore : disableLore),
|
||||
event -> {
|
||||
@ -71,7 +71,7 @@ public class KitDecorOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// Item Display Override
|
||||
setButton(1, 7, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.BEACON.getItem(),
|
||||
setButton(1, 7, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : XMaterial.BEACON.parseItem(),
|
||||
plugin.getLocale().getMessage("interface.kitdecor.displayone").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitdecor.displayonelore")
|
||||
.processPlaceholder("enabled", kitBlockData.isItemOverride() ? enableLore : disableLore)
|
@ -1,19 +1,19 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.CompatibleSound;
|
||||
import com.songoda.core.gui.AnvilGui;
|
||||
import com.songoda.core.gui.DoubleGui;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.input.ChatPrompt;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitAnimation;
|
||||
import com.songoda.ultimatekits.kit.KitItem;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.core.gui.AnvilGui;
|
||||
import com.craftaro.core.gui.DoubleGui;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.input.ChatPrompt;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitAnimation;
|
||||
import com.craftaro.ultimatekits.kit.KitItem;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -26,6 +26,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class KitEditorGui extends DoubleGui {
|
||||
|
||||
@ -54,7 +55,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
setOnClose((event) -> {
|
||||
restoreItemsInstance();
|
||||
saveKit(player, inventory, false);
|
||||
CompatibleSound.ENTITY_VILLAGER_YES.play(player);
|
||||
XSound.ENTITY_VILLAGER_YES.play(player);
|
||||
});
|
||||
|
||||
ItemStack glass1 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_1.getMaterial());
|
||||
@ -68,7 +69,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
mirrorFill(0, 3, false, true, glass1);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> player.closeInventory());
|
||||
@ -84,7 +85,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
});
|
||||
|
||||
// info icon
|
||||
setItem(0, 4, GuiUtils.createButtonItem(CompatibleMaterial.CHEST,
|
||||
setItem(0, 4, GuiUtils.createButtonItem(XMaterial.CHEST,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.info")
|
||||
.processPlaceholder("kit", kit.getKey())
|
||||
.processPlaceholder("perm", "ultimatekits.claim." + kit.getKey().toLowerCase())
|
||||
@ -151,13 +152,13 @@ public class KitEditorGui extends DoubleGui {
|
||||
setUnlockedRange(2, 0, 3, 8);
|
||||
setUnlockedRange(4, 1, 4, 7);
|
||||
|
||||
item = GuiUtils.createButtonItem(CompatibleMaterial.PAPER,
|
||||
item = GuiUtils.createButtonItem(XMaterial.PAPER,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.itemediting").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.itemeditinglore").getMessage().split("\\|"));
|
||||
} else {
|
||||
unlockedCells.clear();
|
||||
|
||||
item = GuiUtils.createButtonItem(CompatibleMaterial.PAPER,
|
||||
item = GuiUtils.createButtonItem(XMaterial.PAPER,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.itemmoving").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.itemmovinglore").getMessage().split("\\|"));
|
||||
}
|
||||
@ -171,10 +172,10 @@ public class KitEditorGui extends DoubleGui {
|
||||
|
||||
ItemStack item2;
|
||||
|
||||
item2 = isInInventory ? GuiUtils.createButtonItem(CompatibleMaterial.ITEM_FRAME,
|
||||
item2 = isInInventory ? GuiUtils.createButtonItem(XMaterial.ITEM_FRAME,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.switchtokitfunctions").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.switchtokitfunctionslore").getMessage().split("\\|"))
|
||||
: GuiUtils.createButtonItem(CompatibleMaterial.ITEM_FRAME,
|
||||
: GuiUtils.createButtonItem(XMaterial.ITEM_FRAME,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.switchtoinventory").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.switchtoinventorylore").getMessage().split("\\|"));
|
||||
|
||||
@ -211,7 +212,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
}
|
||||
|
||||
private void setInvItems() {
|
||||
setPlayerButton(0, GuiUtils.createButtonItem(CompatibleMaterial.REDSTONE_TORCH,
|
||||
setPlayerButton(0, GuiUtils.createButtonItem(XMaterial.REDSTONE_TORCH,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.generaloptions").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.generaloptionslore").getMessage().split("\\|")),
|
||||
(event) -> {
|
||||
@ -219,7 +220,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
guiManager.showGUI(player, new KitGeneralOptionsGui(plugin, player, kit, back));
|
||||
});
|
||||
|
||||
setPlayerButton(1, GuiUtils.createButtonItem(CompatibleMaterial.EMERALD,
|
||||
setPlayerButton(1, GuiUtils.createButtonItem(XMaterial.EMERALD,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.sellingoptions").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.sellingoptionslore").getMessage().split("\\|")),
|
||||
(event) -> {
|
||||
@ -227,7 +228,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
guiManager.showGUI(player, new KitSellingOptionsGui(plugin, player, kit, back));
|
||||
});
|
||||
|
||||
setPlayerButton(3, GuiUtils.createButtonItem(CompatibleMaterial.ITEM_FRAME,
|
||||
setPlayerButton(3, GuiUtils.createButtonItem(XMaterial.ITEM_FRAME,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.guioptions").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.guioptionslore").getMessage().split("\\|")),
|
||||
(event) -> {
|
||||
@ -235,7 +236,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
guiManager.showGUI(player, new KitGuiOptionsGui(plugin, player, kit, back));
|
||||
});
|
||||
|
||||
setPlayerButton(4, GuiUtils.createButtonItem(CompatibleMaterial.PAPER,
|
||||
setPlayerButton(4, GuiUtils.createButtonItem(XMaterial.PAPER,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.addcommand").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.addcommandlore").getMessage().split("\\|")),
|
||||
(event) -> {
|
||||
@ -272,7 +273,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
});
|
||||
});
|
||||
|
||||
setPlayerButton(5, GuiUtils.createButtonItem(CompatibleMaterial.SUNFLOWER,
|
||||
setPlayerButton(5, GuiUtils.createButtonItem(XMaterial.SUNFLOWER,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.addeconomy").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.addeconomylore").getMessage().split("\\|")),
|
||||
(event) -> {
|
||||
@ -305,7 +306,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
guiManager.showGUI(event.player, gui);
|
||||
});
|
||||
|
||||
setPlayerButton(7, GuiUtils.createButtonItem(CompatibleMaterial.SHEEP_SPAWN_EGG,
|
||||
setPlayerButton(7, GuiUtils.createButtonItem(XMaterial.SHEEP_SPAWN_EGG,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.clone").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.clonelore")
|
||||
.getMessage().split("\\|")),
|
||||
@ -321,15 +322,19 @@ public class KitEditorGui extends DoubleGui {
|
||||
} else {
|
||||
Kit newKit = kit.clone(kitStr);
|
||||
plugin.getKitManager().addKit(newKit);
|
||||
player.closeInventory();
|
||||
|
||||
restoreItemsInstance();
|
||||
saveKit(player, inventory, false);
|
||||
XSound.ENTITY_VILLAGER_YES.play(player);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () ->
|
||||
guiManager.showGUI(player, new KitEditorGui(plugin, player, newKit, null)), 2L);
|
||||
guiManager.showGUI(player, new KitEditorGui(plugin, player, newKit, null)), 5L);
|
||||
}
|
||||
});
|
||||
guiManager.showGUI(player, gui);
|
||||
});
|
||||
|
||||
setPlayerButton(8, GuiUtils.createButtonItem(CompatibleMaterial.CHEST,
|
||||
setPlayerButton(8, GuiUtils.createButtonItem(XMaterial.CHEST,
|
||||
plugin.getLocale().getMessage("interface.kiteditor.animation").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kiteditor.animationlore")
|
||||
.processPlaceholder("animation", kit.getKitAnimation().name())
|
||||
@ -394,11 +399,11 @@ 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().trim());
|
||||
if (compatibleMaterial == null) {
|
||||
Optional<XMaterial> compatibleMaterial = XMaterial.matchXMaterial(gui.getInputText().trim());
|
||||
if (!compatibleMaterial.isPresent()) {
|
||||
player.sendMessage("'" + gui.getInputText().trim() + "' is not a valid material.");
|
||||
} else {
|
||||
Material material = compatibleMaterial.getMaterial();
|
||||
Material material = compatibleMaterial.get().parseMaterial();
|
||||
KitItem newItem = new KitItem(itemStack);
|
||||
newItem.setDisplayItem(material);
|
||||
setItem(slot, newItem.getMoveableItem());
|
@ -1,15 +1,15 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.AnvilGui;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.AnvilGui;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -25,7 +25,7 @@ public class KitGeneralOptionsGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> exit());
|
||||
@ -37,7 +37,7 @@ public class KitGeneralOptionsGui extends Gui {
|
||||
event -> guiManager.showGUI(player, new KitEditorGui(plugin, player, kit, back)));
|
||||
|
||||
// edit delay
|
||||
setButton(1, 2, GuiUtils.createButtonItem(CompatibleMaterial.CLOCK,
|
||||
setButton(1, 2, GuiUtils.createButtonItem(XMaterial.CLOCK,
|
||||
plugin.getLocale().getMessage("interface.kitoptions.delay").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitoptions.delaylore")
|
||||
.processPlaceholder("delay", kit.getDelay()).getMessage().split("\\|")),
|
||||
@ -61,7 +61,7 @@ public class KitGeneralOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// edit category
|
||||
setButton(1, 4, GuiUtils.createButtonItem(CompatibleMaterial.BOOK,
|
||||
setButton(1, 4, GuiUtils.createButtonItem(XMaterial.BOOK,
|
||||
plugin.getLocale().getMessage("interface.kitoptions.category").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitoptions.categorylore")
|
||||
.processPlaceholder("category", kit.getCategory() == null ? "none" : kit.getCategory().getName()).getMessage().split("\\|")),
|
||||
@ -91,7 +91,7 @@ public class KitGeneralOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// delete
|
||||
setButton(1, 6, GuiUtils.createButtonItem(CompatibleMaterial.TNT,
|
||||
setButton(1, 6, GuiUtils.createButtonItem(XMaterial.TNT,
|
||||
plugin.getLocale().getMessage("interface.kitoptions.destroy").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitoptions.destroylore").getMessage().split("\\|")),
|
||||
event -> {
|
@ -1,14 +1,14 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.AnvilGui;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.AnvilGui;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -34,7 +34,7 @@ public class KitGuiOptionsGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> exit());
|
||||
@ -49,7 +49,7 @@ public class KitGuiOptionsGui extends Gui {
|
||||
|
||||
private void paint() {
|
||||
// set hologram title
|
||||
setButton(1, 2, GuiUtils.createButtonItem(CompatibleMaterial.NAME_TAG,
|
||||
setButton(1, 2, GuiUtils.createButtonItem(XMaterial.NAME_TAG,
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.holo").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.hololore")
|
||||
.processPlaceholder("onoff",
|
||||
@ -82,7 +82,7 @@ public class KitGuiOptionsGui extends Gui {
|
||||
plugin.saveKits(false);
|
||||
});
|
||||
|
||||
setButton(1, 4, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.BEACON.getItem(),
|
||||
setButton(1, 4, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : XMaterial.BEACON.parseItem(),
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.item").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.itemlore")
|
||||
.processPlaceholder("onoff",
|
||||
@ -103,12 +103,12 @@ public class KitGuiOptionsGui extends Gui {
|
||||
plugin.saveKits(false);
|
||||
});
|
||||
setAction(1, 4, ClickType.RIGHT, event -> {
|
||||
kit.setDisplayItem((ItemStack) null);
|
||||
kit.setDisplayItem(null);
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.itemremoved").processPlaceholder("kit", kit.getName()).sendPrefixedMessage(player);
|
||||
paint();
|
||||
});
|
||||
|
||||
setButton(1, 6, GuiUtils.createButtonItem(CompatibleMaterial.COAL,
|
||||
setButton(1, 6, GuiUtils.createButtonItem(XMaterial.COAL,
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.hide").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitguioptions.hidelore")
|
||||
.processPlaceholder("onoff", plugin.getLocale().getMessage(
|
@ -1,15 +1,16 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -50,7 +51,7 @@ public class KitSelectorGui extends Gui {
|
||||
showPerPage = showPerRow * (glassless ? (nrows == 6 ? 6 : 5) : 4);
|
||||
setPages(kitList.size() / showPerPage);
|
||||
|
||||
setItem(0, 4, GuiUtils.createButtonItem(CompatibleMaterial.BOOK,
|
||||
setItem(0, 4, GuiUtils.createButtonItem(XMaterial.BOOK,
|
||||
plugin.getLocale().getMessage("interface.selector.details")
|
||||
.processPlaceholder("player", player.getName()).getMessage().split("\\|")));
|
||||
|
||||
@ -65,8 +66,8 @@ public class KitSelectorGui extends Gui {
|
||||
}
|
||||
|
||||
if (!glassless) {
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
UltimateKits.getInstance().getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
UltimateKits.getInstance().getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
event -> exit());
|
||||
}
|
||||
|
||||
@ -95,7 +96,7 @@ public class KitSelectorGui extends Gui {
|
||||
|
||||
if (category != null)
|
||||
setButton(0, 0, GuiUtils.createButtonItem(ItemUtils.getCustomHead("3ebf907494a935e955bfcadab81beafb90fb9be49c7026ba97d798d5f1a23"),
|
||||
plugin.getLocale().getMessage("interface.button.back").getMessage()),
|
||||
plugin.getLocale().getMessage("interface.button.back").getMessage()),
|
||||
event -> guiManager.showGUI(player, new CategorySelectorGui(plugin, player)));
|
||||
|
||||
|
||||
@ -116,13 +117,13 @@ public class KitSelectorGui extends Gui {
|
||||
for (int col = 1; col < 8; ++col) {
|
||||
ItemStack it;
|
||||
if ((it = getItem(0, col)) == null || it.getType() == Material.AIR || it.getType().name().contains("PANE"))
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
if ((it = getItem(rows - 1, col)) == null || it.getType() == Material.AIR || it.getType().name().contains("PANE"))
|
||||
setItem(rows - 1, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(rows - 1, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
for (int row = 1; row + 1 < rows; ++row) {
|
||||
setItem(row, 0, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(row, 8, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
setItem(row, 0, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
setItem(row, 8, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,8 +145,8 @@ public class KitSelectorGui extends Gui {
|
||||
.processPlaceholder("kit", TextUtils.formatText(kitItem, true)).getMessage();
|
||||
|
||||
setButton(row, col, GuiUtils.createButtonItem(
|
||||
kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.ENCHANTED_BOOK.getItem(), kitTitle,
|
||||
getKitLore(kit)),
|
||||
kit.getDisplayItem() != null ? kit.getDisplayItem() : XMaterial.ENCHANTED_BOOK.parseItem(), kitTitle,
|
||||
getKitLore(kit)),
|
||||
event -> {
|
||||
if (event.clickType == ClickType.MIDDLE && player.hasPermission("ultimatekits.admin")) {
|
||||
kitsmode = !kitsmode;
|
@ -1,15 +1,15 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.AnvilGui;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.AnvilGui;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -32,7 +32,7 @@ public class KitSellingOptionsGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
ClickType.LEFT,
|
||||
event -> exit());
|
||||
@ -47,7 +47,7 @@ public class KitSellingOptionsGui extends Gui {
|
||||
|
||||
private void paint() {
|
||||
// remove sale
|
||||
setButton(1, 2, GuiUtils.createButtonItem(CompatibleMaterial.BARRIER,
|
||||
setButton(1, 2, GuiUtils.createButtonItem(XMaterial.BARRIER,
|
||||
plugin.getLocale().getMessage("interface.kitsell.nosell").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitsell.noselllore")
|
||||
.processPlaceholder("onoff", plugin.getLocale().getMessage(
|
||||
@ -60,7 +60,7 @@ public class KitSellingOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// kit link
|
||||
setButton(1, 4, GuiUtils.createButtonItem(CompatibleMaterial.PAPER,
|
||||
setButton(1, 4, GuiUtils.createButtonItem(XMaterial.PAPER,
|
||||
plugin.getLocale().getMessage("interface.kitsell.link").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitsell.linklore")
|
||||
.processPlaceholder("onoff",
|
||||
@ -86,7 +86,7 @@ public class KitSellingOptionsGui extends Gui {
|
||||
});
|
||||
|
||||
// kit price
|
||||
setButton(1, 6, GuiUtils.createButtonItem(CompatibleMaterial.SUNFLOWER,
|
||||
setButton(1, 6, GuiUtils.createButtonItem(XMaterial.SUNFLOWER,
|
||||
plugin.getLocale().getMessage("interface.kitsell.price").getMessage(),
|
||||
plugin.getLocale().getMessage("interface.kitsell.pricelore")
|
||||
.processPlaceholder("onoff",
|
@ -1,14 +1,14 @@
|
||||
package com.songoda.ultimatekits.gui;
|
||||
package com.craftaro.ultimatekits.gui;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -81,7 +81,7 @@ public class PreviewKitGui extends Gui {
|
||||
Methods.fillGlass(this);
|
||||
|
||||
// exit button is only visible with a glass border
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),
|
||||
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(XMaterial.OAK_DOOR),
|
||||
plugin.getLocale().getMessage("interface.button.exit").getMessage()),
|
||||
event -> exit());
|
||||
|
||||
@ -93,7 +93,7 @@ public class PreviewKitGui extends Gui {
|
||||
}
|
||||
// purchase button
|
||||
if (buyable) {
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.BUY_ICON.getMaterial(CompatibleMaterial.EMERALD),
|
||||
setButton(rows - 1, 4, GuiUtils.createButtonItem(Settings.BUY_ICON.getMaterial(XMaterial.EMERALD),
|
||||
plugin.getLocale().getMessage("interface.button.buynow").getMessage(),
|
||||
getBuyLore()),
|
||||
event -> {
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.handlers;
|
||||
package com.craftaro.ultimatekits.handlers;
|
||||
|
||||
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;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.handlers;
|
||||
package com.craftaro.ultimatekits.handlers;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleParticleHandler;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.core.compatibility.CompatibleParticleHandler;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.songoda.ultimatekits.key;
|
||||
package com.craftaro.ultimatekits.key;
|
||||
|
||||
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;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@ -35,7 +35,7 @@ public class Key {
|
||||
|
||||
public ItemStack getKeyItem(Kit kit, int amount) {
|
||||
UltimateKits plugin = UltimateKits.getInstance();
|
||||
ItemStack item = Settings.KEY_MATERIAL.getMaterial().getItem();
|
||||
ItemStack item = Settings.KEY_MATERIAL.getMaterial().parseItem();
|
||||
item.setAmount(amount);
|
||||
|
||||
String kitName = kit != null ? TextUtils.formatText(kit.getName(), true)
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.key;
|
||||
package com.craftaro.ultimatekits.key;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
@ -1,26 +1,26 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleHand;
|
||||
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.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.category.Category;
|
||||
import com.songoda.ultimatekits.crate.Crate;
|
||||
import com.songoda.ultimatekits.gui.AnimatedKitGui;
|
||||
import com.songoda.ultimatekits.gui.ConfirmBuyGui;
|
||||
import com.songoda.ultimatekits.gui.PreviewKitGui;
|
||||
import com.songoda.ultimatekits.key.Key;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentCommand;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentEconomy;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.ArmorType;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.compatibility.CompatibleHand;
|
||||
import com.craftaro.core.configuration.Config;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.craftaro.core.utils.ItemUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.PreviewKitGui;
|
||||
import com.craftaro.ultimatekits.key.Key;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentCommand;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentEconomy;
|
||||
import com.craftaro.ultimatekits.category.Category;
|
||||
import com.craftaro.ultimatekits.crate.Crate;
|
||||
import com.craftaro.ultimatekits.gui.AnimatedKitGui;
|
||||
import com.craftaro.ultimatekits.gui.ConfirmBuyGui;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.ArmorType;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -320,7 +320,7 @@ public class Kit implements Cloneable {
|
||||
}
|
||||
|
||||
if (Settings.SOUNDS_ENABLED.getBoolean() && kitAnimation == KitAnimation.NONE)
|
||||
CompatibleSound.ENTITY_PLAYER_LEVELUP.play(player, 0.6F, 15.0F);
|
||||
XSound.ENTITY_PLAYER_LEVELUP.play(player, 0.6F, 15.0F);
|
||||
|
||||
return generateRandomItem(innerContents, itemGiveAmount, 0, player);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
public enum KitAnimation {
|
||||
NONE, ROULETTE
|
@ -1,6 +1,6 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
||||
@ -40,7 +40,7 @@ public class KitBlockData {
|
||||
UltimateKits.getInstance().getDisplayItemHandler().displayItem(this);
|
||||
|
||||
UltimateKits.getInstance().removeHologram(this);
|
||||
UltimateKits.getInstance().getDataManager().updateBlockData(this);
|
||||
UltimateKits.getInstance().getKitDataManager().updateBlockData(this);
|
||||
}
|
||||
|
||||
public Kit getKit() {
|
@ -1,14 +1,14 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
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;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentCommand;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentEconomy;
|
||||
import com.songoda.ultimatekits.kit.type.KitContentItem;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.songoda.ultimatekits.utils.ItemSerializer;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContent;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentCommand;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentEconomy;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.kit.type.KitContentItem;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.utils.ItemSerializer;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
public enum KitItemType {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -56,7 +56,7 @@ public final class KitManager {
|
||||
kit.reset();
|
||||
|
||||
KitBlockData removed = kitsAtLocations.remove(roundLocation(location));
|
||||
UltimateKits.getInstance().getDataManager().deleteBlockData(removed);
|
||||
UltimateKits.getInstance().getKitDataManager().deleteBlockData(removed);
|
||||
return (removed != null ? removed.getKit() : null);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
package com.craftaro.ultimatekits.kit;
|
||||
|
||||
public enum KitType {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.kit.type;
|
||||
package com.craftaro.ultimatekits.kit.type;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,6 +1,6 @@
|
||||
package com.songoda.ultimatekits.kit.type;
|
||||
package com.craftaro.ultimatekits.kit.type;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.kit.type;
|
||||
package com.craftaro.ultimatekits.kit.type;
|
||||
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.ultimatekits.kit.type;
|
||||
package com.craftaro.ultimatekits.kit.type;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.utils.ItemSerializer;
|
||||
import com.craftaro.ultimatekits.utils.ItemSerializer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.key.Key;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.key.Key;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,6 +1,6 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
@ -1,6 +1,6 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
@ -1,15 +1,15 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleHand;
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.gui.BlockEditorGui;
|
||||
import com.songoda.ultimatekits.kit.Kit;
|
||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||
import com.songoda.ultimatekits.kit.KitType;
|
||||
import com.songoda.ultimatekits.utils.Methods;
|
||||
import com.craftaro.core.compatibility.CompatibleHand;
|
||||
import com.craftaro.core.compatibility.ServerVersion;
|
||||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.gui.BlockEditorGui;
|
||||
import com.craftaro.ultimatekits.kit.Kit;
|
||||
import com.craftaro.ultimatekits.kit.KitBlockData;
|
||||
import com.craftaro.ultimatekits.kit.KitType;
|
||||
import com.craftaro.ultimatekits.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -103,8 +103,8 @@ public class InteractListeners implements Listener {
|
||||
// Filter physical actions (pressure plates, buttons)
|
||||
if (event.getAction() == Action.PHYSICAL
|
||||
|| event.getItem() == null
|
||||
|| event.getItem().getType() == CompatibleMaterial.AIR.getMaterial()
|
||||
|| CompatibleMaterial.getMaterial(event.getItem()) != CompatibleMaterial.CHEST)
|
||||
|| event.getItem().getType() == XMaterial.AIR.parseMaterial()
|
||||
|| XMaterial.matchXMaterial(event.getItem()) != XMaterial.CHEST)
|
||||
return;
|
||||
|
||||
ItemStack item = event.getItem();
|
@ -1,7 +1,7 @@
|
||||
package com.songoda.ultimatekits.listeners;
|
||||
package com.craftaro.ultimatekits.listeners;
|
||||
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.ultimatekits.settings;
|
||||
package com.craftaro.ultimatekits.settings;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.configuration.Config;
|
||||
import com.songoda.core.configuration.ConfigSetting;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.ultimatekits.UltimateKits;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.configuration.Config;
|
||||
import com.craftaro.core.configuration.ConfigSetting;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.ultimatekits.UltimateKits;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
@ -74,13 +74,13 @@ public class Settings {
|
||||
// convert glass pane settings
|
||||
int color;
|
||||
if ((color = GLASS_TYPE_1.getInt(-1)) != -1) {
|
||||
config.set(GLASS_TYPE_1.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||
config.set(GLASS_TYPE_1.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name());
|
||||
}
|
||||
if ((color = GLASS_TYPE_2.getInt(-1)) != -1) {
|
||||
config.set(GLASS_TYPE_2.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||
config.set(GLASS_TYPE_2.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name());
|
||||
}
|
||||
if ((color = GLASS_TYPE_3.getInt(-1)) != -1) {
|
||||
config.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||
config.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name());
|
||||
}
|
||||
|
||||
// convert economy settings
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.ultimatekits.utils;
|
||||
package com.craftaro.ultimatekits.utils;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
@ -1,8 +1,8 @@
|
||||
package com.songoda.ultimatekits.utils;
|
||||
package com.craftaro.ultimatekits.utils;
|
||||
|
||||
import com.songoda.core.compatibility.ClassMapping;
|
||||
import com.songoda.core.compatibility.MethodMapping;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.craftaro.core.compatibility.ClassMapping;
|
||||
import com.craftaro.core.compatibility.MethodMapping;
|
||||
import com.craftaro.core.compatibility.ServerVersion;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
@ -1,9 +1,10 @@
|
||||
package com.songoda.ultimatekits.utils;
|
||||
package com.craftaro.ultimatekits.utils;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.gui.Gui;
|
||||
import com.songoda.core.gui.GuiUtils;
|
||||
import com.songoda.ultimatekits.settings.Settings;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.gui.Gui;
|
||||
import com.craftaro.core.gui.GuiUtils;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.ultimatekits.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@ -183,16 +184,16 @@ public class Methods {
|
||||
if (Settings.RAINBOW.getBoolean()) {
|
||||
for (int row = 0; row < gui.getRows(); ++row) {
|
||||
for (int col = row == 1 ? 2 : 3; col < (row == 1 ? 7 : 6); ++col) {
|
||||
gui.setItem(row, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16))));
|
||||
gui.setItem(row, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneForColor(rand.nextInt(16))));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gui.setDefaultItem(GuiUtils.getBorderItem(Settings.GLASS_TYPE_1.getMaterial(CompatibleMaterial.GRAY_STAINED_GLASS_PANE)));
|
||||
gui.setDefaultItem(GuiUtils.getBorderItem(Settings.GLASS_TYPE_1.getMaterial(XMaterial.GRAY_STAINED_GLASS_PANE)));
|
||||
}
|
||||
|
||||
// decorate the edges
|
||||
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial(CompatibleMaterial.BLUE_STAINED_GLASS_PANE));
|
||||
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial(CompatibleMaterial.LIGHT_BLUE_STAINED_GLASS_PANE));
|
||||
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial(XMaterial.BLUE_STAINED_GLASS_PANE));
|
||||
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial(XMaterial.LIGHT_BLUE_STAINED_GLASS_PANE));
|
||||
|
||||
// edges will be type 3
|
||||
gui.mirrorFill(0, 2, true, true, glass3);
|
@ -3,7 +3,7 @@ description: ${project.description}
|
||||
version: ${project.version}
|
||||
api-version: 1.13
|
||||
|
||||
main: com.songoda.ultimatekits.UltimateKits
|
||||
main: com.craftaro.ultimatekits.UltimateKits
|
||||
softdepend:
|
||||
- CMI
|
||||
- Essentials
|
||||
|
Loading…
Reference in New Issue
Block a user