mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Updated ForgeDev MCP Mapping Version (#6532)
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
+24
-24
@@ -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());
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
+3
-3
@@ -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:
|
||||
|
||||
@@ -490,7 +490,7 @@ public class DimensionManager
|
||||
this.type = data.getModType().getRegistryName();
|
||||
if (data.getData() != null)
|
||||
this.data = data.getData().array();
|
||||
this.skyLight = data.func_218272_d();
|
||||
this.skyLight = data.hasSkyLight();
|
||||
}
|
||||
|
||||
private CompoundNBT write()
|
||||
|
||||
@@ -46,7 +46,7 @@ public class VillagerTradingManager
|
||||
|
||||
static
|
||||
{
|
||||
VillagerTrades.field_221239_a.entrySet().forEach(e ->
|
||||
VillagerTrades.VILLAGER_DEFAULT_TRADES.entrySet().forEach(e ->
|
||||
{
|
||||
Int2ObjectMap<ITrade[]> copy = new Int2ObjectOpenHashMap<>();
|
||||
e.getValue().int2ObjectEntrySet().forEach(ent -> copy.put(ent.getIntKey(), Arrays.copyOf(ent.getValue(), ent.getValue().length)));
|
||||
@@ -95,7 +95,7 @@ public class VillagerTradingManager
|
||||
MinecraftForge.EVENT_BUS.post(new VillagerTradesEvent(mutableTrades, prof));
|
||||
Int2ObjectMap<ITrade[]> newTrades = new Int2ObjectOpenHashMap<>();
|
||||
mutableTrades.int2ObjectEntrySet().forEach(e -> newTrades.put(e.getIntKey(), e.getValue().toArray(new ITrade[0])));
|
||||
VillagerTrades.field_221239_a.put(prof, newTrades);
|
||||
VillagerTrades.VILLAGER_DEFAULT_TRADES.put(prof, newTrades);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class LanguageProvider implements IDataProvider {
|
||||
}
|
||||
}
|
||||
|
||||
cache.func_208316_a(target, hash);
|
||||
cache.recordHash(target, hash);
|
||||
}
|
||||
|
||||
public void addBlock(Supplier<? extends Block> key, String name) {
|
||||
|
||||
@@ -900,7 +900,7 @@ public interface IForgeBlock
|
||||
*/
|
||||
default boolean isStickyBlock(BlockState state)
|
||||
{
|
||||
return state.getBlock() == Blocks.SLIME_BLOCK || state.getBlock() == Blocks.field_226907_mc_;
|
||||
return state.getBlock() == Blocks.SLIME_BLOCK || state.getBlock() == Blocks.HONEY_BLOCK;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -911,8 +911,8 @@ public interface IForgeBlock
|
||||
*/
|
||||
default boolean canStickTo(BlockState state, BlockState other)
|
||||
{
|
||||
if (state.getBlock() == Blocks.field_226907_mc_ && other.getBlock() == Blocks.SLIME_BLOCK) return false;
|
||||
if (state.getBlock() == Blocks.SLIME_BLOCK && other.getBlock() == Blocks.field_226907_mc_) return false;
|
||||
if (state.getBlock() == Blocks.HONEY_BLOCK && other.getBlock() == Blocks.SLIME_BLOCK) return false;
|
||||
if (state.getBlock() == Blocks.SLIME_BLOCK && other.getBlock() == Blocks.HONEY_BLOCK) return false;
|
||||
return state.isStickyBlock() || other.isStickyBlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ public interface IForgeDimension
|
||||
*/
|
||||
default SleepResult canSleepAt(net.minecraft.entity.player.PlayerEntity player, BlockPos pos)
|
||||
{
|
||||
return (getDimension().canRespawnHere() && getWorld().func_226691_t_(pos) != Biomes.NETHER) ? SleepResult.ALLOW : SleepResult.BED_EXPLODES;
|
||||
return (getDimension().canRespawnHere() && getWorld().getBiome(pos) != Biomes.NETHER) ? SleepResult.ALLOW : SleepResult.BED_EXPLODES;
|
||||
}
|
||||
|
||||
enum SleepResult
|
||||
@@ -221,7 +221,7 @@ public interface IForgeDimension
|
||||
|
||||
default boolean isHighHumidity(BlockPos pos)
|
||||
{
|
||||
return getWorld().func_226691_t_(pos).isHighHumidity();
|
||||
return getWorld().getBiome(pos).isHighHumidity();
|
||||
}
|
||||
|
||||
default int getHeight()
|
||||
|
||||
@@ -52,9 +52,9 @@ public interface IForgeEntityMinecart
|
||||
*/
|
||||
default BlockPos getCurrentRailPosition()
|
||||
{
|
||||
int x = MathHelper.floor(getMinecart().func_226277_ct_());
|
||||
int y = MathHelper.floor(getMinecart().func_226278_cu_());
|
||||
int z = MathHelper.floor(getMinecart().func_226281_cx_());
|
||||
int x = MathHelper.floor(getMinecart().getPosX());
|
||||
int y = MathHelper.floor(getMinecart().getPosY());
|
||||
int z = MathHelper.floor(getMinecart().getPosZ());
|
||||
BlockPos pos = new BlockPos(x, y - 1, z);
|
||||
if (getMinecart().world.getBlockState(pos).isIn(BlockTags.RAILS)) pos = pos.down();
|
||||
return pos;
|
||||
|
||||
@@ -56,7 +56,7 @@ public interface IForgeFluid
|
||||
*/
|
||||
default boolean isEntityInside(IFluidState state, IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||
{
|
||||
return state.isTagged(tag) && yToTest < (double)(pos.getY() + state.func_215679_a(world, pos) + 0.11111111F);
|
||||
return state.isTagged(tag) && yToTest < (double)(pos.getY() + state.getActualHeight(world, pos) + 0.11111111F);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface IForgeFluidState
|
||||
*/
|
||||
default boolean isEntityInside(IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||
{
|
||||
// return ifluidstate.isTagged(p_213290_1_) && d0 < (double)((float)blockpos.getY() + ifluidstate.func_215679_a(this.world, blockpos) + 0.11111111F);
|
||||
// return ifluidstate.isTagged(p_213290_1_) && d0 < (double)((float)blockpos.getY() + ifluidstate.getActualHeight(this.world, blockpos) + 0.11111111F);
|
||||
return getFluidState().getFluid().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class TransformationHelper
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static TransformationMatrix toTransformation(ItemTransformVec3f transform)
|
||||
{
|
||||
if (transform.equals(ItemTransformVec3f.DEFAULT)) return TransformationMatrix.func_227983_a_();
|
||||
if (transform.equals(ItemTransformVec3f.DEFAULT)) return TransformationMatrix.identity();
|
||||
|
||||
return new TransformationMatrix(transform.translation, quatFromXYZ(transform.rotation, true), transform.scale, null);
|
||||
}
|
||||
@@ -62,8 +62,8 @@ public final class TransformationHelper
|
||||
|
||||
public static Vector3f lerp(Vector3f from, Vector3f to, float progress)
|
||||
{
|
||||
Vector3f res = from.func_229195_e_();
|
||||
res.func_229190_a_(to, progress);
|
||||
Vector3f res = from.copy();
|
||||
res.lerp(to, progress);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class TransformationHelper
|
||||
{
|
||||
return new TransformationMatrix(
|
||||
lerp(one.getTranslation(), that.getTranslation(), progress),
|
||||
slerp(one.func_227989_d_(), that.func_227989_d_(), progress),
|
||||
slerp(one.getRotationLeft(), that.getRotationLeft(), progress),
|
||||
lerp(one.getScale(), that.getScale(), progress),
|
||||
slerp(one.getRightRot(), that.getRightRot(), progress)
|
||||
);
|
||||
@@ -140,7 +140,7 @@ public final class TransformationHelper
|
||||
String transform = json.getAsString();
|
||||
if(transform.equals("identity"))
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,15 +266,15 @@ public final class TransformationHelper
|
||||
{
|
||||
if (entry.getKey().equals("x"))
|
||||
{
|
||||
ret = Vector3f.field_229179_b_.func_229187_a_(entry.getValue().getAsNumber().floatValue());
|
||||
ret = Vector3f.XP.rotationDegrees(entry.getValue().getAsNumber().floatValue());
|
||||
}
|
||||
else if (entry.getKey().equals("y"))
|
||||
{
|
||||
ret = Vector3f.field_229181_d_.func_229187_a_(entry.getValue().getAsNumber().floatValue());
|
||||
ret = Vector3f.YP.rotationDegrees(entry.getValue().getAsNumber().floatValue());
|
||||
}
|
||||
else if (entry.getKey().equals("z"))
|
||||
{
|
||||
ret = Vector3f.field_229183_f_.func_229187_a_(entry.getValue().getAsNumber().floatValue());
|
||||
ret = Vector3f.ZP.rotationDegrees(entry.getValue().getAsNumber().floatValue());
|
||||
}
|
||||
else throw new JsonParseException("Axis rotation: expected single axis key, got: " + entry.getKey());
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public final class TransformationHelper
|
||||
{
|
||||
if (e.getAsJsonArray().get(0).isJsonObject())
|
||||
{
|
||||
Quaternion ret = Quaternion.field_227060_a_.func_227068_g_();
|
||||
Quaternion ret = Quaternion.ONE.copy();
|
||||
for (JsonElement a : e.getAsJsonArray())
|
||||
{
|
||||
ret.multiply(parseAxisRotation(a));
|
||||
|
||||
@@ -307,9 +307,9 @@ public final class Clips
|
||||
return Pair.of(new IModelTransform()
|
||||
{
|
||||
@Override
|
||||
public TransformationMatrix func_225615_b_()
|
||||
public TransformationMatrix getRotation()
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -317,7 +317,7 @@ public final class Clips
|
||||
{
|
||||
if(!(part instanceof IJoint))
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
IJoint joint = (IJoint)part;
|
||||
// TODO: Cache clip application?
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class JointClips
|
||||
@Override
|
||||
public TransformationMatrix apply(float time)
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ public class ChunkCoordComparator implements java.util.Comparator<ChunkPos>
|
||||
|
||||
public ChunkCoordComparator(ServerPlayerEntity entityplayer)
|
||||
{
|
||||
x = (int) entityplayer.func_226277_ct_() >> 4;
|
||||
z = (int) entityplayer.func_226281_cx_() >> 4;
|
||||
x = (int) entityplayer.getPosX() >> 4;
|
||||
z = (int) entityplayer.getPosZ() >> 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CapabilityEnergy
|
||||
@Override
|
||||
public INBT writeNBT(Capability<IEnergyStorage> capability, IEnergyStorage instance, Direction side)
|
||||
{
|
||||
return IntNBT.func_229692_a_(instance.getEnergyStored());
|
||||
return IntNBT.valueOf(instance.getEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -425,7 +425,7 @@ public class ForgeEventFactory
|
||||
|
||||
if(isCanceled)
|
||||
{
|
||||
entityMounting.setPositionAndRotation(entityMounting.func_226277_ct_(), entityMounting.func_226278_cu_(), entityMounting.func_226281_cx_(), entityMounting.prevRotationYaw, entityMounting.prevRotationPitch);
|
||||
entityMounting.setPositionAndRotation(entityMounting.getPosX(), entityMounting.getPosY(), entityMounting.getPosZ(), entityMounting.prevRotationYaw, entityMounting.prevRotationPitch);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -173,7 +173,7 @@ public class LivingSpawnEvent extends LivingEvent
|
||||
{
|
||||
public AllowDespawn(MobEntity entity)
|
||||
{
|
||||
super(entity, entity.world, entity.func_226277_ct_(), entity.func_226278_cu_(), entity.func_226281_cx_());
|
||||
super(entity, entity.world, entity.getPosX(), entity.getPosY(), entity.getPosZ());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ public class FluidAttributes
|
||||
@Override
|
||||
public int getColor(ILightReader world, BlockPos pos)
|
||||
{
|
||||
return BiomeColors.func_228363_c_(world, pos) | 0xFF000000;
|
||||
return BiomeColors.getWaterColor(world, pos) | 0xFF000000;
|
||||
}
|
||||
|
||||
public static Builder builder(ResourceLocation stillTexture, ResourceLocation flowingTexture) {
|
||||
|
||||
@@ -143,7 +143,7 @@ public class FluidUtil
|
||||
if (player != null)
|
||||
{
|
||||
SoundEvent soundevent = simulatedTransfer.getFluid().getAttributes().getFillSound(simulatedTransfer);
|
||||
player.world.playSound(null, player.func_226277_ct_(), player.func_226278_cu_() + 0.5, player.func_226281_cx_(), soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
player.world.playSound(null, player.getPosX(), player.getPosY() + 0.5, player.getPosZ(), soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -187,7 +187,7 @@ public class FluidUtil
|
||||
if (doDrain && player != null)
|
||||
{
|
||||
SoundEvent soundevent = transfer.getFluid().getAttributes().getEmptySound(transfer);
|
||||
player.world.playSound(null, player.func_226277_ct_(), player.func_226278_cu_() + 0.5, player.func_226281_cx_(), soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
player.world.playSound(null, player.getPosX(), player.getPosY() + 0.5, player.getPosZ(), soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
ItemStack resultContainer = containerFluidHandler.getContainer();
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean func_215665_a(IFluidState state, IBlockReader world, BlockPos pos, Fluid fluidIn, Direction direction)
|
||||
protected boolean canDisplace(IFluidState state, IBlockReader world, BlockPos pos, Fluid fluidIn, Direction direction)
|
||||
{
|
||||
// Based on the water implementation, may need to be overriden for mod fluids that shouldn't behave like water.
|
||||
return direction == Direction.DOWN && !isEquivalentTo(fluidIn);
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ClientModLoader
|
||||
SidedProvider.setClient(()->minecraft);
|
||||
LogicalSidedProvider.setClient(()->minecraft);
|
||||
LanguageHook.loadForgeAndMCLangs();
|
||||
earlyLoaderGUI = new EarlyLoaderGUI(minecraft.func_228018_at_());
|
||||
earlyLoaderGUI = new EarlyLoaderGUI(minecraft.getMainWindow());
|
||||
createRunnableWithCatch(() -> ModLoader.get().gatherAndInitializeMods(earlyLoaderGUI::renderTick)).run();
|
||||
ResourcePackLoader.loadResourcePacks(defaultResourcePacks, ClientModLoader::buildPackFinder);
|
||||
mcResourceManager.addReloadListener(ClientModLoader::onreload);
|
||||
|
||||
@@ -95,7 +95,7 @@ public class EarlyLoaderGUI {
|
||||
}
|
||||
|
||||
void renderMessage(final String message, final float[] colour, int line, float alpha) {
|
||||
GlStateManager.func_227770_y_(GL11.GL_VERTEX_ARRAY);
|
||||
GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
ByteBuffer charBuffer = MemoryUtil.memAlloc(message.length() * 270);
|
||||
int quads = STBEasyFont.stb_easy_font_print(0, 0, message, null, charBuffer);
|
||||
GL14.glVertexPointer(2, GL11.GL_FLOAT, 16, charBuffer);
|
||||
|
||||
@@ -208,10 +208,10 @@ public class GuiUtils
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder wr = tessellator.getBuffer();
|
||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
wr.func_225582_a_(x , y + height, zLevel).func_225583_a_( u * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.func_225582_a_(x + width, y + height, zLevel).func_225583_a_((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.func_225582_a_(x + width, y , zLevel).func_225583_a_((u + width) * uScale, ( v * vScale)).endVertex();
|
||||
wr.func_225582_a_(x , y , zLevel).func_225583_a_( u * uScale, ( v * vScale)).endVertex();
|
||||
wr.pos(x , y + height, zLevel).tex( u * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.pos(x + width, y + height, zLevel).tex((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.pos(x + width, y , zLevel).tex((u + width) * uScale, ( v * vScale)).endVertex();
|
||||
wr.pos(x , y , zLevel).tex( u * uScale, ( v * vScale)).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@@ -374,10 +374,10 @@ public class GuiUtils
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostBackground(stack, textLines, tooltipX, tooltipY, font, tooltipTextWidth, tooltipHeight));
|
||||
|
||||
IRenderTypeBuffer.Impl renderType = IRenderTypeBuffer.func_228455_a_(Tessellator.getInstance().getBuffer());
|
||||
IRenderTypeBuffer.Impl renderType = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer());
|
||||
MatrixStack textStack = new MatrixStack();
|
||||
textStack.func_227861_a_(0.0D, 0.0D, (double)zLevel);
|
||||
Matrix4f textLocation = textStack.func_227866_c_().func_227870_a_();
|
||||
textStack.translate(0.0D, 0.0D, (double)zLevel);
|
||||
Matrix4f textLocation = textStack.getLast().getMatrix();
|
||||
|
||||
int tooltipTop = tooltipY;
|
||||
|
||||
@@ -385,7 +385,7 @@ public class GuiUtils
|
||||
{
|
||||
String line = textLines.get(lineNumber);
|
||||
if (line != null)
|
||||
font.func_228079_a_(line, (float)tooltipX, (float)tooltipY, -1, true, textLocation, renderType, false, 0, 15728880);
|
||||
font.renderString(line, (float)tooltipX, (float)tooltipY, -1, true, textLocation, renderType, false, 0, 15728880);
|
||||
|
||||
if (lineNumber + 1 == titleLinesCount)
|
||||
tooltipY += 2;
|
||||
@@ -393,7 +393,7 @@ public class GuiUtils
|
||||
tooltipY += 10;
|
||||
}
|
||||
|
||||
renderType.func_228461_a_();
|
||||
renderType.finish();
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostText(stack, textLines, tooltipX, tooltipTop, font, tooltipTextWidth, tooltipHeight));
|
||||
|
||||
@@ -422,10 +422,10 @@ public class GuiUtils
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
|
||||
buffer.func_225582_a_(right, top, zLevel).func_227885_a_(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.func_225582_a_( left, top, zLevel).func_227885_a_(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.func_225582_a_( left, bottom, zLevel).func_227885_a_( endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
buffer.func_225582_a_(right, bottom, zLevel).func_227885_a_( endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
buffer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.pos( left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.pos( left, bottom, zLevel).color( endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
buffer.pos(right, bottom, zLevel).color( endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
RenderSystem.shadeModel(GL11.GL_FLAT);
|
||||
|
||||
@@ -437,10 +437,10 @@ public class ModListScreen extends Screen
|
||||
|
||||
@Override
|
||||
public void updateDynamicTexture() {
|
||||
this.func_229148_d_();
|
||||
this.bindTexture();
|
||||
NativeImage td = this.getTextureData();
|
||||
// Use custom "blur" value which controls texture filtering (nearest-neighbor vs linear)
|
||||
this.getTextureData().func_227789_a_(0, 0, 0, 0, 0, td.getWidth(), td.getHeight(), selectedMod.getLogoBlur(), false, false, false);
|
||||
this.getTextureData().uploadTextureSub(0, 0, 0, 0, 0, td.getWidth(), td.getHeight(), selectedMod.getLogoBlur(), false, false, false);
|
||||
}
|
||||
}), new Size2i(logo.getWidth(), logo.getHeight()));
|
||||
}
|
||||
|
||||
@@ -53,6 +53,6 @@ public class RenderingRegistry
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T extends Entity> void register(EntityRendererManager manager, EntityType<T> entityType, IRenderFactory<?> renderFactory)
|
||||
{
|
||||
manager.func_229087_a_(entityType, ((IRenderFactory<T>)renderFactory).createRenderFor(manager));
|
||||
manager.register(entityType, ((IRenderFactory<T>)renderFactory).createRenderFor(manager));
|
||||
}
|
||||
}
|
||||
@@ -73,9 +73,9 @@ public class FMLPlayMessages
|
||||
this.typeId = Registry.ENTITY_TYPE.getId(e.getType());
|
||||
this.entityId = e.getEntityId();
|
||||
this.uuid = e.getUniqueID();
|
||||
this.posX = e.func_226277_ct_();
|
||||
this.posY = e.func_226278_cu_();
|
||||
this.posZ = e.func_226281_cx_();
|
||||
this.posX = e.getPosX();
|
||||
this.posY = e.getPosY();
|
||||
this.posZ = e.getPosZ();
|
||||
this.pitch = (byte) MathHelper.floor(e.rotationPitch * 256.0F / 360.0F);
|
||||
this.yaw = (byte) MathHelper.floor(e.rotationYaw * 256.0F / 360.0F);
|
||||
this.headYaw = (byte) (e.getRotationYawHead() * 256.0F / 360.0F);
|
||||
@@ -158,7 +158,7 @@ public class FMLPlayMessages
|
||||
return;
|
||||
}
|
||||
|
||||
e.func_213312_b(msg.posX, msg.posY, msg.posZ);
|
||||
e.setPacketCoordinates(msg.posX, msg.posY, msg.posZ);
|
||||
e.setPositionAndRotation(msg.posX, msg.posY, msg.posZ, (msg.yaw * 360) / 256.0F, (msg.pitch * 360) / 256.0F);
|
||||
e.setRotationYawHead((msg.headYaw * 360) / 256.0F);
|
||||
e.setRenderYawOffset((msg.headYaw * 360) / 256.0F);
|
||||
@@ -323,7 +323,7 @@ public class FMLPlayMessages
|
||||
id = type.getId() + 1;
|
||||
dimName = type.getRegistryName();
|
||||
modDimensionName = type.getModType().getRegistryName();
|
||||
skylight = type.func_218272_d();
|
||||
skylight = type.hasSkyLight();
|
||||
extraData = new PacketBuffer(Unpooled.buffer());
|
||||
type.getModType().write(extraData, true);
|
||||
}
|
||||
|
||||
@@ -82,12 +82,12 @@ public class DelegatingResourcePack extends ResourcePack
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> func_225637_a_(ResourcePackType type, String pathIn, String pathIn2, int maxDepth, Predicate<String> filter)
|
||||
public Collection<ResourceLocation> getAllResourceLocations(ResourcePackType type, String pathIn, String pathIn2, int maxDepth, Predicate<String> filter)
|
||||
{
|
||||
synchronized(delegates)
|
||||
{
|
||||
return delegates.stream()
|
||||
.flatMap(r -> r.func_225637_a_(type, pathIn, pathIn2, maxDepth, filter).stream())
|
||||
.flatMap(r -> r.getAllResourceLocations(type, pathIn, pathIn2, maxDepth, filter).stream())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ModFileResourcePack extends DelegatableResourcePack
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> func_225637_a_(ResourcePackType type, String resourceNamespace, String pathIn, int maxDepth, Predicate<String> filter)
|
||||
public Collection<ResourceLocation> getAllResourceLocations(ResourcePackType type, String resourceNamespace, String pathIn, int maxDepth, Predicate<String> filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -183,14 +183,14 @@ public class ItemHandlerHelper
|
||||
// play sound if something got picked up
|
||||
if (remainder.isEmpty() || remainder.getCount() != stack.getCount())
|
||||
{
|
||||
world.playSound(null, player.func_226277_ct_(), player.func_226278_cu_() + 0.5, player.func_226281_cx_(),
|
||||
world.playSound(null, player.getPosX(), player.getPosY() + 0.5, player.getPosZ(),
|
||||
SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
}
|
||||
|
||||
// drop remaining itemstack into the world
|
||||
if (!remainder.isEmpty() && !world.isRemote)
|
||||
{
|
||||
ItemEntity entityitem = new ItemEntity(world, player.func_226277_ct_(), player.func_226278_cu_() + 0.5, player.func_226281_cx_(), remainder);
|
||||
ItemEntity entityitem = new ItemEntity(world, player.getPosX(), player.getPosY() + 0.5, player.getPosZ(), remainder);
|
||||
entityitem.setPickupDelay(40);
|
||||
entityitem.setMotion(entityitem.getMotion().mul(0, 1, 0));
|
||||
|
||||
|
||||
@@ -849,7 +849,7 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
|
||||
data.putIntArray("blocked", blocked);
|
||||
|
||||
ListNBT dummied = new ListNBT();
|
||||
this.dummied.stream().sorted().forEach(e -> dummied.add(StringNBT.func_229705_a_(e.toString())));
|
||||
this.dummied.stream().sorted().forEach(e -> dummied.add(StringNBT.valueOf(e.toString())));
|
||||
data.put("dummied", dummied);
|
||||
|
||||
return data;
|
||||
|
||||
@@ -461,7 +461,7 @@ public class GameData
|
||||
for (BlockState state : block.getStateContainer().getValidStates())
|
||||
{
|
||||
blockstateMap.add(state);
|
||||
state.func_215692_c();
|
||||
state.cacheState();
|
||||
}
|
||||
|
||||
block.getLootTable();
|
||||
|
||||
@@ -70,7 +70,7 @@ class CommandEntity
|
||||
.then(Commands.argument("filter", StringArgumentType.string())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(ForgeRegistries.ENTITIES.getKeys().stream().map(id -> id.toString()), builder))
|
||||
.then(Commands.argument("dim", DimensionArgument.getDimension())
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.func_212592_a(ctx, "dim")))
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.getDimensionArgument(ctx, "dim")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().dimension.getType()))
|
||||
)
|
||||
|
||||
@@ -42,9 +42,9 @@ class CommandGenerate
|
||||
.then(Commands.argument("count", IntegerArgumentType.integer(1))
|
||||
.then(Commands.argument("dim", DimensionArgument.getDimension())
|
||||
.then(Commands.argument("interval", IntegerArgumentType.integer())
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), getInt(ctx, "interval")))
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.getDimensionArgument(ctx, "dim"), getInt(ctx, "interval")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), -1))
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.getDimensionArgument(ctx, "dim"), -1))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), ctx.getSource().getWorld().dimension.getType(), -1))
|
||||
)
|
||||
|
||||
@@ -50,9 +50,9 @@ public class CommandSetDimension
|
||||
.then(Commands.argument("targets", EntityArgument.entities())
|
||||
.then(Commands.argument("dim", DimensionArgument.getDimension())
|
||||
.then(Commands.argument("pos", BlockPosArgument.blockPos())
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos")))
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.getDimensionArgument(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), new BlockPos(ctx.getSource().getPos())))
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.getDimensionArgument(ctx, "dim"), new BlockPos(ctx.getSource().getPos())))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class CommandTps
|
||||
return Commands.literal("tps")
|
||||
.requires(cs->cs.hasPermissionLevel(0)) //permission
|
||||
.then(Commands.argument("dim", DimensionArgument.getDimension())
|
||||
.executes(ctx -> sendTime(ctx.getSource(), DimensionArgument.func_212592_a(ctx, "dim")))
|
||||
.executes(ctx -> sendTime(ctx.getSource(), DimensionArgument.getDimensionArgument(ctx, "dim")))
|
||||
)
|
||||
.executes(ctx -> {
|
||||
for (DimensionType dim : DimensionType.getAll())
|
||||
|
||||
Reference in new issue
Block a user