mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 03:05:52 -07:00
Update to Minecraft 1.9
This commit is contained in:
@@ -75,20 +75,18 @@
|
||||
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
||||
WorldData worlddata = worldserver.getWorldData();
|
||||
BlockPosition blockposition = worldserver.getSpawn();
|
||||
@@ -79,7 +114,8 @@
|
||||
this.a(entityplayer, (EntityPlayer) null, worldserver);
|
||||
@@ -80,6 +115,7 @@
|
||||
PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer);
|
||||
|
||||
- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimension(), worldserver.getDifficulty(), this.getMaxPlayers(), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimension(), worldserver.getDifficulty(), Math.min(this.getMaxPlayers(), 60), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo"))); // CraftBukkit - cap player list to 60
|
||||
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getDimensionID(), worldserver.getDifficulty(), this.getMaxPlayers(), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||
playerconnection.sendPacket(new PacketPlayOutCustomPayload("MC|Brand", (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
||||
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
playerconnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
|
||||
@@ -89,17 +125,23 @@
|
||||
@@ -90,17 +126,23 @@
|
||||
entityplayer.getStatisticManager().updateStatistics(entityplayer);
|
||||
this.sendScoreboard((ScoreboardServer) worldserver.getScoreboard(), entityplayer);
|
||||
this.server.aH();
|
||||
this.server.aC();
|
||||
- ChatMessage chatmessage;
|
||||
+ // CraftBukkit start - login message is handled in the event
|
||||
+ // ChatMessage chatmessage;
|
||||
@@ -114,17 +112,17 @@
|
||||
+ worldserver = server.getWorldServer(entityplayer.dimension); // CraftBukkit - Update in case join event changed it
|
||||
playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
||||
this.b(entityplayer, worldserver);
|
||||
if (this.server.getResourcePack().length() > 0) {
|
||||
@@ -126,6 +168,8 @@
|
||||
}
|
||||
if (!this.server.getResourcePack().isEmpty()) {
|
||||
@@ -160,6 +202,8 @@
|
||||
}
|
||||
|
||||
entityplayer.syncInventory();
|
||||
+ // CraftBukkit - Moved from above, added world
|
||||
+ PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "]" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")");
|
||||
}
|
||||
|
||||
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
||||
@@ -158,6 +202,7 @@
|
||||
@@ -192,26 +236,27 @@
|
||||
}
|
||||
|
||||
public void setPlayerFileData(WorldServer[] aworldserver) {
|
||||
@@ -132,16 +130,41 @@
|
||||
this.playerFileData = aworldserver[0].getDataManager().getPlayerFileData();
|
||||
aworldserver[0].getWorldBorder().a(new IWorldBorderListener() {
|
||||
public void a(WorldBorder worldborder, double d0) {
|
||||
@@ -202,7 +247,7 @@
|
||||
- PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_SIZE));
|
||||
+ PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_SIZE), worldborder.world);
|
||||
}
|
||||
|
||||
public void a(WorldBorder worldborder, double d0, double d1, long i) {
|
||||
- PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.LERP_SIZE));
|
||||
+ PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.LERP_SIZE), worldborder.world);
|
||||
}
|
||||
|
||||
public void a(WorldBorder worldborder, double d0, double d1) {
|
||||
- PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_CENTER));
|
||||
+ PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_CENTER), worldborder.world);
|
||||
}
|
||||
|
||||
public void a(WorldBorder worldborder, int i) {
|
||||
- PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_WARNING_TIME));
|
||||
+ PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_WARNING_TIME), worldborder.world);
|
||||
}
|
||||
|
||||
public void b(WorldBorder worldborder, int i) {
|
||||
- PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_WARNING_BLOCKS));
|
||||
+ PlayerList.this.sendAll(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.SET_WARNING_BLOCKS), worldborder.world);
|
||||
}
|
||||
|
||||
public void b(WorldBorder worldborder, double d0) {}
|
||||
@@ -236,7 +281,7 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound a(EntityPlayer entityplayer) {
|
||||
- NBTTagCompound nbttagcompound = this.server.worldServer[0].getWorldData().i();
|
||||
+ NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); // CraftBukkit
|
||||
- NBTTagCompound nbttagcompound = this.server.worldServer[0].getWorldData().h();
|
||||
+ NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().h(); // CraftBukkit
|
||||
NBTTagCompound nbttagcompound1;
|
||||
|
||||
if (entityplayer.getName().equals(this.server.S()) && nbttagcompound != null) {
|
||||
@@ -226,33 +271,72 @@
|
||||
if (entityplayer.getName().equals(this.server.Q()) && nbttagcompound != null) {
|
||||
@@ -260,28 +305,70 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -153,8 +176,6 @@
|
||||
+ // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer})); // CraftBukkit - replaced with loop below
|
||||
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
||||
|
||||
- worldserver.addEntity(entityplayer);
|
||||
- this.a(entityplayer, (WorldServer) null);
|
||||
+ // CraftBukkit start
|
||||
+ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(cserver.getPlayer(entityplayer), joinMessage);
|
||||
+ cserver.getPluginManager().callEvent(playerJoinEvent);
|
||||
@@ -172,10 +193,11 @@
|
||||
+
|
||||
+ // CraftBukkit start - sendAll above replaced with this loop
|
||||
+ PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entityplayer);
|
||||
|
||||
+
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
||||
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { (EntityPlayer) this.players.get(i)}));
|
||||
+ EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
||||
+
|
||||
+ if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) {
|
||||
+ entityplayer1.playerConnection.sendPacket(packet);
|
||||
+ }
|
||||
@@ -184,10 +206,12 @@
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer1}));
|
||||
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer1}));
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
|
||||
- worldserver.addEntity(entityplayer);
|
||||
- this.a(entityplayer, (WorldServer) null);
|
||||
+ // CraftBukkit start - Only add if the player wasn't moved in the event
|
||||
+ if (entityplayer.world == worldserver && !worldserver.players.contains(entityplayer)) {
|
||||
+ worldserver.addEntity(entityplayer);
|
||||
@@ -197,11 +221,13 @@
|
||||
}
|
||||
|
||||
public void d(EntityPlayer entityplayer) {
|
||||
entityplayer.u().getPlayerChunkMap().movePlayer(entityplayer);
|
||||
entityplayer.x().getPlayerChunkMap().movePlayer(entityplayer);
|
||||
}
|
||||
|
||||
- public void disconnect(EntityPlayer entityplayer) {
|
||||
+ public String disconnect(EntityPlayer entityplayer) { // CraftBukkit - return string
|
||||
WorldServer worldserver = entityplayer.x();
|
||||
|
||||
entityplayer.b(StatisticList.f);
|
||||
+
|
||||
+ // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
||||
@@ -213,14 +239,9 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.savePlayerFile(entityplayer);
|
||||
WorldServer worldserver = entityplayer.u();
|
||||
|
||||
- if (entityplayer.vehicle != null) {
|
||||
+ if (entityplayer.vehicle != null && !(entityplayer.vehicle instanceof EntityPlayer)) { // CraftBukkit - Don't remove players
|
||||
worldserver.removeEntity(entityplayer.vehicle);
|
||||
PlayerList.f.debug("removing player mount");
|
||||
}
|
||||
@@ -268,13 +352,61 @@
|
||||
if (entityplayer.isPassenger()) {
|
||||
Entity entity = entityplayer.getVehicle();
|
||||
@@ -313,13 +400,61 @@
|
||||
this.o.remove(uuid);
|
||||
}
|
||||
|
||||
@@ -285,7 +306,7 @@
|
||||
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
|
||||
|
||||
s = "You are banned from this server!\nReason: " + gameprofilebanentry.getReason();
|
||||
@@ -282,10 +414,12 @@
|
||||
@@ -327,10 +462,12 @@
|
||||
s = s + "\nYour ban will be removed on " + PlayerList.g.format(gameprofilebanentry.getExpires());
|
||||
}
|
||||
|
||||
@@ -301,7 +322,7 @@
|
||||
IpBanEntry ipbanentry = this.l.get(socketaddress);
|
||||
|
||||
s = "Your IP address is banned from this server!\nReason: " + ipbanentry.getReason();
|
||||
@@ -293,13 +427,25 @@
|
||||
@@ -338,13 +475,25 @@
|
||||
s = s + "\nYour ban will be removed on " + PlayerList.g.format(ipbanentry.getExpires());
|
||||
}
|
||||
|
||||
@@ -314,13 +335,13 @@
|
||||
+ if (this.players.size() >= this.maxPlayers && !this.f(gameprofile)) {
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full");
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ cserver.getPluginManager().callEvent(event);
|
||||
+ if (event.getResult() != PlayerLoginEvent.Result.ALLOWED) {
|
||||
+ loginlistener.disconnect(event.getKickMessage());
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
+ return entity;
|
||||
}
|
||||
|
||||
@@ -330,7 +351,7 @@
|
||||
UUID uuid = EntityHuman.a(gameprofile);
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
|
||||
@@ -334,17 +480,25 @@
|
||||
@@ -379,17 +528,25 @@
|
||||
}
|
||||
|
||||
return new EntityPlayer(this.server, this.server.getWorldServer(0), gameprofile, (PlayerInteractManager) object);
|
||||
@@ -344,10 +365,10 @@
|
||||
+ return this.moveToWorld(entityplayer, i, flag, null, true);
|
||||
+ }
|
||||
+ public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag, Location location, boolean avoidSuffocation) {
|
||||
entityplayer.u().getTracker().untrackPlayer(entityplayer);
|
||||
- entityplayer.u().getTracker().untrackEntity(entityplayer);
|
||||
+ // entityplayer.u().getTracker().untrackEntity(entityplayer); // CraftBukkit
|
||||
entityplayer.u().getPlayerChunkMap().removePlayer(entityplayer);
|
||||
entityplayer.x().getTracker().untrackPlayer(entityplayer);
|
||||
- entityplayer.x().getTracker().untrackEntity(entityplayer);
|
||||
+ // entityplayer.x().getTracker().untrackEntity(entityplayer); // CraftBukkit
|
||||
entityplayer.x().getPlayerChunkMap().removePlayer(entityplayer);
|
||||
this.players.remove(entityplayer);
|
||||
this.server.getWorldServer(entityplayer.dimension).removeEntity(entityplayer);
|
||||
BlockPosition blockposition = entityplayer.getBed();
|
||||
@@ -357,21 +378,22 @@
|
||||
entityplayer.dimension = i;
|
||||
Object object;
|
||||
|
||||
@@ -355,80 +509,276 @@
|
||||
@@ -400,6 +557,11 @@
|
||||
}
|
||||
|
||||
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object);
|
||||
-
|
||||
+ // */
|
||||
+ EntityPlayer entityplayer1 = entityplayer;
|
||||
+ org.bukkit.World fromWorld = entityplayer.getBukkitEntity().getWorld();
|
||||
+ entityplayer.viewingCredits = false;
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
entityplayer1.playerConnection = entityplayer.playerConnection;
|
||||
entityplayer1.copyTo(entityplayer, flag);
|
||||
entityplayer1.d(entityplayer.getId());
|
||||
entityplayer1.o(entityplayer);
|
||||
@@ -414,43 +576,157 @@
|
||||
entityplayer1.a(s);
|
||||
}
|
||||
|
||||
- WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
||||
+ // WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); // CraftBukkit - handled later
|
||||
|
||||
@@ -420,7 +442,7 @@
|
||||
+ entityplayer1.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
+ // CraftBukkit end
|
||||
|
||||
worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
|
||||
worldserver.getChunkProviderServer().getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
|
||||
|
||||
- while (!worldserver.getCubes(entityplayer1, entityplayer1.getBoundingBox()).isEmpty() && entityplayer1.locY < 256.0D) {
|
||||
+ while (avoidSuffocation && !worldserver.getCubes(entityplayer1, entityplayer1.getBoundingBox()).isEmpty() && entityplayer1.locY < 256.0D) {
|
||||
@@ -445,6 +467,7 @@
|
||||
entityplayer1.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition1));
|
||||
entityplayer1.playerConnection.sendPacket(new PacketPlayOutExperience(entityplayer1.exp, entityplayer1.expTotal, entityplayer1.expLevel));
|
||||
this.b(entityplayer1, worldserver);
|
||||
- this.f(entityplayer1);
|
||||
- worldserver.getPlayerChunkMap().addPlayer(entityplayer1);
|
||||
- worldserver.addEntity(entityplayer1);
|
||||
- this.players.add(entityplayer1);
|
||||
@@ -483,9 +506,6 @@
|
||||
return entityplayer1;
|
||||
}
|
||||
|
||||
- public void changeDimension(EntityPlayer entityplayer, int i) {
|
||||
- int j = entityplayer.dimension;
|
||||
- WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
||||
+ // CraftBukkit start - Replaced the standard handling of portals with a more customised method.
|
||||
+ public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) {
|
||||
+ WorldServer exitWorld = null;
|
||||
@@ -497,9 +517,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- entityplayer.dimension = i;
|
||||
- WorldServer worldserver1 = this.server.getWorldServer(entityplayer.dimension);
|
||||
+
|
||||
+ Location enter = entityplayer.getBukkitEntity().getLocation();
|
||||
+ Location exit = null;
|
||||
+ boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
|
||||
@@ -516,17 +534,7 @@
|
||||
+ useTravelAgent = true;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutRespawn(entityplayer.dimension, entityplayer.world.getDifficulty(), entityplayer.world.getWorldData().getType(), entityplayer.playerInteractManager.getGameMode()));
|
||||
- worldserver.removeEntity(entityplayer);
|
||||
- entityplayer.dead = false;
|
||||
- this.changeWorld(entityplayer, j, worldserver, worldserver1);
|
||||
- this.a(entityplayer, worldserver);
|
||||
- entityplayer.playerConnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
||||
- entityplayer.playerInteractManager.a(worldserver1);
|
||||
- this.b(entityplayer, worldserver1);
|
||||
- this.updateClient(entityplayer);
|
||||
- Iterator iterator = entityplayer.getEffects().iterator();
|
||||
+
|
||||
+ 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);
|
||||
@@ -534,32 +542,32 @@
|
||||
+ if (event.isCancelled() || event.getTo() == null) {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- MobEffect mobeffect = (MobEffect) iterator.next();
|
||||
+
|
||||
+ exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
|
||||
+ if (exit == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ exitWorld = ((CraftWorld) exit.getWorld()).getHandle();
|
||||
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect));
|
||||
+
|
||||
+ 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();
|
||||
+ 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);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public void f(EntityPlayer entityplayer) {
|
||||
GameProfile gameprofile = entityplayer.getProfile();
|
||||
int i = this.isOp(gameprofile) ? this.operators.a(gameprofile) : 0;
|
||||
@@ -489,12 +765,111 @@
|
||||
}
|
||||
|
||||
public void changeWorld(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) {
|
||||
@@ -581,12 +589,12 @@
|
||||
+ double d1 = enter.getZ();
|
||||
+ double d2 = 8.0D;
|
||||
+ /*
|
||||
double d0 = entity.locX;
|
||||
double d1 = entity.locZ;
|
||||
double d2 = 8.0D;
|
||||
float f = entity.yaw;
|
||||
|
||||
worldserver.methodProfiler.a("moving");
|
||||
+ double d0 = entity.locX;
|
||||
+ double d1 = entity.locZ;
|
||||
+ double d2 = 8.0D;
|
||||
+ float f = entity.yaw;
|
||||
+
|
||||
+ worldserver.methodProfiler.a("moving");
|
||||
+ */
|
||||
+ if (worldserver1.dimension == -1) {
|
||||
+ d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b()+ 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
|
||||
@@ -656,12 +664,12 @@
|
||||
+ int i = worldserver.dimension;
|
||||
+
|
||||
+ /*
|
||||
+ double d0 = entity.locX;
|
||||
+ double d1 = entity.locZ;
|
||||
+ double d2 = 8.0D;
|
||||
+ float f = entity.yaw;
|
||||
+
|
||||
+ worldserver.methodProfiler.a("moving");
|
||||
double d0 = entity.locX;
|
||||
double d1 = entity.locZ;
|
||||
double d2 = 8.0D;
|
||||
float f = entity.yaw;
|
||||
|
||||
worldserver.methodProfiler.a("moving");
|
||||
+ */
|
||||
+ entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch());
|
||||
+ if (entity.isAlive()) {
|
||||
@@ -671,7 +679,7 @@
|
||||
if (entity.dimension == -1) {
|
||||
d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
|
||||
d1 = MathHelper.a(d1 / d2, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D);
|
||||
@@ -447,6 +797,8 @@
|
||||
@@ -513,6 +888,8 @@
|
||||
BlockPosition blockposition;
|
||||
|
||||
if (i == 1) {
|
||||
@@ -680,7 +688,7 @@
|
||||
blockposition = worldserver1.getSpawn();
|
||||
} else {
|
||||
blockposition = worldserver1.getDimensionSpawn();
|
||||
@@ -460,15 +812,26 @@
|
||||
@@ -526,15 +903,26 @@
|
||||
worldserver.entityJoinedWorld(entity, false);
|
||||
}
|
||||
}
|
||||
@@ -709,7 +717,7 @@
|
||||
worldserver1.addEntity(entity);
|
||||
worldserver1.entityJoinedWorld(entity, false);
|
||||
}
|
||||
@@ -477,6 +840,7 @@
|
||||
@@ -543,6 +931,7 @@
|
||||
}
|
||||
|
||||
entity.spawnIn(worldserver1);
|
||||
@@ -717,7 +725,7 @@
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
@@ -494,6 +858,25 @@
|
||||
@@ -560,6 +949,25 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -740,14 +748,13 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public void a(Packet packet, int i) {
|
||||
public void a(Packet<?> packet, int i) {
|
||||
for (int j = 0; j < this.players.size(); ++j) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
|
||||
@@ -589,10 +972,24 @@
|
||||
@@ -658,11 +1066,23 @@
|
||||
|
||||
public void addOp(GameProfile gameprofile) {
|
||||
this.operators.add(new OpListEntry(gameprofile, this.server.p(), this.operators.b(gameprofile)));
|
||||
+
|
||||
this.operators.add(new OpListEntry(gameprofile, this.server.q(), this.operators.b(gameprofile)));
|
||||
this.b(this.a(gameprofile.getId()), i);
|
||||
+ // CraftBukkit start
|
||||
+ Player player = server.server.getPlayer(gameprofile.getId());
|
||||
+ if (player != null) {
|
||||
@@ -758,7 +765,7 @@
|
||||
|
||||
public void removeOp(GameProfile gameprofile) {
|
||||
this.operators.remove(gameprofile);
|
||||
+
|
||||
this.b(this.a(gameprofile.getId()), 0);
|
||||
+ // CraftBukkit start
|
||||
+ Player player = server.server.getPlayer(gameprofile.getId());
|
||||
+ if (player != null) {
|
||||
@@ -767,17 +774,17 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean isWhitelisted(GameProfile gameprofile) {
|
||||
@@ -600,7 +997,7 @@
|
||||
private void b(EntityPlayer entityplayer, int i) {
|
||||
@@ -687,7 +1107,7 @@
|
||||
}
|
||||
|
||||
public boolean isOp(GameProfile gameprofile) {
|
||||
- return this.operators.d(gameprofile) || this.server.T() && this.server.worldServer[0].getWorldData().v() && this.server.S().equalsIgnoreCase(gameprofile.getName()) || this.t;
|
||||
+ return this.operators.d(gameprofile) || this.server.T() && this.server.worlds.get(0).getWorldData().v() && this.server.S().equalsIgnoreCase(gameprofile.getName()) || this.t; // CraftBukkit
|
||||
- return this.operators.d(gameprofile) || this.server.R() && this.server.worldServer[0].getWorldData().u() && this.server.Q().equalsIgnoreCase(gameprofile.getName()) || this.t;
|
||||
+ return this.operators.d(gameprofile) || this.server.R() && this.server.worlds.get(0).getWorldData().u() && this.server.Q().equalsIgnoreCase(gameprofile.getName()) || this.t; // CraftBukkit
|
||||
}
|
||||
|
||||
public EntityPlayer getPlayer(String s) {
|
||||
@@ -627,6 +1024,12 @@
|
||||
@@ -710,6 +1130,12 @@
|
||||
for (int j = 0; j < this.players.size(); ++j) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
|
||||
|
||||
@@ -790,7 +797,7 @@
|
||||
if (entityplayer != entityhuman && entityplayer.dimension == i) {
|
||||
double d4 = d0 - entityplayer.locX;
|
||||
double d5 = d1 - entityplayer.locY;
|
||||
@@ -674,21 +1077,26 @@
|
||||
@@ -757,21 +1183,26 @@
|
||||
public void reloadWhitelist() {}
|
||||
|
||||
public void b(EntityPlayer entityplayer, WorldServer worldserver) {
|
||||
@@ -799,7 +806,7 @@
|
||||
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE));
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")));
|
||||
if (worldserver.S()) {
|
||||
if (worldserver.W()) {
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0.0F));
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F)));
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.h(1.0F)));
|
||||
@@ -808,7 +815,7 @@
|
||||
+ // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F)));
|
||||
+ // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.h(1.0F)));
|
||||
+ entityplayer.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL, false);
|
||||
+ entityplayer.updateWeather(-worldserver.p, worldserver.p, -worldserver.r, worldserver.r);
|
||||
+ entityplayer.updateWeather(-worldserver.o, worldserver.o, -worldserver.q, worldserver.q);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -822,7 +829,7 @@
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
|
||||
}
|
||||
|
||||
@@ -701,7 +1109,7 @@
|
||||
@@ -784,7 +1215,7 @@
|
||||
}
|
||||
|
||||
public String[] getSeenPlayers() {
|
||||
@@ -831,7 +838,7 @@
|
||||
}
|
||||
|
||||
public boolean getHasWhitelist() {
|
||||
@@ -751,16 +1159,26 @@
|
||||
@@ -834,16 +1265,26 @@
|
||||
|
||||
public void u() {
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
@@ -860,7 +867,7 @@
|
||||
}
|
||||
|
||||
public void sendMessage(IChatBaseComponent ichatbasecomponent) {
|
||||
@@ -797,8 +1215,10 @@
|
||||
@@ -880,8 +1321,10 @@
|
||||
WorldServer[] aworldserver = this.server.worldServer;
|
||||
int j = aworldserver.length;
|
||||
|
||||
|
Reference in New Issue
Block a user