15.6_dev-1

This commit is contained in:
JaTiTV 2023-07-08 19:03:29 +02:00
parent 59133a36f9
commit 7b04697895
4 changed files with 32 additions and 37 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>15.4</version> <version>15.6_dev-1</version>
<!--version>VERSION_snapshot-0</version--> <!--version>VERSION_snapshot-0</version-->
<!--version>VERSION_beta-0</version--> <!--version>VERSION_beta-0</version-->
<!--version>VERSION_dev-0</version--> <!--version>VERSION_dev-0</version-->

View File

@ -52,6 +52,20 @@ public class T2CitemBuilder {
return itemStack; return itemStack;
} }
public static void setItem(Integer slot, Integer amount, String material, String displayName, List<String> lore, Inventory inventory) {
ItemStack item;
if (getLegacy && material.contains(",")) {
String[] split = material.split(",");
item = new ItemStack(Material.valueOf(split[0]), 1, Short.parseShort(split[1]));
} else item = new ItemStack(Material.valueOf(material));
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore);
item.setItemMeta(itemMeta);
item.setAmount(amount);
inventory.setItem(slot, item);
}
public static ItemStack base64(String base64Value, Integer amount, String displayName, List<String> lore) { public static ItemStack base64(String base64Value, Integer amount, String displayName, List<String> lore) {
ItemStack itemStack = new ItemStack(T2CitemVersion.getHead()); ItemStack itemStack = new ItemStack(T2CitemVersion.getHead());
SkullMeta itemMeta = (SkullMeta) itemStack.getItemMeta(); SkullMeta itemMeta = (SkullMeta) itemStack.getItemMeta();

View File

@ -1,19 +1,31 @@
package net.t2code.t2codelib.SPIGOT.api.items; package net.t2code.t2codelib.SPIGOT.api.items;
import lombok.Getter;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion; import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class T2CitemVersion { public class T2CitemVersion {
@Getter
private static Material Head; private static Material Head;
@Getter
private static ItemStack HeadIS; private static ItemStack HeadIS;
@Getter
private static ItemStack CRAFTING_TABLE; private static ItemStack CRAFTING_TABLE;
@Getter
private static ItemStack YELLOW_WOOL; private static ItemStack YELLOW_WOOL;
@Getter
private static ItemStack ORANGE_WOOL; private static ItemStack ORANGE_WOOL;
@Getter
private static ItemStack GREEN_WOOL; private static ItemStack GREEN_WOOL;
@Getter
private static ItemStack GRAY_WOOL; private static ItemStack GRAY_WOOL;
@Getter
private static ItemStack RED_WOOL; private static ItemStack RED_WOOL;
@Getter
private static ItemStack RED_STAINED_GLASS_PANE; private static ItemStack RED_STAINED_GLASS_PANE;
@Getter
private static ItemStack BLACK_STAINED_GLASS_PANE;
public static void scan() { public static void scan() {
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) { if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
@ -24,6 +36,7 @@ public class T2CitemVersion {
GRAY_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8); GRAY_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8);
RED_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14); RED_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14);
RED_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14); RED_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14);
BLACK_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 15);
CRAFTING_TABLE = new ItemStack(Material.valueOf("WORKBENCH")); CRAFTING_TABLE = new ItemStack(Material.valueOf("WORKBENCH"));
} else { } else {
Head = Material.valueOf("PLAYER_HEAD"); Head = Material.valueOf("PLAYER_HEAD");
@ -34,43 +47,8 @@ public class T2CitemVersion {
GRAY_WOOL = new ItemStack(Material.GRAY_WOOL); GRAY_WOOL = new ItemStack(Material.GRAY_WOOL);
RED_WOOL = new ItemStack(Material.RED_WOOL); RED_WOOL = new ItemStack(Material.RED_WOOL);
RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE); RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE);
BLACK_STAINED_GLASS_PANE = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);
} }
HeadIS = new ItemStack(Head, 1, (byte) 3); HeadIS = new ItemStack(Head, 1, (byte) 3);
} }
public static Material getHead() {
return Head;
}
public static ItemStack getHeadIS() {
return HeadIS;
}
public static ItemStack getCraftingTable() {
return CRAFTING_TABLE;
}
public static ItemStack getYellowWool() {
return YELLOW_WOOL;
}
public static ItemStack getOrangeWool() {
return ORANGE_WOOL;
}
public static ItemStack getGreenWool() {
return GREEN_WOOL;
}
public static ItemStack getGrayWool() {
return GRAY_WOOL;
}
public static ItemStack getRedWool() {
return RED_WOOL;
}
public static ItemStack getRedStainedGlassPane() {
return RED_STAINED_GLASS_PANE;
}
} }

View File

@ -68,6 +68,9 @@ public class T2Ctemplate {
T2Csend.console(prefix + " §8-------------------------------"); T2Csend.console(prefix + " §8-------------------------------");
} }
public static void onLoadFooter(String prefix, Long long_, String v) {
onLoadFooter(prefix,long_);
}
public static void onLoadFooter(String prefix, Long long_) { public static void onLoadFooter(String prefix, Long long_) {
onLoadSeparateStroke(prefix); onLoadSeparateStroke(prefix);
T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms"); T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");