diff --git a/CHANGELOG.md b/CHANGELOG.md index 90067c73..f08b5677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ +### 1.15.1-3.0.1 +- Fluids in guis render again + +### 1.15.1-3.0.0 +- Initial 1.15.1 release +- Many rendering issues are present + ### 1.14.4-2.2.7 - Fixed upgrading machine does not consume item +- Useless Ingots are now valid beacon payment ### 1.14.4-2.2.6 - Added compatibility for [Mystical Agriculture](https://www.curseforge.com/minecraft/mc-mods/mystical-agriculture) diff --git a/src/main/java/tk/themcbros/uselessmod/client/gui/MachineFluidScreen.java b/src/main/java/tk/themcbros/uselessmod/client/gui/MachineFluidScreen.java index 76e946c5..24f520a1 100644 --- a/src/main/java/tk/themcbros/uselessmod/client/gui/MachineFluidScreen.java +++ b/src/main/java/tk/themcbros/uselessmod/client/gui/MachineFluidScreen.java @@ -15,6 +15,7 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluid; import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.PlayerContainer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.fluids.FluidAttributes; @@ -98,12 +99,10 @@ protected void drawTiledSprite(final int xPosition, final int yPosition, final i private static TextureAtlasSprite getStillFluidSprite(FluidStack fluidStack) { Minecraft minecraft = Minecraft.getInstance(); -// AtlasTexture textureMapBlocks = minecraft.getTextureMap(); - AtlasTexture textureMapBlocks = new AtlasTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); Fluid fluid = fluidStack.getFluid(); FluidAttributes attributes = fluid.getAttributes(); ResourceLocation fluidStill = attributes.getStillTexture(fluidStack); - return textureMapBlocks.getSprite(fluidStill); + return minecraft.func_228015_a_(PlayerContainer.field_226615_c_).apply(fluidStill); } private static void setGLColorFromInt(int color) { @@ -116,22 +115,22 @@ private static void setGLColorFromInt(int color) { } private static void drawTextureWithMasking(double xCoord, double yCoord, TextureAtlasSprite textureSprite, int maskTop, int maskRight, double zLevel) { -// double uMin = textureSprite.getMinU(); -// double uMax = textureSprite.getMaxU(); -// double vMin = textureSprite.getMinV(); -// double vMax = textureSprite.getMaxV(); -// uMax = uMax - (maskRight / 16.0 * (uMax - uMin)); -// vMax = vMax - (maskTop / 16.0 * (vMax - vMin)); -// -// Tessellator tessellator = Tessellator.getInstance(); -// BufferBuilder bufferBuilder = tessellator.getBuffer(); -// bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX); -// bufferBuilder.func_225582_a_(xCoord, yCoord + 16, zLevel).tex(uMin, vMax).endVertex(); -// bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex(uMax, vMax).endVertex(); -// bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex(uMax, vMin).endVertex(); -// bufferBuilder.func_225582_a_(xCoord, yCoord + maskTop, zLevel).tex(uMin, vMin).endVertex(); -// -// tessellator.draw(); + double uMin = textureSprite.getMinU(); + double uMax = textureSprite.getMaxU(); + double vMin = textureSprite.getMinV(); + double vMax = textureSprite.getMaxV(); + uMax = uMax - (maskRight / 16.0 * (uMax - uMin)); + vMax = vMax - (maskTop / 16.0 * (vMax - vMin)); + + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX); + bufferBuilder.func_225582_a_(xCoord, yCoord + 16, zLevel).func_225583_a_((float) uMin, (float) vMax).endVertex(); + bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + 16, zLevel).func_225583_a_((float) uMax, (float) vMax).endVertex(); + bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).func_225583_a_((float) uMax, (float) vMin).endVertex(); + bufferBuilder.func_225582_a_(xCoord, yCoord + maskTop, zLevel).func_225583_a_((float) uMin, (float) vMin).endVertex(); + + tessellator.draw(); } } diff --git a/src/main/java/tk/themcbros/uselessmod/items/DescriptionItem.java b/src/main/java/tk/themcbros/uselessmod/items/DescriptionItem.java index 292f3a99..405c3b62 100644 --- a/src/main/java/tk/themcbros/uselessmod/items/DescriptionItem.java +++ b/src/main/java/tk/themcbros/uselessmod/items/DescriptionItem.java @@ -24,7 +24,7 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List