Merge branch 'master' of ssh://dev.mineplex.com:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2013-12-18 04:48:24 -05:00
commit 0ba8349e03
2 changed files with 15 additions and 3 deletions

View File

@ -516,18 +516,20 @@ public class UtilEnt
}
}
public static void CreatureMoveFast(Entity ent, Location target, float speed)
public static boolean CreatureMoveFast(Entity ent, Location target, float speed)
{
if (!(ent instanceof Creature))
return;
return false;
if (UtilMath.offset(ent.getLocation(), target) < 0.1)
return;
return false;
if (UtilMath.offset(ent.getLocation(), target) < 2)
speed = Math.min(speed, 1f);
EntityCreature ec = ((CraftCreature)ent).getHandle();
ec.getControllerMove().a(target.getX(), target.getY(), target.getZ(), speed);
return true;
}
}

View File

@ -37,6 +37,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
@ -272,4 +273,13 @@ public class WorldManager extends MiniPlugin
{
event.setCancelled(true);
}
@EventHandler
public void CreatureTarget(EntityTargetEvent event)
{
if (Manager.Mode.equals("Christmas"))
{
event.setCancelled(true);
}
}
}