diff --git a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobInterface.java b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobInterface.java index d6fd0f5e..9063fa00 100644 --- a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobInterface.java +++ b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobInterface.java @@ -9,5 +9,9 @@ public interface MythicMobInterface { boolean isMythicMob(LivingEntity lVictim); void registerListener(); + + String getDisplayName(String id); + + } diff --git a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs2.java b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs2.java index 3d4a5bed..9ab29f31 100644 --- a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs2.java +++ b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs2.java @@ -9,6 +9,8 @@ import com.gamingmesh.jobs.Jobs; import net.elseland.xikage.MythicMobs.MythicMobs; import net.elseland.xikage.MythicMobs.API.MythicMobsAPI; +import net.elseland.xikage.MythicMobs.API.Exceptions.InvalidMobTypeException; +import net.elseland.xikage.MythicMobs.Mobs.MythicMob; public class MythicMobs2 implements MythicMobInterface { @@ -56,4 +58,16 @@ public class MythicMobs2 implements MythicMobInterface { return true; } + + @Override + public String getDisplayName(String id) { + try { + MythicMob mm = MMAPI.getMobAPI().getMythicMob(id); + if (mm != null) + return mm.getDisplayName(); + } catch (InvalidMobTypeException e) { + return ""; + } + return ""; + } } diff --git a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java index 27b04b06..b08b99df 100644 --- a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java +++ b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java @@ -6,8 +6,11 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.plugin.Plugin; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.stuff.Debug; + import io.lumine.xikage.mythicmobs.MythicMobs; import io.lumine.xikage.mythicmobs.api.bukkit.BukkitAPIHelper; +import io.lumine.xikage.mythicmobs.mobs.MythicMob; public class MythicMobs4 implements MythicMobInterface { @@ -56,4 +59,14 @@ public class MythicMobs4 implements MythicMobInterface { return true; } + + @Override + public String getDisplayName(String id) { + Debug.D(id); + MythicMob mm = MMAPI.getMythicMob(id); + if (mm != null) + return mm.getDisplayName(); + return ""; + } + } diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index f5604dc3..e7d0e5c9 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -101,7 +101,6 @@ public class NameTranslatorManager { } break; case CUSTOMKILL: - case MMKILL: case EXPLORE: break; case SHEAR: @@ -112,6 +111,9 @@ public class NameTranslatorManager { } } break; + + case MMKILL: + return Jobs.getMythicManager().getDisplayName(materialName); } return materialName; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobInfo.java b/src/main/java/com/gamingmesh/jobs/container/JobInfo.java index cc121e74..0c2588cf 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobInfo.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobInfo.java @@ -80,7 +80,7 @@ public class JobInfo { public String getRealisticName() { String materialName = getName().toLowerCase().replace('_', ' '); materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1); - materialName = Jobs.getNameTranslatorManager().Translate(materialName, this); + materialName = Jobs.getNameTranslatorManager().Translate(getActionType().equals(ActionType.MMKILL) ? getName() : materialName, this); materialName = org.bukkit.ChatColor.translateAlternateColorCodes('&', materialName); return materialName; } diff --git a/src/main/java/jobConfig.yml b/src/main/java/jobConfig.yml index a531d93d..c70f358f 100644 --- a/src/main/java/jobConfig.yml +++ b/src/main/java/jobConfig.yml @@ -73,6 +73,10 @@ Jobs: Id: 17 # data of block, usualy its 0, but in example Diorite will have id of 1 and data of 3 Data: 2 + # !OPTIONALY! + # Instead of providing item id and data you can provide skull owner name or UUID to use it in GUI + # In this case you don't need to use Id and Data fields + CustomSkull: Zrips ######################################################################## # Section used to configure what items the job gets paid for, how much # they get paid and how much experience they gain. diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 067b6622..f8d3ff11 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.5.2 +version: 4.5.3 website: https://www.spigotmc.org/resources/jobs-reborn.4216/ author: phrstbrn softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet]