3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Remove us.myles.ViaVersion.chunks, I must have looked past this but it's not used.

Dieser Commit ist enthalten in:
Myles 2016-03-07 16:34:22 +00:00
Ursprung 6b5c166a22
Commit b3de4de0cd
4 geänderte Dateien mit 0 neuen und 104 gelöschten Zeilen

Datei anzeigen

@ -1,51 +0,0 @@
package us.myles.ViaVersion.chunks;
import lombok.Getter;
@Getter
public class ByteWriter {
private final byte[] output;
private int byteIndex;
private int bitIndex;
public ByteWriter(int size) {
this.output = new byte[size];
this.byteIndex = 0;
this.bitIndex = 0;
}
public void writeFullByte(int b){
writeByte(b, 8);
}
public void writeByte(int b, int length) {
byte current = getCurrentByte();
byte byteB = (byte)(int)((b) & 0xff);
System.out.println("Input: " + byteB);
System.out.println(Integer.toBinaryString(byteB));
int space = (8 - bitIndex);
int written = space > length ? length : space;
System.out.println("Written is " + written);
output[byteIndex] = (byte) (current | (extractRange(byteB, 0, written) >> (bitIndex - 1)));
System.out.println("output value: " + output[byteIndex]);
this.bitIndex += length;
if(this.bitIndex >= 8) {
this.byteIndex += 1;
this.bitIndex = bitIndex - 8;
// write remaining into this
System.out.println("Writing from " + written + " to " + (written + bitIndex));
System.out.println("Value: " + extractRange(byteB, written, written + bitIndex));
output[byteIndex] = (byte) (extractRange(byteB, written, written + bitIndex) << written);
}
}
private byte extractRange(int in, int begin, int end){
return (byte) ((in >> begin) & ((1 << (end - begin)) - 1));
}
public byte getCurrentByte() {
if (byteIndex == output.length) throw new RuntimeException("ByteWriter overflow!");
return output[byteIndex];
}
}

Datei anzeigen

@ -1,14 +0,0 @@
package us.myles.ViaVersion.chunks;
import lombok.RequiredArgsConstructor;
import java.util.BitSet;
@RequiredArgsConstructor
public class MagicBitSet extends BitSet {
private final int initLength;
public int getTrueLength() {
return length() == 0 ? initLength : length();
}
}

Datei anzeigen

@ -1,14 +0,0 @@
package us.myles.ViaVersion.chunks;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class PacketChunk {
private PacketChunkData[] chunkData;
private byte[] biomeData;
}

Datei anzeigen

@ -1,25 +0,0 @@
package us.myles.ViaVersion.chunks;
public class PacketChunkData {
private short[] blocks = new short[4096];
private byte[] blockLight = new byte[2048];
private byte[] skyLight;
public PacketChunkData(boolean isSkyLightData) {
if(isSkyLightData){
skyLight = new byte[2048];
}
}
public short[] getBlocks() {
return this.blocks;
}
public byte[] getBlockLight() {
return this.blockLight;
}
public byte[] getSkyLight() {
return this.skyLight;
}
}