Jump to content

Recommended Posts

Posted

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/:?]

Posted

Its pretty easy. just try this:

 

 

  Reveal hidden contents

 

 

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).

Posted

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

Posted
  On 8/14/2015 at 11:10 AM, 28Smiles said:

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 :P

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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