Added tame mission type added "ALL" for all Missions that require Material or EntityType

This commit is contained in:
DroppingAnvil 2019-09-15 03:46:41 -05:00
parent fcab9790b5
commit 0d5e5dda73
2 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ public class MissionHandler implements Listener {
List<Mission> missions = fPlayer.getFaction().getMissions().values().stream().filter(mission -> mission.getType().equalsIgnoreCase("kill")).collect(Collectors.toList());
for (Mission mission2 : missions) {
ConfigurationSection section = plugin.getConfig().getConfigurationSection("Missions").getConfigurationSection(mission2.getName());
if (!event.getEntityType().toString().equals(section.getConfigurationSection("Mission").getString("EntityType"))) {
if (!event.getEntityType().toString().equals(section.getConfigurationSection("Mission").getString("EntityType")) && !section.getConfigurationSection("Mission").getString("EntityType").equalsIgnoreCase("ALL")) {
continue;
}
mission2.incrementProgress();
@ -58,7 +58,7 @@ public class MissionHandler implements Listener {
List<Mission> missions = fPlayer.getFaction().getMissions().values().stream().filter(mission -> mission.getType().equalsIgnoreCase("mine")).collect(Collectors.toList());
for (Mission mission2 : missions) {
ConfigurationSection section = plugin.getConfig().getConfigurationSection("Missions").getConfigurationSection(mission2.getName());
if (!event.getBlock().getType().toString().equals(section.getConfigurationSection("Mission").getString("Material"))) {
if (!event.getBlock().getType().toString().equals(section.getConfigurationSection("Mission").getString("Material")) && !section.getConfigurationSection("Mission").getString("Material").equalsIgnoreCase("ALL")) {
continue;
}
mission2.incrementProgress();
@ -75,7 +75,7 @@ public class MissionHandler implements Listener {
List<Mission> missions = fPlayer.getFaction().getMissions().values().stream().filter(mission -> mission.getType().equalsIgnoreCase("place")).collect(Collectors.toList());
for (Mission mission2 : missions) {
ConfigurationSection section = plugin.getConfig().getConfigurationSection("Missions").getConfigurationSection(mission2.getName());
if (!event.getBlock().getType().toString().equals(section.getConfigurationSection("Mission").getString("Material"))) {
if (!event.getBlock().getType().toString().equals(section.getConfigurationSection("Mission").getString("Material")) && !section.getConfigurationSection("Mission").getString("Material").equalsIgnoreCase("ALL")) {
continue;
}
mission2.incrementProgress();
@ -112,7 +112,7 @@ public class MissionHandler implements Listener {
List<Mission> missions = fPlayer.getFaction().getMissions().values().stream().filter(mission -> mission.getType().equalsIgnoreCase("tame")).collect(Collectors.toList());
for (Mission mission2 : missions) {
ConfigurationSection section = plugin.getConfig().getConfigurationSection("Missions").getConfigurationSection(mission2.getName());
if (!event.getEntityType().toString().equals(section.getConfigurationSection("Mission").getString("EntityType"))) {
if (!event.getEntityType().toString().equals(section.getConfigurationSection("Mission").getString("EntityType")) && !section.getConfigurationSection("Mission").getString("EntityType").equalsIgnoreCase("ALL")) {
continue;
}
mission2.incrementProgress();

View File

@ -779,7 +779,7 @@ Missions:
Reward:
Commands: ["f points add %faction% 100"]
animaltaming:
Slot: 20
Slot: 21
Material: "BONE"
Name: "&f100 &cTamed Animals"
Lore: