mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #47 - Singleplayer lag fixes
This commit is contained in:
@ -18,9 +18,12 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import java.util.zip.Inflater;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -556,6 +559,16 @@ public class PlatformRuntime {
|
||||
return new DeflaterOutputStream(os);
|
||||
}
|
||||
|
||||
public static int deflateFull(byte[] input, int inputOff, int inputLen, byte[] output, int outputOff,
|
||||
int outputLen) throws IOException {
|
||||
Deflater df = new Deflater();
|
||||
df.setInput(input, inputOff, inputLen);
|
||||
df.finish();
|
||||
int i = df.deflate(output, outputOff, outputLen);
|
||||
df.end();
|
||||
return i;
|
||||
}
|
||||
|
||||
public static OutputStream newGZIPOutputStream(OutputStream os) throws IOException {
|
||||
return new GZIPOutputStream(os);
|
||||
}
|
||||
@ -564,6 +577,21 @@ public class PlatformRuntime {
|
||||
return new InflaterInputStream(is);
|
||||
}
|
||||
|
||||
public static int inflateFull(byte[] input, int inputOff, int inputLen, byte[] output, int outputOff,
|
||||
int outputLen) throws IOException {
|
||||
Inflater df = new Inflater();
|
||||
int i;
|
||||
try {
|
||||
df.setInput(input, inputOff, inputLen);
|
||||
i = df.inflate(output, outputOff, outputLen);
|
||||
}catch(DataFormatException ex) {
|
||||
throw new IOException("Failed to inflate!", ex);
|
||||
}finally {
|
||||
df.end();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static InputStream newGZIPInputStream(InputStream is) throws IOException {
|
||||
return new GZIPInputStream(is);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import net.lax1dude.unsafememcpy.UnsafeMemcpy;
|
||||
import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
@ -18,7 +18,7 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class EaglerLWJGLByteBuffer implements ByteBuffer {
|
||||
public class EaglerLWJGLByteBuffer extends ByteBuffer {
|
||||
|
||||
final long address;
|
||||
final boolean original;
|
||||
|
@ -4,7 +4,7 @@ import net.lax1dude.unsafememcpy.UnsafeMemcpy;
|
||||
import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
@ -18,7 +18,7 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class EaglerLWJGLFloatBuffer implements FloatBuffer {
|
||||
public class EaglerLWJGLFloatBuffer extends FloatBuffer {
|
||||
|
||||
final long address;
|
||||
final boolean original;
|
||||
|
@ -4,7 +4,7 @@ import net.lax1dude.unsafememcpy.UnsafeMemcpy;
|
||||
import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
@ -18,7 +18,7 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class EaglerLWJGLIntBuffer implements IntBuffer {
|
||||
public class EaglerLWJGLIntBuffer extends IntBuffer {
|
||||
|
||||
final long address;
|
||||
final boolean original;
|
||||
|
@ -4,7 +4,7 @@ import net.lax1dude.unsafememcpy.UnsafeMemcpy;
|
||||
import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
@ -18,7 +18,7 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class EaglerLWJGLShortBuffer implements ShortBuffer {
|
||||
public class EaglerLWJGLShortBuffer extends ShortBuffer {
|
||||
|
||||
final long address;
|
||||
final boolean original;
|
||||
|
Reference in New Issue
Block a user