Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-08 04:20:06 +01:00
Revert "~1/3 faster history writing with small caching"
This reverts commit 836b7a9750
.
Dieser Commit ist enthalten in:
Ursprung
836b7a9750
Commit
bfd04e4155
@ -132,9 +132,6 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet {
|
|||||||
int lx;
|
int lx;
|
||||||
int ly;
|
int ly;
|
||||||
int lz;
|
int lz;
|
||||||
// 16*16*4
|
|
||||||
byte[] buff = new byte[1024];
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(OutputStream out, int x, int y, int z) throws IOException {
|
public void write(OutputStream out, int x, int y, int z) throws IOException {
|
||||||
@ -147,16 +144,13 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet {
|
|||||||
int x16 = (rx >> 8) & 0xF;
|
int x16 = (rx >> 8) & 0xF;
|
||||||
int z16 = (rz >> 8) & 0xF;
|
int z16 = (rz >> 8) & 0xF;
|
||||||
byte b4 = MathMan.pair16(x16, z16);
|
byte b4 = MathMan.pair16(x16, z16);
|
||||||
System.arraycopy(new byte[] {b1, b2, b3, b4}, 0, buff, index, 4);
|
out.write(b1);
|
||||||
index += 4;
|
out.write(b2);
|
||||||
if (index == 1024) {
|
out.write(b3);
|
||||||
out.write(buff);
|
out.write(b4);
|
||||||
buff = new byte[1024];
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final byte[] buffer = new byte[4];
|
byte[] buffer = new byte[4];
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int readX(FaweInputStream in) throws IOException {
|
public int readX(FaweInputStream in) throws IOException {
|
||||||
@ -176,29 +170,22 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
posDel = new FaweStreamPositionDelegate() {
|
posDel = new FaweStreamPositionDelegate() {
|
||||||
|
final byte[] buffer = new byte[5];
|
||||||
int lx;
|
int lx;
|
||||||
int ly;
|
int ly;
|
||||||
int lz;
|
int lz;
|
||||||
// 16*16*5
|
|
||||||
byte[] buff = new byte[1280];
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(OutputStream out, int x, int y, int z) throws IOException {
|
public void write(OutputStream stream, int x, int y, int z) throws IOException {
|
||||||
int rx = -lx + (lx = x);
|
int rx = -lx + (lx = x);
|
||||||
int ry = -ly + (ly = y);
|
int ry = -ly + (ly = y);
|
||||||
int rz = -lz + (lz = z);
|
int rz = -lz + (lz = z);
|
||||||
System.arraycopy(new byte[] {(byte) ((rx) & 0xff), (byte) (((rx) >> 8) & 0xff), (byte) ((rz) & 0xff),
|
stream.write((rx) & 0xff);
|
||||||
(byte) (((rz) >> 8) & 0xff), (byte) ry}, 0, buff, index, 5);
|
stream.write(((rx) >> 8) & 0xff);
|
||||||
index += 5;
|
stream.write((rz) & 0xff);
|
||||||
if (index == 1280) {
|
stream.write(((rz) >> 8) & 0xff);
|
||||||
out.write(buff);
|
stream.write((byte) ry);
|
||||||
buff = new byte[1280];
|
|
||||||
index = 0;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
final byte[] buffer = new byte[5];
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int readX(FaweInputStream is) throws IOException {
|
public int readX(FaweInputStream is) throws IOException {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren