diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVConfigMigrator.java b/src/main/java/com/onarandombox/MultiverseCore/MVConfigMigrator.java index 45b4c3d1..f9bfa4ab 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVConfigMigrator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVConfigMigrator.java @@ -63,7 +63,7 @@ public class MVConfigMigrator { oldConfig.load(); List keys = oldConfig.getKeys("worlds"); if (keys == null) { - this.core.log(Level.WARNING, "Migration FAILURE!"); + this.core.log(Level.SEVERE, "Migration FAILURE!"); return false; } for (String key : keys) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVEntityListener.java b/src/main/java/com/onarandombox/MultiverseCore/MVEntityListener.java index 031e323d..6b3f5111 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVEntityListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVEntityListener.java @@ -14,7 +14,6 @@ import org.bukkit.entity.Slime; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityListener; import org.bukkit.event.entity.EntityRegainHealthEvent; @@ -31,10 +30,7 @@ public class MVEntityListener extends EntityListener { } /** - * Event - When a Entity is Damaged, we first sort out whether it is of - * importance to us, such as EntityVSEntity or EntityVSProjectile. Then we - * grab the attacked and defender and check if its a player. Then deal with - * the PVP Aspect. + * Event - When a Entity is Damaged, we first sort out whether it is of importance to us, such as EntityVSEntity or EntityVSProjectile. Then we grab the attacked and defender and check if its a player. Then deal with the PVP Aspect. */ @Override public void onEntityDamage(EntityDamageEvent event) { @@ -47,10 +43,6 @@ public class MVEntityListener extends EntityListener { EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent) event; attacker = sub.getDamager(); defender = sub.getEntity(); - } else if (event instanceof EntityDamageByProjectileEvent) { - EntityDamageByProjectileEvent sub = (EntityDamageByProjectileEvent) event; - attacker = sub.getDamager(); - defender = sub.getEntity(); } else { return; } @@ -62,7 +54,7 @@ public class MVEntityListener extends EntityListener { World w = player.getWorld(); if (!this.plugin.isMVWorld(w.getName())) { - //if the world is not handled, we don't care + // if the world is not handled, we don't care return; } MVWorld world = this.plugin.getMVWorld(w.getName()); @@ -70,7 +62,6 @@ public class MVEntityListener extends EntityListener { if (attacker != null && attacker instanceof Player) { Player pattacker = (Player) attacker; - if (!world.getPvp() && this.plugin.getConfig().getBoolean("fakepvp", false)) { pattacker.sendMessage(ChatColor.RED + "PVP is disabled in this World."); event.setCancelled(true); diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVTeleport.java b/src/main/java/com/onarandombox/MultiverseCore/MVTeleport.java index 577d9b29..5c9af10e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVTeleport.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVTeleport.java @@ -4,6 +4,7 @@ import java.util.logging.Level; import org.bukkit.Location; import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; import com.onarandombox.utils.BlockSafety; @@ -175,22 +176,29 @@ public class MVTeleport { l.setX(l.getBlockX() + .5); l.setZ(l.getBlockZ() + .5); e.teleport(l); - //System.out.print("The first location you gave me was safe!"); + // System.out.print("The first location you gave me was safe!"); return true; } Location safeLocation = this.getSafeLocation(l); if (safeLocation != null) { // Add offset to account for a vehicle on dry land! - if(!this.bs.isEntitiyOnTrack(e, safeLocation)) { + if (!this.bs.isEntitiyOnTrack(e, safeLocation)) { safeLocation.setY(safeLocation.getBlockY() + .5); } e.teleport(safeLocation); - //System.out.print("Had to look for a bit, but I found a safe place for ya!" + safeLocation); + // System.out.print("Had to look for a bit, but I found a safe place for ya!" + safeLocation); return true; } - this.plugin.log(Level.WARNING, "Sorry champ, you're basically trying to teleport into a minefield. I should just kill you now."); + if (e instanceof Player) { + Player p = (Player) e; + p.sendMessage("No safe locations found!"); + } + else if (e.getPassenger() instanceof Player) { + Player p = (Player) e.getPassenger(); + p.sendMessage("No safe locations found!"); + } + this.plugin.log(Level.WARNING, "Sorry champ, you're(" + e.getEntityId() + ") basically trying to teleport into a minefield. I should just kill you now."); return false; } - - + } diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index a7c5db34..f09d3c2b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -151,7 +151,7 @@ public class MultiverseCore extends JavaPlugin { this.loadWorlds(true); } else { - this.log(Level.WARNING, "Your configs were not loaded. Very little will function in MV."); + this.log(Level.SEVERE , "Your configs were not loaded. Very little will function in Multiverse."); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigMigrateEvent.java b/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigMigrateEvent.java new file mode 100644 index 00000000..bf59789c --- /dev/null +++ b/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigMigrateEvent.java @@ -0,0 +1,23 @@ +package com.onarandombox.MultiverseCore.event; + +import java.util.List; + +import org.bukkit.event.Event; + +public class MVConfigMigrateEvent extends Event { + private static final long serialVersionUID = 3647950355746345397L; + private List configsLoaded; + + public MVConfigMigrateEvent(List configsLoaded) { + super("MVConfigMigrate"); + this.configsLoaded = configsLoaded; + } + + public void addConfig(String config) { + this.configsLoaded.add(config); + } + + public List getAllConfigsLoaded() { + return this.configsLoaded; + } +}