Fix per a world world borders

Well... mostly anyway
This commit is contained in:
Thinkofdeath
2014-12-10 19:16:37 +00:00
parent e24569a9ed
commit f48410a39c
5 changed files with 134 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/PlayerList.java 2014-12-06 22:26:41.687189417 +0000
+++ src/main/java/net/minecraft/server/PlayerList.java 2014-12-06 22:25:44.071190696 +0000
--- ../work/decompile-8eb82bde/net/minecraft/server/PlayerList.java 2014-12-10 19:16:20.668465387 +0000
+++ src/main/java/net/minecraft/server/PlayerList.java 2014-12-10 19:10:19.948469302 +0000
@@ -18,6 +18,25 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -379,13 +379,13 @@
+ entityplayer1.setRespawnPosition(null, true);
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutGameStateChange(0, 0.0F));
+ }
}
+ }
+
+ if (location == null) {
+ cworld = (CraftWorld) this.server.server.getWorlds().get(0);
+ blockposition = cworld.getHandle().getSpawn();
+ location = new Location(cworld, blockposition.getX() + 0.5, blockposition.getY(), blockposition.getZ() + 0.5);
+ }
}
+
+ Player respawnPlayer = cserver.getPlayer(entityplayer1);
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
@@ -557,7 +557,8 @@
+ double d1 = entity.locZ;
+ double d2 = 8.0D;
+ float f = entity.yaw;
+
- entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect));
+ worldserver.methodProfiler.a("moving");
+ */
+ if (worldserver1.dimension == -1) {
@@ -580,8 +581,7 @@
+ */
+ } else {
+ BlockPosition blockposition;
- entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect));
+
+ if (i == 1) {
+ // use default NORMAL world spawn instead of target
+ worldserver1 = this.server.worlds.get(0);
@@ -691,7 +691,23 @@
}
public void tick() {
@@ -549,10 +900,24 @@
@@ -458,6 +809,15 @@
}
+ // CraftBukkit start - add a world limited version
+ public void sendAll(Packet packet, World world) {
+ for (int i = 0; i < world.players.size(); ++i) {
+ ((EntityPlayer) this.players.get(i)).playerConnection.sendPacket(packet);
+ }
+
+ }
+ // CraftBukkit end
+
public void a(Packet packet, int i) {
for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@@ -549,10 +909,24 @@
public void addOp(GameProfile gameprofile) {
this.operators.add(new OpListEntry(gameprofile, this.server.p()));
@@ -716,7 +732,7 @@
}
public boolean isWhitelisted(GameProfile gameprofile) {
@@ -560,7 +925,7 @@
@@ -560,7 +934,7 @@
}
public boolean isOp(GameProfile gameprofile) {
@@ -725,7 +741,7 @@
}
public EntityPlayer getPlayer(String s) {
@@ -587,6 +952,12 @@
@@ -587,6 +961,12 @@
for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@@ -738,7 +754,7 @@
if (entityplayer != entityhuman && entityplayer.dimension == i) {
double d4 = d0 - entityplayer.locX;
double d5 = d1 - entityplayer.locY;
@@ -634,21 +1005,26 @@
@@ -634,21 +1014,26 @@
public void reloadWhitelist() {}
public void b(EntityPlayer entityplayer, WorldServer worldserver) {
@@ -770,7 +786,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
}
@@ -661,7 +1037,7 @@
@@ -661,7 +1046,7 @@
}
public String[] getSeenPlayers() {
@@ -779,7 +795,7 @@
}
public boolean getHasWhitelist() {
@@ -711,10 +1087,17 @@
@@ -711,10 +1096,17 @@
public void v() {
for (int i = 0; i < this.players.size(); ++i) {
@@ -798,7 +814,7 @@
public void sendMessage(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.server.sendMessage(ichatbasecomponent);
@@ -754,11 +1137,10 @@
@@ -754,11 +1146,10 @@
public void a(int i) {
this.r = i;
if (this.server.worldServer != null) {