Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@
<shadedPattern>xyz.theprogramsrc.supercoreapi.libs.apache.commons.codec</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>xyz.theprogramsrc.supercoreapi.libs.slf4j</shadedPattern>
<pattern>org.apache.commons.io</pattern>
<shadedPattern>xyz.theprogramsrc.supercoreapi.apache.commons.io</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<includes>
<include>com/cryptomorin/xseries/*</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -166,6 +174,13 @@
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- XSeries -->
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>8.0.0</version>
<scope>compile</scope>
</dependency>
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package xyz.theprogramsrc.supercoreapi.spigot.dialog;

import com.cryptomorin.xseries.messages.ActionBar;
import com.cryptomorin.xseries.messages.Titles;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand All @@ -13,8 +15,6 @@
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.utils.Utils;
import xyz.theprogramsrc.supercoreapi.spigot.SpigotModule;
import xyz.theprogramsrc.supercoreapi.spigot.packets.Actionbar;
import xyz.theprogramsrc.supercoreapi.spigot.packets.Title;

import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -62,8 +62,8 @@ public void openDialog(){
}

private void sendTitleAndActionbar() {
Title.sendTitle(this.getPlayer(), 0, 999, 0, this.apply(Utils.ct(this.getTitle() != null ? this.getTitle() : "")), this.apply(Utils.ct(this.getSubtitle() != null ? this.getSubtitle() : "")));
Actionbar.sendActionBar(this.getPlayer(), this.apply(Utils.ct(this.getActionbar() != null ? this.getActionbar() : "")));
Titles.sendTitle(this.player, 0, 999, 0, this.apply(Utils.ct(this.getTitle() != null ? this.getTitle() : "")), this.apply(Utils.ct(this.getSubtitle() != null ? this.getSubtitle() : "")));
ActionBar.sendActionBar(this.getPlayer(), this.apply(Utils.ct(this.getActionbar() != null ? this.getActionbar() : "")));
}

/**
Expand All @@ -74,8 +74,8 @@ public void close(){
if(this.task != null) this.task.stop();
HandlerList.unregisterAll(this);
this.getSpigotTasks().runAsyncTask(() -> {
Title.clearTitle(this.getPlayer());
Actionbar.clearActionbar(this.getPlayer());
Titles.clearTitle(this.getPlayer());
ActionBar.clearActionBar(this.getPlayer());
});
this.onDialogClose();
if(this.recall != null){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.theprogramsrc.supercoreapi.spigot.guis;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand All @@ -18,7 +19,6 @@
import xyz.theprogramsrc.supercoreapi.spigot.guis.action.ClickType;
import xyz.theprogramsrc.supercoreapi.spigot.guis.events.*;
import xyz.theprogramsrc.supercoreapi.spigot.guis.objects.GUIRows;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

import java.util.Collection;
import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package xyz.theprogramsrc.supercoreapi.spigot.guis.precreated;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.entity.Player;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUI;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUIButton;
import xyz.theprogramsrc.supercoreapi.spigot.guis.action.ClickAction;
import xyz.theprogramsrc.supercoreapi.spigot.guis.objects.GUIRows;
import xyz.theprogramsrc.supercoreapi.spigot.items.SimpleItem;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

public abstract class ConfirmationGUI extends GUI {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package xyz.theprogramsrc.supercoreapi.spigot.guis.precreated;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.utils.Utils;
import xyz.theprogramsrc.supercoreapi.spigot.guis.BrowserGUI;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUIButton;
import xyz.theprogramsrc.supercoreapi.spigot.guis.action.ClickAction;
import xyz.theprogramsrc.supercoreapi.spigot.items.SimpleItem;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

import java.util.Arrays;

Expand All @@ -21,7 +22,7 @@ public MaterialBrowser(Player player) {
@Override
public XMaterial[] getObjects() {
Inventory inventory = Bukkit.createInventory(null, 9);
return Arrays.stream(XMaterial.itemsSupported()).filter(m-> m.parseMaterial() != null).filter(m->{
return Arrays.stream(XMaterial.values()).filter(XMaterial::isSupported).filter(m-> m.parseMaterial() != null).filter(m->{
inventory.setItem(4, m.parseItem());
if(inventory.getItem(4) != null){
inventory.clear();
Expand All @@ -34,11 +35,11 @@ public XMaterial[] getObjects() {
@Override
public GUIButton getButton(XMaterial xMaterial) {
SimpleItem item = new SimpleItem(xMaterial)
.setDisplayName("&a"+Base.MATERIAL_SELECTOR_ITEM_NAME.toString())
.setDisplayName("&a" + Base.MATERIAL_SELECTOR_ITEM_NAME)
.setLore(
"&7",
"&7" + Base.MATERIAL_SELECTOR_ITEM_DESCRIPTION
).addPlaceholder("{Material}", xMaterial.getHumanName());
).addPlaceholder("{Material}", Utils.getEnumName(xMaterial));
return new GUIButton(item).setAction(a-> this.onSelect(a, xMaterial));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.bukkit.entity.Player;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.utils.Utils;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUI;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUIButton;
import xyz.theprogramsrc.supercoreapi.spigot.guis.action.ClickAction;
Expand Down Expand Up @@ -52,7 +51,7 @@ protected String getTitle() {
return "&c" + Base.SETTING_PANE_GUI_TITLE.options().placeholder("{Setting}", settingPane.getDisplayName()).get();
}

return "&c" + Base.SETTINGS_GUI_TITLE.toString();
return "&c" + Base.SETTINGS_GUI_TITLE;
}

public abstract SettingPane[] getSettingPanes();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package xyz.theprogramsrc.supercoreapi.spigot.guis.precreated.settings.precreated;

import com.cryptomorin.xseries.XMaterial;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.utils.Utils;
import xyz.theprogramsrc.supercoreapi.spigot.dialog.Dialog;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUIButton;
import xyz.theprogramsrc.supercoreapi.spigot.guis.objects.GUIRows;
import xyz.theprogramsrc.supercoreapi.spigot.guis.precreated.settings.SettingPane;
import xyz.theprogramsrc.supercoreapi.spigot.items.SimpleItem;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

import java.util.LinkedList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package xyz.theprogramsrc.supercoreapi.spigot.guis.precreated.settings.precreated;

import com.cryptomorin.xseries.XMaterial;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.translations.TranslationPack;
import xyz.theprogramsrc.supercoreapi.spigot.guis.GUIButton;
import xyz.theprogramsrc.supercoreapi.spigot.guis.precreated.settings.CustomSettingPane;
import xyz.theprogramsrc.supercoreapi.spigot.items.SimpleItem;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.theprogramsrc.supercoreapi.spigot.items;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.enchantments.Enchantment;
import xyz.theprogramsrc.supercoreapi.global.translations.Base;
import xyz.theprogramsrc.supercoreapi.global.utils.Utils;
import xyz.theprogramsrc.supercoreapi.spigot.SpigotModule;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

/**
* Representation of the Pre-Created Items
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.theprogramsrc.supercoreapi.spigot.items;

import com.cryptomorin.xseries.XMaterial;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import org.apache.commons.codec.binary.Base64;
Expand All @@ -16,7 +17,6 @@
import xyz.theprogramsrc.supercoreapi.spigot.SpigotPlugin;
import xyz.theprogramsrc.supercoreapi.spigot.utils.SpigotUtils;
import xyz.theprogramsrc.supercoreapi.spigot.utils.skintexture.SkinTexture;
import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial;

import java.lang.reflect.Field;
import java.util.*;
Expand All @@ -26,7 +26,7 @@
*/
public class SimpleItem {

private final SpigotUtils utils = ((SpigotUtils)SpigotPlugin.i.getSuperUtils());
private final SpigotUtils utils = SpigotPlugin.i.getSuperUtils();
private ItemStack item;
private LinkedHashMap<String, String> placeholders;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

public enum Skulls {

BACK("http://textures.minecraft.net/texture/9c042597eda9f061794fe11dacf78926d247f9eea8ddef39dfbe6022989b8395"),
ARROW_LEFT("http://textures.minecraft.net/texture/f7aacad193e2226971ed95302dba433438be4644fbab5ebf818054061667fbe2"),
ARROW_RIGHT("http://textures.minecraft.net/texture/a5fb343b2e7822c7de47abac4c3679f6ad1fa12efc5866c033c7584d6848"),
BACK("https://textures.minecraft.net/texture/9c042597eda9f061794fe11dacf78926d247f9eea8ddef39dfbe6022989b8395"),
ARROW_LEFT("https://textures.minecraft.net/texture/f7aacad193e2226971ed95302dba433438be4644fbab5ebf818054061667fbe2"),
ARROW_RIGHT("https://textures.minecraft.net/texture/a5fb343b2e7822c7de47abac4c3679f6ad1fa12efc5866c033c7584d6848"),

;

Expand Down Expand Up @@ -47,7 +47,7 @@ public SkinTexture asSkinTexture(){
*/
public static SkinTexture fromDataBase(String key){
if(cache == null) cache = new LinkedHashMap<>();
return new SkinTexture(cache.getOrDefault(key, "http://textures.minecraft.net/texture/badc048a7ce78f7dad72a07da27d85c0916881e5522eeed1e3daf217a38c1a"));
return new SkinTexture(cache.getOrDefault(key, "https://textures.minecraft.net/texture/badc048a7ce78f7dad72a07da27d85c0916881e5522eeed1e3daf217a38c1a"));
}

/**
Expand All @@ -57,7 +57,7 @@ public static SkinTexture fromDataBase(String key){
*/
public static String urlFromDataBase(String key){
if(cache == null) cache = new LinkedHashMap<>();
return cache.getOrDefault(key, "http://textures.minecraft.net/texture/badc048a7ce78f7dad72a07da27d85c0916881e5522eeed1e3daf217a38c1a");
return cache.getOrDefault(key, "https://textures.minecraft.net/texture/badc048a7ce78f7dad72a07da27d85c0916881e5522eeed1e3daf217a38c1a");
}

/**
Expand Down
Loading