1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Updating for the 1.16 support and base color handling

This commit is contained in:
Zrips 2020-06-29 13:51:24 +03:00
parent 20e54e805c
commit 21fa78ee92
27 changed files with 3884 additions and 3637 deletions

View File

@ -221,7 +221,7 @@
<!-- <artifactId>maven-jar-plugin</artifactId> -->
<!-- <version>2.3.1</version> -->
<!-- <configuration> -->
<!-- <outputDirectory>C:\Users\Arte\Desktop\Server 1.15\plugins\</outputDirectory> -->
<!-- <outputDirectory>C:\Users\Arte\Desktop\Server 1.16\plugins\</outputDirectory> -->
<!-- </configuration> -->
<!-- </plugin> -->
</plugins>

View File

@ -0,0 +1,98 @@
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ActionBarManager {
private static Object packet;
private static Method getHandle;
private static Method sendPacket;
private static Field playerConnection;
private static Class<?> nmsChatSerializer;
private static Class<?> nmsIChatBaseComponent;
private static Class<?> packetType;
private static Class<?> ChatMessageclz;
private static Class<?> sub;
private static Object[] consts;
static {
if (Version.isCurrentHigher(Version.v1_7_R4)) {
Version version = Version.getCurrent();
try {
packetType = Class.forName("net.minecraft.server." + version + ".PacketPlayOutChat");
Class<?> typeCraftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer");
Class<?> typeNMSPlayer = Class.forName("net.minecraft.server." + version + ".EntityPlayer");
Class<?> typePlayerConnection = Class.forName("net.minecraft.server." + version + ".PlayerConnection");
nmsChatSerializer = Class.forName(getChatSerializerClasspath());
nmsIChatBaseComponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent");
getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName("net.minecraft.server." + version + ".Packet"));
if (Version.isCurrentHigher(Version.v1_11_R1)) {
ChatMessageclz = Class.forName("net.minecraft.server." + version + ".ChatMessageType");
consts = ChatMessageclz.getEnumConstants();
sub = consts[2].getClass();
}
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | NoSuchFieldException ex) {
Bukkit.getConsoleSender().sendMessage("Error {0} ");
Bukkit.getConsoleSender().sendMessage(ex.toString());
}
}
}
public static void send(CommandSender receivingPacket, String msg) {
if (receivingPacket instanceof Player)
send((Player) receivingPacket, msg);
else
receivingPacket.sendMessage(msg);
}
public static void send(Player receivingPacket, String msg) {
if (receivingPacket == null)
return;
if (!receivingPacket.isOnline())
return;
if (msg == null)
return;
try {
if (!Version.getCurrent().isHigher(Version.v1_7_R4) || nmsChatSerializer == null) {
receivingPacket.sendMessage(CMIChatColor.translate(msg));
return;
}
RawMessage rm = new RawMessage();
rm.add(msg);
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, CMIChatColor.translate(rm.getRaw()));
if (Version.isCurrentHigher(Version.v1_15_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub, UUID.class).newInstance(serialized, consts[2], receivingPacket.getUniqueId());
else if (Version.isCurrentHigher(Version.v1_11_R1)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, sub).newInstance(serialized, consts[2]);
} else if (Version.isCurrentHigher(Version.v1_7_R4)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, byte.class).newInstance(serialized, (byte) 2);
} else {
packet = packetType.getConstructor(nmsIChatBaseComponent, int.class).newInstance(serialized, 2);
}
Object player = getHandle.invoke(receivingPacket);
Object connection = playerConnection.get(player);
sendPacket.invoke(connection, packet);
return;
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static String getChatSerializerClasspath() {
if (!Version.isCurrentHigher(Version.v1_8_R2))
return "net.minecraft.server." + Version.getCurrent() + ".ChatSerializer";
return "net.minecraft.server." + Version.getCurrent() + ".IChatBaseComponent$ChatSerializer";// 1_8_R2 moved to IChatBaseComponent
}
}

View File

@ -1,235 +0,0 @@
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.UUID;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
public class ActionBarTitleMessages {
private static Object packet;
private static Method getHandle;
private static Method sendPacket;
private static Field playerConnection;
private static Class<?> nmsChatSerializer;
private static Class<?> nmsIChatBaseComponent;
private static Class<?> packetType;
private static Constructor<?> nmsPacketPlayOutTitle;
private static Class<?> enumTitleAction;
private static Method fromString;
private static boolean simpleTitleMessages = false;
private static Class<?> ChatMessageclz;
private static Class<?> sub;
private static Object[] consts;
static {
if (Version.getCurrent().isHigher(Version.v1_7_R4)) {
try {
packetType = Class.forName(getPacketPlayOutChat());
Class<?> typeCraftPlayer = Class.forName(getCraftPlayerClasspath());
Class<?> typeNMSPlayer = Class.forName(getNMSPlayerClasspath());
Class<?> typePlayerConnection = Class.forName(getPlayerConnectionClasspath());
nmsChatSerializer = Class.forName(getChatSerializerClasspath());
nmsIChatBaseComponent = Class.forName(getIChatBaseComponentClasspath());
getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName(getPacketClasspath()));
if (Version.isCurrentHigher(Version.v1_11_R1)) {
ChatMessageclz = Class.forName(getChatMessageTypeClasspath());
consts = ChatMessageclz.getEnumConstants();
sub = consts[2].getClass();
}
} catch (Exception ex) {
Bukkit.getLogger().log(Level.SEVERE, "Error {0}", ex);
}
// Title
try {
Class<?> typePacketPlayOutTitle = Class.forName(getPacketPlayOutTitleClasspath());
enumTitleAction = Class.forName(getEnumTitleActionClasspath());
nmsPacketPlayOutTitle = typePacketPlayOutTitle.getConstructor(enumTitleAction, nmsIChatBaseComponent);
fromString = Class.forName(getClassMessageClasspath()).getMethod("fromString", String.class);
} catch (Exception ex) {
simpleTitleMessages = true;
}
}
}
public void send(CommandSender receivingPacket, String msg) {
if (receivingPacket instanceof Player)
send((Player) receivingPacket, msg);
else
receivingPacket.sendMessage(msg);
}
public void send(Player receivingPacket, String msg) {
if (receivingPacket == null)
return;
if (!receivingPacket.isOnline())
return;
if (msg == null)
return;
try {
if (!Version.getCurrent().isHigher(Version.v1_7_R4) || nmsChatSerializer == null) {
receivingPacket.sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
return;
}
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, "{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', msg) + "\"}");
if (Version.isCurrentEqualOrHigher(Version.v1_16_R1)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, sub, UUID.class)
.newInstance(serialized, consts[2], receivingPacket.getUniqueId());
} else if (Version.isCurrentHigher(Version.v1_11_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub).newInstance(serialized, consts[2]);
else if (Version.isCurrentHigher(Version.v1_7_R4)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, byte.class).newInstance(serialized, (byte) 2);
} else {
packet = packetType.getConstructor(nmsIChatBaseComponent, int.class).newInstance(serialized, 2);
}
Object player = getHandle.invoke(receivingPacket);
Object connection = playerConnection.get(player);
sendPacket.invoke(connection, packet);
} catch (Throwable t) {
}
try {
Object player = getHandle.invoke(receivingPacket);
Object connection = playerConnection.get(player);
sendPacket.invoke(connection, packet);
} catch (Exception t) {
}
}
public static void sendTitle(final Player receivingPacket, final Object title, final Object subtitle) {
sendTitle(receivingPacket, title, subtitle, 0, 20, 20);
}
@SuppressWarnings("deprecation")
public static void sendTitle(final Player receivingPacket, final Object title, final Object subtitle, final int fadeIn, final int keep, final int fadeOut) {
Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), () -> {
String t = title == null ? null : CMIChatColor.translate((String) title);
String s = subtitle == null ? null : CMIChatColor.translate((String) subtitle);
if (simpleTitleMessages) {
receivingPacket.sendMessage(t);
receivingPacket.sendMessage(s);
return;
}
try {
switch (Version.getCurrent()) {
case v1_9_R1:
case v1_9_R2:
case v1_10_R1:
case v1_11_R1:
receivingPacket.sendTitle(t, s);
break;
case v1_12_R1:
case v1_13_R1:
case v1_13_R2:
case v1_14_R1:
case v1_14_R2:
case v1_15_R1:
case v1_15_R2:
case v1_16_R1:
case v1_16_R2:
receivingPacket.sendTitle(t, s, fadeIn, keep, fadeOut);
break;
case v1_7_R1:
case v1_7_R2:
case v1_7_R3:
case v1_7_R4:
case v1_8_R1:
case v1_8_R2:
case v1_8_R3:
if (title != null) {
Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null),
((Object[]) fromString.invoke(null, t))[0]);
sendPacket(receivingPacket, packetTitle);
}
if (subtitle != null) {
if (title == null) {
Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), ((Object[]) fromString.invoke(null, ""))[0]);
sendPacket(receivingPacket, packetTitle);
}
Object packetSubtitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("SUBTITLE").get(null),
((Object[]) fromString.invoke(null, s))[0]);
sendPacket(receivingPacket, packetSubtitle);
}
break;
default:
break;
}
} catch (Exception ex) {
simpleTitleMessages = true;
Bukkit.getLogger().log(Level.SEVERE, "Your server can't fully support title messages. They will be shown in chat instead.");
}
return;
});
}
private static void sendPacket(Player player, Object packet) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Object handle = getHandle.invoke(player);
Object connection = playerConnection.get(handle);
sendPacket.invoke(connection, packet);
}
private static String getCraftPlayerClasspath() {
return "org.bukkit.craftbukkit." + Version.getCurrent() + ".entity.CraftPlayer";
}
private static String getPlayerConnectionClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".PlayerConnection";
}
private static String getNMSPlayerClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".EntityPlayer";
}
private static String getPacketClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".Packet";
}
private static String getIChatBaseComponentClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".IChatBaseComponent";
}
private static String getChatSerializerClasspath() {
if (!Version.isCurrentHigher(Version.v1_8_R2))
return "net.minecraft.server." + Version.getCurrent() + ".ChatSerializer";
return "net.minecraft.server." + Version.getCurrent() + ".IChatBaseComponent$ChatSerializer";// 1_8_R2 moved to IChatBaseComponent
}
private static String getPacketPlayOutChat() {
return "net.minecraft.server." + Version.getCurrent() + ".PacketPlayOutChat";
}
private static String getPacketPlayOutTitleClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".PacketPlayOutTitle";
}
private static String getEnumTitleActionClasspath() {
return getPacketPlayOutTitleClasspath() + "$EnumTitleAction";
}
private static String getClassMessageClasspath() {
return "org.bukkit.craftbukkit." + Version.getCurrent() + ".util.CraftChatMessage";
}
private static String getChatMessageTypeClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".ChatMessageType";
}
}

View File

@ -11,8 +11,7 @@ import java.util.regex.Pattern;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import org.jetbrains.annotations.Nullable;
public class CMIChatColor {
@ -85,14 +84,14 @@ public class CMIChatColor {
if (Version.isCurrentLower(Version.v1_16_R1) && name.equalsIgnoreCase("Hex"))
return;
BY_CHAR.put(Character.valueOf(c), this);
BY_NAME.put(this.getName().toLowerCase().replace("_", ""), this);
}
public static String translate(String text) {
if (text == null)
return "";
return null;
if (text.contains("#")) {
@ -120,23 +119,14 @@ public class CMIChatColor {
}
public static String colorize(String text) {
return text == null ? "" : translate(text);
}
public static List<String> deColorize(List<String> text) {
if (text == null)
return new ArrayList<>();
for (int i = 0; i < text.size(); i++) {
text.set(i, deColorize(text.get(i)));
}
return text;
return null;
return translate(text);
}
public static String deColorize(String text) {
if (text == null)
return "";
return null;
text = CMIChatColor.translate(text);
return text.replace("§", "&");
@ -144,14 +134,14 @@ public class CMIChatColor {
public static String stripColor(String text) {
if (text == null)
return "";
return null;
text = CMIChatColor.translate(text);
return ChatColor.stripColor(text);
}
public static String getLastColors(String text) {
if (text == null)
return "";
return null;
// text = CMIChatColor.translate(text);
return ChatColor.getLastColors(text);
}
@ -228,7 +218,9 @@ public class CMIChatColor {
}
public Color getRGBColor() {
return blue < 0 ? null : Color.fromBGR(blue, green, red);
if (blue < 0)
return null;
return Color.fromBGR(blue, green, red);
}
public String getHex() {
@ -260,4 +252,11 @@ public class CMIChatColor {
}
return "#" + hex;
}
public static List<String> deColorize(List<String> lore) {
for (int i = 0; i < lore.size(); i++) {
lore.set(i, deColorize(lore.get(i)));
}
return lore;
}
}

View File

@ -1,459 +1,467 @@
package com.gamingmesh.jobs.CMILib;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
public enum CMIEntityType {
DROPPED_ITEM(1, "Item"),
EXPERIENCE_ORB(2, "Experience Orb"),
AREA_EFFECT_CLOUD(3, "Area Effect Cloud"),
ELDER_GUARDIAN(4, "Elder Guardian", Arrays.asList(
"MWM3OTc0ODJhMTRiZmNiODc3MjU3Y2IyY2ZmMWI2ZTZhOGI4NDEzMzM2ZmZiNGMyOWE2MTM5Mjc4YjQzNmIifX19")),
WITHER_SKELETON(5, "Wither Skeleton", Arrays.asList(
"Nzk1M2I2YzY4NDQ4ZTdlNmI2YmY4ZmIyNzNkNzIwM2FjZDhlMWJlMTllODE0ODFlYWQ1MWY0NWRlNTlhOCJ9fX0=",
"NDk2YmM4ZWJkNGUxM2Y0OTZkOGQ3NGM1NjVkZDU2ZTk5YTRhZjJlMmVhN2EyN2E5NmMxYWJkMjg0MTg0YiJ9fX0=",
"ZjVlYzk2NDY0NWE4ZWZhYzc2YmUyZjE2MGQ3Yzk5NTYzNjJmMzJiNjUxNzM5MGM1OWMzMDg1MDM0ZjA1MGNmZiJ9fX0=")),
STRAY(6, "Stray", Arrays.asList(
"NzhkZGY3NmU1NTVkZDVjNGFhOGEwYTVmYzU4NDUyMGNkNjNkNDg5YzI1M2RlOTY5ZjdmMjJmODVhOWEyZDU2In19fQ==")),
EGG(7, "Thrown Egg"),
LEASH_HITCH(8, "Leash Knot"),
PAINTING(9, "Painting"),
ARROW(10, "Arrow"),
SNOWBALL(11, "Snowball"),
FIREBALL(12, "Fireball"),
SMALL_FIREBALL(13, "Small Fireball"),
ENDER_PEARL(14, "Thrown Ender Pearl"),
ENDER_SIGNAL(15, "End Signal"),
SPLASH_POTION(16, "Splash Potion"),
THROWN_EXP_BOTTLE(17, "Thrown Bottle o' Enchanting"),
ITEM_FRAME(18, "Item Frame"),
WITHER_SKULL(19, "Wither Skull"),
PRIMED_TNT(20, "Primed TNT"),
FALLING_BLOCK(21, "Falling Block"),
FIREWORK(22, "Firework Rocket"),
HUSK(23, "Husk", Arrays.asList(
"Nzc3MDY4MWQxYTI1NWZiNGY3NTQ3OTNhYTA1NWIyMjA0NDFjZGFiOWUxMTQxZGZhNTIzN2I0OTkzMWQ5YjkxYyJ9fX0=")),
SPECTRAL_ARROW(24, "Spectral Arrow"),
SHULKER_BULLET(25, "Shulker Bullet"),
DRAGON_FIREBALL(26, "Dragon Fireball"),
ZOMBIE_VILLAGER(27, "Zombie Villager", Arrays.asList(
"NDRmMDhlYmQ0ZTI1Y2RhM2FkZTQ1Yjg2MzM3OGFkMzc3ZjE4YzUxMGRiNGQyOGU4MmJiMjQ0NTE0MzliMzczNCJ9fX0=",
"OTYxZjE5ZmZkOGFlNDI1NzkyYzRiMTgxNzU2YWRmZjhkNDgxNzRhZWVmNThhMGYzMjdhMjhjNzQyYzcyNDQyIn19fQ==",
"NTI4YzJiYWQ1Mzg5Y2IzNTkyYjU2NWIzYzQ3ZWNjMTg5ZTA1NDJhODc4MzUwMjhkNjE0OGJiZTMzNDU2N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3YzM3ZWE5ZTUzYmVhN2JhMmRlODZiIn19fQ==")),
VINDICATOR(36, "Vindicator", Arrays.asList(
"YTAwZDNmZmYxNmMyZGNhNTliOWM1OGYwOTY1MjVjODY5NzExNjZkYmFlMTMzYjFiMDUwZTVlZTcxNjQ0MyJ9fX0=")),
ILLUSIONER(37, "Illusioner", Arrays.asList(
"NTEyNTEyZTdkMDE2YTIzNDNhN2JmZjFhNGNkMTUzNTdhYjg1MTU3OWYxMzg5YmQ0ZTNhMjRjYmViODhiIn19fQ==",
"MmYyODgyZGQwOTcyM2U0N2MwYWI5NjYzZWFiMDgzZDZhNTk2OTI3MzcwNjExMGM4MjkxMGU2MWJmOGE4ZjA3ZSJ9fX0=")),
MINECART_COMMAND(40, "Minecart with Command Block"),
BOAT(41, "Boat"),
MINECART(42, "Minecart"),
MINECART_CHEST(43, "Minecart with Chest"),
MINECART_FURNACE(44, "Minecart with Furnace"),
MINECART_TNT(45, "Minecart with TNT"),
MINECART_HOPPER(46, "Minecart with Hopper"),
MINECART_MOB_SPAWNER(47, "Minecart with Spawner"),
CREEPER(50, "Creeper", Arrays.asList(
"ZjQyNTQ4MzhjMzNlYTIyN2ZmY2EyMjNkZGRhYWJmZTBiMDIxNWY3MGRhNjQ5ZTk0NDQ3N2Y0NDM3MGNhNjk1MiJ9fX0=",
"YTNmMTcyZDI5Y2Y5NGJjODk1NjA4YjdhNWRjMmFmMGRlNDljNzg4ZDViZWNiMTYwNWYxZjUzNDg4YTAxNzBiOCJ9fX0=")),
SKELETON(51, "Skeleton", Arrays.asList(
"MzAxMjY4ZTljNDkyZGExZjBkODgyNzFjYjQ5MmE0YjMwMjM5NWY1MTVhN2JiZjc3ZjRhMjBiOTVmYzAyZWIyIn19fQ==",
"Yjk1MDc4ZDNiM2IxNzAxZDQ1NzI5ZDNhMTQyMjQ2N2IyOWRiYjJlMWE5MTI4MTMzYTJmMTYzZWJlODVkMmRiOSJ9fX0=")),
SPIDER(52, "Spider", Arrays.asList(
"Y2Q1NDE1NDFkYWFmZjUwODk2Y2QyNThiZGJkZDRjZjgwYzNiYTgxNjczNTcyNjA3OGJmZTM5MzkyN2U1N2YxIn19fQ==")),
GIANT(53, "Giant"),
ZOMBIE(54, "Zombie", Arrays.asList(
"NTZmYzg1NGJiODRjZjRiNzY5NzI5Nzk3M2UwMmI3OWJjMTA2OTg0NjBiNTFhNjM5YzYwZTVlNDE3NzM0ZTExIn19fQ==",
"MzExZGQ5MWVlNGQzMWRkZDU5MWQyODMyZWExZWMwODBmMmVkZWQzM2FiODllZTFkYjhiMDRiMjZhNjhhIn19fQ==")),
SLIME(55, "Slime", Arrays.asList(
"MTZhZDIwZmMyZDU3OWJlMjUwZDNkYjY1OWM4MzJkYTJiNDc4YTczYTY5OGI3ZWExMGQxOGM5MTYyZTRkOWI1In19fQ==")),
GHAST(56, "Ghast", Arrays.asList(
"OGI2YTcyMTM4ZDY5ZmJiZDJmZWEzZmEyNTFjYWJkODcxNTJlNGYxYzk3ZTVmOTg2YmY2ODU1NzFkYjNjYzAifX19")),
PIG_ZOMBIE(57, "Zombie Pigman", Arrays.asList(
"NzRlOWM2ZTk4NTgyZmZkOGZmOGZlYjMzMjJjZDE4NDljNDNmYjE2YjE1OGFiYjExY2E3YjQyZWRhNzc0M2ViIn19fQ==")),
ENDERMAN(58, "Enderman", Arrays.asList(
"N2E1OWJiMGE3YTMyOTY1YjNkOTBkOGVhZmE4OTlkMTgzNWY0MjQ1MDllYWRkNGU2YjcwOWFkYTUwYjljZiJ9fX0=")),
CAVE_SPIDER(59, "Cave Spider", Arrays.asList(
"NDE2NDVkZmQ3N2QwOTkyMzEwN2IzNDk2ZTk0ZWViNWMzMDMyOWY5N2VmYzk2ZWQ3NmUyMjZlOTgyMjQifX19")),
SILVERFISH(60, "Silverfish", Arrays.asList(
"ZGE5MWRhYjgzOTFhZjVmZGE1NGFjZDJjMGIxOGZiZDgxOWI4NjVlMWE4ZjFkNjIzODEzZmE3NjFlOTI0NTQwIn19fQ==")),
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mNWRlNGIyOTgxY2NlNzhmNTJmYzJjYzdjZDdiNWM2MmNhZWZlZGRlYjljZjMxMWU4M2Q5MDk3In19fQ==",
"ZjhhODJjOGI3NWRkMWMyY2U4MTMzYzBiYTkzOWI4YzUyZTQ3ZDNlYzM3NDk1MGY0N2RkZGJiZTM0NWUyMCJ9fX0=",
"YWNhNTgwYjA1MWM2M2JlMjlkYTU0NWE5YWE3ZmY3ZTEzNmRmNzdhODFjNjdkYzFlZTllNjE3MGMxNGZiMzEwIn19fQ==")),
PANDA(113, "Panda", Arrays.asList(
"ZDE4OGM5ODBhYWNmYTk0Y2YzMzA4ODUxMmIxYjk1MTdiYTgyNmIxNTRkNGNhZmMyNjJhZmY2OTc3YmU4YSJ9fX0=")),
PILLAGER(114, "Pillager", Arrays.asList(
"NGFlZTZiYjM3Y2JmYzkyYjBkODZkYjVhZGE0NzkwYzY0ZmY0NDY4ZDY4Yjg0OTQyZmRlMDQ0MDVlOGVmNTMzMyJ9fX0=")),
VILLAGER(120, "Villager", Arrays.asList(
"ODIyZDhlNzUxYzhmMmZkNGM4OTQyYzQ0YmRiMmY1Y2E0ZDhhZThlNTc1ZWQzZWIzNGMxOGE4NmU5M2IifX19")),
FOX(121, "Fox", Arrays.asList(
"YjZmZWI3NjFiMmY1OWZhYmU1Y2MzY2M4MmE5MzRiNTM0ZWE5OWVkYjkxMzJjY2RhOWY0ODRiZDU5ODZkNyJ9fX0=",
"MjRhMDM0NzQzNjQzNGViMTNkNTM3YjllYjZiNDViNmVmNGM1YTc4Zjg2ZTkxODYzZWY2MWQyYjhhNTNiODIifX19",
"MTZkYjdkNTA3Mzg5YTE0YmJlYzM5ZGU2OTIyMTY1YjMyZDQzNjU3YmNiNmFhZjRiNTE4MjgyNWIyMmI0In19fQ==")),
ENDER_CRYSTAL(200, "End Crystal"),
WANDERING_TRADER(604, "Wandering Trader", Arrays.asList(
"NWYxMzc5YTgyMjkwZDdhYmUxZWZhYWJiYzcwNzEwZmYyZWMwMmRkMzRhZGUzODZiYzAwYzkzMGM0NjFjZjkzMiJ9fX0=")),
TURTLE(901, "Turtle", Arrays.asList(
"MGE0MDUwZTdhYWNjNDUzOTIwMjY1OGZkYzMzOWRkMTgyZDdlMzIyZjlmYmNjNGQ1Zjk5YjU3MThhIn19fQ==")),
PHANTOM(902, "Phantom", Arrays.asList(
"NDExZDI1YmNkYWJhZmFkNWZkNmUwMTBjNWIxY2Y3YTAwYzljY2E0MGM1YTQ2NzQ3ZjcwNmRjOWNiM2EifX19",
"YWQyZmE1NjE4NDQ3NzYyZTI2MTExZTA2MGRjNTkzZWE2MjJkNWRkZmMzODVkN2U0MjUzMmU0NjMyN2Y4MDdjMCJ9fX0=")),
TRIDENT(903, "Trident"),
COD(904, "Cod", Arrays.asList(
"NmY5OWI1ODBkNDVhNzg0ZTdhOTY0ZTdkM2IxZjk3Y2VjZTc0OTExMTczYmQyMWMxZDdjNTZhY2RjMzg1ZWQ1In19fQ==")),
SALMON(905, "Salmon", Arrays.asList(
"YWRmYzU3ZDA5MDU5ZTQ3OTlmYTkyYzE1ZTI4NTEyYmNmYWExMzE1NTc3ZmUzYTI3YWVkMzg5ZTRmNzUyMjg5YSJ9fX0=")),
PUFFERFISH(906, "Pufferfish", Arrays.asList(
"YTk1NTkzODg5OTNmZTc4MmY2N2JkNThkOThjNGRmNTZiY2Q0MzBlZGNiMmY2NmVmNTc3N2E3M2MyN2RlMyJ9fX0=")),
TROPICAL_FISH(907, "Tropical Fish", Arrays.asList(
"MzZkMTQ5ZTRkNDk5OTI5NjcyZTI3Njg5NDllNjQ3Nzk1OWMyMWU2NTI1NDYxM2IzMjdiNTM4ZGYxZTRkZiJ9fX0=")),
DROWNED(908, "Drowned", Arrays.asList(
"YzNmN2NjZjYxZGJjM2Y5ZmU5YTYzMzNjZGUwYzBlMTQzOTllYjJlZWE3MWQzNGNmMjIzYjNhY2UyMjA1MSJ9fX0=",
"MWY4YmFhNDhiOGY1MTE5OTBlNDdkYjk2ODMyNGMxNTJ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2ZGQzZTdjMGNhNjMzMCJ9fX0=")),
STRIDER(927, "Strider", Arrays.asList("MThhOWFkZjc4MGVjN2RkNDYyNWM5YzA3NzkwNTJlNmExNWE0NTE4NjY2MjM1MTFlNGM4MmU5NjU1NzE0YjNjMSJ9fX0=")),
ZOGLIN(928, "Zoglin", Arrays.asList("ZTY3ZTE4NjAyZTAzMDM1YWQ2ODk2N2NlMDkwMjM1ZDg5OTY2NjNmYjllYTQ3NTc4ZDNhN2ViYmM0MmE1Y2NmOSJ9fX0=")),
// if possible we can remove this string for each texture to save up some space
// eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUv
UNKNOWN(999, "Unknown");
private int id;
private String name;
private String secondaryName;
EntityType type = null;
public static HashMap<String, ItemStack> cache = new HashMap<String, ItemStack>();
CMIEntityType(int id, String name, List<String> headTextures) {
this(id, name, null, headTextures);
}
CMIEntityType(int id, String name) {
this(id, name, null, new ArrayList<String>());
}
CMIEntityType(int id, String name, String secondaryName) {
this(id, name, secondaryName, new ArrayList<String>());
}
CMIEntityType(int id, String name, String secondaryName, List<String> headTextures) {
this.id = id;
this.name = name;
this.secondaryName = secondaryName;
for (String one : headTextures) {
String text = one;
if (text.length() < 150)
text = "" + text;
}
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public static CMIEntityType getById(int id) {
for (CMIEntityType one : CMIEntityType.values()) {
if (one.getId() == id)
return one;
}
return CMIEntityType.PIG;
}
public static CMIEntityType getByType(EntityType entity) {
return getByName(entity.toString());
}
public static CMIEntityType getByItem(ItemStack item) {
if (item == null)
return null;
if (CMIMaterial.isMonsterEgg(item.getType())) {
String name = item.getType().toString().replace("_SPAWN_EGG", "");
return getByName(name);
}
if (CMIMaterial.SPAWNER.equals(item.getType())) {
if (item.getItemMeta() instanceof BlockStateMeta) {
BlockStateMeta bsm = (BlockStateMeta) item.getItemMeta();
if (bsm.getBlockState() instanceof CreatureSpawner) {
CreatureSpawner bs = (CreatureSpawner) bsm.getBlockState();
return CMIEntityType.getByType(bs.getSpawnedType());
}
}
}
return null;
}
public static CMIEntityType getByName(String name) {
String main = name;
String sub = null;
if (name.contains("_")) {
main = name.split("_")[0];
sub = name.split("_")[1];
}
if (name.contains(":")) {
main = name.split(":")[0];
sub = name.split(":")[1];
}
String updated = (main + (sub == null ? "" : sub)).toLowerCase();
String reverse = ((sub == null ? "" : sub) + main).toLowerCase();
CMIEntityType type = null;
Integer id = null;
try {
id = Integer.parseInt(main);
} catch (NumberFormatException e) {
}
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name().replace("_", "").equalsIgnoreCase(updated) || one.name.replace(" ", "").equalsIgnoreCase(updated)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.secondaryName == null)
continue;
String oneN = one.secondaryName;
oneN = oneN.replace("_", "");
if (oneN.equalsIgnoreCase(name)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.replace("_", "").contains(updated)) {
type = one;
break;
}
}
if (sub != null) {
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name().replace("_", "").equalsIgnoreCase(reverse) || one.name.replace(" ", "").equalsIgnoreCase(reverse)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.replace("_", "").contains(reverse)) {
type = one;
break;
}
}
}
if (id != null) {
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.getId() == id) {
type = one;
break;
}
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.contains("_"))
continue;
if (one.name.equalsIgnoreCase(main)) {
type = one;
break;
}
}
return type;
}
public EntityType getType() {
if (type != null)
return type;
for (EntityType one : EntityType.values()) {
if (one.toString().equalsIgnoreCase(this.name())) {
type = one;
break;
}
}
return type;
}
public boolean isAlive() {
return getType() == null ? false : getType().isAlive();
}
public boolean isSpawnable() {
return getType() == null ? false : getType().isSpawnable();
}
public static String getRealNameByType(EntityType type) {
if (type == null)
return null;
CMIEntityType ctype = CMIEntityType.getByType(type);
if (ctype != null)
return ctype.getName();
String name = type.name();
name = name.toLowerCase().replace("_", " ");
name = name.substring(0, 1).toUpperCase() + name.substring(1);
return name;
}
public CMIMaterial getSpawnEggMaterial() {
CMIMaterial m = CMIMaterial.get((this.equals(CMIEntityType.MUSHROOM_COW) ? "Mooshroom".toLowerCase() : this.toString().toLowerCase()) + "_spawn_egg");
return m != null && m.isMonsterEgg() ? m : null;
}
}
package com.gamingmesh.jobs.CMILib;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
import org.bukkit.inventory.meta.ItemMeta;
public enum CMIEntityType {
DROPPED_ITEM(1, "Item"),
EXPERIENCE_ORB(2, "Experience Orb"),
AREA_EFFECT_CLOUD(3, "Area Effect Cloud"),
ELDER_GUARDIAN(4, "Elder Guardian", Arrays.asList(
"MWM3OTc0ODJhMTRiZmNiODc3MjU3Y2IyY2ZmMWI2ZTZhOGI4NDEzMzM2ZmZiNGMyOWE2MTM5Mjc4YjQzNmIifX19")),
WITHER_SKELETON(5, "Wither Skeleton", Arrays.asList(
"Nzk1M2I2YzY4NDQ4ZTdlNmI2YmY4ZmIyNzNkNzIwM2FjZDhlMWJlMTllODE0ODFlYWQ1MWY0NWRlNTlhOCJ9fX0=",
"NDk2YmM4ZWJkNGUxM2Y0OTZkOGQ3NGM1NjVkZDU2ZTk5YTRhZjJlMmVhN2EyN2E5NmMxYWJkMjg0MTg0YiJ9fX0=",
"ZjVlYzk2NDY0NWE4ZWZhYzc2YmUyZjE2MGQ3Yzk5NTYzNjJmMzJiNjUxNzM5MGM1OWMzMDg1MDM0ZjA1MGNmZiJ9fX0=")),
STRAY(6, "Stray", Arrays.asList(
"NzhkZGY3NmU1NTVkZDVjNGFhOGEwYTVmYzU4NDUyMGNkNjNkNDg5YzI1M2RlOTY5ZjdmMjJmODVhOWEyZDU2In19fQ==")),
EGG(7, "Thrown Egg"),
LEASH_HITCH(8, "Leash Knot"),
PAINTING(9, "Painting"),
ARROW(10, "Arrow"),
SNOWBALL(11, "Snowball"),
FIREBALL(12, "Fireball"),
SMALL_FIREBALL(13, "Small Fireball"),
ENDER_PEARL(14, "Thrown Ender Pearl"),
ENDER_SIGNAL(15, "End Signal"),
SPLASH_POTION(16, "Splash Potion"),
THROWN_EXP_BOTTLE(17, "Thrown Bottle o' Enchanting"),
ITEM_FRAME(18, "Item Frame"),
WITHER_SKULL(19, "Wither Skull"),
PRIMED_TNT(20, "Primed TNT"),
FALLING_BLOCK(21, "Falling Block"),
FIREWORK(22, "Firework Rocket"),
HUSK(23, "Husk", Arrays.asList(
"Nzc3MDY4MWQxYTI1NWZiNGY3NTQ3OTNhYTA1NWIyMjA0NDFjZGFiOWUxMTQxZGZhNTIzN2I0OTkzMWQ5YjkxYyJ9fX0=")),
SPECTRAL_ARROW(24, "Spectral Arrow"),
SHULKER_BULLET(25, "Shulker Bullet"),
DRAGON_FIREBALL(26, "Dragon Fireball"),
ZOMBIE_VILLAGER(27, "Zombie Villager", Arrays.asList(
"NDRmMDhlYmQ0ZTI1Y2RhM2FkZTQ1Yjg2MzM3OGFkMzc3ZjE4YzUxMGRiNGQyOGU4MmJiMjQ0NTE0MzliMzczNCJ9fX0=",
"OTYxZjE5ZmZkOGFlNDI1NzkyYzRiMTgxNzU2YWRmZjhkNDgxNzRhZWVmNThhMGYzMjdhMjhjNzQyYzcyNDQyIn19fQ==",
"NTI4YzJiYWQ1Mzg5Y2IzNTkyYjU2NWIzYzQ3ZWNjMTg5ZTA1NDJhODc4MzUwMjhkNjE0OGJiZTMzNDU2NDUifX19",
"YTE2MTU1ZmNmMzY2Y2Y0ZTA2Y2U1ZGZmYzQ4Y2E1NGU4ZWE0OGRmZTUyNTM1OGI2MTJkYzQ0ZmQ0MzIifX19",
"Y2ZmMDQ4MmZkMzJmYWIyY2U5ZjVmYTJlMmQ5YjRkYzc1NjFkYTQyMjE1MmM5OWZjODA0YjkxMzljYWYyNTZiIn19fQ==",
"MzdlODM4Y2NjMjY3NzZhMjE3YzY3ODM4NmY2YTY1NzkxZmU4Y2RhYjhjZTljYTRhYzZiMjgzOTdhNGQ4MWMyMiJ9fX0=")),
SKELETON_HORSE(28, "Skeleton Horse", Arrays.asList(
"NDdlZmZjZTM1MTMyYzg2ZmY3MmJjYWU3N2RmYmIxZDIyNTg3ZTk0ZGYzY2JjMjU3MGVkMTdjZjg5NzNhIn19fQ==")),
ZOMBIE_HORSE(29, "Zombie Horse", Arrays.asList(
"ZDIyOTUwZjJkM2VmZGRiMThkZTg2ZjhmNTVhYzUxOGRjZTczZjEyYTZlMGY4NjM2ZDU1MWQ4ZWI0ODBjZWVjIn19fQ==")),
ARMOR_STAND(30, "Armor Stand"),
DONKEY(31, "Donkey", Arrays.asList(
"ZGZiNmMzYzA1MmNmNzg3ZDIzNmEyOTE1ZjgwNzJiNzdjNTQ3NDk3NzE1ZDFkMmY4Y2JjOWQyNDFkODhhIn19fQ==")),
MULE(32, "Mule", Arrays.asList(
"YTA0ODZhNzQyZTdkZGEwYmFlNjFjZTJmNTVmYTEzNTI3ZjFjM2IzMzRjNTdjMDM0YmI0Y2YxMzJmYjVmNWYifX19")),
EVOKER_FANGS(33, "Evoker Fangs"),
EVOKER(34, "Evoker", Arrays.asList(
"YTAwZDNmZmYxNmMyZGNhNTliOWM1OGYwOTY1MjVjODY5NzExNjZkYmFlMTMzYjFiMDUwZTVlZTcxNjQ0MyJ9fX0=")),
VEX(35, "Vex", Arrays.asList(
"NWU3MzMwYzdkNWNkOGEwYTU1YWI5ZTk1MzIxNTM1YWM3YWUzMGZlODM3YzM3ZWE5ZTUzYmVhN2JhMmRlODZiIn19fQ==")),
VINDICATOR(36, "Vindicator", Arrays.asList(
"YTAwZDNmZmYxNmMyZGNhNTliOWM1OGYwOTY1MjVjODY5NzExNjZkYmFlMTMzYjFiMDUwZTVlZTcxNjQ0MyJ9fX0=")),
ILLUSIONER(37, "Illusioner", Arrays.asList(
"NTEyNTEyZTdkMDE2YTIzNDNhN2JmZjFhNGNkMTUzNTdhYjg1MTU3OWYxMzg5YmQ0ZTNhMjRjYmViODhiIn19fQ==",
"MmYyODgyZGQwOTcyM2U0N2MwYWI5NjYzZWFiMDgzZDZhNTk2OTI3MzcwNjExMGM4MjkxMGU2MWJmOGE4ZjA3ZSJ9fX0=")),
MINECART_COMMAND(40, "Minecart with Command Block"),
BOAT(41, "Boat"),
MINECART(42, "Minecart"),
MINECART_CHEST(43, "Minecart with Chest"),
MINECART_FURNACE(44, "Minecart with Furnace"),
MINECART_TNT(45, "Minecart with TNT"),
MINECART_HOPPER(46, "Minecart with Hopper"),
MINECART_MOB_SPAWNER(47, "Minecart with Spawner"),
CREEPER(50, "Creeper", Arrays.asList(
"ZjQyNTQ4MzhjMzNlYTIyN2ZmY2EyMjNkZGRhYWJmZTBiMDIxNWY3MGRhNjQ5ZTk0NDQ3N2Y0NDM3MGNhNjk1MiJ9fX0=",
"YTNmMTcyZDI5Y2Y5NGJjODk1NjA4YjdhNWRjMmFmMGRlNDljNzg4ZDViZWNiMTYwNWYxZjUzNDg4YTAxNzBiOCJ9fX0=")),
SKELETON(51, "Skeleton", Arrays.asList(
"MzAxMjY4ZTljNDkyZGExZjBkODgyNzFjYjQ5MmE0YjMwMjM5NWY1MTVhN2JiZjc3ZjRhMjBiOTVmYzAyZWIyIn19fQ==",
"Yjk1MDc4ZDNiM2IxNzAxZDQ1NzI5ZDNhMTQyMjQ2N2IyOWRiYjJlMWE5MTI4MTMzYTJmMTYzZWJlODVkMmRiOSJ9fX0=")),
SPIDER(52, "Spider", Arrays.asList(
"Y2Q1NDE1NDFkYWFmZjUwODk2Y2QyNThiZGJkZDRjZjgwYzNiYTgxNjczNTcyNjA3OGJmZTM5MzkyN2U1N2YxIn19fQ==")),
GIANT(53, "Giant"),
ZOMBIE(54, "Zombie", Arrays.asList(
"NTZmYzg1NGJiODRjZjRiNzY5NzI5Nzk3M2UwMmI3OWJjMTA2OTg0NjBiNTFhNjM5YzYwZTVlNDE3NzM0ZTExIn19fQ==",
"MzExZGQ5MWVlNGQzMWRkZDU5MWQyODMyZWExZWMwODBmMmVkZWQzM2FiODllZTFkYjhiMDRiMjZhNjhhIn19fQ==")),
SLIME(55, "Slime", Arrays.asList(
"MTZhZDIwZmMyZDU3OWJlMjUwZDNkYjY1OWM4MzJkYTJiNDc4YTczYTY5OGI3ZWExMGQxOGM5MTYyZTRkOWI1In19fQ==")),
GHAST(56, "Ghast", Arrays.asList(
"OGI2YTcyMTM4ZDY5ZmJiZDJmZWEzZmEyNTFjYWJkODcxNTJlNGYxYzk3ZTVmOTg2YmY2ODU1NzFkYjNjYzAifX19")),
PIG_ZOMBIE(57, "Zombie Pigman", Arrays.asList(
"NzRlOWM2ZTk4NTgyZmZkOGZmOGZlYjMzMjJjZDE4NDljNDNmYjE2YjE1OGFiYjExY2E3YjQyZWRhNzc0M2ViIn19fQ==")),
ENDERMAN(58, "Enderman", Arrays.asList(
"N2E1OWJiMGE3YTMyOTY1YjNkOTBkOGVhZmE4OTlkMTgzNWY0MjQ1MDllYWRkNGU2YjcwOWFkYTUwYjljZiJ9fX0=")),
CAVE_SPIDER(59, "Cave Spider", Arrays.asList(
"NDE2NDVkZmQ3N2QwOTkyMzEwN2IzNDk2ZTk0ZWViNWMzMDMyOWY5N2VmYzk2ZWQ3NmUyMjZlOTgyMjQifX19")),
SILVERFISH(60, "Silverfish", Arrays.asList(
"ZGE5MWRhYjgzOTFhZjVmZGE1NGFjZDJjMGIxOGZiZDgxOWI4NjVlMWE4ZjFkNjIzODEzZmE3NjFlOTI0NTQwIn19fQ==")),
BLAZE(61, "Blaze", Arrays.asList(
"Yjc4ZWYyZTRjZjJjNDF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n19fQ==")),
VILLAGER(120, "Villager", Arrays.asList(
"ODIyZDhlNzUxYzhmMmZkNGM4OTQyYzQ0YmRiMmY1Y2E0ZDhhZThlNTc1ZWQzZWIzNGMxOGE4NmU5M2IifX19")),
ENDER_CRYSTAL(200, "End Crystal"),
TURTLE(901, "Turtle", Arrays.asList(
"MGE0MDUwZTdhYWNjNDUzOTIwMjY1OGZkYzMzOWRkMTgyZDdlMzIyZjlmYmNjNGQ1Zjk5YjU3MThhIn19fQ==")),
PHANTOM(902, "Phantom", Arrays.asList(
"NDExZDI1YmNkYWJhZmFkNWZkNmUwMTBjNWIxY2Y3YTAwYzljY2E0MGM1YTQ2NzQ3ZjcwNmRjOWNiM2EifX19",
"YWQyZmE1NjE4NDQ3NzYyZTI2MTExZTA2MGRjNTkzZWE2MjJkNWRkZmMzODVkN2U0MjUzMmU0NjMyN2Y4MDdjMCJ9fX0=")),
TRIDENT(903, "Trident"),
COD(904, "Cod", Arrays.asList(
"NmY5OWI1ODBkNDVhNzg0ZTdhOTY0ZTdkM2IxZjk3Y2VjZTc0OTExMTczYmQyMWMxZDdjNTZhY2RjMzg1ZWQ1In19fQ==")),
SALMON(905, "Salmon", Arrays.asList(
"YWRmYzU3ZDA5MDU5ZTQ3OTlmYTkyYzE1ZTI4NTEyYmNmYWExMzE1NTc3ZmUzYTI3YWVkMzg5ZTRmNzUyMjg5YSJ9fX0=")),
PUFFERFISH(906, "Pufferfish", Arrays.asList(
"YTk1NTkzODg5OTNmZTc4MmY2N2JkNThkOThjNGRmNTZiY2Q0MzBlZGNiMmY2NmVmNTc3N2E3M2MyN2RlMyJ9fX0=")),
TROPICAL_FISH(907, "Tropical Fish", Arrays.asList(
"MzZkMTQ5ZTRkNDk5OTI5NjcyZTI3Njg5NDllNjQ3Nzk1OWMyMWU2NTI1NDYxM2IzMjdiNTM4ZGYxZTRkZiJ9fX0=")),
DROWNED(908, "Drowned", Arrays.asList(
"YzNmN2NjZjYxZGJjM2Y5ZmU5YTYzMzNjZGUwYzBlMTQzOTllYjJlZWE3MWQzNGNmMjIzYjNhY2UyMjA1MSJ9fX0=",
"MWY4YmFhNDhiOGY1MTE5OTBlNDdkYjk2ODMyNGMxNTJiZDExNjc3MzFkZGYwMzQ1MzAwNDQ3MzVhNmJkMmVkNCJ9fX0=",
"YzFhNzMyNTI0MDFhNmU5NDZmNjFkYmFjMGUwMjdkMTgzZTBhY2U1ODc1MmZhMTVhNjRkMjQ0OWZjZjUwODdiNyJ9fX0=",
"Yzg0ZGY3OWM0OTEwNGIxOThjZGFkNmQ5OWZkMGQwYmNmMTUzMWM5MmQ0YWI2MjY5ZTQwYjdkM2NiYmI4ZTk4YyJ9fX0=",
"ZmIxNTMxYzA0ZTI1ZDdmYTY0NTc2OTgyNjg0OTFjYjg5NmQzMzAyZDI2ODg0ZmNmZGYxYTBiMmY5MmQ3N2M4ZiJ9fX0=",
"NTZkYWY1MGVhZjc2YzNhNmQ1YWQzOWM5NjZmMjk4NzdiOTFkOTUwZGQxZTM3MTIyZTljODE5NTg1Yzg5ZDkyZSJ9fX0=")),
DOLPHIN(909, "Dolphin", Arrays.asList(
"OGU5Njg4Yjk1MGQ4ODBiNTViN2FhMmNmY2Q3NmU1YTBmYTk0YWFjNmQxNmY3OGU4MzNmNzQ0M2VhMjlmZWQzIn19fQ==")),
LINGERING_POTION(910, "Lingering Potion"),
FISHING_HOOK(911, "Fishing Hook"),
LIGHTNING(912, "Lightning Bolt"),
WEATHER(913, "Weather"),
PLAYER(914, "Player"),
COMPLEX_PART(915, "Complex Part"),
TIPPED_ARROW(916, "Tipped Arrow"),
PANDA(917, "Panda", Arrays.asList(
"ZDE4OGM5ODBhYWNmYTk0Y2YzMzA4ODUxMmIxYjk1MTdiYTgyNmIxNTRkNGNhZmMyNjJhZmY2OTc3YmU4YSJ9fX0=")),
PILLAGER(918, "Pillager", Arrays.asList(
"NGFlZTZiYjM3Y2JmYzkyYjBkODZkYjVhZGE0NzkwYzY0ZmY0NDY4ZDY4Yjg0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MThhOWFkZjc4MGVjN2RkNDYyNWM5YzA3NzkwNTJlNmExNWE0NTE4NjY2MjM1MTFlNGM4MmU5NjU1NzE0YjNjMSJ9fX0=")),
ZOGLIN(928, "Zoglin", Arrays.asList("ZTY3ZTE4NjAyZTAzMDM1YWQ2ODk2N2NlMDkwMjM1ZDg5OTY2NjNmYjllYTQ3NTc4ZDNhN2ViYmM0MmE1Y2NmOSJ9fX0=")),
// if possible we can remove this string for each texture to save up some space
// eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUv
UNKNOWN(999, "Unknown");
private int id;
private String name;
private String secondaryName;
EntityType type = null;
public static HashMap<String, ItemStack> cache = new HashMap<String, ItemStack>();
CMIEntityType(int id, String name, List<String> headTextures) {
this(id, name, null, headTextures);
}
CMIEntityType(int id, String name) {
this(id, name, null, new ArrayList<String>());
}
CMIEntityType(int id, String name, String secondaryName) {
this(id, name, secondaryName, new ArrayList<String>());
}
CMIEntityType(int id, String name, String secondaryName, List<String> headTextures) {
this.id = id;
this.name = name;
this.secondaryName = secondaryName;
for (String one : headTextures) {
String text = one;
if (text.length() < 150)
text = "" + text;
}
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public static CMIEntityType getById(int id) {
for (CMIEntityType one : CMIEntityType.values()) {
if (one.getId() == id)
return one;
}
return CMIEntityType.PIG;
}
public static CMIEntityType getByType(EntityType entity) {
return getByName(entity.toString());
}
public static CMIEntityType getByItem(ItemStack item) {
if (item == null)
return null;
if (CMIMaterial.isMonsterEgg(item.getType())) {
String name = item.getType().toString().replace("_SPAWN_EGG", "");
return getByName(name);
}
if (CMIMaterial.SPAWNER.equals(item.getType())) {
if (item.getItemMeta() instanceof BlockStateMeta) {
BlockStateMeta bsm = (BlockStateMeta) item.getItemMeta();
if (bsm.getBlockState() instanceof CreatureSpawner) {
CreatureSpawner bs = (CreatureSpawner) bsm.getBlockState();
return CMIEntityType.getByType(bs.getSpawnedType());
}
}
}
return null;
}
public static CMIEntityType getByName(String name) {
String main = name;
String sub = null;
if (name.contains("_")) {
main = name.split("_")[0];
sub = name.split("_")[1];
}
if (name.contains(":")) {
main = name.split(":")[0];
sub = name.split(":")[1];
}
String updated = (main + (sub == null ? "" : sub)).toLowerCase();
String reverse = ((sub == null ? "" : sub) + main).toLowerCase();
CMIEntityType type = null;
Integer id = null;
try {
id = Integer.parseInt(main);
} catch (Exception e) {
}
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name().replace("_", "").equalsIgnoreCase(updated) || one.name.replace(" ", "").equalsIgnoreCase(updated)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.secondaryName == null)
continue;
String oneN = one.secondaryName;
oneN = oneN.replace("_", "");
if (oneN.equalsIgnoreCase(name)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.replace("_", "").contains(updated)) {
type = one;
break;
}
}
if (sub != null) {
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name().replace("_", "").equalsIgnoreCase(reverse) || one.name.replace(" ", "").equalsIgnoreCase(reverse)) {
type = one;
break;
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.replace("_", "").contains(reverse)) {
type = one;
break;
}
}
}
if (id != null) {
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.getId() == id) {
type = one;
break;
}
}
}
if (type == null)
for (CMIEntityType one : CMIEntityType.values()) {
if (one.name.contains("_"))
continue;
if (one.name.equalsIgnoreCase(main)) {
type = one;
break;
}
}
return type;
}
public EntityType getType() {
if (type != null)
return type;
for (EntityType one : EntityType.values()) {
if (one.toString().equalsIgnoreCase(this.name())) {
type = one;
break;
}
}
return type;
}
public boolean isAlive() {
return getType() == null ? false : getType().isAlive();
}
public boolean isSpawnable() {
return getType() == null ? false : getType().isSpawnable();
}
public static String getRealNameByType(EntityType type) {
if (type == null)
return null;
CMIEntityType ctype = CMIEntityType.getByType(type);
if (ctype != null)
return ctype.getName();
String name = type.name();
name = name.toLowerCase().replace("_", " ");
name = name.substring(0, 1).toUpperCase() + name.substring(1);
return name;
}
public CMIMaterial getSpawnEggMaterial() {
CMIMaterial m = CMIMaterial.get((this.equals(CMIEntityType.MUSHROOM_COW) ? "Mooshroom".toLowerCase() : this.toString().toLowerCase()) + "_spawn_egg");
if (m != null && m.isMonsterEgg())
return m;
return null;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
package com.gamingmesh.jobs.CMILib;
public enum CMIMaterialCriteria {
seeThrow, stars, slab, door, carpet, wool, monsteregg;
}
package com.gamingmesh.jobs.CMILib;
public enum CMIMaterialCriteria {
seeThrow, stars, slab, door, carpet, wool, monsteregg
}

View File

@ -4,6 +4,7 @@
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
@ -11,7 +12,7 @@ import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.Jobs;
public class Reflections {
public class CMIReflections {
private Class<?> CraftServerClass;
private Object CraftServer;
@ -21,10 +22,10 @@ public class Reflections {
// private Class<?> NBTTagList;
private static Class<?> CraftItemStack;
// private Class<?> Item;
private static Class<?> Item;
private static Class<?> IStack;
public Reflections() {
public CMIReflections() {
initialize();
}
@ -34,17 +35,17 @@ public class Reflections {
CraftServer = CraftServerClass.cast(Bukkit.getServer());
NBTTagCompound = getMinecraftClass("NBTTagCompound");
NBTBase = getMinecraftClass("NBTBase");
/*try {
/*try {
NBTTagList = getMinecraftClass("NBTTagList");
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
e.printStackTrace();
}*/
}*/
CraftItemStack = getBukkitClass("inventory.CraftItemStack");
/*try {
Item = getMinecraftClass("Item");
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
e.printStackTrace();
}*/
try {
Item = getMinecraftClass("Item");
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
e.printStackTrace();
}
IStack = getMinecraftClass("ItemStack");
} catch (ClassCastException | ClassNotFoundException e) {
e.printStackTrace();
@ -281,7 +282,49 @@ public class Reflections {
}
}
public Object getCraftServer() {
return CraftServer;
public static String getItemMinecraftName(ItemStack item) {
try {
Object nmsStack = asNMSCopy(item);
if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) {
Object pre = nmsStack.getClass().getMethod("getItem").invoke(nmsStack);
Object n = pre.getClass().getMethod("getName").invoke(pre);
Class<?> ll = Class.forName("net.minecraft.server." + Version.getCurrent() + ".LocaleLanguage");
Object lla = ll.getMethod("a").invoke(ll);
return (String) lla.getClass().getMethod("a", String.class).invoke(lla, (String) n);
}
Field field = Item.getField("REGISTRY");
Object reg = field.get(field);
Method meth = reg.getClass().getMethod("b", Object.class);
meth.setAccessible(true);
Method secmeth = nmsStack.getClass().getMethod("getItem");
Object res2 = secmeth.invoke(nmsStack);
Object res = meth.invoke(reg, res2);
return res.toString();
} catch (Exception e) {
return null;
}
}
public String getItemMinecraftNamePath(ItemStack item) {
try {
Object nmsStack = asNMSCopy(item);
Method itemMeth = Item.getMethod("getById", int.class);
@SuppressWarnings("deprecation")
Object res = itemMeth.invoke(Item, item.getType().getId());
Method nameThingy = Item.getMethod("j", IStack);
Object resThingy = nameThingy.invoke(res, nmsStack);
return resThingy.toString();
} catch (Throwable e) {
return null;
}
}
public static ItemStack getItemInOffHand(org.bukkit.entity.Player player) {
if (Jobs.getVersionCheckManager().getVersion().isLower(Version.v1_9_R1))
return null;
return player.getInventory().getItemInOffHand();
}
}

View File

@ -0,0 +1,8 @@
package com.gamingmesh.jobs.CMILib;
public enum CMISlabType {
TOP,
BOTTOM,
DOUBLE,
NOTSLAB;
}

View File

@ -15,7 +15,7 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.container.Potion;
import com.gamingmesh.jobs.stuff.Util;
@ -52,7 +52,7 @@ public class ItemManager {
String mojangName = null;
try {
if (Version.isCurrentEqualOrLower(Version.v1_14_R1) || mat.isItem())
mojangName = ItemReflection.getItemMinecraftName(new ItemStack(mat));
mojangName = CMIReflections.getItemMinecraftName(new ItemStack(mat));
} catch (Exception e) {
e.printStackTrace();
}
@ -63,8 +63,7 @@ public class ItemManager {
for (Potion p : Potion.values()) {
byName.put(cmiName + ":" + p.getName().toLowerCase(), one);
}
}
else if (byName.containsKey(cmiName)) {
} else if (byName.containsKey(cmiName)) {
byName.put(cmiName + ":" + data, one);
} else
byName.put(cmiName, one);
@ -291,7 +290,7 @@ public class ItemManager {
ItemStack skull = Util.getSkull(d);
if (skull == null) {
break main;
}
}
headCache.put(original, skull);
cm.setItemStack(skull);

View File

@ -15,8 +15,8 @@ import org.bukkit.inventory.ItemStack;
public class RawMessage {
List<String> parts = new ArrayList<>();
List<String> cleanParts = new ArrayList<>();
List<String> parts = new ArrayList<String>();
List<String> cleanParts = new ArrayList<String>();
private String unfinished = "";
private String unfinishedClean = "";
@ -29,8 +29,8 @@ public class RawMessage {
// private boolean colorizeEntireWithLast = true;
public void clear() {
parts = new ArrayList<>();
cleanParts = new ArrayList<>();
parts = new ArrayList<String>();
cleanParts = new ArrayList<String>();
combined = "";
combinedClean = "";
}
@ -63,17 +63,19 @@ public class RawMessage {
return add(text, hoverText, command, suggestion, null);
}
Set<CMIChatColor> formats = new HashSet<>();
Set<CMIChatColor> formats = new HashSet<CMIChatColor>();
CMIChatColor lastColor = null;
Set<CMIChatColor> savedFormats = new HashSet<>();
Set<CMIChatColor> savedFormats = new HashSet<CMIChatColor>();
CMIChatColor savedLastColor = null;
CMIChatColor firstBlockColor = null;
private String intoJsonColored(String text) {
if (text.equalsIgnoreCase(" "))
if (text.equalsIgnoreCase(" ")) {
text = "{\"text\":\" \"}";
return text;
}
text = CMIChatColor.deColorize(text);
@ -89,7 +91,7 @@ public class RawMessage {
text = text.replaceAll(decolmatch.group(), string);
}
List<String> splited = new ArrayList<>();
List<String> splited = new ArrayList<String>();
if (text.contains(" ")) {
for (String one : text.split(" ")) {
// if (this.isBreakLine() && one.contains("\\n")) {
@ -118,7 +120,7 @@ public class RawMessage {
Pattern prepattern = Pattern.compile(CMIChatColor.hexColorRegex);
List<String> plt = new ArrayList<>(splited);
List<String> plt = new ArrayList<String>(splited);
splited.clear();
for (String one : plt) {
Matcher match = prepattern.matcher(one);
@ -232,10 +234,10 @@ public class RawMessage {
}
one = one.replace(c.getColorCode(), c.getColorCode() + form);
} else if (c.getHex() != null) {
//String form = "";
//for (CMIChatColor oneC : formats) {
//form += oneC.getColorCode();
//}
String form = "";
for (CMIChatColor oneC : formats) {
form += oneC.getColorCode();
}
// CMIDebug.d("*"+net.md_5.bungee.api.ChatColor.of("#" + c.getHex())+ "_"+net.md_5.bungee.api.ChatColor.of("#FF00FF")+ "+");
@ -412,7 +414,6 @@ public class RawMessage {
return this;
text = processText(text);
if (dontBreakLine) {
text = text.replace("\n", "\\\\n");
text = text.replace("\\n", "\\\\n");
@ -545,7 +546,7 @@ public class RawMessage {
f += ",\"insertion\":\"" + insertion + "\"";
}
String res = Reflections.toJson(item);
String res = CMIReflections.toJson(item);
f += ",\"hoverEvent\":{\"action\":\"show_item\",\"value\":\"" + res + "\"}";
@ -566,7 +567,7 @@ public class RawMessage {
}
public List<String> softCombine() {
List<String> ls = new ArrayList<>();
List<String> ls = new ArrayList<String>();
String f = "";
for (String part : parts) {
if (f.isEmpty())

View File

@ -1,92 +1,89 @@
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
public class RawMessageManager {
private static Object packet;
private static Method getHandle;
private static Method sendPacket;
private static Field playerConnection;
private static Class<?> nmsChatSerializer;
private static Class<?> nmsIChatBaseComponent;
private static Class<?> packetType;
private static Class<?> ChatMessageclz;
private static Class<?> sub;
private static Object[] consts;
static {
Version version = Version.getCurrent();
try {
packetType = Class.forName("net.minecraft.server." + version + ".PacketPlayOutChat");
Class<?> typeCraftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer");
Class<?> typeNMSPlayer = Class.forName("net.minecraft.server." + version + ".EntityPlayer");
Class<?> typePlayerConnection = Class.forName("net.minecraft.server." + version + ".PlayerConnection");
nmsChatSerializer = Class.forName(getChatSerializerClasspath());
nmsIChatBaseComponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent");
getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName("net.minecraft.server." + version + ".Packet"));
if (Version.isCurrentHigher(Version.v1_11_R1)) {
ChatMessageclz = Class.forName("net.minecraft.server." + version + ".ChatMessageType");
consts = ChatMessageclz.getEnumConstants();
sub = consts[2].getClass();
}
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | NoSuchFieldException ex) {
Jobs.consoleMsg("Error {0} ");
Jobs.consoleMsg(ex.toString());
}
}
public static void send(CommandSender receivingPacket, String msg) {
if (receivingPacket instanceof Player)
send((Player) receivingPacket, msg);
else
receivingPacket.sendMessage(msg);
}
public static void send(Player receivingPacket, String json) {
if (receivingPacket == null)
return;
if (!receivingPacket.isOnline())
return;
if (json == null)
return;
try {
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, json);
if (Version.isCurrentHigher(Version.v1_15_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub, UUID.class).newInstance(serialized, consts[1], receivingPacket.getUniqueId());
else if (Version.isCurrentHigher(Version.v1_11_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub).newInstance(serialized, consts[1]);
else if (Version.isCurrentHigher(Version.v1_7_R4)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, byte.class).newInstance(serialized, (byte) 1);
} else {
packet = packetType.getConstructor(nmsIChatBaseComponent, int.class).newInstance(serialized, 1);
}
Object player = getHandle.invoke(receivingPacket);
Object connection = playerConnection.get(player);
sendPacket.invoke(connection, packet);
} catch (Exception ex) {
ex.printStackTrace();
Jobs.consoleMsg("Failed to show json message with packets, using command approach");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "minecraft:tellraw \"" + receivingPacket.getName() + "\" " + json);
}
}
private static String getChatSerializerClasspath() {
if (!Version.isCurrentHigher(Version.v1_8_R2))
return "net.minecraft.server." + Version.getCurrent() + ".ChatSerializer";
return "net.minecraft.server." + Version.getCurrent() + ".IChatBaseComponent$ChatSerializer";// 1_8_R2 moved to IChatBaseComponent
}
}
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class RawMessageManager {
private static Object packet;
private static Method getHandle;
private static Method sendPacket;
private static Field playerConnection;
private static Class<?> nmsChatSerializer;
private static Class<?> nmsIChatBaseComponent;
private static Class<?> packetType;
private static Class<?> ChatMessageclz;
private static Class<?> sub;
private static Object[] consts;
static {
Version version = Version.getCurrent();
try {
packetType = Class.forName("net.minecraft.server." + version + ".PacketPlayOutChat");
Class<?> typeCraftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer");
Class<?> typeNMSPlayer = Class.forName("net.minecraft.server." + version + ".EntityPlayer");
Class<?> typePlayerConnection = Class.forName("net.minecraft.server." + version + ".PlayerConnection");
nmsChatSerializer = Class.forName(getChatSerializerClasspath());
nmsIChatBaseComponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent");
getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName("net.minecraft.server." + version + ".Packet"));
if (Version.isCurrentHigher(Version.v1_11_R1)) {
ChatMessageclz = Class.forName("net.minecraft.server." + version + ".ChatMessageType");
consts = ChatMessageclz.getEnumConstants();
sub = consts[2].getClass();
}
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | NoSuchFieldException ex) {
Bukkit.getConsoleSender().sendMessage("Error {0} ");
Bukkit.getConsoleSender().sendMessage(ex.toString());
}
}
public static void send(CommandSender receivingPacket, String msg) {
if (receivingPacket instanceof Player)
send((Player) receivingPacket, msg);
else
receivingPacket.sendMessage(msg);
}
public static void send(Player receivingPacket, String json) {
if (receivingPacket == null)
return;
if (!receivingPacket.isOnline())
return;
if (json == null)
return;
try {
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, json);
if (Version.isCurrentHigher(Version.v1_15_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub, UUID.class).newInstance(serialized, consts[1], receivingPacket.getUniqueId());
else if (Version.isCurrentHigher(Version.v1_11_R1))
packet = packetType.getConstructor(nmsIChatBaseComponent, sub).newInstance(serialized, consts[1]);
else if (Version.isCurrentHigher(Version.v1_7_R4)) {
packet = packetType.getConstructor(nmsIChatBaseComponent, byte.class).newInstance(serialized, (byte) 1);
} else {
packet = packetType.getConstructor(nmsIChatBaseComponent, int.class).newInstance(serialized, 1);
}
Object player = getHandle.invoke(receivingPacket);
Object connection = playerConnection.get(player);
sendPacket.invoke(connection, packet);
} catch (Exception ex) {
ex.printStackTrace();
Bukkit.getConsoleSender().sendMessage("Failed to show json message with packets, using command approach");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "minecraft:tellraw \"" + receivingPacket.getName() + "\" " + json);
}
}
private static String getChatSerializerClasspath() {
if (!Version.isCurrentHigher(Version.v1_8_R2))
return "net.minecraft.server." + Version.getCurrent() + ".ChatSerializer";
return "net.minecraft.server." + Version.getCurrent() + ".IChatBaseComponent$ChatSerializer";// 1_8_R2 moved to IChatBaseComponent
}
}

View File

@ -0,0 +1,136 @@
package com.gamingmesh.jobs.CMILib;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
public class TitleMessageManager {
private static Method getHandle;
private static Method sendPacket;
private static Field playerConnection;
private static Class<?> nmsIChatBaseComponent;
private static Constructor<?> nmsPacketPlayOutTitle;
private static Constructor<?> nmsPacketPlayOutTimes;
private static Class<?> enumTitleAction;
private static Method fromString;
private static boolean simpleTitleMessages = false;
static {
if (Version.isCurrentHigher(Version.v1_7_R4)) {
Version version = Version.getCurrent();
try {
Class<?> typeCraftPlayer = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftPlayer");
Class<?> typeNMSPlayer = Class.forName("net.minecraft.server." + version + ".EntityPlayer");
Class<?> typePlayerConnection = Class.forName("net.minecraft.server." + version + ".PlayerConnection");
nmsIChatBaseComponent = Class.forName("net.minecraft.server." + version + ".IChatBaseComponent");
getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName("net.minecraft.server." + version + ".Packet"));
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | NoSuchFieldException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Error {0}", ex);
}
// Title
try {
Class<?> typePacketPlayOutTitle = Class.forName(getPacketPlayOutTitleClasspath());
enumTitleAction = Class.forName(getEnumTitleActionClasspath());
nmsPacketPlayOutTitle = typePacketPlayOutTitle.getConstructor(enumTitleAction, nmsIChatBaseComponent);
nmsPacketPlayOutTimes = typePacketPlayOutTitle.getConstructor(int.class, int.class, int.class);
fromString = Class.forName("org.bukkit.craftbukkit." + version + ".util.CraftChatMessage").getMethod("fromString", String.class);
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException ex) {
simpleTitleMessages = true;
}
}
}
public static void send(final Player receivingPacket, final Object title, final Object subtitle) {
send(receivingPacket, title, subtitle, 0, 40, 10);
}
public static void send(final Player receivingPacket, final Object title, final Object subtitle, final int fadeIn, final int keep, final int fadeOut) {
Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), new Runnable() {
@Override
public void run() {
String t = title == null ? null : CMIChatColor.translate((String) title);
String s = subtitle == null ? null : CMIChatColor.translate((String) subtitle);
if (Version.isCurrentEqualOrLower(Version.v1_7_R4)) {
ActionBarManager.send(receivingPacket, (t == null ? "" : t) + (s == null ? "" : s));
return;
}
if (simpleTitleMessages) {
receivingPacket.sendMessage(t);
receivingPacket.sendMessage(s);
return;
}
try {
switch (Version.getCurrent()) {
case v1_12_R1:
case v1_13_R1:
case v1_13_R2:
case v1_14_R1:
case v1_14_R2:
case v1_15_R1:
case v1_15_R2:
case v1_16_R1:
default:
receivingPacket.sendTitle(t, s, fadeIn, keep, fadeOut);
break;
case v1_9_R1:
case v1_9_R2:
case v1_10_R1:
case v1_11_R1:
case v1_8_R1:
case v1_8_R2:
case v1_8_R3:
Object packetTimes = nmsPacketPlayOutTimes.newInstance(fadeIn, keep, fadeOut);
sendPacket(receivingPacket, packetTimes);
if (title != null) {
Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), ((Object[]) fromString.invoke(null, t))[0]);
sendPacket(receivingPacket, packetTitle);
}
if (subtitle != null) {
if (title == null) {
Object packetTitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("TITLE").get(null), ((Object[]) fromString.invoke(null, ""))[0]);
sendPacket(receivingPacket, packetTitle);
}
Object packetSubtitle = nmsPacketPlayOutTitle.newInstance(enumTitleAction.getField("SUBTITLE").get(null), ((Object[]) fromString.invoke(null, s))[0]);
sendPacket(receivingPacket, packetSubtitle);
}
break;
}
} catch (SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchFieldException ex) {
simpleTitleMessages = true;
Bukkit.getLogger().log(Level.SEVERE, "Your server can't fully support title messages. They will be shown in chat instead.");
}
return;
}
});
}
private static void sendPacket(Player player, Object packet) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Object handle = getHandle.invoke(player);
Object connection = playerConnection.get(handle);
sendPacket.invoke(connection, packet);
}
private static String getPacketPlayOutTitleClasspath() {
return "net.minecraft.server." + Version.getCurrent() + ".PacketPlayOutTitle";
}
private static String getEnumTitleActionClasspath() {
return getPacketPlayOutTitleClasspath() + "$EnumTitleAction";
}
}

View File

@ -0,0 +1,95 @@
package com.gamingmesh.jobs.CMILib;
import org.bukkit.Bukkit;
public enum Version {
v1_7_R1,
v1_7_R2,
v1_7_R3,
v1_7_R4,
v1_8_R1,
v1_8_R2,
v1_8_R3,
v1_9_R1,
v1_9_R2,
v1_10_R1,
v1_11_R1,
v1_12_R1,
v1_13_R1,
v1_13_R2,
v1_13_R3,
v1_14_R1,
v1_14_R2,
v1_15_R1,
v1_15_R2,
v1_16_R1,
v1_16_R2,
v1_17_R1,
v1_17_R2;
private Integer value;
private String shortVersion;
private static Version current = null;
Version() {
try {
this.value = Integer.valueOf(this.name().replaceAll("[^\\d.]", ""));
} catch (Exception e) {
}
shortVersion = this.name().substring(0, this.name().length() - 3);
}
public Integer getValue() {
return value;
}
public String getShortVersion() {
return shortVersion;
}
public static Version getCurrent() {
if (current != null)
return current;
String[] v = Bukkit.getServer().getClass().getPackage().getName().split("\\.");
String vv = v[v.length - 1];
for (Version one : values()) {
if (one.name().equalsIgnoreCase(vv)) {
current = one;
break;
}
}
return current;
}
public boolean isLower(Version version) {
return getValue() < version.getValue();
}
public boolean isHigher(Version version) {
return getValue() > version.getValue();
}
public boolean isEqualOrLower(Version version) {
return getValue() <= version.getValue();
}
public boolean isEqualOrHigher(Version version) {
return getValue() >= version.getValue();
}
public static boolean isCurrentEqualOrHigher(Version v) {
return getCurrent().getValue() >= v.getValue();
}
public static boolean isCurrentHigher(Version v) {
return getCurrent().getValue() > v.getValue();
}
public static boolean isCurrentLower(Version v) {
return getCurrent().getValue() < v.getValue();
}
public static boolean isCurrentEqualOrLower(Version v) {
return getCurrent().getValue() <= v.getValue();
}
}

View File

@ -18,11 +18,12 @@
package com.gamingmesh.jobs;
import com.gamingmesh.jobs.CMILib.ActionBarTitleMessages;
import com.gamingmesh.jobs.CMILib.RawMessage;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.CMILib.ActionBarManager;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIReflections;
import com.gamingmesh.jobs.CMILib.VersionChecker;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.Gui.GuiManager;
import com.gamingmesh.jobs.Placeholders.NewPlaceholderAPIHook;
import com.gamingmesh.jobs.Placeholders.Placeholder;
@ -90,7 +91,7 @@ public class Jobs extends JavaPlugin {
private static ConfigManager configManager = null;
private static GeneralConfigManager GconfigManager = null;
private static Reflections reflections = null;
private static CMIReflections reflections = null;
private static JobsDAO dao = null;
private static List<Job> jobs = null;
@ -112,8 +113,6 @@ public class Jobs extends JavaPlugin {
private static NMS nms = null;
private static ActionBarTitleMessages actionbar = null;
protected static VersionChecker versionCheckManager = null;
protected static SelectionManager smanager = null;
@ -171,9 +170,9 @@ public class Jobs extends JavaPlugin {
return BpManager;
}
public static Reflections getReflections() {
public static CMIReflections getReflections() {
if (reflections == null)
reflections = new Reflections();
reflections = new CMIReflections();
return reflections;
}
@ -215,12 +214,6 @@ public class Jobs extends JavaPlugin {
return GconfigManager;
}
public static ActionBarTitleMessages getActionBar() {
if (actionbar == null)
actionbar = new ActionBarTitleMessages();
return actionbar;
}
public static NMS getNms() {
return nms;
}
@ -1172,7 +1165,7 @@ public class Jobs extends JavaPlugin {
int sec = Math.round((time - System.currentTimeMillis()) / 1000L);
if (inform) {
if (player.canGetPaid(info))
getActionBar().send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
ActionBarManager.send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
}
return false;
}
@ -1198,7 +1191,7 @@ public class Jobs extends JavaPlugin {
int sec = Math.round((time - System.currentTimeMillis()) / 1000L);
if (inform) {
if (player.canGetPaid(info))
getActionBar().send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
ActionBarManager.send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
}
getBpManager().add(block, cd);
return false;
@ -1285,7 +1278,7 @@ public class Jobs extends JavaPlugin {
public static void consoleMsg(String msg) {
if (msg != null) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
Bukkit.getServer().getConsoleSender().sendMessage(CMIChatColor.translate(msg));
}
}

View File

@ -41,9 +41,9 @@ import org.bukkit.entity.Tameable;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta;
import com.gamingmesh.jobs.CMILib.ItemReflection;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.CMILib.ActionBarManager;
import com.gamingmesh.jobs.CMILib.CMIReflections;
import com.gamingmesh.jobs.api.JobsJoinEvent;
import com.gamingmesh.jobs.api.JobsLeaveEvent;
import com.gamingmesh.jobs.api.JobsLevelUpEvent;
@ -559,7 +559,7 @@ public class PlayerManager {
if (player != null) {
for (String line : message.split("\n")) {
if (Jobs.getGCManager().LevelChangeActionBar)
Jobs.getActionBar().send(player, line);
ActionBarManager.send(player, line);
if (Jobs.getGCManager().LevelChangeChat)
player.sendMessage(line);
}
@ -716,7 +716,7 @@ public class PlayerManager {
Bukkit.getServer().broadcastMessage(line);
} else if (player != null) {
if (Jobs.getGCManager().LevelChangeActionBar)
Jobs.getActionBar().send(player, line);
ActionBarManager.send(player, line);
if (Jobs.getGCManager().LevelChangeChat)
player.sendMessage(line);
}
@ -755,7 +755,7 @@ public class PlayerManager {
Bukkit.getServer().broadcastMessage(line);
} else if (player != null) {
if (Jobs.getGCManager().TitleChangeActionBar)
Jobs.getActionBar().send(player, line);
ActionBarManager.send(player, line);
if (Jobs.getGCManager().TitleChangeChat)
player.sendMessage(line);
}
@ -896,7 +896,7 @@ public class PlayerManager {
// Lets check offhand
if (Version.isCurrentEqualOrHigher(Version.v1_9_R1) && Jobs.getGCManager().boostedItemsInOffHand) {
iih = ItemReflection.getItemInOffHand(player);
iih = CMIReflections.getItemInOffHand(player);
if (iih != null) {
jitem = getJobsItemByNbt(iih);
if (jitem != null && jitem.getJobs().contains(prog))
@ -928,7 +928,7 @@ public class PlayerManager {
if (item == null)
return null;
Object itemName = Reflections.getNbt(item, JobsItemBoost);
Object itemName = CMIReflections.getNbt(item, JobsItemBoost);
if (itemName == null || itemName.toString().isEmpty()) {
// Checking old boost items and converting to new format if needed
@ -938,7 +938,7 @@ public class PlayerManager {
if (itemName != null) {
JobItems b = ItemBoostManager.getItemByKey(itemName.toString());
if (b != null) {
ItemStack ic = Reflections.setNbt(item, JobsItemBoost, b.getNode());
ItemStack ic = CMIReflections.setNbt(item, JobsItemBoost, b.getNode());
item.setItemMeta(ic.getItemMeta());
}
break;

View File

@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.ItemBoostManager;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.CMILib.CMIReflections;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.commands.JobCommand;
import com.gamingmesh.jobs.container.BoostMultiplier;
@ -78,7 +78,7 @@ public class edititembonus implements Cmd {
case add:
if (jobitem == null)
return false;
iih = Reflections.setNbt(iih, "JobsItemBoost", jobitem.getNode());
iih = CMIReflections.setNbt(iih, "JobsItemBoost", jobitem.getNode());
Jobs.getNms().setItemInMainHand(player, iih);
break;
case list:
@ -93,7 +93,7 @@ public class edititembonus implements Cmd {
sender.sendMessage(Jobs.getLanguage().getMessage("command.bonus.output.topline"));
Object key = Reflections.getNbt(iih, "JobsItemBoost");
Object key = CMIReflections.getNbt(iih, "JobsItemBoost");
if (key == null)
return true;

View File

@ -3,6 +3,7 @@ package com.gamingmesh.jobs.commands.list;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.commands.JobCommand;
@ -39,7 +40,7 @@ public class entitylist implements Cmd {
msg += type.name().toLowerCase();
}
sender.sendMessage(org.bukkit.ChatColor.translateAlternateColorCodes('&', msg));
sender.sendMessage(CMIChatColor.translate(msg));
return true;
}

View File

@ -6,7 +6,7 @@ import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.commands.JobCommand;

View File

@ -9,7 +9,7 @@ import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.container.BossBarInfo;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobProgression;

View File

@ -18,11 +18,12 @@
package com.gamingmesh.jobs.config;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIEnchantment;
import com.gamingmesh.jobs.CMILib.CMIEntityType;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.ConfigReader;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.ItemBoostManager;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.container.*;
@ -704,7 +705,7 @@ public class ConfigManager {
continue;
}
String description = org.bukkit.ChatColor.translateAlternateColorCodes('&', jobSection.getString("description", ""));
String description = CMIChatColor.translate(jobSection.getString("description", ""));
List<String> fDescription = new ArrayList<>();
if (jobSection.contains("FullDescription")) {
@ -713,7 +714,7 @@ public class ConfigManager {
else if (jobSection.isList("FullDescription"))
fDescription.addAll(jobSection.getStringList("FullDescription"));
for (int i = 0; i < fDescription.size(); i++) {
fDescription.set(i, org.bukkit.ChatColor.translateAlternateColorCodes('&', fDescription.get(i)));
fDescription.set(i, CMIChatColor.translate(fDescription.get(i)));
}
}
@ -905,7 +906,7 @@ public class ConfigManager {
}
List<String> requires = permissionSection.getStringList("requires"),
perform = permissionSection.getStringList("perform");
perform = permissionSection.getStringList("perform");
jobConditions.add(new JobConditions(ConditionKey.toLowerCase(), requires, perform));
}
}
@ -971,7 +972,7 @@ public class ConfigManager {
List<String> lore = new ArrayList<>();
if (itemSection.contains("lore"))
for (String eachLine : itemSection.getStringList("lore")) {
lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine));
lore.add(CMIChatColor.translate(eachLine));
}
HashMap<Enchantment, Integer> enchants = new HashMap<>();
@ -1027,7 +1028,7 @@ public class ConfigManager {
List<String> lore = new ArrayList<>();
if (itemSection.contains("lore"))
for (String eachLine : itemSection.getStringList("lore")) {
lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine));
lore.add(CMIChatColor.translate(eachLine));
}
HashMap<Enchantment, Integer> enchants = new HashMap<>();
@ -1160,8 +1161,8 @@ public class ConfigManager {
job.setMaxDailyQuests(jobSection.getInt("maxDailyQuests", 1));
Integer softIncomeLimit = null,
softExpLimit = null,
softPointsLimit = null;
softExpLimit = null,
softPointsLimit = null;
if (jobSection.isInt("softIncomeLimit"))
softIncomeLimit = jobSection.getInt("softIncomeLimit");
if (jobSection.isInt("softExpLimit"))

View File

@ -35,7 +35,7 @@ import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.CMIEnchantment;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.ConfigReader;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.container.CurrencyLimit;
import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.container.Schedule;

View File

@ -24,6 +24,7 @@ import com.gamingmesh.jobs.CMIGUI.CMIGui;
import com.gamingmesh.jobs.CMIGUI.CMIGuiButton;
import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIClickType;
import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIRows;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIEnchantment;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.container.BoostMultiplier;
@ -158,7 +159,7 @@ public class ShopManager {
Job job = Jobs.getJob(one.getKey());
if (job == null) {
continue;
}
}
String jobColor = "";
String levelColor = "";
@ -318,8 +319,8 @@ public class ShopManager {
for (String category : categoriesList) {
ConfigurationSection NameSection = ConfCategory.getConfigurationSection(category);
if (NameSection == null) {
continue;
}
continue;
}
if (!NameSection.isDouble("Price")) {
Jobs.getPluginLogger().severe("Shop item " + category + " has an invalid Price property. Skipping!");
@ -340,12 +341,12 @@ public class ShopManager {
Sitem.setIconAmount(NameSection.getInt("Icon.Amount", 1));
if (NameSection.isString("Icon.Name"))
Sitem.setIconName(ChatColor.translateAlternateColorCodes('&', NameSection.getString("Icon.Name")));
Sitem.setIconName(CMIChatColor.translate(NameSection.getString("Icon.Name")));
if (NameSection.isList("Icon.Lore")) {
List<String> lore = new ArrayList<>();
for (String eachLine : NameSection.getStringList("Icon.Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', eachLine));
lore.add(CMIChatColor.translate(eachLine));
}
Sitem.setIconLore(lore);
}
@ -395,7 +396,7 @@ public class ShopManager {
if (NameSection.isList("PerformCommands")) {
List<String> cmd = new ArrayList<>();
for (String eachLine : NameSection.getStringList("PerformCommands")) {
cmd.add(ChatColor.translateAlternateColorCodes('&', eachLine));
cmd.add(CMIChatColor.translate(eachLine));
}
Sitem.setCommands(cmd);
}
@ -421,12 +422,12 @@ public class ShopManager {
String name = null;
if (itemSection.isString("Name"))
name = ChatColor.translateAlternateColorCodes('&', itemSection.getString("Name"));
name = CMIChatColor.translate(itemSection.getString("Name"));
List<String> lore = new ArrayList<>();
if (itemSection.contains("Lore"))
for (String eachLine : itemSection.getStringList("Lore")) {
lore.add(ChatColor.translateAlternateColorCodes('&', eachLine));
lore.add(CMIChatColor.translate(eachLine));
}
HashMap<Enchantment, Integer> enchants = new HashMap<>();

View File

@ -30,8 +30,9 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.ItemMeta;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.CMILib.CMIReflections;
public class JobItems {
private String node;
@ -52,7 +53,7 @@ public class JobItems {
ItemMeta meta = item.getItemMeta();
if (name != null)
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name));
meta.setDisplayName(CMIChatColor.translate(name));
if (lore != null && !lore.isEmpty())
meta.setLore(lore);
@ -70,7 +71,7 @@ public class JobItems {
}
item.setItemMeta(meta);
item.setAmount(amount);
item = Reflections.setNbt(item, "JobsItemBoost", node);
item = CMIReflections.setNbt(item, "JobsItemBoost", node);
} catch (Throwable e) {
e.printStackTrace();
}
@ -91,11 +92,11 @@ public class JobItems {
ItemStack item = this.item.clone();
ItemMeta meta = item.getItemMeta();
if (meta.hasDisplayName())
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', meta.getDisplayName().replace("[player]", player.getName())));
meta.setDisplayName(CMIChatColor.translate(meta.getDisplayName().replace("[player]", player.getName())));
if (meta.hasLore()) {
List<String> TranslatedLore = new ArrayList<>();
for (String oneLore : meta.getLore()) {
TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName())));
TranslatedLore.add(CMIChatColor.translate(oneLore.replace("[player]", player.getName())));
}
meta.setLore(TranslatedLore);
}

View File

@ -31,6 +31,8 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.ActionBarManager;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.Signs.SignTopType;
import com.gamingmesh.jobs.dao.JobsDAO;
import com.gamingmesh.jobs.economy.PaymentData;
@ -174,7 +176,7 @@ public class JobsPlayer {
data.setInformed();
}
if (data.IsAnnounceTime(limit.getAnnouncementDelay()) && player.isOnline())
Jobs.getActionBar().send(player, Jobs.getLanguage().getMessage("command.limit.output." + name + "time", "%time%", TimeManage.to24hourShort(data.GetLeftTime(type))));
ActionBarManager.send(player, Jobs.getLanguage().getMessage("command.limit.output." + name + "time", "%time%", TimeManage.to24hourShort(data.GetLeftTime(type))));
if (data.isReseted())
data.setReseted(false);
return false;
@ -733,8 +735,7 @@ public class JobsPlayer {
honorific = builder.toString().trim();
if (honorific.length() > 0)
honorific = org.bukkit.ChatColor.translateAlternateColorCodes('&',
Jobs.getGCManager().modifyChatPrefix + honorific + Jobs.getGCManager().modifyChatSuffix);
honorific = CMIChatColor.translate(Jobs.getGCManager().modifyChatPrefix + honorific + Jobs.getGCManager().modifyChatSuffix);
}

View File

@ -69,8 +69,10 @@ import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.ActionBarManager;
import com.gamingmesh.jobs.CMILib.CMIChatColor;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.Signs.SignTopType;
import com.gamingmesh.jobs.Signs.SignUtil;
import com.gamingmesh.jobs.Signs.jobsSign;
@ -369,8 +371,7 @@ public class JobsListener implements Listener {
event.setCancelled(true);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
signUtil.SignUpdate(job, type), 1L);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> signUtil.SignUpdate(job, type), 1L);
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
@ -413,7 +414,7 @@ public class JobsListener implements Listener {
private static String Convert(String line) {
Pattern ReplacePatern = Pattern.compile("&([0-9a-fk-or])");
return ReplacePatern.matcher(ChatColor.translateAlternateColorCodes('&', line)).replaceAll("\u00a7$1");
return ReplacePatern.matcher(CMIChatColor.translate(line)).replaceAll("\u00a7$1");
}
// Adding to chat prefix job name
@ -493,8 +494,7 @@ public class JobsListener implements Listener {
if (!Jobs.getGCManager().canPerformActionInWorld(event.getBlock().getWorld()))
return;
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
Jobs.getBpManager().remove(event.getBlock()), 1L);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> Jobs.getBpManager().remove(event.getBlock()), 1L);
}
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
@ -542,7 +542,7 @@ public class JobsListener implements Listener {
if (meinOk != null) {
event.setCancelled(true);
Jobs.getActionBar().send(player, Jobs.getLanguage().getMessage("limitedItem.error.levelup", "[jobname]", meinOk));
ActionBarManager.send(player, Jobs.getLanguage().getMessage("limitedItem.error.levelup", "[jobname]", meinOk));
}
}
@ -551,7 +551,7 @@ public class JobsListener implements Listener {
return false;
if (oneItem.getName() != null && name != null) {
if (!ChatColor.translateAlternateColorCodes('&', oneItem.getName()).equalsIgnoreCase(name)) {
if (!CMIChatColor.translate(oneItem.getName()).equalsIgnoreCase(name)) {
return false;
}
}

View File

@ -18,10 +18,11 @@
package com.gamingmesh.jobs.listeners;
import com.gamingmesh.jobs.CMILib.ActionBarManager;
import com.gamingmesh.jobs.CMILib.CMIEnchantment;
import com.gamingmesh.jobs.CMILib.CMIMaterial;
import com.gamingmesh.jobs.CMILib.ItemManager;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.CMILib.Version;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.actions.*;
import com.gamingmesh.jobs.api.JobsChunkChangeEvent;
@ -414,8 +415,8 @@ public class JobsPaymentListener implements Listener {
// Prevent money duplication when breaking plant blocks
Material brokenBlock = block.getRelative(BlockFace.DOWN).getType();
if (Jobs.getGCManager().preventCropResizePayment && (brokenBlock == CMIMaterial.SUGAR_CANE.getMaterial()
|| brokenBlock == CMIMaterial.KELP.getMaterial()
|| brokenBlock == CMIMaterial.CACTUS.getMaterial() || brokenBlock == CMIMaterial.BAMBOO.getMaterial())) {
|| brokenBlock == CMIMaterial.KELP.getMaterial()
|| brokenBlock == CMIMaterial.CACTUS.getMaterial() || brokenBlock == CMIMaterial.BAMBOO.getMaterial())) {
return;
}
@ -464,8 +465,8 @@ public class JobsPaymentListener implements Listener {
// Prevent money duplication when placing plant blocks
Material placedBlock = event.getBlockPlaced().getRelative(BlockFace.DOWN).getType();
if (Jobs.getGCManager().preventCropResizePayment && (placedBlock == CMIMaterial.SUGAR_CANE.getMaterial()
|| placedBlock == CMIMaterial.KELP.getMaterial()
|| placedBlock == CMIMaterial.CACTUS.getMaterial() || placedBlock == CMIMaterial.BAMBOO.getMaterial())) {
|| placedBlock == CMIMaterial.KELP.getMaterial()
|| placedBlock == CMIMaterial.CACTUS.getMaterial() || placedBlock == CMIMaterial.BAMBOO.getMaterial())) {
return;
}
@ -708,7 +709,7 @@ public class JobsPaymentListener implements Listener {
Jobs.action(jPlayer, new PotionItemActionInfo(currentItem, ActionType.CRAFT, potion.getBasePotionData().getType()));
} else if (resultStack.hasItemMeta() && resultStack.getItemMeta().hasDisplayName()) {
Jobs.action(jPlayer, new ItemNameActionInfo(ChatColor.stripColor(resultStack.getItemMeta()
.getDisplayName()), ActionType.CRAFT));
.getDisplayName()), ActionType.CRAFT));
} else if (currentItem != null) {
Jobs.action(jPlayer, new ItemActionInfo(currentItem, ActionType.CRAFT));
}
@ -824,7 +825,7 @@ public class JobsPaymentListener implements Listener {
Inventory inv = event.getInventory();
// must be anvil inventory
if (!(inv instanceof AnvilInventory) && (Version.isCurrentEqualOrHigher(Version.v1_14_R1)
&& !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory)))
&& !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory)))
return;
int slot = event.getSlot();
@ -1713,9 +1714,9 @@ public class JobsPaymentListener implements Listener {
report = true;
if (report)
Jobs.getActionBar().send(p, Jobs.getLanguage().getMessage("general.error.noFurnaceRegistration"));
ActionBarManager.send(p, Jobs.getLanguage().getMessage("general.error.noFurnaceRegistration"));
} else if (done.equals(ownershipFeedback.newReg) && jPlayer != null) {
Jobs.getActionBar().send(p, Jobs.getLanguage().getMessage("general.error.newFurnaceRegistration",
ActionBarManager.send(p, Jobs.getLanguage().getMessage("general.error.newFurnaceRegistration",
"[current]", jPlayer.getFurnaceCount(),
"[max]", jPlayer.getMaxFurnacesAllowed() == 0 ? "-" : jPlayer.getMaxFurnacesAllowed()));
}
@ -1739,9 +1740,9 @@ public class JobsPaymentListener implements Listener {
report = true;
if (report)
Jobs.getActionBar().send(p, Jobs.getLanguage().getMessage("general.error.noBrewingRegistration"));
ActionBarManager.send(p, Jobs.getLanguage().getMessage("general.error.noBrewingRegistration"));
} else if (done.equals(ownershipFeedback.newReg) && jPlayer != null) {
Jobs.getActionBar().send(p, Jobs.getLanguage().getMessage("general.error.newBrewingRegistration",
ActionBarManager.send(p, Jobs.getLanguage().getMessage("general.error.newBrewingRegistration",
"[current]", jPlayer.getBrewingStandCount(),
"[max]", jPlayer.getMaxBrewingStandsAllowed() == 0 ? "-" : jPlayer.getMaxBrewingStandsAllowed()));
}