Updated ForgeDev MCP Mapping Version (#6532)

This commit is contained in:
DaemonUmbra authored and GitHub committed 2020-02-25 19:45:14 -08:00
1 parent aca45340bf
commit 2ce4f5ece5
83 files changed
+392 -379

No files matched your search

@@ -141,18 +141,18 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
float v1 = sectZ1 * sectPx;
// Bottom
buffer.func_225582_a_(sectX0, 0, sectZ0).func_225583_a_(u0, v0).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, 0, sectZ0).func_225583_a_(u1, v0).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, 0, sectZ1).func_225583_a_(u1, v1).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
buffer.func_225582_a_(sectX0, 0, sectZ1).func_225583_a_(u0, v1).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
buffer.pos(sectX0, 0, sectZ0).tex(u0, v0).color(bCol, bCol, bCol, ALPHA).endVertex();
buffer.pos(sectX1, 0, sectZ0).tex(u1, v0).color(bCol, bCol, bCol, ALPHA).endVertex();
buffer.pos(sectX1, 0, sectZ1).tex(u1, v1).color(bCol, bCol, bCol, ALPHA).endVertex();
buffer.pos(sectX0, 0, sectZ1).tex(u0, v1).color(bCol, bCol, bCol, ALPHA).endVertex();
if (fancy)
{
// Top
buffer.func_225582_a_(sectX0, HEIGHT, sectZ0).func_225583_a_(u0, v0).func_227885_a_(1, 1, 1, ALPHA).endVertex();
buffer.func_225582_a_(sectX0, HEIGHT, sectZ1).func_225583_a_(u0, v1).func_227885_a_(1, 1, 1, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, HEIGHT, sectZ1).func_225583_a_(u1, v1).func_227885_a_(1, 1, 1, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, HEIGHT, sectZ0).func_225583_a_(u1, v0).func_227885_a_(1, 1, 1, ALPHA).endVertex();
buffer.pos(sectX0, HEIGHT, sectZ0).tex(u0, v0).color(1, 1, 1, ALPHA).endVertex();
buffer.pos(sectX0, HEIGHT, sectZ1).tex(u0, v1).color(1, 1, 1, ALPHA).endVertex();
buffer.pos(sectX1, HEIGHT, sectZ1).tex(u1, v1).color(1, 1, 1, ALPHA).endVertex();
buffer.pos(sectX1, HEIGHT, sectZ0).tex(u1, v0).color(1, 1, 1, ALPHA).endVertex();
float slice;
float sliceCoord0;
@@ -167,10 +167,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (slice > -CULL_DIST)
{
slice += INSET;
buffer.func_225582_a_(slice, 0, sectZ1).func_225583_a_(sliceCoord0, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, HEIGHT, sectZ1).func_225583_a_(sliceCoord1, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, HEIGHT, sectZ0).func_225583_a_(sliceCoord1, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, 0, sectZ0).func_225583_a_(sliceCoord0, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
slice -= INSET;
}
@@ -179,10 +179,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (slice <= CULL_DIST)
{
slice -= INSET;
buffer.func_225582_a_(slice, 0, sectZ0).func_225583_a_(sliceCoord0, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, HEIGHT, sectZ0).func_225583_a_(sliceCoord1, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, HEIGHT, sectZ1).func_225583_a_(sliceCoord1, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.func_225582_a_(slice, 0, sectZ1).func_225583_a_(sliceCoord0, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
buffer.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
slice += INSET;
}
}
@@ -196,10 +196,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (slice > -CULL_DIST)
{
slice += INSET;
buffer.func_225582_a_(sectX0, 0, slice).func_225583_a_(u0, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX0, HEIGHT, slice).func_225583_a_(u0, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, HEIGHT, slice).func_225583_a_(u1, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, 0, slice).func_225583_a_(u1, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
slice -= INSET;
}
@@ -208,10 +208,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (slice <= CULL_DIST)
{
slice -= INSET;
buffer.func_225582_a_(sectX1, 0, slice).func_225583_a_(u1, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX1, HEIGHT, slice).func_225583_a_(u1, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX0, HEIGHT, slice).func_225583_a_(u0, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.func_225582_a_(sectX0, 0, slice).func_225583_a_(u0, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
buffer.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
slice += INSET;
}
}
@@ -290,12 +290,12 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
double totalOffset = cloudTicks + partialTicks;
double x = entity.prevPosX + (entity.func_226277_ct_() - entity.prevPosX) * partialTicks
double x = entity.prevPosX + (entity.getPosX() - entity.prevPosX) * partialTicks
+ totalOffset * 0.03;
double y = mc.world.dimension.getCloudHeight()
- (entity.lastTickPosY + (entity.func_226278_cu_() - entity.lastTickPosY) * partialTicks)
- (entity.lastTickPosY + (entity.getPosY() - entity.lastTickPosY) * partialTicks)
+ 0.33;
double z = entity.prevPosZ + (entity.func_226281_cx_() - entity.prevPosZ) * partialTicks;
double z = entity.prevPosZ + (entity.getPosZ() - entity.prevPosZ) * partialTicks;
int scale = getScale();
@@ -388,7 +388,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
VertexBuffer.unbindBuffer(); // Unbind buffer and disable pointers.
buffer.limit(0);
for (int i = 0; i < FORMAT.func_227894_c_().size(); i++)
for (int i = 0; i < FORMAT.getElements().size(); i++)
FORMAT.getElements().get(i).getUsage().postDraw(FORMAT, i, FORMAT.getSize(), buffer);
buffer.position(0);
@@ -454,4 +454,4 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
}
}
*/
*/
@@ -286,7 +286,7 @@ public class ForgeHooksClient
for (int z = -distance; z <= distance; ++z)
{
BlockPos pos = center.add(x, 0, z);
Biome biome = world.func_225526_b_(pos.getX(), pos.getY(), pos.getZ());
Biome biome = world.getNoiseBiome(pos.getX(), pos.getY(), pos.getZ());
int colour = 0xFFFFFF; // TODO: biome.getSkyColorByTemp(biome.getTemperature(pos));
r += (colour & 0xFF0000) >> 16;
g += (colour & 0x00FF00) >> 8;
@@ -388,7 +388,7 @@ public class ForgeHooksClient
private static final net.minecraft.client.renderer.Matrix4f flipX;
private static final net.minecraft.client.renderer.Matrix3f flipXNormal;
static {
flipX = Matrix4f.func_226593_a_(-1,1,1);
flipX = Matrix4f.makeScale(-1,1,1);
flipXNormal = new net.minecraft.client.renderer.Matrix3f(flipX);
}
@@ -398,20 +398,20 @@ public class ForgeHooksClient
model = model.handlePerspective(cameraTransformType, stack);
// If the stack is not empty, the code has added a matrix for us to use.
if (!stack.func_227867_d_())
if (!stack.clear())
{
// Apply the transformation to the real matrix stack, flipping for left hand
net.minecraft.client.renderer.Matrix4f tMat = stack.func_227866_c_().func_227870_a_();
net.minecraft.client.renderer.Matrix3f nMat = stack.func_227866_c_().func_227872_b_();
net.minecraft.client.renderer.Matrix4f tMat = stack.getLast().getMatrix();
net.minecraft.client.renderer.Matrix3f nMat = stack.getLast().getNormal();
if (leftHandHackery)
{
tMat.multiplyBackward(flipX);
tMat.func_226595_a_(flipX);
tMat.mul(flipX);
nMat.multiplyBackward(flipXNormal);
nMat.func_226118_b_(flipXNormal);
nMat.mul(flipXNormal);
}
matrixStack.func_227866_c_().func_227870_a_().func_226595_a_(tMat);
matrixStack.func_227866_c_().func_227872_b_().func_226118_b_(nMat);
matrixStack.getLast().getMatrix().mul(tMat);
matrixStack.getLast().getNormal().mul(nMat);
}
return model;
}
@@ -420,7 +420,7 @@ public class ForgeHooksClient
public static void preDraw(Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
{
VertexFormatElement attr = format.func_227894_c_().get(element);
VertexFormatElement attr = format.getElements().get(element);
int count = attr.getElementCount();
int constant = attr.getType().getGlConstant();
buffer.position(format.getOffset(element));
@@ -461,7 +461,7 @@ public class ForgeHooksClient
public static void postDraw(Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
{
VertexFormatElement attr = format.func_227894_c_().get(element);
VertexFormatElement attr = format.getElements().get(element);
switch(attrType)
{
case POSITION:
@@ -490,7 +490,7 @@ public class ForgeHooksClient
public static int getColorIndex(VertexFormat fmt)
{
ImmutableList<VertexFormatElement> elements = fmt.func_227894_c_();
ImmutableList<VertexFormatElement> elements = fmt.getElements();
for(int i=0;i<elements.size();i++)
{
if (elements.get(i).getUsage() == Usage.COLOR)
@@ -527,9 +527,9 @@ public class ForgeHooksClient
{
ResourceLocation overlayTexture = fluidStateIn.getFluid().getAttributes().getOverlayTexture();
return new TextureAtlasSprite[] {
Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getStillTexture(world, pos)),
Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getFlowingTexture(world, pos)),
overlayTexture == null ? null : Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(overlayTexture),
Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getStillTexture(world, pos)),
Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getFlowingTexture(world, pos)),
overlayTexture == null ? null : Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(overlayTexture),
};
}
@@ -566,7 +566,7 @@ public class ForgeHooksClient
v1.sub(t1);
v2.sub(t2);
v2.cross(v1);
v2.func_229194_d_();
v2.normalize();
int x = ((byte) Math.round(v2.getX() * 127)) & 0xFF;
int y = ((byte) Math.round(v2.getY() * 127)) & 0xFF;
@@ -701,7 +701,7 @@ public class ForgeHooksClient
public static boolean onGuiMouseScrollPre(MouseHelper mouseHelper, Screen guiScreen, double scrollDelta)
{
MainWindow mainWindow = guiScreen.getMinecraft().func_228018_at_();
MainWindow mainWindow = guiScreen.getMinecraft().getMainWindow();
double mouseX = mouseHelper.getMouseX() * (double) mainWindow.getScaledWidth() / (double) mainWindow.getWidth();
double mouseY = mouseHelper.getMouseY() * (double) mainWindow.getScaledHeight() / (double) mainWindow.getHeight();
Event event = new GuiScreenEvent.MouseScrollEvent.Pre(guiScreen, mouseX, mouseY, scrollDelta);
@@ -710,7 +710,7 @@ public class ForgeHooksClient
public static boolean onGuiMouseScrollPost(MouseHelper mouseHelper, Screen guiScreen, double scrollDelta)
{
MainWindow mainWindow = guiScreen.getMinecraft().func_228018_at_();
MainWindow mainWindow = guiScreen.getMinecraft().getMainWindow();
double mouseX = mouseHelper.getMouseX() * (double) mainWindow.getScaledWidth() / (double) mainWindow.getWidth();
double mouseY = mouseHelper.getMouseY() * (double) mainWindow.getScaledHeight() / (double) mainWindow.getHeight();
Event event = new GuiScreenEvent.MouseScrollEvent.Post(guiScreen, mouseX, mouseY, scrollDelta);
@@ -36,7 +36,7 @@ public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
public PlayerSPPushOutOfBlocksEvent(PlayerEntity player)
{
super(player);
this.minY = player.func_226278_cu_() + 0.5D;
this.minY = player.getPosY() + 0.5D;
}
public void setMinY(double value) {
@@ -35,6 +35,6 @@ public interface IForgeModelTransform
*/
default TransformationMatrix getPartTransformation(Object part)
{
return TransformationMatrix.func_227983_a_();
return TransformationMatrix.identity();
}
}
@@ -36,22 +36,22 @@ public interface IForgeTransformationMatrix
default boolean isIdentity()
{
return getTransformaion().equals(TransformationMatrix.func_227983_a_());
return getTransformaion().equals(TransformationMatrix.identity());
}
default void push(MatrixStack stack)
{
stack.func_227860_a_();
stack.push();
Vector3f trans = getTransformaion().getTranslation();
stack.func_227861_a_(trans.getX(), trans.getY(), trans.getZ());
stack.translate(trans.getX(), trans.getY(), trans.getZ());
stack.func_227863_a_(getTransformaion().func_227989_d_());
stack.rotate(getTransformaion().getRotationLeft());
Vector3f scale = getTransformaion().getScale();
stack.func_227862_a_(scale.getX(), scale.getY(), scale.getZ());
stack.scale(scale.getX(), scale.getY(), scale.getZ());
stack.func_227863_a_(getTransformaion().getRightRot());
stack.rotate(getTransformaion().getRightRot());
}
@@ -59,33 +59,33 @@ public interface IForgeTransformationMatrix
{
if (getTransformaion().isIdentity()) return other;
if (other.isIdentity()) return getTransformaion();
Matrix4f m = getTransformaion().func_227988_c_();
m.func_226595_a_(other.func_227988_c_());
Matrix4f m = getTransformaion().getMatrix();
m.mul(other.getMatrix());
return new TransformationMatrix(m);
}
default TransformationMatrix inverse()
{
if (isIdentity()) return getTransformaion();
Matrix4f m = getTransformaion().func_227988_c_().func_226601_d_();
m.func_226600_c_();
Matrix4f m = getTransformaion().getMatrix().copy();
m.invert();
return new TransformationMatrix(m);
}
default void transformPosition(Vector4f position)
{
position.func_229372_a_(getTransformaion().func_227988_c_());
position.transform(getTransformaion().getMatrix());
}
default void transformNormal(Vector3f normal)
{
normal.func_229188_a_(getTransformaion().getNormalMatrix());
normal.func_229194_d_();
normal.transform(getTransformaion().getNormalMatrix());
normal.normalize();
}
default Direction rotateTransform(Direction facing)
{
return Direction.func_229385_a_(getTransformaion().func_227988_c_(), facing);
return Direction.rotateFace(getTransformaion().getMatrix(), facing);
}
/**
@@ -94,14 +94,14 @@ public interface IForgeTransformationMatrix
default TransformationMatrix blockCenterToCorner()
{
TransformationMatrix transform = getTransformaion();
if (transform.isIdentity()) return TransformationMatrix.func_227983_a_();
if (transform.isIdentity()) return TransformationMatrix.identity();
Matrix4f ret = transform.func_227988_c_();
Matrix4f tmp = Matrix4f.func_226599_b_(.5f, .5f, .5f);
Matrix4f ret = transform.getMatrix();
Matrix4f tmp = Matrix4f.makeTranslate(.5f, .5f, .5f);
ret.multiplyBackward(tmp);
tmp.func_226591_a_();
tmp.setIdentity();
tmp.setTranslation(-.5f, -.5f, -.5f);
ret.func_226595_a_(tmp);
ret.mul(tmp);
return new TransformationMatrix(ret);
}
@@ -111,14 +111,14 @@ public interface IForgeTransformationMatrix
default TransformationMatrix blockCornerToCenter()
{
TransformationMatrix transform = getTransformaion();
if (transform.isIdentity()) return TransformationMatrix.func_227983_a_();
if (transform.isIdentity()) return TransformationMatrix.identity();
Matrix4f ret = transform.func_227988_c_();
Matrix4f tmp = Matrix4f.func_226599_b_(-.5f, -.5f, -.5f);
Matrix4f ret = transform.getMatrix();
Matrix4f tmp = Matrix4f.makeTranslate(-.5f, -.5f, -.5f);
ret.multiplyBackward(tmp);
tmp.func_226591_a_();
tmp.setIdentity();
tmp.setTranslation(.5f, .5f, .5f);
ret.func_226595_a_(tmp);
ret.mul(tmp);
return new TransformationMatrix(ret);
}
@@ -43,7 +43,7 @@ public interface IForgeVertexBuilder
// Copy of func_227889_a_, but enables tinting
default void addVertexData(MatrixStack.Entry matrixStack, BakedQuad bakedQuad, float red, float green, float blue, int lightmapCoord, int overlayColor, boolean readExistingColor) {
getVertexBuilder().func_227890_a_(matrixStack, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
getVertexBuilder().addQuad(matrixStack, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
}
// Copy of func_227889_a_ with alpha support
@@ -56,13 +56,13 @@ public interface IForgeVertexBuilder
addVertexData(matrixEntry, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
}
// Copy of func_227890_a_ with alpha support
// Copy of addQuad with alpha support
default void addVertexData(MatrixStack.Entry matrixEntry, BakedQuad bakedQuad, float[] baseBrightness, float red, float green, float blue, float alpha, int[] lightmapCoords, int overlayCoords, boolean readExistingColor) {
int[] aint = bakedQuad.getVertexData();
Vec3i faceNormal = bakedQuad.getFace().getDirectionVec();
Vector3f normal = new Vector3f((float)faceNormal.getX(), (float)faceNormal.getY(), (float)faceNormal.getZ());
Matrix4f matrix4f = matrixEntry.func_227870_a_();
normal.func_229188_a_(matrixEntry.func_227872_b_());
Matrix4f matrix4f = matrixEntry.getMatrix();
normal.transform(matrixEntry.getNormal());
int intSize = DefaultVertexFormats.BLOCK.getIntegerSize();
int vertexCount = aint.length / intSize;
@@ -100,22 +100,22 @@ public interface IForgeVertexBuilder
float f9 = bytebuffer.getFloat(16);
float f10 = bytebuffer.getFloat(20);
Vector4f pos = new Vector4f(f, f1, f2, 1.0F);
pos.func_229372_a_(matrix4f);
applyBakedNormals(normal, bytebuffer, matrixEntry.func_227872_b_());
((IVertexBuilder)this).func_225588_a_(pos.getX(), pos.getY(), pos.getZ(), cr, cg, cb, ca, f9, f10, overlayCoords, lightmapCoord, normal.getX(), normal.getY(), normal.getZ());
pos.transform(matrix4f);
applyBakedNormals(normal, bytebuffer, matrixEntry.getNormal());
((IVertexBuilder)this).addVertex(pos.getX(), pos.getY(), pos.getZ(), cr, cg, cb, ca, f9, f10, overlayCoords, lightmapCoord, normal.getX(), normal.getY(), normal.getZ());
}
}
}
default int applyBakedLighting(int lightmapCoord, ByteBuffer data) {
int bl = LightTexture.func_228450_a_(lightmapCoord);
int sl = LightTexture.func_228454_b_(lightmapCoord);
int bl = LightTexture.getLightBlock(lightmapCoord);
int sl = LightTexture.getLightSky(lightmapCoord);
int offset = LightUtil.getLightOffset(0) * 4; // int offset for vertex 0 * 4 bytes per int
int blBaked = Short.toUnsignedInt(data.getShort(offset)) >> 4;
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2)) >> 4;
bl = Math.max(bl, blBaked);
sl = Math.max(sl, slBaked);
return LightTexture.func_228451_a_(bl, sl);
return LightTexture.packLight(bl, sl);
}
default void applyBakedNormals(Vector3f generated, ByteBuffer data, Matrix3f normalTransform) {
@@ -124,7 +124,7 @@ public interface IForgeVertexBuilder
byte nz = data.get(30);
if (nx != 0 || ny != 0 || nz != 0) {
generated.set(nx / 127f, ny / 127f, nz / 127f);
generated.func_229188_a_(normalTransform);
generated.transform(normalTransform);
}
}
}
@@ -107,9 +107,9 @@ public class ForgeIngameGui extends IngameGui
@Override
public void renderGameOverlay(float partialTicks)
{
this.scaledWidth = this.mc.func_228018_at_().getScaledWidth();
this.scaledHeight = this.mc.func_228018_at_().getScaledHeight();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.func_228018_at_());
this.scaledWidth = this.mc.getMainWindow().getScaledWidth();
this.scaledHeight = this.mc.getMainWindow().getScaledHeight();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.getMainWindow());
renderHealthMount = mc.player.getRidingEntity() instanceof LivingEntity;
renderFood = mc.player.getRidingEntity() == null;
renderJumpBar = mc.player.isRidingHorse();
@@ -845,14 +845,14 @@ public class ForgeIngameGui extends IngameGui
public void update()
{
Entity entity = this.mc.getRenderViewEntity();
this.rayTraceBlock = entity.func_213324_a(rayTraceDistance, 0.0F, false);
this.rayTraceFluid = entity.func_213324_a(rayTraceDistance, 0.0F, true);
this.rayTraceBlock = entity.pick(rayTraceDistance, 0.0F, false);
this.rayTraceFluid = entity.pick(rayTraceDistance, 0.0F, true);
}
@Override protected void func_230024_c_(){}
@Override protected void func_230025_d_(){}
@Override protected void renderDebugInfoLeft(){}
@Override protected void renderDebugInfoRight(){}
private List<String> getLeft()
{
List<String> ret = this.call();
List<String> ret = this.getDebugInfoLeft();
ret.add("");
ret.add("Debug: Pie [shift]: " + (this.mc.gameSettings.showDebugProfilerChart ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.gameSettings.showLagometer ? "visible" : "hidden"));
ret.add("For help: press F3 + Q");
@@ -189,9 +189,9 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
Tessellator tess = Tessellator.getInstance();
BufferBuilder worldr = tess.getBuffer();
double scale = client.func_228018_at_().getGuiScaleFactor();
double scale = client.getMainWindow().getGuiScaleFactor();
GL11.glEnable(GL11.GL_SCISSOR_TEST);
GL11.glScissor((int)(left * scale), (int)(client.func_228018_at_().getFramebufferHeight() - (bottom * scale)),
GL11.glScissor((int)(left * scale), (int)(client.getMainWindow().getFramebufferHeight() - (bottom * scale)),
(int)(width * scale), (int)(height * scale));
if (this.client.world != null)
@@ -206,10 +206,10 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
final float texScale = 32.0F;
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.func_225582_a_(this.left, this.bottom, 0.0D).func_225583_a_(this.left / texScale, (this.bottom + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.func_225582_a_(this.right, this.bottom, 0.0D).func_225583_a_(this.right / texScale, (this.bottom + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.func_225582_a_(this.right, this.top, 0.0D).func_225583_a_(this.right / texScale, (this.top + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.func_225582_a_(this.left, this.top, 0.0D).func_225583_a_(this.left / texScale, (this.top + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.left, this.bottom, 0.0D).tex(this.left / texScale, (this.bottom + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.bottom, 0.0D).tex(this.right / texScale, (this.bottom + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.top, 0.0D).tex(this.right / texScale, (this.top + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.left, this.top, 0.0D).tex(this.left / texScale, (this.top + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
tess.draw();
}
@@ -231,22 +231,22 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
RenderSystem.disableTexture();
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.func_225582_a_(barLeft, this.bottom, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth, this.bottom, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth, this.top, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.func_225582_a_(barLeft, this.top, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(barLeft, this.bottom, 0.0D).tex(0.0F, 1.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(barLeft + barWidth, this.bottom, 0.0D).tex(1.0F, 1.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(barLeft + barWidth, this.top, 0.0D).tex(1.0F, 0.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(barLeft, this.top, 0.0D).tex(0.0F, 0.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
tess.draw();
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.func_225582_a_(barLeft, barTop + barHeight, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth, barTop + barHeight, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth, barTop, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.func_225582_a_(barLeft, barTop, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(barLeft, barTop + barHeight, 0.0D).tex(0.0F, 1.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(barLeft + barWidth, barTop + barHeight, 0.0D).tex(1.0F, 1.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(barLeft + barWidth, barTop, 0.0D).tex(1.0F, 0.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(barLeft, barTop, 0.0D).tex(0.0F, 0.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
tess.draw();
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.func_225582_a_(barLeft, barTop + barHeight - 1, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth - 1, barTop + barHeight - 1, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.func_225582_a_(barLeft + barWidth - 1, barTop, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.func_225582_a_(barLeft, barTop, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(barLeft, barTop + barHeight - 1, 0.0D).tex(0.0F, 1.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(barLeft + barWidth - 1, barTop + barHeight - 1, 0.0D).tex(1.0F, 1.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(barLeft + barWidth - 1, barTop, 0.0D).tex(1.0F, 0.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(barLeft, barTop, 0.0D).tex(0.0F, 0.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
tess.draw();
}
@@ -101,7 +101,7 @@ public class BlockModelConfiguration implements IModelConfiguration
@Override
public Material resolveTexture(String name)
{
return owner.func_228816_c_(name);
return owner.resolveTextureName(name);
}
@Override
@@ -133,7 +133,7 @@ public class BlockModelConfiguration implements IModelConfiguration
IModelTransform state = getCustomModelState();
return state != null
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.func_225615_b_())
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.getRotation())
: new SimpleModelTransform(PerspectiveMapWrapper.getTransforms(getCameraTransforms()));
}
@@ -180,16 +180,16 @@ public class CompositeModel implements IDynamicBakedModel
throw new UnsupportedOperationException("Attempted to call adQuads on a Submodel instance. Please don't.");
}
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
{
return model.func_225613_a_(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
return model.bakeModel(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
this.modelTransform.isUvLock() || modelTransform.isUvLock()), modelLocation);
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors)
{
return model.func_225614_a_(modelGetter, missingTextureErrors);
return model.getTextures(modelGetter, missingTextureErrors);
}
}
@@ -226,7 +226,7 @@ public class CompositeModel implements IDynamicBakedModel
Submodel submodel = part.getValue();
if (!owner.getPartVisibility(submodel))
continue;
bakedParts.put(part.getKey(), submodel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation));
bakedParts.put(part.getKey(), submodel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
}
return new CompositeModel(owner.isShadedInGui(), owner.useSmoothLighting(), particle, bakedParts.build(), owner.getCombinedTransform(), overrides);
}
@@ -97,25 +97,25 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
{
Material particleLocation = owner.resolveTexture("particle");
if (MissingTextureSprite.getLocation().equals(particleLocation.func_229313_b_()))
if (MissingTextureSprite.getLocation().equals(particleLocation.getTextureLocation()))
{
particleLocation = null;
}
Material baseLocation = owner.resolveTexture("base");
if (MissingTextureSprite.getLocation().equals(baseLocation.func_229313_b_()))
if (MissingTextureSprite.getLocation().equals(baseLocation.getTextureLocation()))
{
baseLocation = null;
}
Material fluidMaskLocation = owner.resolveTexture("fluid");
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.func_229313_b_()))
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.getTextureLocation()))
{
fluidMaskLocation = null;
}
Material coverLocation = owner.resolveTexture("cover");
if (!MissingTextureSprite.getLocation().equals(coverLocation.func_229313_b_()))
if (!MissingTextureSprite.getLocation().equals(coverLocation.getTextureLocation()))
{
// cover (the actual item around the other two)
coverLocation = null;
@@ -135,7 +135,7 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
modelTransform = new ModelTransformComposition(modelTransform, new SimpleModelTransform(new TransformationMatrix(null, new Quaternion(0, 0, 1, 0), null, null)));
}
TransformationMatrix transform = modelTransform.func_225615_b_();
TransformationMatrix transform = modelTransform.getRotation();
TextureAtlasSprite fluidSprite = fluid != Fluids.EMPTY ? spriteGetter.apply(ForgeHooksClient.getBlockMaterial(fluid.getAttributes().getStillTexture())) : null;
@@ -91,7 +91,7 @@ final class FancyMissingModel implements IUnbakedModel
}
@Override
public Collection<Material> func_225614_a_(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
public Collection<Material> getTextures(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
{
return ImmutableList.of(font2);
}
@@ -104,11 +104,11 @@ final class FancyMissingModel implements IUnbakedModel
@Nullable
@Override
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
{
IBakedModel bigMissing = missingModel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation);
IBakedModel bigMissing = missingModel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation);
ModelTransformComposition smallState = new ModelTransformComposition(modelTransform, new SimpleModelTransform(smallTransformation));
IBakedModel smallMissing = missingModel.func_225613_a_(bakery, spriteGetter, smallState, modelLocation);
IBakedModel smallMissing = missingModel.bakeModel(bakery, spriteGetter, smallState, modelLocation);
return new BakedModel(bigMissing, smallMissing, fontRenderer, message, spriteGetter.apply(font2));
}
@@ -198,7 +198,7 @@ final class FancyMissingModel implements IUnbakedModel
@Override
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat)
{
TransformationMatrix transform = TransformationMatrix.func_227983_a_();
TransformationMatrix transform = TransformationMatrix.identity();
boolean big = true;
switch (cameraTransformType)
{
@@ -235,7 +235,7 @@ final class FancyMissingModel implements IUnbakedModel
default:
break;
}
mat.func_227866_c_().func_227870_a_().func_226595_a_(transform.func_227988_c_());
mat.getLast().getMatrix().mul(transform.getMatrix());
if (big != this.big)
{
return otherModel;
@@ -83,7 +83,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
{
FluidAttributes attrs = fluid.getAttributes();
return new CachingBakedFluid(
modelTransform.func_225615_b_(),
modelTransform.getRotation(),
PerspectiveMapWrapper.getTransforms(modelTransform),
modelLocation,
attrs.getColor(),
@@ -389,7 +389,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
private void putVertex(IVertexConsumer consumer, Direction side, boolean offset, float x, float y, float z, float u, float v)
{
VertexFormat format = DefaultVertexFormats.BLOCK;
ImmutableList<VertexFormatElement> elements = format.func_227894_c_();
ImmutableList<VertexFormatElement> elements = format.getElements();
for(int e = 0; e < elements.size(); e++)
{
switch(elements.get(e).getUsage())
@@ -84,7 +84,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
{
//TODO: Verify
TransformationMatrix transform = modelTransform.func_225615_b_();
TransformationMatrix transform = modelTransform.getRotation();
ImmutableList<BakedQuad> quads = getQuadsForSprites(textures, transform, spriteGetter);
TextureAtlasSprite particle = spriteGetter.apply(
owner.isTexturePresent("particle") ? owner.resolveTexture("particle") : textures.get(0)
@@ -396,9 +396,9 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
private static void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v)
{
VertexFormat format = consumer.getVertexFormat();
for(int e = 0; e < format.func_227894_c_().size(); e++)
for(int e = 0; e < format.getElements().size(); e++)
{
switch(format.func_227894_c_().get(e).getUsage())
switch(format.getElements().get(e).getUsage())
{
case POSITION:
consumer.put(e, x, y, z, 1f);
@@ -413,7 +413,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
consumer.put(e, offX, offY, offZ, 0f);
break;
case UV:
if(format.func_227894_c_().get(e).getIndex() == 0)
if(format.getElements().get(e).getIndex() == 0)
{
consumer.put(e, u, v, 0f, 1f);
break;
@@ -264,9 +264,9 @@ public final class ItemTextureQuadConverter
float x, float y, float z, float u, float v, int color)
{
VertexFormat format = consumer.getVertexFormat();
for (int e = 0; e < format.func_227894_c_().size(); e++)
for (int e = 0; e < format.getElements().size(); e++)
{
switch (format.func_227894_c_().get(e).getUsage())
switch (format.getElements().get(e).getUsage())
{
case POSITION:
consumer.put(e, x, y, z, 1f);
@@ -285,7 +285,7 @@ public final class ItemTextureQuadConverter
consumer.put(e, offX, offY, offZ, 0f);
break;
case UV:
if (format.func_227894_c_().get(e).getIndex() == 0)
if (format.getElements().get(e).getIndex() == 0)
{
consumer.put(e, u, v, 0f, 1f);
break;
@@ -162,7 +162,7 @@ public final class ModelLoader extends ModelBakery
{
if (instance == null)
{
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).func_229314_c_();
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).getSprite();
}
return instance;
}
@@ -264,7 +264,7 @@ public final class ModelLoader extends ModelBakery
*/
public static Function<Material, TextureAtlasSprite> defaultTextureGetter()
{
return Material::func_229314_c_;
return Material::getSprite;
}
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
@@ -223,7 +223,7 @@ public class ModelLoaderRegistry
{
throw new JsonParseException("transform: allowed keys: 'thirdperson', 'firstperson', 'gui', 'head', 'matrix', 'translation', 'rotation', 'scale', 'post-rotation'");
}
TransformationMatrix base = TransformationMatrix.func_227983_a_();
TransformationMatrix base = TransformationMatrix.identity();
if(!transform.entrySet().isEmpty())
{
base = context.deserialize(transform, TransformationMatrix.class);
@@ -282,7 +282,7 @@ public class ModelLoaderRegistry
modelBuilder.addGeneralQuad(BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
} else {
modelBuilder.addFaceQuad(
modelTransform.func_225615_b_().rotateTransform(blockpartface.cullFace),
modelTransform.getRotation().rotateTransform(blockpartface.cullFace),
BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
}
}
@@ -51,9 +51,9 @@ public class ModelTransformComposition implements IModelTransform
}
@Override
public TransformationMatrix func_225615_b_()
public TransformationMatrix getRotation()
{
return first.func_225615_b_().compose(second.func_225615_b_());
return first.getRotation().compose(second.getRotation());
}
@Override
@@ -72,7 +72,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
Set<Material> materials = Sets.newHashSet();
materials.add(owner.resolveTexture("particle"));
for (IUnbakedModel m : models.values())
materials.addAll(m.func_225614_a_(modelGetter, missingTextureErrors));
materials.addAll(m.getTextures(modelGetter, missingTextureErrors));
return materials;
}
@@ -81,7 +81,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
ImmutableMap.Builder<RenderType, IBakedModel> builder = ImmutableMap.builder();
for(Map.Entry<RenderType, IUnbakedModel> entry : models.entrySet())
{
builder.put(entry.getKey(), entry.getValue().func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation));
builder.put(entry.getKey(), entry.getValue().bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
}
return builder.build();
}
@@ -95,7 +95,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
owner.useSmoothLighting(), owner.isShadedInGui(),
owner.isSideLit(), spriteGetter.apply(owner.resolveTexture("particle")), overrides,
buildModels(models, modelTransform, bakery, spriteGetter, modelLocation),
missing.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation),
missing.bakeModel(bakery, spriteGetter, modelTransform, modelLocation),
PerspectiveMapWrapper.getTransforms(new ModelTransformComposition(owner.getCombinedTransform(), modelTransform)));
}
@@ -220,7 +220,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
{
ImmutableMap.Builder<RenderType, IUnbakedModel> builder = ImmutableMap.builder();
JsonObject layersObject = JSONUtils.getJsonObject(modelContents, "layers");
for(RenderType layer : RenderType.func_228661_n_()) // block layers
for(RenderType layer : RenderType.getBlockRenderTypes()) // block layers
{
String layerName = layer.toString(); // mc overrides toString to return the ID for the layer
if(layersObject.has(layerName))
@@ -106,7 +106,7 @@ public class PerspectiveMapWrapper implements IDynamicBakedModel
public static IBakedModel handlePerspective(IBakedModel model, ImmutableMap<ItemCameraTransforms.TransformType, TransformationMatrix> transforms, ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat)
{
TransformationMatrix tr = transforms.getOrDefault(cameraTransformType, TransformationMatrix.func_227983_a_());
TransformationMatrix tr = transforms.getOrDefault(cameraTransformType, TransformationMatrix.identity());
if (!tr.isIdentity())
{
tr.push(mat);
@@ -57,7 +57,7 @@ public class QuadTransformer
Vector4f pos = new Vector4f(x, y, z, 1);
transform.transformPosition(pos);
pos.func_229375_f_();
pos.perspectiveDivide();
putAtByteOffset(outData, offset, Float.floatToRawIntBits(pos.getX()));
putAtByteOffset(outData,offset + 4, Float.floatToRawIntBits(pos.getY()));
@@ -77,7 +77,7 @@ public class QuadTransformer
Vector3f pos = new Vector3f(x, y, z);
transform.transformNormal(pos);
pos.func_229194_d_();
pos.normalize();
int normalOut = ((((byte)(x / 127.0f)) & 0xFF) << 24) |
((((byte)(y / 127.0f)) & 0xFF) << 16) |
@@ -125,16 +125,16 @@ public class QuadTransformer
{
int index;
VertexFormatElement element = null;
for (index = 0; index < fmt.func_227894_c_().size(); index++)
for (index = 0; index < fmt.getElements().size(); index++)
{
VertexFormatElement el = fmt.func_227894_c_().get(index);
VertexFormatElement el = fmt.getElements().get(index);
if (el.getUsage() == VertexFormatElement.Usage.POSITION)
{
element = el;
break;
}
}
if (index == fmt.func_227894_c_().size() || element == null)
if (index == fmt.getElements().size() || element == null)
throw new RuntimeException("Expected vertex format to have a POSITION attribute");
if (element.getType() != VertexFormatElement.Type.FLOAT)
throw new RuntimeException("Expected POSITION attribute to have data type FLOAT");
@@ -147,16 +147,16 @@ public class QuadTransformer
{
int index;
VertexFormatElement element = null;
for (index = 0; index < fmt.func_227894_c_().size(); index++)
for (index = 0; index < fmt.getElements().size(); index++)
{
VertexFormatElement el = fmt.func_227894_c_().get(index);
VertexFormatElement el = fmt.getElements().get(index);
if (el.getUsage() == VertexFormatElement.Usage.NORMAL)
{
element = el;
break;
}
}
if (index == fmt.func_227894_c_().size() || element == null)
if (index == fmt.getElements().size() || element == null)
throw new IllegalStateException("BLOCK format does not have normals?");
if (element.getType() != VertexFormatElement.Type.BYTE)
throw new RuntimeException("Expected NORMAL attribute to have data type BYTE");
@@ -176,7 +176,7 @@ public class QuadTransformer
int[] outData = Arrays.copyOf(inData, inData.length);
processVertices(inData, outData);
return new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.getSprite(), input.shouldApplyDiffuseLighting());
return new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.func_187508_a(), input.shouldApplyDiffuseLighting());
}
/**
@@ -208,7 +208,7 @@ public class QuadTransformer
int[] outData = Arrays.copyOf(inData, inData.length);
processVertices(inData, outData);
outputs.add(new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.getSprite(), input.shouldApplyDiffuseLighting()));
outputs.add(new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.func_187508_a(), input.shouldApplyDiffuseLighting()));
}
return outputs;
}
@@ -69,7 +69,7 @@ public abstract class SimpleModelFontRenderer extends FontRenderer {
private void addVertex(BakedQuadBuilder quadBuilder, float x, float y, float u, float v)
{
ImmutableList<VertexFormatElement> elements = quadBuilder.getVertexFormat().func_227894_c_();
ImmutableList<VertexFormatElement> elements = quadBuilder.getVertexFormat().getElements();
for(int e = 0; e < elements.size(); e++)
{
VertexFormatElement element = elements.get(e);
@@ -29,14 +29,14 @@ import com.google.common.collect.ImmutableMap;
*/
public final class SimpleModelTransform implements IModelTransform
{
public static final SimpleModelTransform IDENTITY = new SimpleModelTransform(TransformationMatrix.func_227983_a_());
public static final SimpleModelTransform IDENTITY = new SimpleModelTransform(TransformationMatrix.identity());
private final ImmutableMap<?, TransformationMatrix> map;
private final TransformationMatrix base;
public SimpleModelTransform(ImmutableMap<?, TransformationMatrix> map)
{
this(map, TransformationMatrix.func_227983_a_());
this(map, TransformationMatrix.identity());
}
public SimpleModelTransform(TransformationMatrix base)
@@ -51,7 +51,7 @@ public final class SimpleModelTransform implements IModelTransform
}
@Override
public TransformationMatrix func_225615_b_()
public TransformationMatrix getRotation()
{
return base;
}
@@ -59,6 +59,6 @@ public final class SimpleModelTransform implements IModelTransform
@Override
public TransformationMatrix getPartTransformation(Object part)
{
return map.getOrDefault(part, TransformationMatrix.func_227983_a_());
return map.getOrDefault(part, TransformationMatrix.identity());
}
}
@@ -79,7 +79,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
})
// TODO where should uvlock data come from?
.map(state -> model.func_225613_a_(bakery, bakedTextureGetter, new ModelTransformComposition(state, this.state), modelLoc))
.map(state -> model.bakeModel(bakery, bakedTextureGetter, new ModelTransformComposition(state, this.state), modelLoc))
.orElseGet(() -> super.getModelWithOverrides(originalModel, stack, world, entity));
}
}
@@ -408,8 +408,8 @@ public class ModelBlockAnimation
}
Quaternion rot = new Quaternion(rotation_axis, rotation_angle, false);
TransformationMatrix base = new TransformationMatrix(translation, rot, scale, null);
Vector3f negOrigin = origin.func_229195_e_();
negOrigin.func_229192_b_(-1,-1,-1);
Vector3f negOrigin = origin.copy();
negOrigin.mul(-1,-1,-1);
base = new TransformationMatrix(origin, null, null, null).compose(base).compose(new TransformationMatrix(negOrigin, null, null, null));
return base.blockCenterToCorner();
}
@@ -428,7 +428,7 @@ public class ModelBlockAnimation
@Override
public TransformationMatrix getInvBindPose()
{
return TransformationMatrix.func_227983_a_();
return TransformationMatrix.identity();
}
@Override
@@ -537,8 +537,8 @@ public class ModelBlockAnimation
if(!trOp.isIdentity())
{
float w = info.getWeights().get(i)[0];
tmp = trOp.func_227988_c_();
tmp.func_226592_a_(w);
tmp = trOp.getMatrix();
tmp.mul(w);
m.add(tmp);
weight += w;
}
@@ -546,7 +546,7 @@ public class ModelBlockAnimation
}
if(weight > 1e-5)
{
m.func_226592_a_(1f / weight);
m.mul(1f / weight);
return new TransformationMatrix(m);
}
}
@@ -57,7 +57,7 @@ public class TileEntityRendererAnimation<T extends TileEntity> extends TileEntit
protected static BlockRendererDispatcher blockRenderer;
@Override
public void func_225616_a_(T te, float partialTick, MatrixStack mat, IRenderTypeBuffer renderer, int light, int otherlight)
public void render(T te, float partialTick, MatrixStack mat, IRenderTypeBuffer renderer, int light, int otherlight)
{
LazyOptional<IAnimationStateMachine> cap = te.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY);
if(!cap.isPresent())
@@ -80,7 +80,7 @@ public class TileEntityRendererAnimation<T extends TileEntity> extends TileEntit
// TODO: caching?
data.setData(Properties.AnimationProperty, pair.getLeft());
blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, mat, renderer.getBuffer(Atlases.func_228782_g_()), false, new Random(), 42, light, data);
blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, mat, renderer.getBuffer(Atlases.getSolidBlockType()), false, new Random(), 42, light, data);
});
}
}
@@ -65,7 +65,7 @@ public enum B3DClip implements IClip
@Override
public TransformationMatrix apply(float time)
{
TransformationMatrix ret = TransformationMatrix.func_227983_a_();
TransformationMatrix ret = TransformationMatrix.identity();
if(node.getAnimation() == null)
{
return ret.compose(new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null));
@@ -226,13 +226,13 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
@Override
public TransformationMatrix func_225615_b_()
public TransformationMatrix getRotation()
{
if(parent != null)
{
return parent.func_225615_b_();
return parent.getRotation();
}
return TransformationMatrix.func_227983_a_();
return TransformationMatrix.identity();
}
@Override
@@ -242,7 +242,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
if(!(part instanceof NodeJoint))
{
return TransformationMatrix.func_227983_a_();
return TransformationMatrix.identity();
}
Node<?> node = ((NodeJoint)part).getNode();
TransformationMatrix nodeTransform;
@@ -290,7 +290,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
public static TransformationMatrix getNodeMatrix(@Nullable Animation animation, Node<?> node, int frame)
{
TransformationMatrix ret = TransformationMatrix.func_227983_a_();
TransformationMatrix ret = TransformationMatrix.identity();
Key key = null;
if(animation != null) key = animation.getKeys().get(frame, node);
else if(node.getAnimation() != null) key = node.getAnimation().getKeys().get(frame, node);
@@ -355,8 +355,8 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
@Override
public TransformationMatrix getInvBindPose()
{
Matrix4f m = new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null).func_227988_c_();
m.func_226600_c_();
Matrix4f m = new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
m.invert();
TransformationMatrix pose = new TransformationMatrix(m);
if(node.getParent() != null)
@@ -446,7 +446,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
}
@Override
public Collection<Material> func_225614_a_(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
public Collection<Material> getTextures(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
{
return textures.values().stream().filter(loc -> !loc.startsWith("#"))
.map(t -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(t)))
@@ -461,7 +461,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
@Nullable
@Override
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
{
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
TextureAtlasSprite missing = spriteGetter.apply(new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, MissingTextureSprite.getLocation()));
@@ -694,7 +694,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
Mesh mesh = (Mesh)node.getKind();
Collection<Face> faces = mesh.bake(new Function<Node<?>, Matrix4f>()
{
private final TransformationMatrix global = state.func_225615_b_();
private final TransformationMatrix global = state.getRotation();
private final LoadingCache<Node<?>, TransformationMatrix> localCache = CacheBuilder.newBuilder()
.maximumSize(32)
.build(new CacheLoader<Node<?>, TransformationMatrix>()
@@ -709,7 +709,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
@Override
public Matrix4f apply(Node<?> node)
{
return global.compose(localCache.getUnchecked(node)).func_227988_c_();
return global.compose(localCache.getUnchecked(node)).getMatrix();
}
});
for(Face f : faces)
@@ -735,7 +735,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
private final void putVertexData(IVertexConsumer consumer, Vertex v, Vector3f faceNormal, TextureAtlasSprite sprite)
{
// TODO handle everything not handled (texture transformations, bones, transformations, normals, e.t.c)
ImmutableList<VertexFormatElement> vertexFormatElements = consumer.getVertexFormat().func_227894_c_();
ImmutableList<VertexFormatElement> vertexFormatElements = consumer.getVertexFormat().getElements();
for(int e = 0; e < vertexFormatElements.size(); e++)
{
switch(vertexFormatElements.get(e).getUsage())
@@ -663,7 +663,7 @@ public class B3DModel
Matrix4f t = new Matrix4f();
if(mesh.getWeightMap().get(this).isEmpty())
{
t.func_226591_a_();
t.setIdentity();
}
else
{
@@ -671,11 +671,11 @@ public class B3DModel
{
totalWeight += bone.getLeft();
Matrix4f bm = animator.apply(bone.getRight());
bm.func_226592_a_(bone.getLeft());
bm.mul(bone.getLeft());
t.add(bm);
}
if(Math.abs(totalWeight) > 1e-4) t.func_226592_a_(1f / totalWeight);
else t.func_226591_a_();
if(Math.abs(totalWeight) > 1e-4) t.mul(1f / totalWeight);
else t.setIdentity();
}
TransformationMatrix trsr = new TransformationMatrix(t);
@@ -684,7 +684,7 @@ public class B3DModel
Vector4f pos = new Vector4f(this.pos);
pos.setW(1);
trsr.transformPosition(pos);
pos.func_229374_e_();
pos.normalize();
Vector3f rPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
// normal
@@ -692,7 +692,7 @@ public class B3DModel
if(this.normal != null)
{
rNormal = this.normal.func_229195_e_();
rNormal = this.normal.copy();
trsr.transformNormal(rNormal);
}
@@ -784,13 +784,13 @@ public class B3DModel
public static Vector3f getNormal(Vertex v1, Vertex v2, Vertex v3)
{
Vector3f a = v2.getPos().func_229195_e_();
Vector3f a = v2.getPos().copy();
a.sub(v1.getPos());
Vector3f b = v3.getPos().func_229195_e_();
Vector3f b = v3.getPos().copy();
b.sub(v1.getPos());
Vector3f c = a.func_229195_e_();
Vector3f c = a.copy();
c.cross(b);
c.func_229194_d_();
c.normalize();
return c;
}
}
@@ -350,12 +350,12 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
Vector3f a = positions.get(indices[0][0]);
Vector3f ab = positions.get(indices[1][0]);
Vector3f ac = positions.get(indices[2][0]);
Vector3f abs = ab.func_229195_e_();
Vector3f abs = ab.copy();
abs.sub(a);
Vector3f acs = ac.func_229195_e_();
Vector3f acs = ac.copy();
acs.sub(a);
abs.cross(acs);
abs.func_229194_d_();
abs.normalize();
faceNormal = abs;
}
@@ -389,7 +389,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
Vector4f color = index.length >= 4 && colors.size() > 0 ? colors.get(index[3]) : COLOR_WHITE;
if (hasTransform)
{
normal = norm0.func_229195_e_();
normal = norm0.copy();
transformation.transformPosition(position);
transformation.transformNormal(normal);
};
@@ -463,7 +463,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
private void putVertexData(IVertexConsumer consumer, Vector4f position0, Vec2f texCoord0, Vector3f normal0, Vector4f color0, Vec2f uv2, TextureAtlasSprite texture)
{
ImmutableList<VertexFormatElement> elements = consumer.getVertexFormat().func_227894_c_();
ImmutableList<VertexFormatElement> elements = consumer.getVertexFormat().getElements();
for(int j=0;j<elements.size();j++)
{
VertexFormatElement e = elements.get(j);
@@ -533,7 +533,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
for (int[][] face : mesh.faces)
{
Pair<BakedQuad, Direction> quad = makeQuad(face, tintIndex, colorTint, mat.ambientColor, texture, modelTransform.func_225615_b_());
Pair<BakedQuad, Direction> quad = makeQuad(face, tintIndex, colorTint, mat.ambientColor, texture, modelTransform.getRotation());
if (quad.getRight() == null)
modelBuilder.addGeneralQuad(quad.getLeft());
else
@@ -34,7 +34,7 @@ import net.minecraft.util.Direction;
*/
public class BakedQuadBuilder implements IVertexConsumer
{
private static final int SIZE = DefaultVertexFormats.BLOCK.func_227894_c_().size();
private static final int SIZE = DefaultVertexFormats.BLOCK.getElements().size();
private final float[][][] unpackedData = new float[4][SIZE][4];
private int tint = -1;
@@ -134,7 +134,7 @@ public class BakedQuadBuilder implements IVertexConsumer
float tS = tX > tY ? tX : tY;
float ep = 1f / (tS * 0x100);
int uve = 0;
ImmutableList<VertexFormatElement> elements = DefaultVertexFormats.BLOCK.func_227894_c_();
ImmutableList<VertexFormatElement> elements = DefaultVertexFormats.BLOCK.getElements();
while(uve < elements.size())
{
VertexFormatElement e = elements.get(uve);
@@ -63,7 +63,7 @@ public class BlockInfo
{
if(cachedTint == tint) return cachedMultiplier;
cachedTint = tint;
cachedMultiplier = colors.func_228054_a_(state, world, blockPos, tint);
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
return cachedMultiplier;
}
@@ -130,7 +130,7 @@ public class BlockInfo
int brightness = 0x00FF00FF; // FIXME: state.getPackedLightmapCoords(world, pos);
s[x][y][z] = (brightness >> 0x14) & 0xF;
b[x][y][z] = (brightness >> 0x04) & 0xF;
ao[x][y][z] = state.func_215703_d(world, pos);
ao[x][y][z] = state.getAmbientOcclusionLightValue(world, pos);
}
}
}
@@ -139,10 +139,10 @@ public class BlockInfo
BlockPos pos = blockPos.offset(side);
BlockState state = world.getBlockState(pos);
BlockState thisStateShape = this.state.isSolid() && this.state.func_215691_g() ? this.state : Blocks.AIR.getDefaultState();
BlockState otherStateShape = state.isSolid() && state.func_215691_g() ? state : Blocks.AIR.getDefaultState();
BlockState thisStateShape = this.state.isSolid() && this.state.isTransparent() ? this.state : Blocks.AIR.getDefaultState();
BlockState otherStateShape = state.isSolid() && state.isTransparent() ? state : Blocks.AIR.getDefaultState();
if(state.getOpacity(world, blockPos) == 15 || VoxelShapes.func_223416_b(thisStateShape.func_215702_a(world, blockPos, side), otherStateShape.func_215702_a(world, pos, side.getOpposite())))
if(state.getOpacity(world, blockPos) == 15 || VoxelShapes.faceShapeCovers(thisStateShape.getFaceOcclusionShape(world, blockPos, side), otherStateShape.getFaceOcclusionShape(world, pos, side.getOpposite())))
{
int x = side.getXOffset() + 1;
int y = side.getYOffset() + 1;
@@ -24,8 +24,8 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.Direction;
/**
* Assumes that the data length is not less than e.func_227894_c_().size().
* Also assumes that element index passed will increment from 0 to format.func_227894_c_().size() - 1.
* Assumes that the data length is not less than e.getElements().size().
* Also assumes that element index passed will increment from 0 to format.getElements().size() - 1.
* Normal, Color and UV are assumed to be in 0-1 range.
*/
public interface IVertexConsumer
@@ -87,7 +87,7 @@ public class LightUtil
public static void putBakedQuad(IVertexConsumer consumer, BakedQuad quad)
{
consumer.setTexture(quad.getSprite());
consumer.setTexture(quad.func_187508_a());
consumer.setQuadOrientation(quad.getFace());
if(quad.hasTintIndex())
{
@@ -97,8 +97,8 @@ public class LightUtil
float[] data = new float[4];
VertexFormat formatFrom = consumer.getVertexFormat();
VertexFormat formatTo = DefaultVertexFormats.BLOCK;
int countFrom = formatFrom.func_227894_c_().size();
int countTo = formatTo.func_227894_c_().size();
int countFrom = formatFrom.getElements().size();
int countTo = formatTo.getElements().size();
int[] eMap = mapFormats(formatFrom, formatTo);
for(int v = 0; v < 4; v++)
{
@@ -131,17 +131,17 @@ public class LightUtil
private static int[] generateMapping(VertexFormat from, VertexFormat to)
{
int fromCount = from.func_227894_c_().size();
int toCount = to.func_227894_c_().size();
int fromCount = from.getElements().size();
int toCount = to.getElements().size();
int[] eMap = new int[fromCount];
for(int e = 0; e < fromCount; e++)
{
VertexFormatElement expected = from.func_227894_c_().get(e);
VertexFormatElement expected = from.getElements().get(e);
int e2;
for(e2 = 0; e2 < toCount; e2++)
{
VertexFormatElement current = to.func_227894_c_().get(e2);
VertexFormatElement current = to.getElements().get(e2);
if(expected.getUsage() == current.getUsage() && expected.getIndex() == current.getIndex())
{
break;
@@ -155,7 +155,7 @@ public class LightUtil
public static void unpack(int[] from, float[] to, VertexFormat formatFrom, int v, int e)
{
int length = 4 < to.length ? 4 : to.length;
VertexFormatElement element = formatFrom.func_227894_c_().get(e);
VertexFormatElement element = formatFrom.getElements().get(e);
int vertexStart = v * formatFrom.getSize() + formatFrom.getOffset(e);
int count = element.getElementCount();
VertexFormatElement.Type type = element.getType();
@@ -210,7 +210,7 @@ public class LightUtil
public static void pack(float[] from, int[] to, VertexFormat formatTo, int v, int e)
{
VertexFormatElement element = formatTo.func_227894_c_().get(e);
VertexFormatElement element = formatTo.getElements().get(e);
int vertexStart = v * formatTo.getSize() + formatTo.getOffset(e);
int count = element.getElementCount();
VertexFormatElement.Type type = element.getType();
@@ -319,7 +319,7 @@ public class LightUtil
@Override
public void put(int element, float... data)
{
if(getVertexFormat().func_227894_c_().get(element).getUsage() == VertexFormatElement.Usage.COLOR)
if(getVertexFormat().getElements().get(element).getUsage() == VertexFormatElement.Usage.COLOR)
{
System.arraycopy(auxColor, 0, buf, 0, buf.length);
int n = Math.min(4, data.length);
@@ -333,7 +333,7 @@ public class LightUtil
{
super.put(element, data);
}
if(element == getVertexFormat().func_227894_c_().size() - 1)
if(element == getVertexFormat().getElements().size() - 1)
{
vertices++;
if(vertices == 4)
@@ -38,8 +38,8 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
public void setVertexFormat(VertexFormat format)
{
this.format = format;
dataLength = new byte[format.func_227894_c_().size()];
quadData = new float[format.func_227894_c_().size()][4][4];
dataLength = new byte[format.getElements().size()];
quadData = new float[format.getElements().size()][4][4];
}
@Override
@@ -56,7 +56,7 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
{
dataLength[element] = (byte)data.length;
}
if (element == getVertexFormat().func_227894_c_().size() - 1)
if (element == getVertexFormat().getElements().size() - 1)
{
vertices++;
}
@@ -36,7 +36,7 @@ public class TRSRTransformer extends VertexTransformer
@Override
public void put(int element, float... data)
{
switch (getVertexFormat().func_227894_c_().get(element).getUsage())
switch (getVertexFormat().getElements().get(element).getUsage())
{
case POSITION:
Vector4f pos = new Vector4f(data[0], data[1], data[2], data[3]);
@@ -59,12 +59,12 @@ public class VertexBufferConsumer implements IVertexConsumer
// TODO
/*
VertexFormat format = getVertexFormat();
if(renderer.isColorDisabled() && format.func_227894_c_().get(e).getUsage() == Usage.COLOR)
if(renderer.isColorDisabled() && format.getElements().get(e).getUsage() == Usage.COLOR)
{
data = dummyColor;
}
LightUtil.pack(data, quadData, format, v, e);
if(e == format.func_227894_c_().size() - 1)
if(e == format.getElements().size() - 1)
{
v++;
if(v == 4)
@@ -66,9 +66,9 @@ public class VertexLighterFlat extends QuadGatheringTransformer
private void updateIndices()
{
for(int i = 0; i < getVertexFormat().func_227894_c_().size(); i++)
for(int i = 0; i < getVertexFormat().getElements().size(); i++)
{
switch(getVertexFormat().func_227894_c_().get(i).getUsage())
switch(getVertexFormat().getElements().get(i).getUsage())
{
case POSITION:
posIndex = i;
@@ -80,7 +80,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
colorIndex = i;
break;
case UV:
if(getVertexFormat().func_227894_c_().get(i).getIndex() == 2)
if(getVertexFormat().getElements().get(i).getIndex() == 2)
{
lightmapIndex = i;
}
@@ -123,7 +123,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
{
if (format == null || format.hasNormal())
return format;
List<VertexFormatElement> l = Lists.newArrayList(format.func_227894_c_());
List<VertexFormatElement> l = Lists.newArrayList(format.getElements());
l.add(NORMAL_4F);
return new VertexFormat(ImmutableList.copyOf(l));
}
@@ -153,7 +153,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
t.set(position[0]);
v2.sub(t);
v2.cross(v1);
v2.func_229194_d_();
v2.normalize();
for(int v = 0; v < 4; v++)
{
normal[v][0] = v2.getX();
@@ -170,7 +170,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
}
VertexFormat format = parent.getVertexFormat();
int count = format.func_227894_c_().size();
int count = format.getElements().size();
for(int v = 0; v < 4; v++)
{
@@ -209,7 +209,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
// no need for remapping cause all we could've done is add 1 element to the end
for(int e = 0; e < count; e++)
{
VertexFormatElement element = format.func_227894_c_().get(e);
VertexFormatElement element = format.getElements().get(e);
switch(element.getUsage())
{
case POSITION: