Christmas hub snowman target cancel
This commit is contained in:
parent
de99a642d3
commit
54f2cb3467
@ -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))
|
if (!(ent instanceof Creature))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
if (UtilMath.offset(ent.getLocation(), target) < 0.1)
|
if (UtilMath.offset(ent.getLocation(), target) < 0.1)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
if (UtilMath.offset(ent.getLocation(), target) < 2)
|
if (UtilMath.offset(ent.getLocation(), target) < 2)
|
||||||
speed = Math.min(speed, 1f);
|
speed = Math.min(speed, 1f);
|
||||||
|
|
||||||
EntityCreature ec = ((CraftCreature)ent).getHandle();
|
EntityCreature ec = ((CraftCreature)ent).getHandle();
|
||||||
ec.getControllerMove().a(target.getX(), target.getY(), target.getZ(), speed);
|
ec.getControllerMove().a(target.getX(), target.getY(), target.getZ(), speed);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
import org.bukkit.event.block.LeavesDecayEvent;
|
import org.bukkit.event.block.LeavesDecayEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
|
||||||
@ -272,4 +273,13 @@ public class WorldManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void CreatureTarget(EntityTargetEvent event)
|
||||||
|
{
|
||||||
|
if (Manager.Mode.equals("Christmas"))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user