Jump to content

[1.9.4] Fluid haven't texture!


TheHobber1712

Recommended Posts

(Sorry for my bad english!)

 

After I learned the basics of Blocks , Items... I wanted to make custom fluids.

After I finished my work I saw a Problem! not the Game Crashes! not the fluid isn't in-game! No! the fluid hasn't his texture!

So I  began my search for the Mistake I made but after more than 4 hours I can't find anything!

 

fluids.json

{
    "forge_marker": 1,
    "defaults": {
        "model": "forge:fluid",
        "transform": "forge:default-item"
    },
    "variants": {
        "fluid": [{
            "custom": { "fluid": "fluid_test" }
        }]
    }
}

 

BlockFluidTest Class

public class BlockFluidTest extends BlockFluidClassic{

	public BlockFluidTest(Fluid fluid) {
		super(fluid, Material.WATER);
		this.setUnlocalizedName("block_test");
		this.setRegistryName("block_test");
	}

}

 

FluidTest Class

public class FluidTest extends Fluid{

	public FluidTest() {
		super("fluid_test", new ResourceLocation("blocks/water_still"), new ResourceLocation("blocks/water_flow"));
	}
}

 

Main Class


public static FluidTest fluid = new FluidTest();
public static Block blockfluid;

@EventHandler
public void init(FMLInitializationEvent event)
{
    FluidRegistry.registerFluid(fluid);
    blockfluid = new BlockFluidTest(fluid);
    registerBlock(blockfluid);
}

public static void registerBlock(Block block)
{
    GameRegistry.register(block);
    GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}

 

Client Proxy

registerFluidModel(TestMod.blockfluid, "fluid");

public void registerFluidModel(Block fluidBlock, final String name)
{
	Item item = Item.getItemFromBlock(fluidBlock);
	ModelBakery.registerItemVariants(item);
	ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
			
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) {
			return new ModelResourceLocation(TestMod.MODID + ":fluids", name);
		}
	});
	ModelLoader.setCustomStateMapper(fluidBlock, new StateMapperBase() {
			
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
			return new ModelResourceLocation(TestMod.MODID + ":fluids", name);
		}
	});
}

 

2018-08-20_11_34_10.thumb.png.6a8e354ea27cdeb999c9c283caadfe7d.png

 

Thanks in Advance! ?

Link to comment
Share on other sites

Here

 

Spoiler

[00:07:03] [Client thread/INFO]: Setting user: Player518
[00:07:06] [Client thread/INFO]: LWJGL Version: 2.9.4
[00:07:09] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod
[00:07:11] [Sound Library Loader/INFO]: Starting up SoundSystem...
[00:07:11] [Thread-8/INFO]: Initializing LWJGL OpenAL
[00:07:11] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[00:07:12] [Thread-8/INFO]: OpenAL initialized.
[00:07:12] [Sound Library Loader/INFO]: Sound engine started
[00:07:14] [Client thread/INFO]: Created: 16x16 textures-atlas
[00:07:16] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod
[00:07:17] [Client thread/INFO]: SoundSystem shutting down...
[00:07:18] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[00:07:18] [Sound Library Loader/INFO]: Starting up SoundSystem...
[00:07:18] [Thread-10/INFO]: Initializing LWJGL OpenAL
[00:07:18] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[00:07:18] [Thread-10/INFO]: OpenAL initialized.
[00:07:18] [Sound Library Loader/INFO]: Sound engine started
[00:07:20] [Client thread/INFO]: Created: 1024x512 textures-atlas
[00:07:25] [Server thread/INFO]: Starting integrated minecraft server version 1.9.4
[00:07:25] [Server thread/INFO]: Generating keypair
[00:07:25] [Server thread/INFO]: Preparing start region for level 0
[00:07:26] [Server thread/INFO]: Changing view distance to 12, from 10
[00:07:26] [Client thread/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@50e0bce4[id=9c6f7109-b578-36c3-a272-028e06c40407,name=Player518,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationUnavailableException: Cannot contact authentication server
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:71) ~[YggdrasilAuthenticationService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:168) [YggdrasilMinecraftSessionService.class:?]
    at net.minecraft.client.Minecraft.launchIntegratedServer(Minecraft.java:2442) [Minecraft.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:715) [FMLClientHandler.class:?]
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.loadWorld(GuiListWorldSelectionEntry.java:249) [GuiListWorldSelectionEntry.class:?]
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.joinWorld(GuiListWorldSelectionEntry.java:203) [GuiListWorldSelectionEntry.class:?]
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.mousePressed(GuiListWorldSelectionEntry.java:167) [GuiListWorldSelectionEntry.class:?]
    at net.minecraft.client.gui.GuiListExtended.mouseClicked(GuiListExtended.java:57) [GuiListExtended.class:?]
    at net.minecraft.client.gui.GuiWorldSelection.mouseClicked(GuiWorldSelection.java:134) [GuiWorldSelection.class:?]
    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:613) [GuiScreen.class:?]
    at net.minecraft.client.gui.GuiWorldSelection.handleMouseInput(GuiWorldSelection.java:49) [GuiWorldSelection.class:?]
    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:579) [GuiScreen.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1796) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:404) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
    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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.net.UnknownHostException: sessionserver.mojang.com
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.Socket.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.NetworkClient.doConnect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivilegedWithCombiner(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.access$200(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivilegedWithCombiner(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) ~[?:1.8.0_181]
    at com.mojang.authlib.HttpAuthenticationService.performGetRequest(HttpAuthenticationService.java:126) ~[HttpAuthenticationService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[YggdrasilAuthenticationService.class:?]
    ... 28 more
[00:07:26] [Server thread/INFO]: Player518[local:E:3bb3c1de] logged in with entity id 33 at (1156.5, 66.0, 707.5)
[00:07:26] [Server thread/INFO]: Player518 joined the game
[00:07:27] [Server thread/INFO]: Saving and pausing game...
[00:07:27] [Server thread/INFO]: Saving chunks for level 'World'/Overworld
[00:07:27] [Server thread/INFO]: Saving chunks for level 'World'/Nether
[00:07:27] [Server thread/INFO]: Saving chunks for level 'World'/The End
[00:07:27] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@1081240a[id=9c6f7109-b578-36c3-a272-028e06c40407,name=Player518,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationUnavailableException: Cannot contact authentication server
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:71) ~[YggdrasilAuthenticationService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
    at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3043) [Minecraft.class:?]
    at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [SkinManager$3.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.net.UnknownHostException: sessionserver.mojang.com
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at java.net.Socket.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.NetworkClient.doConnect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivilegedWithCombiner(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.access$200(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    at java.security.AccessController.doPrivilegedWithCombiner(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) ~[?:1.8.0_181]
    at com.mojang.authlib.HttpAuthenticationService.performGetRequest(HttpAuthenticationService.java:126) ~[HttpAuthenticationService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[YggdrasilAuthenticationService.class:?]
    ... 19 more
[00:07:47] [Server thread/INFO]: Saving and pausing game...
[00:07:47] [Server thread/INFO]: Saving chunks for level 'World'/Overworld
[00:07:47] [Server thread/INFO]: Saving chunks for level 'World'/Nether
[00:07:47] [Server thread/INFO]: Saving chunks for level 'World'/The End
[00:07:48] [Server thread/INFO]: Stopping server
[00:07:48] [Server thread/INFO]: Saving players
[00:07:48] [Server thread/INFO]: Saving worlds
[00:07:48] [Server thread/INFO]: Saving chunks for level 'World'/Overworld
[00:07:48] [Server thread/INFO]: Saving chunks for level 'World'/Nether
[00:07:48] [Server thread/INFO]: Saving chunks for level 'World'/The End
[00:07:48] [Client thread/INFO]: Stopping!
[00:07:48] [Client thread/INFO]: SoundSystem shutting down...
[00:07:49] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

 

Link to comment
Share on other sites

Okay, hum... in my fluid I use:

    public static void registry() 
    {
        ClassMod.FLUID = Fluid.instance;
        FluidRegistry.registerFluid(ClassMod.FLUID);
        ClassMod.FLUID_BLOCK = registerFluidBlock(fluid, new BlockFluid(ClassMod.FLUID), "fluid");
        
        ClassMod.FLUID_BUCKET = registerBucket((new ItemBucket(ClassMod.FLUID_BLOCK)).setContainerItem(Items.BUCKET), "bucket_fluid").setCreativeTab(CREATIVETAB);
    }
    
    private static Item registerBucket(Item setContainerItem, String name) 
    {
        setContainerItem.setUnlocalizedName(name);
        setContainerItem.setRegistryName(name);

        GameRegistry.register(setContainerItem);
        return setContainerItem;
    }

    public static Block registerFluidBlock(Fluid fluid, Block fluidBlock, String name)
    {
        Block block = GameRegistry.register(fluidBlock, new ResourceLocation(Minecraft_mod.MOD_ID, name));
        ClassMod.proxy.registerFluidBlockRendering(block, name);
        fluid.setBlock(fluidBlock);
        return block;
    }

I do not really understand why this does not work in your code but it maybe due to incompatibility...

You can use that, but I no sure if it will work...

 

- JM

Link to comment
Share on other sites

In your ClientProxy, you can replace by that:

    @Override
    public void registerFluid(Block block, String name) 
    {
        final ModelResourceLocation location = new ModelResourceLocation(MOD_ID + ":" + name, "fluid");

        ModelLoader.setCustomStateMapper(block, new StateMapperBase()
        {
            @Override
            protected ModelResourceLocation getModelResourceLocation(IBlockState state)
            {
                return location;
            }
        });
    }

 

Link to comment
Share on other sites

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.