本文整理匯總了Java中org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java TeleportCause.END_PORTAL屬性的具體用法?Java TeleportCause.END_PORTAL怎麽用?Java TeleportCause.END_PORTAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.event.player.PlayerTeleportEvent.TeleportCause
的用法示例。
在下文中一共展示了TeleportCause.END_PORTAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPlayerTeleport
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerTeleport(PlayerTeleportEvent event) {
if (OrebfuscatorConfig.UseProximityHider) {
if(event.getCause() != TeleportCause.END_PORTAL
&& event.getCause() != TeleportCause.NETHER_PORTAL
)
{
ProximityHider.addPlayerToCheck(event.getPlayer(), null);
}
}
}
示例2: onPlayerPortal
@EventHandler(ignoreCancelled=true, priority=EventPriority.HIGHEST)
public void onPlayerPortal(PlayerPortalEvent event)
{
if (event.getCause() == TeleportCause.END_PORTAL) {
if (event.getTo().getWorld().getEnvironment() == Environment.THE_END) {
event.setTo(event.getTo().getWorld().getSpawnLocation().clone().add(0.5D, 0.0D, 0.5D));
} else if (event.getFrom().getWorld().getEnvironment() == Environment.THE_END) {
event.setTo(this.endExitLocation);
}
}
}
示例3: onPlayerPortal
@EventHandler
public void onPlayerPortal(PlayerPortalEvent event) {
ExilePearl pearl = pearlApi.getPearl(event.getPlayer().getUniqueId());
if(pearl != null && pearl.getPearlType() == PearlType.PRISON && event.getCause() == TeleportCause.END_PORTAL) {
event.setTo(pearlApi.getPearlConfig().getPrisonWorld().getSpawnLocation());
}
}
示例4: b
public void b(int i) {
if (this.dimension == 1 && i == 1) {
this.a((Statistic) AchievementList.D);
this.world.kill(this);
this.viewingCredits = true;
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, 0.0F));
} else {
if (this.dimension == 0 && i == 1) {
this.a((Statistic) AchievementList.C);
// CraftBukkit start - Rely on custom portal management
/*
ChunkCoordinates chunkcoordinates = this.server.getWorldServer(i).getDimensionSpawn();
if (chunkcoordinates != null) {
this.playerConnection.a((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, 0.0F, 0.0F);
}
i = 1;
*/
// CraftBukkit end
} else {
this.a((Statistic) AchievementList.y);
}
// CraftBukkit start
TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
this.server.getPlayerList().changeDimension(this, i, cause);
// CraftBukkit end
this.lastSentExp = -1;
this.bQ = -1.0F;
this.bR = -1;
}
}
示例5: b
public void b(int i) {
if (this.dimension == 1 && i == 1) {
this.a((Statistic) AchievementList.C);
this.world.kill(this);
this.viewingCredits = true;
this.playerConnection.sendPacket(new Packet70Bed(4, 0));
} else {
if (this.dimension == 0 && i == 1) {
this.a((Statistic) AchievementList.B);
// CraftBukkit start - Rely on custom portal management
/*
ChunkCoordinates chunkcoordinates = this.server.getWorldServer(i).getDimensionSpawn();
if (chunkcoordinates != null) {
this.playerConnection.a((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, 0.0F, 0.0F);
}
i = 1;
*/
// CraftBukkit end
} else {
this.a((Statistic) AchievementList.x);
}
// CraftBukkit start
TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
this.server.getPlayerList().changeDimension(this, i, cause);
// CraftBukkit end
this.lastSentExp = -1;
this.bP = -1.0F;
this.bQ = -1;
}
}
示例6: onPlayerTeleport
@EventHandler
public void onPlayerTeleport(PlayerTeleportEvent event) {
Player p = event.getPlayer();
if(um.isPlaying(p.getName())) {
if(event.getCause() == TeleportCause.END_PORTAL || event.getCause() == TeleportCause.COMMAND || event.getCause() == TeleportCause.NETHER_PORTAL) {
event.setCancelled(true);
}
}
}
示例7: travelToDimension
public void travelToDimension(int p_71027_1_)
{
if (this.dimension == 1 && p_71027_1_ == 1)
{
this.triggerAchievement(AchievementList.theEnd2);
this.worldObj.removeEntity(this);
this.playerConqueredTheEnd = true;
this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(4, 0.0F));
}
else
{
if (this.dimension == 0 && p_71027_1_ == 1)
{
this.triggerAchievement(AchievementList.theEnd);
ChunkCoordinates chunkcoordinates = this.mcServer.worldServerForDimension(p_71027_1_).getEntrancePortalLocation();
if (chunkcoordinates != null)
{
this.playerNetServerHandler.setPlayerLocation((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, 0.0F, 0.0F);
}
p_71027_1_ = 1;
}
else
{
this.triggerAchievement(AchievementList.portal);
}
// CraftBukkit start
TeleportCause cause = (this.dimension == 1 || p_71027_1_ == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
this.mcServer.getConfigurationManager().transferPlayerToDimension(this, p_71027_1_, cause); // Cauldron
// CraftBukkit end
this.lastExperience = -1;
this.lastHealth = -1.0F;
this.lastFoodLevel = -1;
}
}
示例8: c
@Nullable
public Entity c(int i) {
//this.ck = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
if (this.dimension == 1 && i == 1) {
this.ck = true; // CraftBukkit - Moved down from above
this.world.kill(this);
if (!this.viewingCredits) {
this.viewingCredits = true;
if (this.a(AchievementList.D)) {
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, 0.0F));
} else {
this.b((Statistic) AchievementList.D);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, 1.0F));
}
}
return this;
} else {
if (this.dimension == 0 && i == 1) {
this.b((Statistic) AchievementList.C);
i = 1;
} else {
this.b((Statistic) AchievementList.y);
}
// CraftBukkit start
TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
this.server.getPlayerList().changeDimension(this, i, cause); // PAIL: check all this
// CraftBukkit end
this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false));
this.lastSentExp = -1;
this.lastHealthSent = -1.0F;
this.cc = -1;
return this;
}
}
示例9: onPlayerUsePortal
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void onPlayerUsePortal(final PlayerPortalEvent event) {
this.plugin.entering(this.getClass(), "onPlayerUsePortal", "player=" + event.getPlayer().getName() + ";from=" + NLocation.toString(event.getFrom()) + ";to=" + NLocation.toString(event.getTo()));
final GeneralWorld world = this.plugin.getWorlds().get(event.getFrom().getWorld().getName());
if (GeneralWorld.WorldType.isStock(world)) {
return;
}
if (world.getType() == WorldType.ADDITIONAL) {
final AdditionalWorld additionalWorld = (AdditionalWorld)world;
if (event.getCause() == TeleportCause.NETHER_PORTAL && !additionalWorld.hasNether()) {
event.setCancelled(true);
this.plugin.exiting(this.getClass(), "onPlayerUsePortal", "doesn't have required subworld (nether)");
return;
} else if (event.getCause() == TeleportCause.END_PORTAL && !additionalWorld.hasEnd()) {
event.setCancelled(true);
this.plugin.exiting(this.getClass(), "onPlayerUsePortal", "doesn't have required subworld (end)");
return;
}
}
final PortalEventResult result = this.handlePortalEvent(event.getFrom(), event.getCause(), event.getPortalTravelAgent());
if (result == null) {
return;
}
if (result.destination != null) {
event.setTo(result.destination);
}
if (result.useTravelAgent) {
event.useTravelAgent(true);
}
if (result.cancelEvent) {
event.setCancelled(true);
}
this.plugin.exiting(this.getClass(), "onPlayerUsePortal");
}
示例10: c
public void c(int i) {
if (this.dimension == 1 && i == 1) {
this.a((Statistic) AchievementList.C);
this.world.kill(this);
this.viewingCredits = true;
this.playerConnection.sendPacket(new Packet70Bed(4, 0));
} else {
if (this.dimension == 1 && i == 0) {
this.a((Statistic) AchievementList.B);
// CraftBukkit start - Rely on custom portal management
/*
ChunkCoordinates chunkcoordinates = this.server.getWorldServer(i).getDimensionSpawn();
if (chunkcoordinates != null) {
this.playerConnection.a((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, 0.0F, 0.0F);
}
i = 1;
*/
// CraftBukkit end
} else {
this.a((Statistic) AchievementList.x);
}
// CraftBukkit start
TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
this.server.getPlayerList().changeDimension(this, i, cause);
// CraftBukkit end
this.lastSentExp = -1;
this.cm = -1;
this.cn = -1;
}
}
示例11: changeDimension
public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) {
WorldServer exitWorld = null;
if (entityplayer.dimension < CraftWorld.CUSTOM_DIMENSION_OFFSET) { // plugins must specify exit from custom Bukkit worlds
// only target existing worlds (compensate for allow-nether/allow-end as false)
for (WorldServer world : this.server.worlds) {
if (world.dimension == i) {
exitWorld = world;
}
}
}
Location enter = entityplayer.getBukkitEntity().getLocation();
Location exit = null;
boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
if (exitWorld != null) {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {
// THE_END -> NORMAL; use bed if available, otherwise default spawn
exit = ((org.bukkit.craftbukkit.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation();
if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) {
exit = exitWorld.getWorld().getSpawnLocation();
}
} else {
// NORMAL <-> NETHER or NORMAL -> THE_END
exit = this.calculateTarget(enter, exitWorld);
useTravelAgent = true;
}
}
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause);
event.useTravelAgent(useTravelAgent);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null) {
return;
}
exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
if (exit == null) {
return;
}
exitWorld = ((CraftWorld) exit.getWorld()).getHandle();
Vector velocity = entityplayer.getBukkitEntity().getVelocity();
boolean before = exitWorld.chunkProviderServer.forceChunkLoad;
exitWorld.chunkProviderServer.forceChunkLoad = true;
exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity);
exitWorld.chunkProviderServer.forceChunkLoad = before;
this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we
if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) {
entityplayer.getBukkitEntity().setVelocity(velocity);
}
// CraftBukkit end
}
示例12: changeDimension
public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) {
WorldServer exitWorld = null;
if (entityplayer.dimension < CraftWorld.CUSTOM_DIMENSION_OFFSET) { // plugins must specify exit from custom Bukkit worlds
// only target existing worlds (compensate for allow-nether/allow-end as false)
for (WorldServer world : this.server.worlds) {
if (world.dimension == i) {
exitWorld = world;
}
}
}
Location enter = entityplayer.getBukkitEntity().getLocation();
Location exit = null;
boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
if (exitWorld != null) {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {
// THE_END -> NORMAL; use bed if available, otherwise default spawn
exit = ((org.bukkit.craftbukkit.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation();
if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) {
exit = exitWorld.getWorld().getSpawnLocation();
}
} else {
// NORMAL <-> NETHER or NORMAL -> THE_END
exit = this.calculateTarget(enter, exitWorld);
useTravelAgent = true;
}
}
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().t() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause);
event.useTravelAgent(useTravelAgent);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null) {
return;
}
exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
if (exit == null) {
return;
}
exitWorld = ((CraftWorld) exit.getWorld()).getHandle();
Vector velocity = entityplayer.getBukkitEntity().getVelocity();
boolean before = exitWorld.chunkProviderServer.forceChunkLoad;
exitWorld.chunkProviderServer.forceChunkLoad = true;
exitWorld.t().adjustExit(entityplayer, exit, velocity); // Should be getTravelAgent
exitWorld.chunkProviderServer.forceChunkLoad = before;
this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we
if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) {
entityplayer.getBukkitEntity().setVelocity(velocity);
}
// CraftBukkit end
}
示例13: changeDimension
public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) {
WorldServer exitWorld = null;
if (entityplayer.dimension < CraftWorld.CUSTOM_DIMENSION_OFFSET) { // plugins must specify exit from custom Bukkit worlds
// only target existing worlds (compensate for allow-nether/allow-end as false)
for (WorldServer world : this.server.worlds) {
if (world.dimension == i) {
exitWorld = world;
}
}
}
Location enter = entityplayer.getBukkitEntity().getLocation();
Location exit = null;
boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
if (exitWorld != null) {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {
// THE_END -> NORMAL; use bed if available, otherwise default spawn
exit = ((org.bukkit.craftbukkit.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation();
if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) {
exit = exitWorld.getWorld().getSpawnLocation();
}
} else {
// NORMAL <-> NETHER or NORMAL -> THE_END
exit = this.calculateTarget(enter, exitWorld);
useTravelAgent = true;
}
}
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause);
event.useTravelAgent(useTravelAgent);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null) {
return;
}
exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
if (exit == null) {
return;
}
exitWorld = ((CraftWorld) exit.getWorld()).getHandle();
org.bukkit.event.player.PlayerTeleportEvent tpEvent = new org.bukkit.event.player.PlayerTeleportEvent(entityplayer.getBukkitEntity(), enter, exit, cause);
Bukkit.getServer().getPluginManager().callEvent(tpEvent);
if (tpEvent.isCancelled() || tpEvent.getTo() == null) {
return;
}
Vector velocity = entityplayer.getBukkitEntity().getVelocity();
exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity);
entityplayer.ck = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we
if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) {
entityplayer.getBukkitEntity().setVelocity(velocity);
}
}
示例14: onEntityUsePortal
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void onEntityUsePortal(final EntityPortalEvent event) {
this.plugin.entering(this.getClass(), "onEntityUsePortal", "entity=" + event.getEntityType() + ";from=" + NLocation.toString(event.getFrom()) + ";to=" + NLocation.toString(event.getTo()));
if (event.getEntityType() == EntityType.ENDER_DRAGON) {
this.plugin.exiting(this.getClass(), "onEntityUsePortal", "EnderDragon should really stay in the End!");
event.setCancelled(true);
return;
}
final GeneralWorld world = this.plugin.getWorlds().get(event.getFrom().getWorld().getName());
if (GeneralWorld.WorldType.isStock(world)) {
this.plugin.exiting(this.getClass(), "onEntityUsePortal", "Stock world!");
return;
}
// Build a fake TeleportCause based on From and To locations
PlayerTeleportEvent.TeleportCause cause = null;
final Block block = event.getFrom().getBlock();
switch (block.getType()) {
case PORTAL:
cause = PlayerTeleportEvent.TeleportCause.NETHER_PORTAL;
break;
case ENDER_PORTAL:
cause = PlayerTeleportEvent.TeleportCause.END_PORTAL;
break;
default:
this.plugin.debug("Strange block found: " + block.getType() + ", trying to find a portal block near the Location");
for (final BlockFace face : blockFaces) {
if (block.getRelative(face).getType() == Material.PORTAL) {
cause = PlayerTeleportEvent.TeleportCause.NETHER_PORTAL;
this.plugin.debug("Found a Nether Portal block at " + NLocation.toString(block.getRelative(face).getLocation()));
break;
} else if (block.getRelative(face).getType() == Material.ENDER_PORTAL) {
cause = PlayerTeleportEvent.TeleportCause.END_PORTAL;
this.plugin.debug("Found an End Portal block at " + NLocation.toString(block.getRelative(face).getLocation()));
break;
}
}
if (cause == null) {
cause = PlayerTeleportEvent.TeleportCause.PLUGIN;
}
break;
}
if (world.getType() == WorldType.ADDITIONAL) {
final AdditionalWorld additionalWorld = (AdditionalWorld)world;
if (cause == TeleportCause.NETHER_PORTAL && !additionalWorld.hasNether()) {
event.setCancelled(true);
this.plugin.exiting(this.getClass(), "onEntityUsePortal", "doesn't have required subworld (nether)");
return;
} else if (cause == TeleportCause.END_PORTAL && !additionalWorld.hasEnd()) {
event.setCancelled(true);
this.plugin.exiting(this.getClass(), "onEntityUsePortal", "doesn't have required subworld (end)");
return;
}
}
final PortalEventResult result = this.handlePortalEvent(event.getFrom(), cause, event.getPortalTravelAgent());
if (result == null) {
this.plugin.exiting(this.getClass(), "onEntityUsePortal", "result is null");
return;
}
if (result.destination != null) {
event.setTo(result.destination);
}
if (result.useTravelAgent) {
event.useTravelAgent(true);
}
if (result.cancelEvent) {
event.setCancelled(true);
}
this.plugin.exiting(this.getClass(), "onEntityUsePortal");
}
示例15: changeDimension
public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) {
WorldServer exitWorld = null;
if (entityplayer.dimension < CraftWorld.CUSTOM_DIMENSION_OFFSET) { // plugins must specify exit from custom Bukkit worlds
// only target existing worlds (compensate for allow-nether/allow-end as false)
for (WorldServer world : this.server.worlds) {
if (world.dimension == i) {
exitWorld = world;
}
}
}
Location enter = entityplayer.getBukkitEntity().getLocation();
Location exit = null;
boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
if (exitWorld != null) {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {
// THE_END -> NORMAL; use bed if available, otherwise default spawn
exit = ((org.bukkit.craftbukkit.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation();
if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) {
exit = exitWorld.getWorld().getSpawnLocation();
}
} else {
// NORMAL <-> NETHER or NORMAL -> THE_END
exit = this.calculateTarget(enter, exitWorld);
useTravelAgent = true;
}
}
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().s() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause);
event.useTravelAgent(useTravelAgent);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null) {
return;
}
exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
if (exit == null) {
return;
}
exitWorld = ((CraftWorld) exit.getWorld()).getHandle();
Vector velocity = entityplayer.getBukkitEntity().getVelocity();
boolean before = exitWorld.chunkProviderServer.forceChunkLoad;
exitWorld.chunkProviderServer.forceChunkLoad = true;
exitWorld.s().adjustExit(entityplayer, exit, velocity);
exitWorld.chunkProviderServer.forceChunkLoad = before;
this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we
if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) {
entityplayer.getBukkitEntity().setVelocity(velocity);
}
// CraftBukkit end
}