mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Update mythicmobs repo
This commit is contained in:
parent
e933bc3a84
commit
f3151489be
Binary file not shown.
16
pom.xml
16
pom.xml
@ -69,13 +69,12 @@
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/MythicMobs-2.4.5.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- MythicMobs 4 -->
|
||||
<!-- MythicMobs new -->
|
||||
<dependency>
|
||||
<groupId>io.lumine.xikage.mythicmobs</groupId>
|
||||
<groupId>io.lumine.xikage</groupId>
|
||||
<artifactId>MythicMobs</artifactId>
|
||||
<version>4.9.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/MythicMobs-4.9.0.jar</systemPath>
|
||||
<version>4.9.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- WorldGuard old version -->
|
||||
<dependency>
|
||||
@ -205,6 +204,13 @@
|
||||
<updatePolicy>always</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- MythicMobs -->
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>Lumine Releases</name>
|
||||
<url>https://mvn.lumine.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
<!-- Builds Plugin -->
|
||||
<build>
|
||||
|
@ -295,7 +295,7 @@ public class CMIItemStack {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public CMIItemStack setItemStack(ItemStack item) {
|
||||
this.item = item == null ? null : item;
|
||||
this.item = item;
|
||||
if (item != null) {
|
||||
this.amount = item.getAmount();
|
||||
this.material = item.getType();
|
||||
|
@ -106,7 +106,7 @@ public class NameTranslatorManager {
|
||||
case TAME:
|
||||
for (NameList one : ListOfEntities) {
|
||||
String ids = one.getId() + ":" + one.getMeta();
|
||||
if (!one.getMeta().equalsIgnoreCase("") && ids.equalsIgnoreCase(id + ":" + meta) && !one.getId().equals("0")) {
|
||||
if (!one.getMeta().isEmpty() && ids.equalsIgnoreCase(id + ":" + meta) && !one.getId().equals("0")) {
|
||||
return one.getName();
|
||||
}
|
||||
ids = one.getId();
|
||||
|
@ -81,7 +81,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(getActionType().equals(ActionType.MMKILL) ? getName() : materialName, this);
|
||||
materialName = Jobs.getNameTranslatorManager().Translate(actionType == ActionType.MMKILL ? getName() : materialName, this);
|
||||
materialName = CMIChatColor.translate(materialName);
|
||||
return materialName;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class HookManager {
|
||||
}
|
||||
|
||||
if (MythicManager == null) {
|
||||
Jobs.consoleMsg("&cYour MythicMobs version is not supported by Jobs! Supported versions: 2.4.5+, 4.6.5");
|
||||
Jobs.consoleMsg("&cYour MythicMobs version is not supported by Jobs! Supported versions: 2.4.5+, 4.6.5+");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import net.elseland.xikage.MythicMobs.Mobs.MythicMob;
|
||||
|
||||
public class MythicMobs2 implements MythicMobInterface {
|
||||
|
||||
public MythicMobsAPI MMAPI = null;
|
||||
public MythicMobsAPI MMAPI;
|
||||
private Jobs plugin;
|
||||
|
||||
public MythicMobs2(Jobs plugin) {
|
||||
@ -22,7 +22,7 @@ public class MythicMobs2 implements MythicMobInterface {
|
||||
|
||||
@Override
|
||||
public void registerListener() {
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobs2Listener(plugin), plugin);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobs2Listener(), plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -30,10 +30,7 @@ public class MythicMobs2 implements MythicMobInterface {
|
||||
if (MMAPI == null || lVictim == null)
|
||||
return false;
|
||||
|
||||
if (MMAPI.getMobAPI().isMythicMob(lVictim))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return MMAPI.getMobAPI().isMythicMob(lVictim);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,14 +56,15 @@ public class MythicMobs2 implements MythicMobInterface {
|
||||
|
||||
@Override
|
||||
public String getDisplayName(String id) {
|
||||
try {
|
||||
MythicMob mm = MMAPI.getMobAPI().getMythicMob(id);
|
||||
if (mm != null)
|
||||
return mm.getDisplayName();
|
||||
} catch (InvalidMobTypeException e) {
|
||||
if (MMAPI == null || id == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
try {
|
||||
MythicMob mm = MMAPI.getMobAPI().getMythicMob(id);
|
||||
return mm != null ? mm.getDisplayName() : "";
|
||||
} catch (InvalidMobTypeException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gamingmesh.jobs.hooks.MythicMobs;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -11,23 +10,15 @@ import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.actions.MMKillInfo;
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
import com.gamingmesh.jobs.listeners.JobsPaymentListener;
|
||||
|
||||
import net.elseland.xikage.MythicMobs.API.Bukkit.Events.MythicMobDeathEvent;
|
||||
import net.elseland.xikage.MythicMobs.Mobs.MythicMob;
|
||||
|
||||
public class MythicMobs2Listener implements Listener {
|
||||
|
||||
private Jobs plugin;
|
||||
|
||||
public MythicMobs2Listener(Jobs plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void OnMythicMobDeath(MythicMobDeathEvent event) {
|
||||
// make sure plugin is enabled
|
||||
if (!plugin.isEnabled())
|
||||
return;
|
||||
|
||||
//disabling plugin in world
|
||||
if (event.getEntity() != null && !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||
return;
|
||||
@ -52,7 +43,7 @@ public class MythicMobs2Listener implements Listener {
|
||||
return;
|
||||
|
||||
// check if in creative
|
||||
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
|
||||
if (!JobsPaymentListener.payIfCreative(pDamager))
|
||||
return;
|
||||
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission(pDamager, pDamager.getLocation().getWorld().getName()))
|
||||
|
@ -12,7 +12,7 @@ import io.lumine.xikage.mythicmobs.mobs.MythicMob;
|
||||
|
||||
public class MythicMobs4 implements MythicMobInterface {
|
||||
|
||||
public BukkitAPIHelper MMAPI = null;
|
||||
public BukkitAPIHelper MMAPI;
|
||||
private Jobs plugin;
|
||||
|
||||
public MythicMobs4(Jobs plugin) {
|
||||
@ -21,7 +21,7 @@ public class MythicMobs4 implements MythicMobInterface {
|
||||
|
||||
@Override
|
||||
public void registerListener() {
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobs4Listener(plugin), plugin);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobs4Listener(), plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,10 +29,7 @@ public class MythicMobs4 implements MythicMobInterface {
|
||||
if (MMAPI == null || lVictim == null)
|
||||
return false;
|
||||
|
||||
if (MMAPI.isMythicMob(lVictim))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return MMAPI.isMythicMob(lVictim);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,17 +58,14 @@ public class MythicMobs4 implements MythicMobInterface {
|
||||
|
||||
@Override
|
||||
public String getDisplayName(String id) {
|
||||
if (failed)
|
||||
return "";
|
||||
|
||||
if (MMAPI == null)
|
||||
if (failed || MMAPI == null)
|
||||
return "";
|
||||
|
||||
MythicMob mm = MMAPI.getMythicMob(id);
|
||||
try {
|
||||
if (mm != null)
|
||||
return mm.getDisplayName().toString();
|
||||
} catch (Exception | Error e) {
|
||||
} catch (Throwable e) {
|
||||
if (!failed) {
|
||||
failed = true;
|
||||
Jobs.consoleMsg("&cEncountered error when checking MythicMob entity name. Support for mythicMobs will be suspended for time beying. Please report this issue.");
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gamingmesh.jobs.hooks.MythicMobs;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -11,24 +10,15 @@ import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.actions.MMKillInfo;
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
import com.gamingmesh.jobs.listeners.JobsPaymentListener;
|
||||
|
||||
import io.lumine.xikage.mythicmobs.api.bukkit.events.MythicMobDeathEvent;
|
||||
import io.lumine.xikage.mythicmobs.mobs.MythicMob;
|
||||
|
||||
public class MythicMobs4Listener implements Listener {
|
||||
|
||||
private Jobs plugin;
|
||||
|
||||
public MythicMobs4Listener(Jobs plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void OnMythicMobDeath(MythicMobDeathEvent event) {
|
||||
// make sure plugin is enabled
|
||||
if (!plugin.isEnabled())
|
||||
return;
|
||||
|
||||
//disabling plugin in world
|
||||
if (event.getEntity() != null && !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||
return;
|
||||
@ -53,7 +43,7 @@ public class MythicMobs4Listener implements Listener {
|
||||
return;
|
||||
|
||||
// check if in creative
|
||||
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
|
||||
if (!JobsPaymentListener.payIfCreative(pDamager))
|
||||
return;
|
||||
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission(pDamager, pDamager.getLocation().getWorld().getName()))
|
||||
|
@ -196,8 +196,6 @@ public class JobsPaymentListener implements Listener {
|
||||
return;
|
||||
|
||||
ItemStack itemInHand = Jobs.getNms().getItemInMainHand(player);
|
||||
if (itemInHand == null)
|
||||
return;
|
||||
|
||||
if ((cow.getType() == EntityType.COW && itemInHand.getType() != Material.BUCKET)
|
||||
|| (cow.getType() == EntityType.MUSHROOM_COW && itemInHand.getType() != Material.BOWL)) {
|
||||
@ -277,7 +275,7 @@ public class JobsPaymentListener implements Listener {
|
||||
|
||||
// pay
|
||||
JobsPlayer jDamager = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||
if (jDamager == null)
|
||||
if (jDamager == null || sheep.getColor() == null)
|
||||
return;
|
||||
|
||||
Jobs.action(jDamager, new CustomKillInfo(sheep.getColor().name(), ActionType.SHEAR));
|
||||
@ -373,7 +371,7 @@ public class JobsPaymentListener implements Listener {
|
||||
return;
|
||||
|
||||
ItemStack item = Jobs.getNms().getItemInMainHand(player);
|
||||
if (item != null && item.getType() != Material.AIR) {
|
||||
if (item.getType() != Material.AIR) {
|
||||
// Protection for block break with silktouch
|
||||
if (Jobs.getGCManager().useSilkTouchProtection) {
|
||||
for (Enchantment one : item.getEnchantments().keySet()) {
|
||||
@ -667,7 +665,7 @@ public class JobsPaymentListener implements Listener {
|
||||
ItemStack currentItem = event.getCurrentItem();
|
||||
|
||||
// when we trying to craft tipped arrow effects
|
||||
if (currentItem != null && currentItem.hasItemMeta() && currentItem.getItemMeta() instanceof PotionMeta) {
|
||||
if (currentItem != null && currentItem.getItemMeta() instanceof PotionMeta) {
|
||||
PotionMeta potion = (PotionMeta) currentItem.getItemMeta();
|
||||
Jobs.action(jPlayer, new PotionItemActionInfo(currentItem, ActionType.CRAFT, potion.getBasePotionData().getType()));
|
||||
} else if (resultStack.hasItemMeta() && resultStack.getItemMeta().hasDisplayName()) {
|
||||
|
Loading…
Reference in New Issue
Block a user