Fix packed data reading in anti-xray

This commit is contained in:
Spottedleaf 2020-06-26 14:11:08 -07:00
parent 2bdad1f69a
commit 002d3ab1b5

View file

@ -0,0 +1,54 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 26 Jun 2020 14:10:10 -0700
Subject: [PATCH] fixup! Anti-Xray
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
@@ -0,0 +0,0 @@ public final class DataBitsReader {
bitInLongIndex += bitsPerObject;
if (bitInLongIndex > 63) {
- bitInLongIndex -= 64;
+ bitInLongIndex = 0;
longInDataBitsIndex += 8;
init();
-
- if (bitInLongIndex > 0) {
- value |= current << bitsPerObject - bitInLongIndex & mask;
- }
}
return value;
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
@@ -0,0 +0,0 @@ public final class DataBitsWriter {
if (bitInLongIndex > 63) {
finish();
- bitInLongIndex -= 64;
+ bitInLongIndex = 0;
longInDataBitsIndex += 8;
init();
-
- if (bitInLongIndex > 0) {
- current = current & ~(mask >>> bitsPerObject - bitInLongIndex) | (value & mask) >>> bitsPerObject - bitInLongIndex;
- dirty = true;
- }
}
}
@@ -0,0 +0,0 @@ public final class DataBitsWriter {
if (bitInLongIndex > 63) {
finish();
- bitInLongIndex -= 64;
+ bitInLongIndex = 0;
longInDataBitsIndex += 8;
init();
}