mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Removed temporary hackish fix for the entity interactivity issues, fixed properly in MC1.2.4.
This commit is contained in:
parent
ccbb4b479a
commit
ca8b9a0bb4
3 changed files with 1 additions and 170 deletions
|
@ -127,8 +127,7 @@ public class NetLoginHandler extends NetHandler {
|
||||||
this.server.serverConfigurationManager.a(entityplayer, worldserver);
|
this.server.serverConfigurationManager.a(entityplayer, worldserver);
|
||||||
// this.server.serverConfigurationManager.sendAll(new Packet3Chat("\u00A7e" + entityplayer.name + " joined the game.")); // CraftBukkit - message moved to join event
|
// this.server.serverConfigurationManager.sendAll(new Packet3Chat("\u00A7e" + entityplayer.name + " joined the game.")); // CraftBukkit - message moved to join event
|
||||||
this.server.serverConfigurationManager.c(entityplayer);
|
this.server.serverConfigurationManager.c(entityplayer);
|
||||||
// CraftBukkit - temporary initial join teleport function, houses hacky entity fix.
|
netserverhandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
||||||
netserverhandler.initialJoin(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
|
||||||
this.server.networkListenThread.a(netserverhandler);
|
this.server.networkListenThread.a(netserverhandler);
|
||||||
netserverhandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // CraftBukkit - add support for player specific time
|
netserverhandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // CraftBukkit - add support for player specific time
|
||||||
Iterator iterator = entityplayer.getEffects().iterator();
|
Iterator iterator = entityplayer.getEffects().iterator();
|
||||||
|
|
|
@ -9,8 +9,6 @@ import java.io.UnsupportedEncodingException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
@ -417,90 +415,6 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - temporary initial join teleport function, houses hacky entity fix.
|
|
||||||
public void initialJoin(double d0, double d1, double d2, float f, float f1) {
|
|
||||||
Location to = new Location(this.getPlayer().getWorld(), d0, d1, d2, f, f1);
|
|
||||||
|
|
||||||
this.teleport(to);
|
|
||||||
|
|
||||||
Timer timer = new Timer();
|
|
||||||
final ArrayList<Entity> nearby = new ArrayList<Entity>();
|
|
||||||
// Start inline nearby entities
|
|
||||||
AxisAlignedBB axisalignedbb = player.boundingBox.grow(100, 100, 100);
|
|
||||||
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
|
||||||
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
|
||||||
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
|
|
||||||
int l = MathHelper.floor((axisalignedbb.f + 2.0D) / 16.0D);
|
|
||||||
|
|
||||||
for (int i1 = i; i1 <= j; ++i1) {
|
|
||||||
for (int j1 = k; j1 <= l; ++j1) {
|
|
||||||
if (player.world.chunkProvider.isChunkLoaded(i1, j1)) {
|
|
||||||
player.world.getChunkAt(i1, j1).a(player, axisalignedbb, nearby);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End inline nearby entities
|
|
||||||
for (Object entity : nearby) {
|
|
||||||
if (entity instanceof EntityLiving || entity instanceof EntityMinecart || entity instanceof EntityBoat || entity instanceof IAnimal || entity instanceof EntityPainting) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet29DestroyEntity(((Entity) entity).id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timer.schedule(new TimerTask(){
|
|
||||||
public void run() {
|
|
||||||
// Start inline nearby entities
|
|
||||||
nearby.clear();
|
|
||||||
AxisAlignedBB axisalignedbb = player.boundingBox.grow(100, 100, 100);
|
|
||||||
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
|
||||||
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
|
||||||
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
|
|
||||||
int l = MathHelper.floor((axisalignedbb.f + 2.0D) / 16.0D);
|
|
||||||
|
|
||||||
for (int i1 = i; i1 <= j; ++i1) {
|
|
||||||
for (int j1 = k; j1 <= l; ++j1) {
|
|
||||||
if (player.world.chunkProvider.isChunkLoaded(i1, j1)) {
|
|
||||||
player.world.getChunkAt(i1, j1).a(player, axisalignedbb, nearby);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End inline nearby entities
|
|
||||||
for (Object entityObject2 : nearby) {
|
|
||||||
try {
|
|
||||||
Entity entity = (Entity) entityObject2;
|
|
||||||
|
|
||||||
if (entity instanceof EntityPlayer) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet20NamedEntitySpawn((EntityHuman) entity));
|
|
||||||
} else if (entity instanceof EntityMinecart) {
|
|
||||||
EntityMinecart entityminecart = (EntityMinecart) entity;
|
|
||||||
|
|
||||||
if (entityminecart.type == 0) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 10));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityminecart.type == 1) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 11));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityminecart.type == 2) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 12));
|
|
||||||
}
|
|
||||||
} else if (entity instanceof EntityBoat) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 1));
|
|
||||||
} else if (entity instanceof IAnimal) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet24MobSpawn((EntityLiving) entity));
|
|
||||||
} else if (entity instanceof EntityEnderDragon) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet24MobSpawn((EntityLiving) entity));
|
|
||||||
} else if (entity instanceof EntityPainting) {
|
|
||||||
player.netServerHandler.sendPacket(new Packet25EntityPainting((EntityPainting) entity));
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
public void a(double d0, double d1, double d2, float f, float f1) {
|
public void a(double d0, double d1, double d2, float f, float f1) {
|
||||||
// CraftBukkit start - Delegate to teleport(Location)
|
// CraftBukkit start - Delegate to teleport(Location)
|
||||||
Player player = this.getPlayer();
|
Player player = this.getPlayer();
|
||||||
|
|
|
@ -13,9 +13,6 @@ import java.util.Set;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
|
@ -326,85 +323,6 @@ public class ServerConfigurationManager {
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
// CraftBukkit start - temporary hacky entity fix.
|
|
||||||
Timer timer = new Timer();
|
|
||||||
final ArrayList<Entity> nearby = new ArrayList<Entity>();
|
|
||||||
final EntityPlayer nmsEntity = entityplayer1;
|
|
||||||
// Start inline nearby entities
|
|
||||||
AxisAlignedBB axisalignedbb = nmsEntity.boundingBox.grow(100, 100, 100);
|
|
||||||
i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
|
||||||
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
|
||||||
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
|
|
||||||
int l = MathHelper.floor((axisalignedbb.f + 2.0D) / 16.0D);
|
|
||||||
|
|
||||||
for (int i1 = i; i1 <= j; ++i1) {
|
|
||||||
for (int j1 = k; j1 <= l; ++j1) {
|
|
||||||
if (nmsEntity.world.chunkProvider.isChunkLoaded(i1, j1)) {
|
|
||||||
nmsEntity.world.getChunkAt(i1, j1).a(nmsEntity, axisalignedbb, nearby);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End inline nearby entities
|
|
||||||
for (Object entity : nearby) {
|
|
||||||
if (entity instanceof EntityLiving || entity instanceof EntityMinecart || entity instanceof EntityBoat || entity instanceof IAnimal || entity instanceof EntityPainting) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet29DestroyEntity(((Entity) entity).id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timer.schedule(new TimerTask(){
|
|
||||||
public void run() {
|
|
||||||
// Start inline nearby entities
|
|
||||||
nearby.clear();
|
|
||||||
AxisAlignedBB axisalignedbb = nmsEntity.boundingBox.grow(100, 100, 100);
|
|
||||||
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
|
||||||
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
|
||||||
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
|
|
||||||
int l = MathHelper.floor((axisalignedbb.f + 2.0D) / 16.0D);
|
|
||||||
|
|
||||||
for (int i1 = i; i1 <= j; ++i1) {
|
|
||||||
for (int j1 = k; j1 <= l; ++j1) {
|
|
||||||
if (nmsEntity.world.chunkProvider.isChunkLoaded(i1, j1)) {
|
|
||||||
nmsEntity.world.getChunkAt(i1, j1).a(nmsEntity, axisalignedbb, nearby);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End inline nearby entities
|
|
||||||
for (Object entityObject2 : nearby) {
|
|
||||||
try {
|
|
||||||
Entity entity = (Entity) entityObject2;
|
|
||||||
|
|
||||||
if (entity instanceof EntityPlayer) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet20NamedEntitySpawn((EntityHuman) entity));
|
|
||||||
} else if (entity instanceof EntityMinecart) {
|
|
||||||
EntityMinecart entityminecart = (EntityMinecart) entity;
|
|
||||||
|
|
||||||
if (entityminecart.type == 0) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 10));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityminecart.type == 1) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 11));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityminecart.type == 2) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 12));
|
|
||||||
}
|
|
||||||
} else if (entity instanceof EntityBoat) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet23VehicleSpawn(entity, 1));
|
|
||||||
} else if (entity instanceof IAnimal) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet24MobSpawn((EntityLiving) entity));
|
|
||||||
} else if (entity instanceof EntityEnderDragon) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet24MobSpawn((EntityLiving) entity));
|
|
||||||
} else if (entity instanceof EntityPainting) {
|
|
||||||
nmsEntity.netServerHandler.sendPacket(new Packet25EntityPainting((EntityPainting) entity));
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
return entityplayer1;
|
return entityplayer1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue