mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Refactor Anti-Xray and make some fixes to it (#5938)
This commit is contained in:
parent
2c17a86e82
commit
c00618d009
3 changed files with 505 additions and 538 deletions
|
@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- private final LevelChunkSection[] sections;
|
||||
+ private LevelChunkSection[] sections; // Paper - remove final
|
||||
private Set<BlockPos> tiles;
|
||||
private World world; // Paper - Anti-Xray - Add world
|
||||
private World world; // Paper - Anti-Xray - Add parameters
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {
|
||||
return this.sections;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ //this.lock.release(); // Paper - disable this
|
||||
}
|
||||
|
||||
// Paper start - Anti-Xray - Add predefined objects
|
||||
// Paper start - Anti-Xray - Add preset values
|
||||
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||
return this.palette.idFor(objectAdded);
|
||||
}
|
||||
|
@ -64,9 +64,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.acquire();
|
||||
int i = buf.readByte();
|
||||
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||
@Deprecated public void write(FriendlyByteBuf buf) {
|
||||
write(buf, null, 0);
|
||||
}
|
||||
|
||||
// Paper start - Anti-Xray - Add chunk packet info
|
||||
@Deprecated public void write(FriendlyByteBuf buf) { write(buf, null, 0); } // Notice for updates: Please make sure this method isn't used anywhere
|
||||
- public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int bottomBlockY) {
|
||||
+ public synchronized void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int bottomBlockY) { // Paper - synchronize
|
||||
// Paper end
|
||||
|
@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public synchronized void read(ListTag paletteNbt, long[] data) { // Paper - synchronize
|
||||
try {
|
||||
this.acquire();
|
||||
// Paper - Anti-Xray - TODO: Should this.predefinedObjects.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)?
|
||||
// Paper - Anti-Xray - TODO: Should this.presetValues.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)?
|
||||
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue