1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

Removed Boss dependency

- Fix for mushroom cow can't be milked with bowl
- Now pig_zombie will automatically changes to piglin in 1.16+ versions (for lazy peoples)
This commit is contained in:
montlikadani 2020-10-21 17:31:32 +02:00
parent 081b02c7df
commit 0c4a43e6cc
6 changed files with 20 additions and 42 deletions

View File

@ -355,7 +355,6 @@ public class editquests implements Cmd {
case KILL: case KILL:
case MILK: case MILK:
case MMKILL: case MMKILL:
case BOSS:
case BREED: case BREED:
case TAME: case TAME:
case SHEAR: case SHEAR:
@ -517,7 +516,7 @@ public class editquests implements Cmd {
} }
type = myKey; type = myKey;
} else if (actionT == ActionType.CUSTOMKILL || actionT == ActionType.SHEAR || actionT == ActionType.MMKILL } else if (actionT == ActionType.CUSTOMKILL || actionT == ActionType.SHEAR || actionT == ActionType.MMKILL
|| actionT == ActionType.COLLECT || actionT == ActionType.BAKE || actionT == ActionType.BOSS) || actionT == ActionType.COLLECT || actionT == ActionType.BAKE)
type = myKey; type = myKey;
else if (actionT == ActionType.EXPLORE) { else if (actionT == ActionType.EXPLORE) {
type = myKey; type = myKey;

View File

@ -406,7 +406,6 @@ public class ConfigManager {
case KILL: case KILL:
case MILK: case MILK:
case MMKILL: case MMKILL:
case BOSS:
case BREED: case BREED:
case TAME: case TAME:
case SHEAR: case SHEAR:
@ -526,18 +525,14 @@ public class ConfigManager {
// check entities // check entities
CMIEntityType entity = CMIEntityType.getByName(myKey); CMIEntityType entity = CMIEntityType.getByName(myKey);
if (entity != null) { // Change pig zombie -> piglin in 1.16+
if (entity.isAlive()) { if (Version.isCurrentEqualOrHigher(Version.v1_16_R1) && entity == CMIEntityType.PIG_ZOMBIE) {
type = entity.toString(); entity = CMIEntityType.PIGLIN;
id = entity.getId(); }
// using breeder finder if (entity != null && (entity.isAlive() || entity == CMIEntityType.ENDER_CRYSTAL)) {
if (actionType == ActionType.BREED) type = entity.toString();
Jobs.getGCManager().useBreederFinder = true; id = entity.getId();
} else if (entity == CMIEntityType.ENDER_CRYSTAL) {
type = entity.toString();
id = entity.getId();
}
} }
// Pre 1.13 checks for custom names // Pre 1.13 checks for custom names
@ -582,7 +577,6 @@ public class ConfigManager {
break; break;
} }
} }
} else if (actionType == ActionType.ENCHANT) { } else if (actionType == ActionType.ENCHANT) {
CMIEnchantment enchant = CMIEnchantment.get(myKey); CMIEnchantment enchant = CMIEnchantment.get(myKey);
if (enchant == null && material == CMIMaterial.NONE) { if (enchant == null && material == CMIMaterial.NONE) {
@ -592,7 +586,7 @@ public class ConfigManager {
type = enchant == null ? myKey : enchant.toString(); type = enchant == null ? myKey : enchant.toString();
} else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.COLLECT || actionType == ActionType.MMKILL } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.COLLECT || actionType == ActionType.MMKILL
|| actionType == ActionType.BAKE || actionType == ActionType.BOSS) { || actionType == ActionType.BAKE) {
type = myKey; type = myKey;
} else if (actionType == ActionType.EXPLORE) { } else if (actionType == ActionType.EXPLORE) {
type = myKey; type = myKey;
@ -638,6 +632,10 @@ public class ConfigManager {
if (actionType == ActionType.TNTBREAK) if (actionType == ActionType.TNTBREAK)
Jobs.getGCManager().setTntFinder(true); Jobs.getGCManager().setTntFinder(true);
// using breeder finder
if (actionType == ActionType.BREED)
Jobs.getGCManager().useBreederFinder = true;
KeyValues kv = new KeyValues(); KeyValues kv = new KeyValues();
kv.setId(id); kv.setId(id);
kv.setMeta(meta); kv.setMeta(meta);

View File

@ -148,8 +148,6 @@ public class NameTranslatorManager {
if (got != null && got.getName() != null) if (got != null && got.getName() != null)
return got.getName(); return got.getName();
return HookManager.getMythicManager() == null ? materialName : HookManager.getMythicManager().getDisplayName(materialName); return HookManager.getMythicManager() == null ? materialName : HookManager.getMythicManager().getDisplayName(materialName);
case BOSS:
return HookManager.getBossManager() == null ? materialName : HookManager.getBossManager().getName(materialName);
default: default:
break; break;
} }

View File

@ -41,8 +41,7 @@ public enum ActionType {
EAT("Eat"), EAT("Eat"),
CUSTOMKILL("custom-kill"), CUSTOMKILL("custom-kill"),
COLLECT("Collect"), COLLECT("Collect"),
BAKE("Bake"), BAKE("Bake");
BOSS("Boss");
private String name; private String name;

View File

@ -3,7 +3,6 @@ package com.gamingmesh.jobs.hooks;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.hooks.Boss.BossManager;
import com.gamingmesh.jobs.hooks.McMMO.McMMO1_X_listener; import com.gamingmesh.jobs.hooks.McMMO.McMMO1_X_listener;
import com.gamingmesh.jobs.hooks.McMMO.McMMO2_X_listener; import com.gamingmesh.jobs.hooks.McMMO.McMMO2_X_listener;
import com.gamingmesh.jobs.hooks.McMMO.McMMOManager; import com.gamingmesh.jobs.hooks.McMMO.McMMOManager;
@ -20,7 +19,6 @@ public class HookManager {
private static MythicMobInterface MythicManager; private static MythicMobInterface MythicManager;
private static MyPetManager myPetManager; private static MyPetManager myPetManager;
private static WorldGuardManager worldGuardManager; private static WorldGuardManager worldGuardManager;
private static BossManager bossManager;
private static StackMobHandler stackMobHandler; private static StackMobHandler stackMobHandler;
private static WildStackerHandler wildStackerHandler; private static WildStackerHandler wildStackerHandler;
@ -35,7 +33,6 @@ public class HookManager {
setMyPetManager(); setMyPetManager();
setWorldGuard(); setWorldGuard();
setMythicManager(); setMythicManager();
setBossManager();
setStackMobHandler(); setStackMobHandler();
setWildStackerHandler(); setWildStackerHandler();
@ -82,13 +79,6 @@ public class HookManager {
return McMMOManager; return McMMOManager;
} }
public static BossManager getBossManager() {
if (bossManager == null)
setBossManager();
return bossManager;
}
public static MythicMobInterface getMythicManager() { public static MythicMobInterface getMythicManager() {
return MythicManager; return MythicManager;
} }
@ -144,13 +134,6 @@ public class HookManager {
} }
} }
private static void setBossManager() {
if (isPluginEnabled("Boss")) {
bossManager = new BossManager();
Jobs.consoleMsg("&e[Jobs] Boss detected.");
}
}
private static void setStackMobHandler() { private static void setStackMobHandler() {
if (isPluginEnabled("StackMob")) { if (isPluginEnabled("StackMob")) {
stackMobHandler = new StackMobHandler(); stackMobHandler = new StackMobHandler();

View File

@ -222,8 +222,8 @@ public class JobsPaymentListener implements Listener {
ItemStack itemInHand = Jobs.getNms().getItemInMainHand(player); ItemStack itemInHand = Jobs.getNms().getItemInMainHand(player);
if ((cow.getType() == EntityType.COW && itemInHand.getType() != Material.BUCKET) if (itemInHand.getType() != Material.BUCKET
|| (cow.getType() == EntityType.MUSHROOM_COW && itemInHand.getType() != Material.BOWL)) { && (cow.getType() == EntityType.MUSHROOM_COW && itemInHand.getType() != Material.BOWL)) {
return; return;
} }
@ -878,9 +878,10 @@ public class JobsPaymentListener implements Listener {
return; return;
if (Version.isCurrentEqualOrHigher(Version.v1_14_R1) && inv instanceof StonecutterInventory) { if (Version.isCurrentEqualOrHigher(Version.v1_14_R1) && inv instanceof StonecutterInventory) {
if (event.getAction() != InventoryAction.DROP_ONE_SLOT) { if (event.getAction() != InventoryAction.DROP_ONE_SLOT) {
Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT)); Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT));
} }
return; return;
} }