even even even even even even more work
This commit is contained in:
@@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, 33, new ChunkCoordIntPair(i)); // Paper - no-tick view distance
|
||||
|
||||
if (flag1) {
|
||||
ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { // CraftBukkit - decompile error
|
||||
ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -125,8 +125,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ boolean needsChunkCenterUpdate; // Paper - no-tick view distance
|
||||
+
|
||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
||||
super((World) worldserver, gameprofile);
|
||||
playerinteractmanager.player = this;
|
||||
super(worldserver, worldserver.getSpawn(), gameprofile);
|
||||
this.spawnDimension = World.OVERWORLD;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -306,7 +306,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ player.needsChunkCenterUpdate = false;
|
||||
+ // Paper end - no-tick view distance
|
||||
}
|
||||
|
||||
// Paper end
|
||||
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
@@ -367,18 +367,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error // Paper - diff on change, this is the scheduling method copied in Chunk used to schedule chunk broadcasts (on change it needs to be copied again)
|
||||
- this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // Paper - diff on change, this is the scheduling method copied in Chunk used to schedule chunk broadcasts (on change it needs to be copied again)
|
||||
});
|
||||
return completablefuture1;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
} // Paper
|
||||
}
|
||||
|
||||
- protected void setViewDistance(int i) {
|
||||
protected void setViewDistance(int i) {
|
||||
- int j = MathHelper.clamp(i + 1, 3, 33);
|
||||
+ public final void setViewDistance(int i) { // Paper - public
|
||||
+ int j = MathHelper.clamp(i + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32
|
||||
|
||||
if (j != this.viewDistance) {
|
||||
@@ -501,7 +499,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return Stream.empty();
|
||||
+ }
|
||||
+ // all current cases are inlined so we wont hit this code, it's just in case plugins or future updates use it
|
||||
+ List<EntityPlayer> players = new ArrayList<>();
|
||||
+ List<EntityPlayer> players = new java.util.ArrayList<>();
|
||||
+ Object[] backingSet = inRange.getBackingSet();
|
||||
+
|
||||
+ if (flag) { // flag -> border only
|
||||
@@ -542,7 +540,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
|
||||
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
|
||||
if (apacket[0] == null) {
|
||||
apacket[0] = new PacketPlayOutMapChunk(chunk, 65535);
|
||||
apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true);
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
|
||||
PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
|
||||
@@ -557,23 +555,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
// CraftBukkit - getType()
|
||||
|
||||
// Spigot - view distance
|
||||
networkmanager.queueImmunity = true; // Paper
|
||||
- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), WorldData.c(worlddata.getSeed()), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), worldserver.spigotConfig.viewDistance, flag1, !flag));
|
||||
+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), WorldData.c(worlddata.getSeed()), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), worldserver.getChunkProvider().playerChunkMap.getLoadViewDistance(), flag1, !flag)); // Paper - no-tick view distance
|
||||
- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver.spigotConfig.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
|
||||
+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver1.getChunkProvider().playerChunkMap.getLoadViewDistance(), flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); // Paper - no-tick view distance
|
||||
entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
||||
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
WorldData worlddata = worldserver.getWorldData();
|
||||
|
||||
entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver.worldProvider.getDimensionManager().getType(), WorldData.c(worldserver.getWorldData().getSeed()), worldserver.getWorldData().getType(), entityplayer1.playerInteractManager.getGameMode()));
|
||||
- entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver.spigotConfig.viewDistance)); // Spigot
|
||||
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver.getChunkProvider().playerChunkMap.getLoadViewDistance())); // Paper - no-tick view distance
|
||||
entityplayer1.spawnIn(worldserver);
|
||||
// CraftBukkit start
|
||||
WorldData worlddata = worldserver1.getWorldData();
|
||||
entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver1.getTypeKey(), worldserver1.getDimensionKey(), BiomeManager.a(worldserver1.getSeed()), entityplayer1.playerInteractManager.getGameMode(), entityplayer1.playerInteractManager.c(), worldserver1.isDebugWorld(), worldserver1.isFlatWorld(), flag));
|
||||
- entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver1.spigotConfig.viewDistance)); // Spigot
|
||||
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver1.getChunkProvider().playerChunkMap.getLoadViewDistance())); // Spigot // Paper - no-tick view distance
|
||||
entityplayer1.spawnIn(worldserver1);
|
||||
entityplayer1.dead = false;
|
||||
entityplayer1.playerConnection.teleport(new Location(worldserver.getWorld(), entityplayer1.locX(), entityplayer1.locY(), entityplayer1.locZ(), entityplayer1.yaw, entityplayer1.pitch));
|
||||
entityplayer1.playerConnection.teleport(new Location(worldserver1.getWorld(), entityplayer1.locX(), entityplayer1.locY(), entityplayer1.locZ(), entityplayer1.yaw, entityplayer1.pitch));
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
||||
public void a(int i) {
|
||||
|
||||
Reference in New Issue
Block a user