AT bullshit

This commit is contained in:
MiniDigger | Martin
2021-06-16 00:24:12 +02:00
parent 2eb94202ea
commit a1d90ea32f
48 changed files with 191 additions and 638 deletions

View File

@@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class ChunkHolder {
}
public void broadcast(Packet<?> packet, boolean onlyOnWatchDistanceEdge) { // Paper - private -> public
public void broadcast(Packet<?> packet, boolean onlyOnWatchDistanceEdge) {
- this.playerProvider.getPlayers(this.pos, onlyOnWatchDistanceEdge).forEach((entityplayer) -> {
- entityplayer.connection.send(packet);
- });
@@ -290,12 +290,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return completablefuture1;
}
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
- protected void setViewDistance(int watchDistance) {
public void setViewDistance(int watchDistance) {
- int j = Mth.clamp(watchDistance + 1, 3, 33);
+ public void setViewDistance(int watchDistance) { // Paper - public
+ int j = Mth.clamp(watchDistance + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32
if (j != this.viewDistance) {
@@ -348,6 +346,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (chunk != null) {
this.playerLoadedChunk(player, packets, chunk);
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
@Nullable
- public CompoundTag readChunk(ChunkPos pos) throws IOException { // Paper - private -> public
+ public CompoundTag readChunk(ChunkPos pos) throws IOException {
CompoundTag nbttagcompound = this.read(pos);
// Paper start - Cache chunk status on disk
if (nbttagcompound == null) {
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
}
@@ -438,12 +445,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - per player view distance
}
protected void addEntity(Entity entity) {
public void addEntity(Entity entity) {
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
- private void playerLoadedChunk(ServerPlayer player, Packet<?>[] packets, LevelChunk chunk) {
+ // Paper start
+ private static int getLightMask(final LevelChunk chunk) {
+ final net.minecraft.world.level.chunk.LevelChunkSection[] chunkSections = chunk.getSections();
@@ -485,10 +491,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
+ public void playerLoadedChunk(ServerPlayer player, Packet<?>[] packets, LevelChunk chunk) { // Paper - private -> public
public void playerLoadedChunk(ServerPlayer player, Packet<?>[] packets, LevelChunk chunk) {
if (packets[0] == null) {
packets[0] = new ClientboundLevelChunkPacket(chunk, chunk.level.chunkPacketBlockController.shouldModify(player, chunk)); // Paper - Ani-Xray - Bypass
packets[1] = new ClientboundLightUpdatePacket(chunk.getPos(), this.lightEngine, (BitSet) null, (BitSet) null, true);
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java