mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fixed dev time compilation using J9+ producing incorrect bytecode.
This commit is contained in:
1 parent
aa5b9d12ea
commit
5a552b9f8d
10 files changed
+35
-32
No files matched your search
@@ -39,6 +39,7 @@ import static org.lwjgl.opengl.GL20.glVertexAttribPointer;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -431,7 +432,7 @@ public class ForgeHooksClient
|
||||
VertexFormatElement attr = format.getElements().get(element);
|
||||
int count = attr.getElementCount();
|
||||
int constant = attr.getType().getGlConstant();
|
||||
buffer.position(format.getOffset(element));
|
||||
((Buffer)buffer).position(format.getOffset(element));
|
||||
switch(attrType)
|
||||
{
|
||||
case POSITION:
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
@@ -71,7 +72,7 @@ public interface IForgeVertexBuilder
|
||||
IntBuffer intbuffer = bytebuffer.asIntBuffer();
|
||||
|
||||
for(int v = 0; v < vertexCount; ++v) {
|
||||
intbuffer.clear();
|
||||
((Buffer)intbuffer).clear();
|
||||
intbuffer.put(aint, v * 8, 8);
|
||||
float f = bytebuffer.getFloat(0);
|
||||
float f1 = bytebuffer.getFloat(4);
|
||||
@@ -106,7 +107,7 @@ public interface IForgeVertexBuilder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
default int applyBakedLighting(int lightmapCoord, ByteBuffer data) {
|
||||
int bl = LightTexture.getLightBlock(lightmapCoord);
|
||||
int sl = LightTexture.getLightSky(lightmapCoord);
|
||||
@@ -117,7 +118,7 @@ public interface IForgeVertexBuilder
|
||||
sl = Math.max(sl, slBaked);
|
||||
return LightTexture.packLight(bl, sl);
|
||||
}
|
||||
|
||||
|
||||
default void applyBakedNormals(Vector3f generated, ByteBuffer data, Matrix3f normalTransform) {
|
||||
byte nx = data.get(28);
|
||||
byte ny = data.get(29);
|
||||
|
||||
@@ -22,6 +22,7 @@ package net.minecraftforge.client.model.b3d;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.channels.FileChannel;
|
||||
@@ -41,7 +42,6 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.util.math.Vec2f;
|
||||
import net.minecraftforge.versions.forge.ForgeVersion;
|
||||
import net.minecraftforge.common.model.TransformationHelper;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
@@ -100,11 +100,11 @@ public class B3DModel
|
||||
int l = ByteBuffer.wrap(tmp).order(ByteOrder.LITTLE_ENDIAN).getInt();
|
||||
if(l < 0 || l + 8 < 0) throw new IOException("File is too large");
|
||||
buf = ByteBuffer.allocate(l + 8).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.clear();
|
||||
((Buffer)buf).clear();
|
||||
buf.put(tag);
|
||||
buf.put(tmp);
|
||||
buf.put(IOUtils.toByteArray(in, l));
|
||||
buf.flip();
|
||||
((Buffer)buf).flip();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ public class B3DModel
|
||||
while(buf.get() != 0);
|
||||
int end = buf.position();
|
||||
byte[] tmp = new byte[end - start - 1];
|
||||
buf.position(start);
|
||||
((Buffer)buf).position(start);
|
||||
buf.get(tmp);
|
||||
buf.get();
|
||||
return new String(tmp, "UTF8");
|
||||
@@ -204,12 +204,12 @@ public class B3DModel
|
||||
private void pushLimit()
|
||||
{
|
||||
limitStack.push(buf.limit());
|
||||
buf.limit(buf.position() + length);
|
||||
((Buffer)buf).limit(buf.position() + length);
|
||||
}
|
||||
|
||||
private void popLimit()
|
||||
{
|
||||
buf.limit(limitStack.pop());
|
||||
((Buffer)buf).limit(limitStack.pop());
|
||||
}
|
||||
|
||||
private B3DModel bb3d() throws IOException
|
||||
@@ -501,7 +501,7 @@ public class B3DModel
|
||||
|
||||
private void skip()
|
||||
{
|
||||
buf.position(buf.position() + length);
|
||||
((Buffer)buf).position(buf.position() + length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user