Résolu Problème fluid
-
Bonjour au lecteur :p, comme le titre du sujet l’'indique j’ai un problème de fluid, la texture n’apparait pas.
Voici les logs de console.
[12:30:03] [Client thread/ERROR] [FML]: Exception loading model for variant ram:waterColorBlack#level=2 for blockstate "ram:waterColorBlack[level=2]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model ram:waterColorBlack#level=2 with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:134) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:222) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:210) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:127) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:131) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:112) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:797) [Minecraft.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:332) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:559) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:384) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91] 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_91] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?]
j’ai pas tout mis puisque qu’il répète plusieur fois la même chose.
Voici ma classe fluid.
package com.ram.main; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; public class FluidsRAM { public static ModelResourceLocation WATERCB = new ModelResourceLocation(Reference.MODID + ":" + BlockWaterColorBlack.name, "fluid"); public static void register() { FluidRegistry.registerFluid(FluidWaterColorBlack.instance); GameRegistry.registerBlock(BlockWaterColorBlack.instance, BlockWaterColorBlack.name); Item waterColorBlack = Item.getItemFromBlock(BlockWaterColorBlack.instance); ModelLoader.setCustomMeshDefinition(waterColorBlack, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { return WATERCB; } }); ModelLoader.setCustomStateMapper(BlockWaterColorBlack.instance, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return WATERCB; } }); } public static final class FluidWaterColorBlack extends Fluid { public static final String name = "waterColorBlack"; public static final FluidWaterColorBlack instance = new FluidWaterColorBlack(); public FluidWaterColorBlack(){ super(name, new ResourceLocation(Reference.MODID+":"+"blocks/"+name+"_still"),new ResourceLocation(Reference.MODID+":"+"blocks/"+name+"_flow")); } } public static final class BlockWaterColorBlack extends BlockFluidClassic { public static final BlockWaterColorBlack instance = new BlockWaterColorBlack(); public static final String name = "waterColorBlack"; public BlockWaterColorBlack() { super(FluidWaterColorBlack.instance, Material.WATER); setUnlocalizedName(name); setCreativeTab(Tabs.ramBlock); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } } }
et voici le blockStates
{ "forge_marker": 1, "variants": { "fluid": { "model": "forge:fluid", "custom": {"fluid": "waterColorBlack"} }, "inventory": { "model": "forge_bucket", "textures": { "base": "forge:items/bucket_base", "fluid": "forge:items/bucket_fluid", "cover": "forge:items/bucket_cover" }, "transform": "forge:default-item", "custom": { "fluid": "waterColorBlack", "flipGas": true } } } }
j’ai les 2 textures dans mon fichier /textures/blocks/
le 1 premier waterColorBlack_flow
et le second waterColorBlack_stillj’ai suivi un tuto sur youtube de Champion Ash, je cherche depuis un moment mais je vois pas ce qui cloche :x
je précise bien que le fluide marche j’ai aucun bug avec, c’est juste la texture qui n’apparait pas.
je continu a chercher de mon coté, merci d’avance pour l’aide qui sera fourni.
Cordialement Ryu1982
-
Salut
Il te faut 3 json : un dans blockstate, un dans models/blocks et un dans models/items -
J’avais déjà essayé et cela ne marche pas, le problème dans la vidéo c’est qu’il en fait pas. donc c’est peut peut être normal .
-
Il me semble qu’il faut quelque chose comme “ModelBakery.addVariantName(waterColorBlack);” dans register, juste avant ModelLoader.setCustomMeshDefinition.
(Ps @Axaurus, pour les liquides, on ne passe pas par le model du block et de l’item, on utilise directement le model de fourni par forge, pour ce simplifier la vie) -
Je viens d’essayer idem ça ne marche pas, j’ai vue que j’avais fait quelque erreur je les ai donc modifier
{ "forge_marker": 1, "variants": { "fluid": { "model": "forge:fluid", "custom": {"fluid": "waterColorBlack"} }, "inventory": { "model": "forge:forgebucket", "textures": { "base": "forge:items/bucket_base", "fluid": "ram:items/bucket_waterColorBlack", "cover": "forge:items/bucket_cover" }, "transform": "forge:default-item", "custom": { "fluid": "waterColorBlack", "flipGas": true } } } }
j’ai mis le register dans le preInit, il était dans mon common proxy puisque j’enregistre tout ici moi
.maintenant il me mets ça dans les logs x)
[12:11:31] [Client thread/INFO] [Resource And More]: Finished PreInitialization [12:11:31] [Client thread/INFO] [FML]: Applying holder lookups [12:11:31] [Client thread/INFO] [FML]: Holder lookups applied [12:11:31] [Client thread/INFO] [FML]: Injecting itemstacks [12:11:31] [Client thread/INFO] [FML]: Itemstack injection complete [12:11:41] [Sound Library Loader/INFO]: Starting up SoundSystem… [12:11:42] [Thread-8/INFO]: Initializing LWJGL OpenAL [12:11:42] [Thread-8/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [12:11:51] [Thread-8/INFO]: OpenAL initialized. [12:11:51] [Sound Library Loader/INFO]: Sound engine started [12:11:54] [Client thread/ERROR] [FML]: fluid 'waterColorBlack' not found [12:11:58] [Client thread/INFO] [FML]: Max texture size: 4096 [12:11:58] [Client thread/INFO]: Created: 16x16 textures-atlas [12:12:07] [Client thread/INFO] [Resource And More]: Finished Initialization [12:12:07] [Client thread/INFO] [FML]: Injecting itemstacks [12:12:07] [Client thread/INFO] [FML]: Itemstack injection complete [12:12:07] [Client thread/INFO] [Resource And More]: Finished PostInitialization [12:12:08] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [12:12:08] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Resource And More [12:12:14] [Client thread/INFO]: SoundSystem shutting down… [12:12:14] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com [12:12:14] [Sound Library Loader/INFO]: Starting up SoundSystem… [12:12:14] [Thread-10/INFO]: Initializing LWJGL OpenAL [12:12:14] [Thread-10/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [12:12:19] [Thread-10/INFO]: OpenAL initialized. [12:12:19] [Sound Library Loader/INFO]: Sound engine started [12:12:22] [Client thread/ERROR] [FML]: fluid 'waterColorBlack' not found [12:12:27] [Client thread/INFO] [FML]: Max texture size: 4096 [12:12:28] [Client thread/INFO]: Created: 1024x1024 textures-atlas
Il ne trouve pas le fluid mais il y a une texture celle de l’eau xD
-
Où se trouve la texture waterColorBlack ?
-
J’ai juste les 2 textures
-assets/ram/textures/blocks/waterColorBlack_flow.png
-assets/ram/textures/blocks/waterColorBlack_still.png -
Salut,
regardes la pièce jointe de cette demande d’aide, il a un exemple de fluide.
Il ne me semble pas que cela a changé en 1.9.
https://www.minecraftforgefrance.fr/showthread.php?tid=3240&pid=38349#pid38349 -
Bonjour, problème réglé effectivement forge pour les fluides ne prend pas en compte les majuscules.
J’ai modifié tout ça et maintenant ma texture apparait bien.
Je mets la balise résolu
Un grand merci pour votre aide.Cordialement Ryu1982