Compare commits

..

No commits in common. "f8619e48029340d83642f46f44d89c25b9af717f" and "59133a36f9eedeb583ece64af6f7bf407f93e21e" have entirely different histories.

5 changed files with 58 additions and 68 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>15.6_dev-3</version> <version>15.4</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,20 +52,6 @@ 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,54 +1,76 @@
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 CraftingTable; private static ItemStack YELLOW_WOOL;
@Getter private static ItemStack ORANGE_WOOL;
private static ItemStack YellowWool; private static ItemStack GREEN_WOOL;
@Getter private static ItemStack GRAY_WOOL;
private static ItemStack OrangeWool; private static ItemStack RED_WOOL;
@Getter private static ItemStack RED_STAINED_GLASS_PANE;
private static ItemStack GreenWool;
@Getter
private static ItemStack GrayWool;
@Getter
private static ItemStack RedWool;
@Getter
private static ItemStack RedStainedGlassPane;
@Getter
private static ItemStack BlackStainedGlassPane;
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()) {
Head = Material.valueOf("SKULL_ITEM"); Head = Material.valueOf("SKULL_ITEM");
YellowWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4); YELLOW_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
OrangeWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1); ORANGE_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
GreenWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 5); GREEN_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 5);
GrayWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8); GRAY_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8);
RedWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14); RED_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14);
RedStainedGlassPane = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14); RED_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14);
BlackStainedGlassPane = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 15); CRAFTING_TABLE = new ItemStack(Material.valueOf("WORKBENCH"));
CraftingTable = new ItemStack(Material.valueOf("WORKBENCH"));
} else { } else {
Head = Material.valueOf("PLAYER_HEAD"); Head = Material.valueOf("PLAYER_HEAD");
CraftingTable = new ItemStack(Material.CRAFTING_TABLE); CRAFTING_TABLE = new ItemStack(Material.CRAFTING_TABLE);
YellowWool = new ItemStack(Material.YELLOW_WOOL); YELLOW_WOOL = new ItemStack(Material.YELLOW_WOOL);
OrangeWool = new ItemStack(Material.ORANGE_WOOL); ORANGE_WOOL = new ItemStack(Material.ORANGE_WOOL);
GreenWool = new ItemStack(Material.GREEN_WOOL); GREEN_WOOL = new ItemStack(Material.GREEN_WOOL);
GrayWool = new ItemStack(Material.GRAY_WOOL); GRAY_WOOL = new ItemStack(Material.GRAY_WOOL);
RedWool = new ItemStack(Material.RED_WOOL); RED_WOOL = new ItemStack(Material.RED_WOOL);
RedStainedGlassPane = new ItemStack(Material.RED_STAINED_GLASS_PANE); RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE);
BlackStainedGlassPane = 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

@ -171,19 +171,4 @@ public class T2Creplace {
.replace("&o", "<italic>").replace("§o", "<italic>") .replace("&o", "<italic>").replace("§o", "<italic>")
.replace("&r", "<reset>").replace("§r", "<reset>"); .replace("&r", "<reset>").replace("§r", "<reset>");
} }
public static Object replace(Object object,String placeholder,String replacement) {
if (object instanceof String) {
object = ((String) object).replace(placeholder, replacement);
}
if ((object instanceof List) || (object instanceof ArrayList)) {
List<String> in = (List<String>) object;
List<String> output = new ArrayList<>();
for (String input : in) {
output.add(input.replace(placeholder, replacement));
}
object = output;
}
return object;
}
} }

View File

@ -68,9 +68,6 @@ 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");