Posted August 14, 201510 yr Hello, I've some trouble with my Fluidtank. It dousen't find the Texture of Water here the nessesary code: ResourceLocation fluidTexture = fluidTank.getFluid().getFluid().getStill(fluidTank.getFluid()); fluidTexture = new ResourceLocation(fluidTexture.getResourceDomain(), "textures/" + fluidTexture.getResourcePath()); Minecraft.getMinecraft().renderEngine.bindTexture(fluidTexture); parent.setGLColorFromInt(fluidTank.getFluid().getFluid().getColor()); parent.drawSizedTexturedModalRect((int)position.getX() + 1 + (int)topLeft.getX(), (int)position.getY() + (int)topLeft.getY() + 59 - (int)((58F / 10F) * (((float)fluidTank.getFluidAmount()) / 1000F)), 0, 0, 16, (int)((58F / 10F) * (((float)fluidTank.getFluidAmount()) / 1000F)), 16F, 16F); Java Debugger: fluidTexture := "minecraft:textures/blocks/water_still"; color := r: 255 g: 255 b: 255 a: 1.0F fluid := water Exception: [10:31:32] [Client thread/WARN]: Failed to load texture: minecraft:textures/blocks/water_still java.io.FileNotFoundException: minecraft:textures/blocks/water_still at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:70) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:34) ~[simpleTexture.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:70) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:44) [TextureManager.class:?] at technocore.client.gui.elements.ElementFluidTank.draw(ElementFluidTank.java:38) [ElementFluidTank.class:?] at technocore.client.gui.TechnoCoreGui.drawGuiContainerBackgroundLayer(TechnoCoreGui.java:87) [TechnoCoreGui.class:?] at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:95) [GuiContainer.class:?] at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:460) [ForgeHooksClient.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1114) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] And I also tried another variant: ResourceLocation fluidTexture = fluidTank.getFluid().getFluid().getStill(fluidTank.getFluid()); Minecraft.getMinecraft().renderEngine.bindTexture(fluidTexture); parent.setGLColorFromInt(fluidTank.getFluid().getFluid().getColor()); parent.drawSizedTexturedModalRect((int)position.getX() + 1 + (int)topLeft.getX(), (int)position.getY() + (int)topLeft.getY() + 59 - (int)((58F / 10F) * (((float)fluidTank.getFluidAmount()) / 1000F)), 0, 0, 16, (int)((58F / 10F) * (((float)fluidTank.getFluidAmount()) / 1000F)), 16F, 16F); Java Debugger: fluidTexture := "minecraft:blocks/water_still"; color := r: 255 g: 255 b: 255 a: 1.0F fluid := water Exception: [10:31:53] [Client thread/WARN]: Failed to load texture: minecraft:blocks/water_still java.io.FileNotFoundException: minecraft:blocks/water_still at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:70) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:34) ~[simpleTexture.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:70) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:44) [TextureManager.class:?] at technocore.client.gui.elements.ElementFluidTank.draw(ElementFluidTank.java:38) [ElementFluidTank.class:?] at technocore.client.gui.TechnoCoreGui.drawGuiContainerBackgroundLayer(TechnoCoreGui.java:87) [TechnoCoreGui.class:?] at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:95) [GuiContainer.class:?] at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:460) [ForgeHooksClient.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1114) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?]
August 14, 201510 yr Its pretty easy. just try this: GL11.glPushMatrix(); IIcon iicon = Blocks.water.getIcon(0, 1000); IIcon iicon1 = Blocks.water.getIcon(1, 1000); float f1 =0.5F; Tessellator tessellator = Tessellator.instance; float f2 = 0.5F; float f3 = 0.0F; float f4 = 0.1F/ f1; float f5 =0.0F; float f6 = 0.0F; int i = 0; tessellator.startDrawingQuads(); while (f4 > 0.0F) { IIcon iicon2 = i % 2 == 0 ? iicon : iicon1; indTexture(TextureMap.locationBlocksTexture); float f7 = iicon2.getMinU(); float f8 = iicon2.getMinV(); float f9 = iicon2.getMaxU(); float f10 = iicon2.getMaxV(); if (i / 2 % 2 == 0) { float f11 = f9; f9 = f7; f7 = f11; } tessellator.setColorOpaque(140, 140, 140); //render your bits here } f4 -= 0.45F; f5 -= 0.45F; f2 *= 0.9F; f6 += 0.03F; ++i; } tessellator.draw(); GL11.glPopMatrix(); It will loop through the water texture and animate it. To use it, just do basic drawing of textured rectangle in your gui and do TextureMap.locationBlocksTexture(already in the correct location).
August 14, 201510 yr Author Yes it's easy but just for 1.7.10, in 1.8(look in the Subject) it isn't. My Problem is that the Texture isn't found, I get the missing texture.... Altrough thanks, but the Problem isn't solved
August 14, 201510 yr You must specify file format in resource location (so just add .png in the end)... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
August 14, 201510 yr Yes it's easy but just for 1.7.10, in 1.8(look in the Subject) it isn't. My Problem is that the Texture isn't found, I get the missing texture.... Altrough thanks, but the Problem isn't solved Oh - yea didn't see the 1.8
August 14, 201510 yr Author Thank's to all and especially to elix I missed the *.png at the end for those who are interested in the project here is a picture:
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.