3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Readd the double dimension switch

Dieser Commit ist enthalten in:
Thinkofdeath 2015-03-08 10:28:12 +00:00
Ursprung 091a7212b0
Commit d03ffbf54b

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PlayerList.java 2015-02-26 22:40:23.023608135 +0000 --- /home/matt/mc-dev-private//net/minecraft/server/PlayerList.java 2015-03-08 10:28:09.527576065 +0000
+++ src/main/java/net/minecraft/server/PlayerList.java 2015-02-26 22:40:23.027608135 +0000 +++ src/main/java/net/minecraft/server/PlayerList.java 2015-03-08 10:28:09.531576065 +0000
@@ -18,6 +18,26 @@ @@ -18,6 +18,26 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -367,7 +367,7 @@
entityplayer.dimension = i; entityplayer.dimension = i;
Object object; Object object;
@@ -355,80 +509,267 @@ @@ -355,80 +509,268 @@
} }
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object); EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object);
@ -441,6 +441,7 @@
+ // CraftBukkit start + // CraftBukkit start
+ byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); + byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
+ // Force the client to refresh their chunk cache + // Force the client to refresh their chunk cache
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn((byte) (actualDimension >= 0 ? -1 : 0), worldserver.getDifficulty(), worldserver.getWorldData().getType(), entityplayer.playerInteractManager.getGameMode()));
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(actualDimension, worldserver.getDifficulty(), worldserver.getWorldData().getType(), entityplayer1.playerInteractManager.getGameMode())); + entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(actualDimension, worldserver.getDifficulty(), worldserver.getWorldData().getType(), entityplayer1.playerInteractManager.getGameMode()));
+ entityplayer1.spawnIn(worldserver); + entityplayer1.spawnIn(worldserver);
+ entityplayer1.dead = false; + entityplayer1.dead = false;
@ -673,7 +674,7 @@
if (entity.dimension == -1) { if (entity.dimension == -1) {
d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D); 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); d1 = MathHelper.a(d1 / d2, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D);
@@ -447,6 +788,8 @@ @@ -447,6 +789,8 @@
BlockPosition blockposition; BlockPosition blockposition;
if (i == 1) { if (i == 1) {
@ -682,7 +683,7 @@
blockposition = worldserver1.getSpawn(); blockposition = worldserver1.getSpawn();
} else { } else {
blockposition = worldserver1.getDimensionSpawn(); blockposition = worldserver1.getDimensionSpawn();
@@ -460,15 +803,26 @@ @@ -460,15 +804,26 @@
worldserver.entityJoinedWorld(entity, false); worldserver.entityJoinedWorld(entity, false);
} }
} }
@ -711,7 +712,7 @@
worldserver1.addEntity(entity); worldserver1.addEntity(entity);
worldserver1.entityJoinedWorld(entity, false); worldserver1.entityJoinedWorld(entity, false);
} }
@@ -477,6 +831,7 @@ @@ -477,6 +832,7 @@
} }
entity.spawnIn(worldserver1); entity.spawnIn(worldserver1);
@ -719,7 +720,7 @@
} }
public void tick() { public void tick() {
@@ -494,6 +849,15 @@ @@ -494,6 +850,15 @@
} }
@ -735,7 +736,7 @@
public void a(Packet packet, int i) { public void a(Packet packet, int i) {
for (int j = 0; j < this.players.size(); ++j) { for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@@ -589,10 +953,24 @@ @@ -589,10 +954,24 @@
public void addOp(GameProfile gameprofile) { public void addOp(GameProfile gameprofile) {
this.operators.add(new OpListEntry(gameprofile, this.server.p())); this.operators.add(new OpListEntry(gameprofile, this.server.p()));
@ -760,7 +761,7 @@
} }
public boolean isWhitelisted(GameProfile gameprofile) { public boolean isWhitelisted(GameProfile gameprofile) {
@@ -600,7 +978,7 @@ @@ -600,7 +979,7 @@
} }
public boolean isOp(GameProfile gameprofile) { public boolean isOp(GameProfile gameprofile) {
@ -769,7 +770,7 @@
} }
public EntityPlayer getPlayer(String s) { public EntityPlayer getPlayer(String s) {
@@ -627,6 +1005,12 @@ @@ -627,6 +1006,12 @@
for (int j = 0; j < this.players.size(); ++j) { for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@ -782,7 +783,7 @@
if (entityplayer != entityhuman && entityplayer.dimension == i) { if (entityplayer != entityhuman && entityplayer.dimension == i) {
double d4 = d0 - entityplayer.locX; double d4 = d0 - entityplayer.locX;
double d5 = d1 - entityplayer.locY; double d5 = d1 - entityplayer.locY;
@@ -674,21 +1058,26 @@ @@ -674,21 +1059,26 @@
public void reloadWhitelist() {} public void reloadWhitelist() {}
public void b(EntityPlayer entityplayer, WorldServer worldserver) { public void b(EntityPlayer entityplayer, WorldServer worldserver) {
@ -814,7 +815,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
} }
@@ -701,7 +1090,7 @@ @@ -701,7 +1091,7 @@
} }
public String[] getSeenPlayers() { public String[] getSeenPlayers() {
@ -823,7 +824,7 @@
} }
public boolean getHasWhitelist() { public boolean getHasWhitelist() {
@@ -751,16 +1140,26 @@ @@ -751,16 +1141,26 @@
public void u() { public void u() {
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
@ -852,7 +853,7 @@
} }
public void sendMessage(IChatBaseComponent ichatbasecomponent) { public void sendMessage(IChatBaseComponent ichatbasecomponent) {
@@ -797,8 +1196,10 @@ @@ -797,8 +1197,10 @@
WorldServer[] aworldserver = this.server.worldServer; WorldServer[] aworldserver = this.server.worldServer;
int j = aworldserver.length; int j = aworldserver.length;