Migrate from SongodaCore to CraftaroCore v3.0.0-SNAPSHOT

This commit is contained in:
Christian Koop 2023-07-18 15:14:31 +02:00
parent 91be66c202
commit 6b930d3e25
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
25 changed files with 73 additions and 73 deletions

27
pom.xml
View File

@ -54,7 +54,7 @@
<artifactSet>
<includes>
<include>com.songoda:SongodaCore</include>
<include>com.craftaroSongodaCore</include>
</includes>
</artifactSet>
@ -71,7 +71,7 @@
<relocations>
<relocation>
<pattern>com.songoda.core</pattern>
<pattern>com.craftaro.core</pattern>
<shadedPattern>${project.groupId}.epicvouchers.core</shadedPattern>
</relocation>
</relocations>
@ -98,12 +98,24 @@
<repositories>
<repository>
<id>songoda-public</id>
<url>https://repo.songoda.com/repository/public/</url>
<id>craftaro-minecraft-plugins</id>
<url>https://repo.craftaro.com/repository/minecraft-plugins/</url>
</repository>
<repository>
<id>SpigotMC</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.craftaro</groupId>
<artifactId>CraftaroCore</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
@ -111,13 +123,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>2.6.21</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

View File

@ -1,11 +1,11 @@
package com.songoda.epicvouchers;
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.gui.GuiManager;
import com.craftaro.core.SongodaCore;
import com.craftaro.core.SongodaPlugin;
import com.craftaro.core.commands.CommandManager;
import com.craftaro.core.configuration.Config;
import com.craftaro.core.gui.GuiManager;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.songoda.epicvouchers.commands.CommandEditor;
import com.songoda.epicvouchers.commands.CommandEpicVouchers;
import com.songoda.epicvouchers.commands.CommandForce;
@ -67,7 +67,7 @@ public class EpicVouchers extends SongodaPlugin {
@Override
public void onPluginEnable() {
// Run Songoda Updater
SongodaCore.registerPlugin(this, 25, CompatibleMaterial.EMERALD);
SongodaCore.registerPlugin(this, 25, XMaterial.EMERALD);
// Setup Config
Settings.setupConfig();

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.menus.VoucherMenu;
import org.bukkit.command.CommandSender;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.voucher.Voucher;
import org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.voucher.Voucher;
import org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.voucher.Voucher;
import org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.voucher.Voucher;
import org.bukkit.command.CommandSender;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.voucher.Voucher;
import org.bukkit.command.CommandSender;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.craftaro.core.commands.AbstractCommand;
import com.songoda.epicvouchers.EpicVouchers;
import org.bukkit.command.CommandSender;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.handlers;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import org.bukkit.entity.Player;

View File

@ -1,6 +1,7 @@
package com.songoda.epicvouchers.libraries.inventory;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.SkullUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.menus.ActionMenu;
@ -9,7 +10,7 @@ import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.List;
import java.util.function.BiConsumer;
@ -52,17 +53,11 @@ public abstract class PlayersMenu extends FastInv {
Player player = this.players.get(index);
ItemStack itemStack = CompatibleMaterial.PLAYER_HEAD.getItem();
ItemStack itemStack = SkullUtils.getSkull(player.getUniqueId());
SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta();
try {
skullMeta.setOwningPlayer(player);
} catch (Throwable ignore) {
}
skullMeta.setDisplayName(YELLOW + player.getName());
itemStack.setItemMeta(skullMeta);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(YELLOW + player.getName());
itemStack.setItemMeta(itemMeta);
addItem(slot, itemStack, event -> this.playerConsumer.accept(event.getPlayer(), player));
});
@ -95,7 +90,7 @@ public abstract class PlayersMenu extends FastInv {
}
if (this.instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) {
ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem();
ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem();
IntStream.rangeClosed(this.SLOTS + 1, 26).forEach(slot -> {
if (getInventory().getItem(slot) == null) {

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.libraries.inventory.icons;
import com.songoda.core.input.ChatPrompt;
import com.craftaro.core.input.ChatPrompt;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.utils.Pair;

View File

@ -1,8 +1,8 @@
package com.songoda.epicvouchers.libraries.inventory.icons;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.input.ChatPrompt;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.core.input.ChatPrompt;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.listeners;
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.settings.Settings;
import com.songoda.epicvouchers.utils.CachedSet;

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.FastInv;
@ -61,7 +61,7 @@ public class ActionMenu extends FastInv {
.addGlow().build(), event -> new VoucherMenu(instance).open(event.getPlayer()));
if (instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) {
ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem();
ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem();
fill(new ItemBuilder(fillItem).name(ChatColor.RESET.toString()).build());
}

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.FastInv;
@ -34,7 +34,7 @@ public class ConfirmMenu extends FastInv {
});
if (instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) {
ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem();
ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem();
fill(new ItemBuilder(fillItem).name(ChatColor.RESET.toString()).build());
}

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.FastInv;
@ -43,6 +43,6 @@ public class OptionMenu extends FastInv {
.lore(TextUtils.formatText("&eSet the options of your voucher."))
.build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer()));
fill(new ItemBuilder(CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem()).name(ChatColor.RESET.toString()).build());
fill(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()).name(ChatColor.RESET.toString()).build());
}
}

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.utils.ItemUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.ItemUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.IconInv;
@ -89,7 +89,7 @@ public class VoucherEditorMenu extends IconInv {
reopen(player);
}));
addIcon(13, new StringIcon(instance, new ItemBuilder(voucher.getTexture() == null ? CompatibleMaterial.PLAYER_HEAD.getItem() : ItemUtils.getCustomHead(voucher.getTexture()))
addIcon(13, new StringIcon(instance, new ItemBuilder(voucher.getTexture() == null ? XMaterial.PLAYER_HEAD.parseItem() : ItemUtils.getCustomHead(voucher.getTexture()))
.name(YELLOW + "Skull Texture")
.lore(GRAY + "Right click to edit", GRAY + "Left click to clear").build(), voucher.getTexture(), (player, editString) -> {
voucher.setTexture(editString);

View File

@ -1,8 +1,8 @@
package com.songoda.epicvouchers.menus;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.gui.AnvilGui;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.core.gui.AnvilGui;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.IconInv;

View File

@ -1,6 +1,6 @@
package com.songoda.epicvouchers.menus.sub.editor;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.FastInv;
@ -20,7 +20,7 @@ public class SetItemMenu extends FastInv {
setDefaultCancel(false);
fill(new ItemBuilder(CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem())
fill(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseItem())
.name(ChatColor.RESET.toString()).build(), event -> event.setCancelled(true));
addItem(13, null);

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.menus.sub.editor;
import com.songoda.core.input.ChatPrompt;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.input.ChatPrompt;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.libraries.ItemBuilder;
import com.songoda.epicvouchers.libraries.inventory.IconInv;

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.settings;
import com.songoda.core.configuration.Config;
import com.songoda.core.configuration.ConfigSetting;
import com.craftaro.core.configuration.Config;
import com.craftaro.core.configuration.ConfigSetting;
import com.songoda.epicvouchers.EpicVouchers;
import org.bukkit.event.Listener;

View File

@ -1,10 +1,10 @@
package com.songoda.epicvouchers.voucher;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.songoda.core.utils.ItemUtils;
import com.songoda.core.utils.TextUtils;
import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.craftaro.core.utils.ItemUtils;
import com.craftaro.core.utils.TextUtils;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.events.ForceRedeemEvent;
import com.songoda.epicvouchers.events.VoucherReceiveEvent;
@ -119,7 +119,7 @@ public class Voucher {
}
}
if (this.texture != null && !this.texture.isEmpty() && CompatibleMaterial.PLAYER_HEAD.getMaterial() == this.material) {
if (this.texture != null && !this.texture.isEmpty() && XMaterial.PLAYER_HEAD.parseMaterial() == this.material) {
item = ItemUtils.getCustomHead(this.texture);
}

View File

@ -1,7 +1,7 @@
package com.songoda.epicvouchers.voucher;
import com.songoda.core.compatibility.CompatibleSound;
import com.songoda.core.compatibility.ServerVersion;
import com.craftaro.core.compatibility.CompatibleSound;
import com.craftaro.core.compatibility.ServerVersion;
import com.songoda.epicvouchers.EpicVouchers;
import com.songoda.epicvouchers.events.VoucherRedeemEvent;
import com.songoda.epicvouchers.listeners.PlayerCommandListener;