1
0
Fork 0
This commit is contained in:
HoosierTransfer 2024-04-16 10:19:43 -04:00
parent 27ca7c5b40
commit ece80e88ac
16 changed files with 140573 additions and 207315 deletions

View File

@ -1 +0,0 @@
./bin/proguard.bat -injars eaglercraft-workspace.jar -outjars skibidi.jar -libraryjars "C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\jmods\java.base.jmod" -libraryjars "C:\Users\HoosierTransfer\Downloads\hoosiertransfer-mod-u24\teavm-jso-0.9.2.jar" -libraryjars "C:\Users\HoosierTransfer\Downloads\hoosiertransfer-mod-u24\teavm-jso-apis-0.9.2.jar" -libraryjars "C:\Users\HoosierTransfer\Downloads\hoosiertransfer-mod-u24\teavm-interop-0.9.2.jar" -libraryjars "C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\jmods\java.logging.jmod" -libraryjars "C:\Users\HoosierTransfer\Downloads\hoosiertransfer-mod-u24\jzlib-1.1.3.jar" -keep "class net.minecraft.client.main.Main { *; }" -keepnames "class *" -keepnames "enum *" -keepnames "interface *" -forceprocessing -dontshrink

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
readme.md Normal file
View File

@ -0,0 +1,3 @@
# HoosierTransfer's client
A fork of EaglercraftX that includes many performance improvements.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
/*
* Copyright 2012 Jeff Hain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.jafama;
public class DoubleWrapper {
public double value;
@Override
public String toString() {
return Double.toString(this.value);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
/*
* Copyright 2012 Jeff Hain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.jafama;
public class IntWrapper {
public int value;
@Override
public String toString() {
return Integer.toString(this.value);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -42,23 +42,37 @@ public class ViewFrustum {
this.createRenderChunks(renderChunkFactory);
}
/**
* @reason Improving the performance of this method by using a single loop instead of multiple nested ones and avoiding allocating in loop.
* Improving the performance of this method is beneficial as it reduces lag when loading renderer.
* For example, when loading in a world, changing the render distance, changing graphics quality, etc.
* @author Desoroxxx
*/
protected void createRenderChunks(IRenderChunkFactory renderChunkFactory) {
int i = this.countChunksX * this.countChunksY * this.countChunksZ;
this.renderChunks = new RenderChunk[i];
int j = 0;
final int totalRenderChunks = countChunksX * countChunksY * countChunksZ;
for (int k = 0; k < this.countChunksX; ++k) {
for (int l = 0; l < this.countChunksY; ++l) {
for (int i1 = 0; i1 < this.countChunksZ; ++i1) {
int j1 = (i1 * this.countChunksY + l) * this.countChunksX + k;
BlockPos blockpos = new BlockPos(k * 16, l * 16, i1 * 16);
this.renderChunks[j1] = renderChunkFactory.makeRenderChunk(this.world, this.renderGlobal, blockpos,
j++);
}
}
}
int xChunkIndex = 0;
int yChunkIndex = 0;
int zChunkIndex = 0;
}
renderChunks = new RenderChunk[totalRenderChunks];
for (int i = 0; i < totalRenderChunks; ++i) {
if (xChunkIndex == countChunksX) {
xChunkIndex = 0;
++yChunkIndex;
if (yChunkIndex == countChunksY) {
yChunkIndex = 0;
++zChunkIndex;
}
}
renderChunks[i] = renderChunkFactory.makeRenderChunk(world, renderGlobal, new BlockPos(xChunkIndex * 16, yChunkIndex * 16, zChunkIndex * 16), i);
renderChunks[i].setPosition(new BlockPos(xChunkIndex * 16, yChunkIndex * 16, zChunkIndex * 16));
++xChunkIndex;
}
}
public void deleteGlResources() {
for (int i = 0; i < this.renderChunks.length; ++i) {
@ -86,7 +100,7 @@ public class ViewFrustum {
int k1 = this.func_178157_a(j, k, j1);
for (int l1 = 0; l1 < this.countChunksY; ++l1) {
int i2 = l1 * 16;
int i2 = l1 << 4;
RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
BlockPos blockpos = new BlockPos(i1, i2, k1);
if (!blockpos.equals(renderchunk.getPosition())) {
@ -98,70 +112,50 @@ public class ViewFrustum {
}
private int func_178157_a(int parInt1, int parInt2, int parInt3) {
int i = parInt3 * 16;
int j = i - parInt1 + parInt2 / 2;
if (j < 0) {
j -= parInt2 - 1;
}
private int func_178157_a(int base, int renderDistance, int chunkIndex) {
final int coordinate = chunkIndex << 4;
int offset = coordinate - base + (renderDistance >> 1);
return i - j / parInt2 * parInt2;
}
if (offset < 0)
offset -= renderDistance - 1;
public void markBlocksForUpdate(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) {
int i = MathHelper.bucketInt(fromX, 16);
int j = MathHelper.bucketInt(fromY, 16);
int k = MathHelper.bucketInt(fromZ, 16);
int l = MathHelper.bucketInt(toX, 16);
int i1 = MathHelper.bucketInt(toY, 16);
int j1 = MathHelper.bucketInt(toZ, 16);
return coordinate - offset / renderDistance * renderDistance;
}
for (int k1 = i; k1 <= l; ++k1) {
int l1 = k1 % this.countChunksX;
if (l1 < 0) {
l1 += this.countChunksX;
}
public void markBlocksForUpdate(final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) {
final int chunkMinX = minX >> 4;
final int chunkMinY = minY >> 4;
final int chunkMinZ = minZ >> 4;
final int chunkMaxX = maxX >> 4;
final int chunkMaxY = maxY >> 4;
final int chunkMaxZ = maxZ >> 4;
for (int i2 = j; i2 <= i1; ++i2) {
int j2 = i2 % this.countChunksY;
if (j2 < 0) {
j2 += this.countChunksY;
}
for (int x = chunkMinX; x <= chunkMaxX; ++x) {
final int normalizedX = (x % countChunksX + countChunksX) % countChunksX;
for (int k2 = k; k2 <= j1; ++k2) {
int l2 = k2 % this.countChunksZ;
if (l2 < 0) {
l2 += this.countChunksZ;
}
for (int y = chunkMinY; y <= chunkMaxY; ++y) {
final int normalizedY = (y % countChunksY + countChunksY) % countChunksY;
int i3 = (l2 * this.countChunksY + j2) * this.countChunksX + l1;
RenderChunk renderchunk = this.renderChunks[i3];
renderchunk.setNeedsUpdate(true);
}
}
}
for (int z = chunkMinZ; z <= chunkMaxZ; ++z) {
final int normalizedZ = (z % countChunksZ + countChunksZ) % countChunksZ;
}
renderChunks[(normalizedZ * countChunksY + normalizedY) * countChunksX + normalizedX].setNeedsUpdate(true);
}
}
}
}
protected RenderChunk getRenderChunk(BlockPos pos) {
int i = MathHelper.bucketInt(pos.getX(), 16);
int j = MathHelper.bucketInt(pos.getY(), 16);
int k = MathHelper.bucketInt(pos.getZ(), 16);
if (j >= 0 && j < this.countChunksY) {
i = i % this.countChunksX;
if (i < 0) {
i += this.countChunksX;
}
public RenderChunk getRenderChunk(final BlockPos blockPos) {
int x = blockPos.getX() >> 4;
final int y = blockPos.getY() >> 4;
int z = blockPos.getZ() >> 4;
k = k % this.countChunksZ;
if (k < 0) {
k += this.countChunksZ;
}
if (y >= 0 && y < countChunksY) {
x = (x % countChunksX + countChunksX) % countChunksX;
z = (z % countChunksZ + countChunksZ) % countChunksZ;
int l = (k * this.countChunksY + j) * this.countChunksX + i;
return this.renderChunks[l];
} else {
return null;
}
}
return renderChunks[(z * countChunksY + y) * countChunksX + x];
} else
return null;
}
}

View File

@ -1,5 +1,6 @@
package net.minecraft.util;
import net.jafama.FastMath;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
@ -42,22 +43,22 @@ public class MathHelper {
* sin looked up in a table
*/
public static float sin(float parFloat1) {
return SIN_TABLE[(int)(parFloat1 * 651.8986F) & 4095];
return (float) FastMath.sinQuick(parFloat1);
}
/**+
* cos looked up in the sin table with the appropriate offset
*/
public static float cos(float value) {
return SIN_TABLE[(int)((value + ((float) Math.PI / 2F)) * 651.8986F) & 4095];
return (float) FastMath.cosQuick(value);
}
public static float sqrt_float(float value) {
return (float) Math.sqrt((double) value);
return (float) FastMath.sqrtQuick(value);
}
public static float sqrt_double(double value) {
return (float) Math.sqrt(value);
return (float) FastMath.sqrt(value);
}
// silly thing from quake3
@ -76,8 +77,7 @@ public class MathHelper {
* argument
*/
public static int floor_float(float value) {
int i = (int) value;
return value < (float) i ? i - 1 : i;
return (int) FastMath.floor(value);
}
/**+
@ -93,8 +93,7 @@ public class MathHelper {
* argument
*/
public static int floor_double(double value) {
int i = (int) value;
return value < (double) i ? i - 1 : i;
return (int) FastMath.floor(value);
}
/**+
@ -110,7 +109,7 @@ public class MathHelper {
}
public static float abs(float value) {
return value >= 0.0F ? value : -value;
return FastMath.abs(value);
}
/**+
@ -121,13 +120,11 @@ public class MathHelper {
}
public static int ceiling_float_int(float value) {
int i = (int) value;
return value > (float) i ? i + 1 : i;
return (int) FastMath.ceil(value);
}
public static int ceiling_double_int(double value) {
int i = (int) value;
return value > (double) i ? i + 1 : i;
return (int) FastMath.ceil(value);
}
/**+