Finally back on course and able to merge automatically with Driftay's SaberFactions!
This commit is contained in:
DroppingAnvil 2019-09-15 03:25:14 -05:00 committed by GitHub
commit fcab9790b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 20 deletions

View File

@ -824,6 +824,7 @@ public class FactionsPlayerListener implements Listener {
return;
}
}
if (event.getItem() == null) return;
if (!playerCanUseItemHere(player, block.getLocation(), event.getItem().getType(), false)) {
event.setCancelled(true);

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -28,26 +29,6 @@ public class MissionHandler implements Listener {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityBreed(EntityBreedEvent event) {
if (event.getEntity() == null) {
return;
}
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(event.getEntity().getKiller());
if (fPlayer == null) {
return;
}
List<Mission> missions = fPlayer.getFaction().getMissions().values().stream().filter(mission -> mission.getType().equalsIgnoreCase("breed")).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"))) {
continue;
}
mission2.incrementProgress();
checkIfDone(fPlayer, mission2, section);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDeath(EntityDeathEvent event) {
if (event.getEntity() == null || event.getEntity().getKiller() == null) {