Création de bloc
-
Oui celui de blockstates:
:::
{
“variants”: {
“normal”: {
“model”: “modminefus:m_grass”
}
}
}
:::celui dans Models/block:
:::
{
“parent”: “block/cube_bottom_top”,
“textures”: {
“bottom”: “modminefus:blocks/m_grass_bottom”,
“top”: “modminefus:blocks/m_grass_top”,
“side”: “modminefus:blocks/m_grass_side”
}
}
:::Et celui dans Models/item:
:::
{
“parent”: “modminefus:block/m_grass”,
“display”: {
“thirdperson”: {
“rotation”: [ 10, -45, 170 ],
“translation”: [ 0, 1.5, -2.75 ],
“scale”: [ 0.375, 0.375, 0.375 ]
}
}
}
::: -
Tes JSONs semblent bon, où as-tu mis registerBlockTexture ? Essai de mettre ton modid en minuscule dans ta fonction registerItemTexture :
mesher.register(item, metadata, new ModelResourceLocation("modminefus:" + name, "inventory")); -
Le modid en minuscule ne change rien.
J’ai mis registerBlockTexture(BlockMinefus.m_grass, “m_grass”); dans public void registerRenders(){}
Comme indiqué par Robin et toujours pas de changement ^^ -
As-tu des erreurs dans tes logs ?
-
Non pas d’erreurs dans les logs
-
Bonjour, ta fonction registerBlockTexture pour ton bloc n’est tout simplement pas appelée.
-
J’allais effectivement proposer de vérifier cela, car il tout est bon. Tu dis que registerBlockTexture est appelé dans registerRenders mais cette dernière est-elle bien appelée ?
-
Alors j’ai appelé la fonction mais maintenant j’ai un crashreport:
package com.degraduck.modminefus; import org.apache.logging.log4j.Logger; import com.degraduck.modminefus.init.BlockMinefus; import com.degraduck.modminefus.proxy.CommonProxy; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class ModMinefus { @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; @Instance(Reference.MOD_ID) public static ModMinefus instance; public static final String MODID = "modminefus"; public static Logger logger; public static CreativeTabs tabMBlock = new CreativeTabs("tabMBlock") { @SideOnly(Side.CLIENT) public Item getTabIconItem() { return Items.gold_ingot; } }; @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); proxy.init(); proxy.registerRenders(); BlockMinefus.init(); BlockMinefus.register(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenders(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }Le crashreport:
:::
–-- Minecraft Crash Report ----
// You should try our sister game, Minceraft!Time: 15/08/16 23:08
Description: Initializing gamejava.lang.NullPointerException: Initializing game
at com.degraduck.modminefus.proxy.ClientProxy.registerItemTexture(ClientProxy.java:32)
at com.degraduck.modminefus.proxy.ClientProxy.registerBlockTexture(ClientProxy.java:45)
at com.degraduck.modminefus.proxy.ClientProxy.registerBlockTexture(ClientProxy.java:51)
at com.degraduck.modminefus.proxy.ClientProxy.registerRenders(ClientProxy.java:23)
at com.degraduck.modminefus.ModMinefus.preInit(ModMinefus.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:455)
at net.minecraft.client.Minecraft.run(Minecraft.java:364)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)A detailed walkthrough of the error, its code path and all known details is as follows:
– Head –
Stacktrace:
at com.degraduck.modminefus.proxy.ClientProxy.registerItemTexture(ClientProxy.java:32)
at com.degraduck.modminefus.proxy.ClientProxy.registerBlockTexture(ClientProxy.java:45)
at com.degraduck.modminefus.proxy.ClientProxy.registerBlockTexture(ClientProxy.java:51)
at com.degraduck.modminefus.proxy.ClientProxy.registerRenders(ClientProxy.java:23)
at com.degraduck.modminefus.ModMinefus.preInit(ModMinefus.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:455)– Initialization –
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:364)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)– System Details –
Details:
Minecraft Version: 1.8.9
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_101, Oracle Corporation
Java VM Version: Java HotSpot
64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 669643256 bytes (638 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.19 Powered by Forge 11.15.1.1722 4 mods loaded, 4 mods active
States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCH Forge{11.15.1.1722} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCE modminefus{1.0.0} [Mod Minefus] (bin)
Loaded coremods (and transformers):
GL info: ’ Vendor: ‘Intel’ Version: ‘4.0.0 - Build 10.18.10.4276’ Renderer: ‘Intel
HD Graphics 4000’
Launched Version: 1.8.9
LWJGL: 2.9.4
OpenGL: Intel
HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4276, Intel
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.Using VBOs: No
Is Modded: Definitely; Client brand changed to ‘fml,forge’
Type: Client (map_client.txt)
Resource Packs:
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 4x Intel
Core
i3-3110M CPU @ 2.40GHz
::: -
Le problème vient de la ligne 32 de ton client proxy (at com.degraduck.modminefus.proxy.ClientProxy.registerItemTexture(ClientProxy.java:32), fais un print des différentes variables de ta fonction pour voir ce qui est null.
-
Résolu merci a tous