From 7a92aa3ee3fa22e404f4eb55d579dfa3aed1a5ca Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 1 Sep 2017 11:05:26 +0300 Subject: [PATCH] Count in monster eggs as spawners --- .../com/gamingmesh/jobs/config/GeneralConfigManager.java | 7 +++++-- .../java/com/gamingmesh/jobs/listeners/JobsListener.java | 2 +- .../com/gamingmesh/jobs/listeners/JobsPaymentListener.java | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index 0719bf6b..9b0d5eee 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -507,7 +507,9 @@ public class GeneralConfigManager { c.getW().addComment("hide-jobsinfo-without-permission", "Hide jobs info from player if they lack the permission to join the job"); hideJobsInfoWithoutPermission = c.get("hide-jobsinfo-without-permission", false); - c.getW().addComment("enable-pay-near-spawner", "Option to allow payment to be made when killing mobs from a spawner"); + c.getW().addComment("enable-pay-near-spawner", + "Option to allow payment to be made when killing mobs from a spawner.", + "Use jobs.nearspawner.[amount] to define multiplayer. Example jobs.nearspawner.-0.5 will pay half of payment, jobs.nearspawner.-1 will not pay at all"); payNearSpawner = c.get("enable-pay-near-spawner", false); c.getW().addComment("enable-pay-creative", "Option to allow payment to be made in creative mode"); @@ -760,7 +762,8 @@ public class GeneralConfigManager { c.getW().addComment("ExploitProtections.Smelt.PreventHopperFillUps", "Prevent payments when hoppers moving items into furnace", "Player will not get paid, but items will be smellted"); PreventHopperFillUps = c.get("ExploitProtections.Smelt.PreventHopperFillUps", true); - c.getW().addComment("ExploitProtections.Smelt.PreventMagmaCubeSplit", "Prevent payments when hoppers moving items into brewing stands", "Player will not get paid, but items will be brewd as they supose too"); + c.getW().addComment("ExploitProtections.Smelt.PreventMagmaCubeSplit", "Prevent payments when hoppers moving items into brewing stands", + "Player will not get paid, but items will be brewd as they supose too"); PreventBrewingStandFillUps = c.get("ExploitProtections.Brew.PreventBrewingStandFillUps", true); c.getW().addComment("use-breeder-finder", "Breeder finder.", diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 7ee4b738..739db9d7 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -117,7 +117,7 @@ public class JobsListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onJoin(PlayerJoinEvent event) { if (Jobs.getGCManager().isShowNewVersion() && event.getPlayer().hasPermission("jobs.versioncheck")) - plugin.getVersionCheckManager().VersionCheck(event.getPlayer()); + Jobs.getVersionCheckManager().VersionCheck(event.getPlayer()); } @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index cddfe8ec..291428fa 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -178,7 +178,7 @@ public class JobsPaymentListener implements Listener { //disabling plugin in world if (event.getPlayer() != null && !Jobs.getGCManager().canPerformActionInWorld(event.getPlayer().getWorld())) return; - // Entity that died must be living + if (!(event.getEntity() instanceof Sheep)) return; Sheep sheep = (Sheep) event.getEntity(); @@ -982,7 +982,7 @@ public class JobsPaymentListener implements Listener { //disabling plugin in world if (event.getEntity() != null && !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld())) return; - if (event.getSpawnReason() == SpawnReason.SPAWNER) { + if (event.getSpawnReason() == SpawnReason.SPAWNER || event.getSpawnReason() == SpawnReason.SPAWNER_EGG) { LivingEntity creature = event.getEntity(); creature.setMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata(), new FixedMetadataValue(this.plugin, true)); }