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,22 +42,36 @@ public class ViewFrustum {
this.createRenderChunks(renderChunkFactory); 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) { protected void createRenderChunks(IRenderChunkFactory renderChunkFactory) {
int i = this.countChunksX * this.countChunksY * this.countChunksZ; final int totalRenderChunks = countChunksX * countChunksY * countChunksZ;
this.renderChunks = new RenderChunk[i];
int j = 0;
for (int k = 0; k < this.countChunksX; ++k) { int xChunkIndex = 0;
for (int l = 0; l < this.countChunksY; ++l) { int yChunkIndex = 0;
for (int i1 = 0; i1 < this.countChunksZ; ++i1) { int zChunkIndex = 0;
int j1 = (i1 * this.countChunksY + l) * this.countChunksX + k;
BlockPos blockpos = new BlockPos(k * 16, l * 16, i1 * 16); renderChunks = new RenderChunk[totalRenderChunks];
this.renderChunks[j1] = renderChunkFactory.makeRenderChunk(this.world, this.renderGlobal, blockpos,
j++); 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() { public void deleteGlResources() {
@ -86,7 +100,7 @@ public class ViewFrustum {
int k1 = this.func_178157_a(j, k, j1); int k1 = this.func_178157_a(j, k, j1);
for (int l1 = 0; l1 < this.countChunksY; ++l1) { 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]; RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
BlockPos blockpos = new BlockPos(i1, i2, k1); BlockPos blockpos = new BlockPos(i1, i2, k1);
if (!blockpos.equals(renderchunk.getPosition())) { if (!blockpos.equals(renderchunk.getPosition())) {
@ -98,70 +112,50 @@ public class ViewFrustum {
} }
private int func_178157_a(int parInt1, int parInt2, int parInt3) { private int func_178157_a(int base, int renderDistance, int chunkIndex) {
int i = parInt3 * 16; final int coordinate = chunkIndex << 4;
int j = i - parInt1 + parInt2 / 2; int offset = coordinate - base + (renderDistance >> 1);
if (j < 0) {
j -= parInt2 - 1; if (offset < 0)
offset -= renderDistance - 1;
return coordinate - offset / renderDistance * renderDistance;
} }
return i - j / parInt2 * parInt2; 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 x = chunkMinX; x <= chunkMaxX; ++x) {
final int normalizedX = (x % countChunksX + countChunksX) % countChunksX;
for (int y = chunkMinY; y <= chunkMaxY; ++y) {
final int normalizedY = (y % countChunksY + countChunksY) % countChunksY;
for (int z = chunkMinZ; z <= chunkMaxZ; ++z) {
final int normalizedZ = (z % countChunksZ + countChunksZ) % countChunksZ;
renderChunks[(normalizedZ * countChunksY + normalizedY) * countChunksX + normalizedX].setNeedsUpdate(true);
} }
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);
for (int k1 = i; k1 <= l; ++k1) {
int l1 = k1 % this.countChunksX;
if (l1 < 0) {
l1 += this.countChunksX;
}
for (int i2 = j; i2 <= i1; ++i2) {
int j2 = i2 % this.countChunksY;
if (j2 < 0) {
j2 += this.countChunksY;
}
for (int k2 = k; k2 <= j1; ++k2) {
int l2 = k2 % this.countChunksZ;
if (l2 < 0) {
l2 += this.countChunksZ;
}
int i3 = (l2 * this.countChunksY + j2) * this.countChunksX + l1;
RenderChunk renderchunk = this.renderChunks[i3];
renderchunk.setNeedsUpdate(true);
} }
} }
} }
} public RenderChunk getRenderChunk(final BlockPos blockPos) {
int x = blockPos.getX() >> 4;
final int y = blockPos.getY() >> 4;
int z = blockPos.getZ() >> 4;
protected RenderChunk getRenderChunk(BlockPos pos) { if (y >= 0 && y < countChunksY) {
int i = MathHelper.bucketInt(pos.getX(), 16); x = (x % countChunksX + countChunksX) % countChunksX;
int j = MathHelper.bucketInt(pos.getY(), 16); z = (z % countChunksZ + countChunksZ) % countChunksZ;
int k = MathHelper.bucketInt(pos.getZ(), 16);
if (j >= 0 && j < this.countChunksY) {
i = i % this.countChunksX;
if (i < 0) {
i += this.countChunksX;
}
k = k % this.countChunksZ; return renderChunks[(z * countChunksY + y) * countChunksX + x];
if (k < 0) { } else
k += this.countChunksZ;
}
int l = (k * this.countChunksY + j) * this.countChunksX + i;
return this.renderChunks[l];
} else {
return null; return null;
} }
}
} }

View File

@ -1,5 +1,6 @@
package net.minecraft.util; package net.minecraft.util;
import net.jafama.FastMath;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
@ -42,22 +43,22 @@ public class MathHelper {
* sin looked up in a table * sin looked up in a table
*/ */
public static float sin(float parFloat1) { 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 * cos looked up in the sin table with the appropriate offset
*/ */
public static float cos(float value) { 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) { 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) { public static float sqrt_double(double value) {
return (float) Math.sqrt(value); return (float) FastMath.sqrt(value);
} }
// silly thing from quake3 // silly thing from quake3
@ -76,8 +77,7 @@ public class MathHelper {
* argument * argument
*/ */
public static int floor_float(float value) { public static int floor_float(float value) {
int i = (int) value; return (int) FastMath.floor(value);
return value < (float) i ? i - 1 : i;
} }
/**+ /**+
@ -93,8 +93,7 @@ public class MathHelper {
* argument * argument
*/ */
public static int floor_double(double value) { public static int floor_double(double value) {
int i = (int) value; return (int) FastMath.floor(value);
return value < (double) i ? i - 1 : i;
} }
/**+ /**+
@ -110,7 +109,7 @@ public class MathHelper {
} }
public static float abs(float value) { 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) { public static int ceiling_float_int(float value) {
int i = (int) value; return (int) FastMath.ceil(value);
return value > (float) i ? i + 1 : i;
} }
public static int ceiling_double_int(double value) { public static int ceiling_double_int(double value) {
int i = (int) value; return (int) FastMath.ceil(value);
return value > (double) i ? i + 1 : i;
} }
/**+ /**+