Update to T2CodeLib 8

This commit is contained in:
JaTiTV 2021-12-22 20:18:50 +01:00
parent 675a5651ef
commit fda80bf9fc
7 changed files with 15 additions and 15 deletions

View File

@ -53,7 +53,7 @@ public class GUI_Listener implements Listener {
if (slot.Enable) {
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(Replace.replace(prefix, slot.Name))) {
if (e.getCurrentItem().getType() == ItemVersion.Head || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
if (e.getCurrentItem().getType() == ItemVersion.getHead() || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
if (slot.Cost_Enable) {
if (slot.Command_Enable || slot.Message_Enable || slot.OpenGUI_Enable || slot.ServerChange) {
if (Vault.buy(prefix, player, slot.Price)) {

View File

@ -45,7 +45,7 @@ public class ItemChange {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();

View File

@ -49,7 +49,7 @@ public class Events implements Listener {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
@ -111,7 +111,7 @@ public class Events implements Listener {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
@ -130,7 +130,7 @@ public class Events implements Listener {
Player p = e.getPlayer();
if (SelectConfig.UseItem_Enable) {
if (SelectConfig.UseItem_PlayerHead_Enable) {
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.Head) {
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) {
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
e.setCancelled(true);
if (p.isSneaking()) {

View File

@ -118,7 +118,7 @@ public class Commands {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
@ -163,7 +163,7 @@ public class Commands {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
@ -186,7 +186,7 @@ public class Commands {
}
ItemStack itm1 = player.getInventory().getItem(setSlot - 1);
if (itm1 != null) {
if (itm1.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm1.getType() == ItemVersion.Head) {
if (itm1.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm1.getType() == ItemVersion.getHead()) {
if (itm1.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.sendMessage(SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
return;
@ -200,7 +200,7 @@ public class Commands {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();

View File

@ -92,7 +92,7 @@ public class OpenGUI {
} else {
if (slot.Base64_Enable) {
ItemStack item = new ItemStack(ItemVersion.Head);
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
@ -120,7 +120,7 @@ public class OpenGUI {
inventory.setItem(slot.Slot, item);
} else {
if (slot.PlayerWhoHasOpenedTheGUI) {
ItemStack item = new ItemStack(ItemVersion.Head);
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
@ -138,7 +138,7 @@ public class OpenGUI {
item.setAmount(am);
inventory.setItem(slot.Slot, item);
} else {
ItemStack item = new ItemStack(ItemVersion.Head);
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));

View File

@ -49,7 +49,7 @@ public class Give_UseItem {
send.player(player, Main.prefix + "§c Playerheads for UseItem are only available from version §61.13§c!");
send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!");
} else {
item = new ItemStack(ItemVersion.Head);
item = ItemVersion.getHeadIS();
SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta();
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
if (SelectConfig.UseItem_Base64_Enable) {

View File

@ -42,7 +42,7 @@ public class DefaultGUICreate {
"&eIf you find any errors or bugs,",
"&eplease contact me so I can fix them.",
"&8-----------------",
"&5Discord: §7https://discord.gg/vRyXFFterJ");
"&5Discord: §7http://dc.t2code.net");
private static Boolean CustomSound = false;
private static Boolean CustomSound_NoSound = false;
private static String CustomSound_Sound = "";
@ -57,7 +57,7 @@ public class DefaultGUICreate {
private static Boolean OpenGUI = false;
private static String OpenGUI_GUI = "";
private static Boolean Message = true;
private static List Messages = Arrays.asList("&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ");
private static List Messages = Arrays.asList("&6You can find more information on Discord: &ehttp://dc.t2code.net");
private static Boolean Permission = false;
private static Boolean SetConfig_Enable = false;