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

This never gets null

This commit is contained in:
montlikadani 2020-09-28 18:40:16 +02:00
parent 2f37a7398c
commit de21c1857a

View File

@ -958,37 +958,37 @@ public class PlayerManager {
if (HookManager.getMcMMOManager().mcMMOPresent || HookManager.getMcMMOManager().mcMMOOverHaul) if (HookManager.getMcMMOManager().mcMMOPresent || HookManager.getMcMMOManager().mcMMOOverHaul)
boost.add(BoostOf.McMMO, new BoostMultiplier().add(HookManager.getMcMMOManager().getMultiplier(player.getPlayer()))); boost.add(BoostOf.McMMO, new BoostMultiplier().add(HookManager.getMcMMOManager().getMultiplier(player.getPlayer())));
Double petPay = null; double petPay = 0D;
if (ent instanceof Tameable) { if (ent instanceof Tameable) {
Tameable t = (Tameable) ent; Tameable t = (Tameable) ent;
if (t.isTamed() && t.getOwner() instanceof Player) { if (t.isTamed() && t.getOwner() instanceof Player) {
petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay"); petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay");
if (petPay != null) if (petPay != 0D)
boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay)); boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay));
} }
} }
if (ent != null && HookManager.getMyPetManager() != null && HookManager.getMyPetManager().isMyPet(ent)) { if (ent != null && HookManager.getMyPetManager() != null && HookManager.getMyPetManager().isMyPet(ent)) {
if (petPay == null) if (petPay == 0D)
petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay"); petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay");
if (petPay != null) if (petPay != 0D)
boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay)); boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay));
} }
if (victim != null && victim.hasMetadata(getMobSpawnerMetadata())) { if (victim != null && victim.hasMetadata(getMobSpawnerMetadata())) {
Double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner"); double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner");
if (amount != null) if (amount != 0D)
boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount)); boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount));
} }
if (getall) { if (getall) {
if (petPay == null) if (petPay == 0D)
petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay", force); petPay = Jobs.getPermissionManager().getMaxPermission(player, "jobs.petpay", force);
if (petPay != null) if (petPay != 0D)
boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay)); boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay));
Double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner", force); double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner", force);
if (amount != null) if (amount != 0D)
boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount)); boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount));
} }