Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

tigres810

Members
  • Joined

  • Last visited

Everything posted by tigres810

  1. How I can render a quad? idk anything about this new renderer.
  2. So im trying to render some fluid inside my tank but it doesnt render anything idk why, please I need some help with this here is the code package com.tigres810.testmod.tileentitys.renders; import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.tigres810.testmod.tileentitys.TileFluidTankBlock; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.fluid.Fluid; import net.minecraft.inventory.container.PlayerContainer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.vector.Matrix4f; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fluids.FluidAttributes; import net.minecraftforge.fluids.FluidStack; @OnlyIn(Dist.CLIENT) public class RenderFluidTankBlock extends TileEntityRenderer<TileFluidTankBlock> { public static final float TANK_THICKNESS = 0.3f; public static final float TANK_HEIGHT = 0.2f; public static final float TANK_BOTTOM = 0.0f; public RenderFluidTankBlock(TileEntityRendererDispatcher rendererDispatcherIn) { super(rendererDispatcherIn); } private void add(IVertexBuilder renderer, MatrixStack stack, float x, float y, float z, float u, float v) { renderer.pos(stack.getLast().getMatrix(), x, y, z) .color(1.0f, 1.0f, 1.0f, 1.0f) .tex(u, v) .lightmap(0, 240) .normal(1, 0, 0) .endVertex(); } @Override public void render(TileFluidTankBlock tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { if(tileEntityIn == null || tileEntityIn.isRemoved()) return; FluidStack fluid = tileEntityIn.getTank().getFluid(); if (fluid == null) return; Fluid renderFluid = fluid.getFluid(); if (renderFluid == null) return; FluidAttributes attributes = renderFluid.getAttributes(); ResourceLocation fluidStill = attributes.getStillTexture(fluid); TextureAtlasSprite sprite = Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStill); IVertexBuilder builder = bufferIn.getBuffer(RenderType.getTranslucent()); float scale = (1.0f - TANK_THICKNESS/2 - TANK_THICKNESS) * fluid.getAmount() / (tileEntityIn.getTank().getCapacity()); matrixStackIn.push(); matrixStackIn.translate(tileEntityIn.getPos().getX()+0.5, tileEntityIn.getPos().getY()+1.01/16.0, tileEntityIn.getPos().getZ()+0.5); matrixStackIn.scale(0.25f, 10.8f/16.0f, 0.25f); float u1 = sprite.getMinU(); float v1 = sprite.getMinV(); float u2 = sprite.getMaxU(); float v2 = sprite.getMaxV(); int color = renderFluid.getAttributes().getColor(); float a = 1.0F; float r = (color >> 16 & 0xFF) / 255.0F; float g = (color >> 8 & 0xFF) / 255.0F; float b = (color & 0xFF) / 255.0F; add(builder, matrixStackIn, TANK_THICKNESS, scale + TANK_HEIGHT, TANK_THICKNESS, u1, v1); matrixStackIn.pop(); } } I got no idea why is not working, also im trying to render one side to test if it works later ill add the rest of the faces.
  3. @Egor_VozhakovI have the same issue I cannot run or build my mod, found any solution?
  4. @DavidMThe fluid is still not rendering, I binded the registry into the proxy and still no results idk what to do: My ClientProxy: https://pastebin.com/Syu9U4Ag Also the TESR is not even being called idk why... Also when I bind the thing this name happers on top
  5. @DavidM Okay thanks for the quick response here's my te: https://pastebin.com/NBsV7KHY Scale is not printing anything, idk if I did right heres my TESR again: https://pastebin.com/n8i3NA44 Also the te doesn't have a tank or anything I want to convert fe energy to fluid if that's possible? I tried with a tank of fluid u interact by right clicking on it and still doesnt work, im so lost with the TESR and never done this stuff Can I make the pipe has energy and a fluid tank? Also don't mind the copyright from jabelar I copied his code to fix the update thingy i'll remove it later! I forgot to add the log cause it gives an error but idk if is from TESR: https://pastebin.com/pxjKssah
  6. @DavidM and @Cadiboo My fluid does not render, i'm using a FastTESR this is what I got so far: https://pastebin.com/aa7JE3RD and on my tileentity I did this: @Override public boolean hasFastRenderer() { return true; } The pipe is getting the energy cause the console prints it ! Heres the proof : https://gyazo.com/72c8bac8d4077bd47efb6c3c91e82182 Also I read this before doing it: https://mcforge.readthedocs.io/en/latest/tileentities/tesr/#rendertileentityat Idk what I'm doing wrong? Any guidance ?? Also let me know if I need to bump.
  7. I did some research and found a solution for this thing thanks!
  8. I want to update the pipe while is being filled but if I change his blockstate the energy resets so how I can do that without resetting it? Thanks... Also if I could change from the blockstate one parameter or such it could be helpful I just don't know how to do this and is hard to do. If I update the blockstate every tick the fluid or the blockstate thingy kinda flickers if I leave it to 4 it stays but if I put 8 it disappears! ? Also I cannot show the code I want a solution for this thing, if I could put a block inside and change his size? But idk if that's even possible. I could use buildcraft pipe but I need to transfer the fluid from the generator to the pice and Idk how they connect it, so any solution for this? I need something to not update every tick this thing. Some screenies from tha pipe the repeater means where it should go the fluid in advance!:
  9. No worries if u feel like u can check the github of the project here The only part of the code is working is the east face the other stuff I leave it blank cause if one face doesn't work the others neither. How you transfer energy from a generator to another thing?
  10. Here is the update method: Update method in pipe there I do the stuff thats on the pipe script but it doesnt seem to be working.
  11. How I can transfer energy from my generator to a pipe? I'm using FE energy. Gif with the issue As you can see in the gif the energy is 0 and idk why.
  12. Okay thanks for the help I figure it out by myself on the post u made long ago: Its like u sayd: Ill leave it there if somebody needs it!
  13. Idk how to get the Item from getfilledbucket, I need to return the fluid or how is that? Im trying but it gets an error Also I tried but the bucket isn't there
  14. Can you send me a example? It's a bit confusing the getfilledbucket stuff.
  15. So I made a fluid that adds a bucket from forge how I can get that bucket and add it to a custom tab? Also I need to check his name for a generator thingy. Any help?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.