Merge branch 'ver/1.16' of https://github.com/stonar96/Paper into ver/1.16

This commit is contained in:
Spottedleaf 2020-06-26 20:34:31 -07:00
commit 8c0c587472

View File

@ -847,10 +847,10 @@ index 0000000000000000000000000000000000000000..e61421d87a19bf2f6ce8836b48c445ff
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
new file mode 100644
index 0000000000000000000000000000000000000000..8b8c2a0156fd936ea422b64ca6372fa6bd31be32
index 0000000000000000000000000000000000000000..298ea423084dbcc1b61f991bcd82b8ae51bf0977
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
@@ -0,0 +1,52 @@
@@ -0,0 +1,51 @@
+package com.destroystokyo.paper.antixray;
+
+public final class DataBitsReader {
@ -891,21 +891,20 @@ index 0000000000000000000000000000000000000000..8b8c2a0156fd936ea422b64ca6372fa6
+ }
+
+ public int read() {
+ int value = (int) (current >>> bitInLongIndex) & mask;
+ bitInLongIndex += bitsPerObject;
+
+ if (bitInLongIndex > 63) {
+ if (bitInLongIndex + bitsPerObject > 64) {
+ bitInLongIndex = 0;
+ longInDataBitsIndex += 8;
+ init();
+ }
+
+ int value = (int) (current >>> bitInLongIndex) & mask;
+ bitInLongIndex += bitsPerObject;
+ return value;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
new file mode 100644
index 0000000000000000000000000000000000000000..5260882a319d5f897dd20e149d17077cb3f843ea
index 0000000000000000000000000000000000000000..333763936897befda5bb6c077944d2667f922799
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
@@ -0,0 +1,79 @@
@ -965,24 +964,24 @@ index 0000000000000000000000000000000000000000..5260882a319d5f897dd20e149d17077c
+ }
+
+ public void write(int value) {
+ current = current & ~(mask << bitInLongIndex) | (value & mask) << bitInLongIndex;
+ dirty = true;
+ bitInLongIndex += bitsPerObject;
+
+ if (bitInLongIndex > 63) {
+ if (bitInLongIndex + bitsPerObject > 64) {
+ finish();
+ bitInLongIndex = 0;
+ longInDataBitsIndex += 8;
+ init();
+ }
+
+ current = current & ~(mask << bitInLongIndex) | (value & mask) << bitInLongIndex;
+ dirty = true;
+ bitInLongIndex += bitsPerObject;
+ }
+
+ public void skip() {
+ bitInLongIndex += bitsPerObject;
+
+ if (bitInLongIndex > 63) {
+ if (bitInLongIndex > 64) {
+ finish();
+ bitInLongIndex = 0;
+ bitInLongIndex = bitsPerObject;
+ longInDataBitsIndex += 8;
+ init();
+ }