diff --git a/pom.xml b/pom.xml index 3c2f2cac..c1b2f08d 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,6 @@ mcstats.releases - mcstats.org releases http://repo.mcstats.org/content/repositories/ diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java b/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java index 89d5e7b4..b8fe1df6 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java @@ -236,9 +236,6 @@ public class CmdConfig extends FCommand { } // save change to disk Conf.save(); - - // in case some Spout related setting was changed - SpoutFeatures.updateAppearances(); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java index c9a246a5..57f9b126 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java @@ -85,7 +85,5 @@ public class CmdDisband extends FCommand { } faction.detach(); - - SpoutFeatures.updateAppearances(); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java b/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java index 9da63d12..3e17c2c0 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java @@ -75,14 +75,12 @@ public class CmdOwner extends FCommand { // if no player name was passed, and this claim does already have owners set, clear them if (args.isEmpty() && myFaction.doesLocationHaveOwnersSet(flocation)) { myFaction.clearClaimOwnership(flocation); - SpoutFeatures.updateOwnerListLoc(flocation); fme.msg("You have cleared ownership for this claimed area."); return; } if (myFaction.isPlayerInOwnerList(playerName, flocation)) { myFaction.removePlayerAsOwner(playerName, flocation); - SpoutFeatures.updateOwnerListLoc(flocation); fme.msg("You have removed ownership of this claimed land from %s.", playerName); return; } @@ -92,7 +90,6 @@ public class CmdOwner extends FCommand { return; myFaction.setPlayerAsOwner(playerName, flocation); - SpoutFeatures.updateOwnerListLoc(flocation); fme.msg("You have added %s to the owner list for this claimed land.", playerName); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPeaceful.java b/src/main/java/com/massivecraft/factions/cmd/CmdPeaceful.java index 6234058d..301f7626 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPeaceful.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPeaceful.java @@ -46,7 +46,6 @@ public class CmdPeaceful extends FCommand { } } - SpoutFeatures.updateAppearances(faction); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTag.java b/src/main/java/com/massivecraft/factions/cmd/CmdTag.java index 323cee5a..7efd995c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTag.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTag.java @@ -67,9 +67,6 @@ public class CmdTag extends FCommand { faction.msg("The faction %s changed their name to %s.", fme.getColorTo(faction) + oldtag, myFaction.getTag(faction)); } - if (Conf.spoutFactionTagsOverNames) { - SpoutFeatures.updateAppearances(myFaction); - } } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java b/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java index 39d9df23..c473dddc 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java @@ -38,10 +38,6 @@ public class CmdTitle extends FCommand { // Inform myFaction.msg("%s changed a title: %s", fme.describeTo(myFaction, true), you.describeTo(myFaction, true)); - - if (Conf.spoutFactionTitlesOverNames) { - SpoutFeatures.updateAppearances(me); - } } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java index f29418fa..5ce263de 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java @@ -32,7 +32,6 @@ public class CmdUnclaim extends FCommand { if (otherFaction.isSafeZone()) { if (Permission.MANAGE_SAFE_ZONE.has(sender)) { Board.removeAt(flocation); - SpoutFeatures.updateTerritoryDisplayLoc(flocation); msg("Safe zone was unclaimed."); if (Conf.logLandUnclaims) @@ -44,7 +43,6 @@ public class CmdUnclaim extends FCommand { } else if (otherFaction.isWarZone()) { if (Permission.MANAGE_WAR_ZONE.has(sender)) { Board.removeAt(flocation); - SpoutFeatures.updateTerritoryDisplayLoc(flocation); msg("War zone was unclaimed."); if (Conf.logLandUnclaims) @@ -57,7 +55,6 @@ public class CmdUnclaim extends FCommand { if (fme.isAdminBypassing()) { Board.removeAt(flocation); - SpoutFeatures.updateTerritoryDisplayLoc(flocation); otherFaction.msg("%s unclaimed some of your land.", fme.describeTo(otherFaction, true)); msg("You unclaimed this land."); @@ -97,7 +94,6 @@ public class CmdUnclaim extends FCommand { } Board.removeAt(flocation); - SpoutFeatures.updateTerritoryDisplayLoc(flocation); myFaction.msg("%s unclaimed some land.", fme.describeTo(myFaction, true)); if (Conf.logLandUnclaims) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java index a1365bd1..0daf6a01 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java @@ -44,7 +44,6 @@ public class CmdUnclaimall extends FCommand { Board.unclaimAll(myFaction.getId()); myFaction.msg("%s unclaimed ALL of your faction's land.", fme.describeTo(myFaction, true)); - SpoutFeatures.updateTerritoryDisplayLoc(null); if (Conf.logLandUnclaims) P.p.log(fme.getName() + " unclaimed everything for the faction: " + myFaction.getTag()); diff --git a/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java b/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java index 0ddc0a96..57031913 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java @@ -81,7 +81,5 @@ public abstract class FRelationCommand extends FCommand { myFaction.msg("This will have no effect while your faction is peaceful."); } - SpoutFeatures.updateAppearances(myFaction, them); - SpoutFeatures.updateTerritoryDisplayLoc(null); } } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java index ad24310c..1dff9591 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -19,6 +19,7 @@ import org.bukkit.event.hanging.HangingBreakEvent.RemoveCause; import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.bukkit.projectiles.ProjectileSource; import java.text.MessageFormat; import java.util.*; @@ -219,13 +220,16 @@ public class FactionsEntityListener implements Listener { } if (!badjuju) return; - Entity thrower = event.getPotion().getShooter(); + ProjectileSource thrower = event.getPotion().getShooter(); + if (!(thrower instanceof Entity)) { + return; + } // scan through affected entities to make sure they're all valid targets Iterator iter = event.getAffectedEntities().iterator(); while (iter.hasNext()) { LivingEntity target = iter.next(); - EntityDamageByEntityEvent sub = new EntityDamageByEntityEvent(thrower, target, EntityDamageEvent.DamageCause.CUSTOM, 0); + EntityDamageByEntityEvent sub = new EntityDamageByEntityEvent((Entity) thrower, target, EntityDamageEvent.DamageCause.CUSTOM, 0); if (!this.canDamagerHurtDamagee(sub, true)) event.setIntensity(target, 0.0); // affected entity list doesn't accept modification (so no iter.remove()), but this works sub = null; @@ -249,7 +253,8 @@ public class FactionsEntityListener implements Listener { public boolean canDamagerHurtDamagee(EntityDamageByEntityEvent sub, boolean notify) { Entity damager = sub.getDamager(); Entity damagee = sub.getEntity(); - int damage = sub.getDamage(); + ProjectileSource shooter = null; + double damage = sub.getDamage(); if (!(damagee instanceof Player)) return true; @@ -263,10 +268,11 @@ public class FactionsEntityListener implements Listener { Faction defLocFaction = Board.getFactionAt(new FLocation(defenderLoc)); // for damage caused by projectiles, getDamager() returns the projectile... what we need to know is the source - if (damager instanceof Projectile) - damager = ((Projectile) damager).getShooter(); + if (damager instanceof Projectile) { + shooter = ((Projectile) damager).getShooter(); + } - if (damager == damagee) // ender pearl usage and other self-inflicted damage + if (shooter != null && shooter == damagee) // ender pearl usage and other self-inflicted damage return true; // Players can not take attack damage in a SafeZone, or possibly peaceful territory diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 418c07d9..c685c579 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -38,10 +38,6 @@ public class FactionsPlayerListener implements Listener { // Store player's current FLocation and notify them where they are me.setLastStoodAt(new FLocation(event.getPlayer().getLocation())); - if (!SpoutFeatures.updateTerritoryDisplay(me)) - me.sendFactionHereMessage(); - - SpoutFeatures.updateAppearancesShortly(event.getPlayer()); } @EventHandler(priority = EventPriority.NORMAL) @@ -57,7 +53,6 @@ public class FactionsPlayerListener implements Listener { if (myFaction != null) { myFaction.memberLoggedOff(); } - SpoutFeatures.playerDisconnect(me); } @EventHandler(priority = EventPriority.MONITOR) @@ -91,19 +86,16 @@ public class FactionsPlayerListener implements Listener { me.setLastStoodAt(to); // Did we change "host"(faction)? - boolean spoutClient = SpoutFeatures.availableFor(player); Faction factionFrom = Board.getFactionAt(from); Faction factionTo = Board.getFactionAt(to); boolean changedFaction = (factionFrom != factionTo); - if (changedFaction && SpoutFeatures.updateTerritoryDisplay(me)) + if (changedFaction) changedFaction = false; if (me.isMapAutoUpdating()) { me.sendMessage(Board.getMap(me.getFaction(), to, player.getLocation().getYaw())); - if (spoutClient && Conf.spoutTerritoryOwnersShow) - SpoutFeatures.updateOwnerList(me); } else { Faction myFaction = me.getFaction(); String ownersTo = myFaction.getOwnerListString(to); @@ -116,11 +108,7 @@ public class FactionsPlayerListener implements Listener { && Conf.ownedMessageOnBorder && - ( - !spoutClient - || - !Conf.spoutTerritoryOwnersShow - ) + (!Conf.spoutTerritoryOwnersShow) && myFaction == factionTo && @@ -128,8 +116,6 @@ public class FactionsPlayerListener implements Listener { ) { me.sendMessage(Conf.ownedLandMessage + ownersTo); } - } else if (spoutClient && Conf.spoutTerritoryOwnersShow) { - SpoutFeatures.updateOwnerList(me); } else if ( Conf.ownedAreasEnabled @@ -494,8 +480,6 @@ public class FactionsPlayerListener implements Listener { return; } - SpoutFeatures.playerDisconnect(badGuy); - // if player was banned (not just kicked), get rid of their stored info if (Conf.removePlayerDataWhenBanned && event.getReason().equals("Banned by admin.")) { if (badGuy.getRole() == Role.ADMIN) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsServerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsServerListener.java index 7510a6e3..22c1b0a3 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsServerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsServerListener.java @@ -19,17 +19,11 @@ public class FactionsServerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPluginDisable(PluginDisableEvent event) { String name = event.getPlugin().getDescription().getName(); - if (name.equals("Spout")) { - SpoutFeatures.setAvailable(false, ""); - } } @EventHandler(priority = EventPriority.MONITOR) public void onPluginEnable(PluginEnableEvent event) { Plugin plug = event.getPlugin(); String name = plug.getDescription().getName(); - if (name.equals("Spout")) { - SpoutFeatures.setAvailable(true, plug.getDescription().getFullName()); - } } } \ No newline at end of file