Rendu complexe de bloc via TESR
-
Déjà traité dans la section support pour les moddeurs. Il faut poser un second bloc en même temps et l’enleve quand un des deux est détruit (onBlockPlacedBy et blockBreak).
-
Bonjour j’ai un petit problème, quand je regarde dans l’inventaire (le rendu du block) ou que je me give le block, le jeu crash instantanément … Je ne sais aps pourquoi, j’ai pourtant suvi le tutoriel là la lettre … Ps: Je suis en Forge 1.7.2
Crash :
Time: 18/05/14 10:15 Description: Rendering item java.lang.NullPointerException: Rendering item at net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer.bindTexture(TileEntitySpecialRenderer.java:21) at fr.mrazerty31.MoreFurnitures.proxy.TileEntityChairSpecialRender.renderTileEntityChairAt(TileEntityChairSpecialRender.java:38) at fr.mrazerty31.MoreFurnitures.proxy.TileEntityChairSpecialRender.renderInventory(TileEntityChairSpecialRender.java:25) at fr.mrazerty31.MoreFurnitures.proxy.TESRInventoryRenderer.renderInventoryBlock(TESRInventoryRenderer.java:49) at cpw.mods.fml.client.registry.RenderingRegistry.renderInventoryBlock(RenderingRegistry.java:125) at net.minecraft.src.FMLRenderAccessLibrary.renderInventoryBlock(FMLRenderAccessLibrary.java:59) at net.minecraft.client.renderer.RenderBlocks.renderBlockAsItem(RenderBlocks.java:8378) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:447) at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1143) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1022) at net.minecraft.client.Minecraft.run(Minecraft.java:910) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer.bindTexture(TileEntitySpecialRenderer.java:21) at fr.mrazerty31.MoreFurnitures.proxy.TileEntityChairSpecialRender.renderTileEntityChairAt(TileEntityChairSpecialRender.java:38) at fr.mrazerty31.MoreFurnitures.proxy.TileEntityChairSpecialRender.renderInventory(TileEntityChairSpecialRender.java:25) at fr.mrazerty31.MoreFurnitures.proxy.TESRInventoryRenderer.renderInventoryBlock(TESRInventoryRenderer.java:49) at cpw.mods.fml.client.registry.RenderingRegistry.renderInventoryBlock(RenderingRegistry.java:125) at net.minecraft.src.FMLRenderAccessLibrary.renderInventoryBlock(FMLRenderAccessLibrary.java:59) at net.minecraft.client.renderer.RenderBlocks.renderBlockAsItem(RenderBlocks.java:8378) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:447) -- Item being rendered -- Details: Item Type: net.minecraft.item.ItemBlock@56c96a62 Item Aux: 0 Item NBT: null Item Foil: false Stacktrace: at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) -- Screen render details -- Details: Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative Mouse location: Scaled: (225, 128). Absolute: (450, 222) Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2 -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player624'/49, l='MpServer', x=-482,50, y=5,62, z=-279,50]] Chunk stats: MultiplayerChunkCache: 225, 225 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (-489,4,-277), Chunk: (at 7,0,11 in -31,-18; contains blocks -496,0,-288 to -481,255,-273), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 144 game time, 144 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 8 total; [EntitySlime['Slime'/7788, l='MpServer', x=-490,80, y=4,00, z=-225,43], EntitySlime['Slime'/8138, l='MpServer', x=-459,50, y=4,00, z=-228,72], EntitySlime['Slime'/7202, l='MpServer', x=-451,81, y=4,00, z=-225,55], EntitySlime['Slime'/20525, l='MpServer', x=-561,81, y=4,00, z=-343,31], EntitySlime['Slime'/7200, l='MpServer', x=-453,54, y=4,00, z=-238,64], EntitySlime['Slime'/9123, l='MpServer', x=-517,09, y=4,00, z=-278,41], EntityClientPlayerMP['Player624'/49, l='MpServer', x=-482,50, y=5,62, z=-279,50], EntitySlime['Slime'/10016, l='MpServer', x=-461,97, y=4,77, z=-330,11]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2521) at net.minecraft.client.Minecraft.run(Minecraft.java:932) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) – System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 946895344 bytes (903 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 9251 (518056 bytes; 0 MB) allocated, 155 (8680 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.01-pre FML v7.2.156.1060 Minecraft Forge 10.12.1.1060 4 mods loaded, 4 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.2.156.1060} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.1.1060.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.12.1.1060} [Minecraft Forge] (forgeSrc-1.7.2-10.12.1.1060.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available morefurnitures{0.0.1} [More Furnitures] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: GeForce GT 630/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation 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) Vec3 Pool Size: 353 (19768 bytes; 0 MB) allocated, 65 (3640 bytes; 0 MB) used Anisotropic Filtering: Off (1) #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Guillaume\Desktop\Programmation\Programmes\Minecraft\Mods\New 1.7.2\More Furnitures\eclipse\.\crash-reports\crash-2014-05-18_10.15.43-client.txt AL lib: (EE) alc_cleanup: 1 device not closed -
Problème au niveau du proxy
-
Je vais voir si j’ai bien tout mis ^^ Merci de ta réponse

Je ne vois rien dans le Client Proxy qui pourrait causer un crash Oo
Mon ClientProxy.java :
package fr.mrazerty31.MoreFurnitures.proxy; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import fr.mrazerty31.MoreFurnitures.MoreFurnitures; import fr.mrazerty31.MoreFurnitures.TileEntityChair; import fr.mrazerty31.MoreFurnitures.proxy.TESRInventoryRenderer.TESRIndex; public class ClientProxy extends CommonProxy { public static int renderInventoryTESRId; @Override public void registerRender() { renderInventoryTESRId = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer()); } @Override public void registerTileEntityRender() { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChair.class, new TileEntityChairSpecialRender()); TESRInventoryRenderer.blockByTESR.put(new TESRIndex(MoreFurnitures.woodenChair, 0), new TileEntityChairSpecialRender()); } } -
Le problème est très simple:
[1.6.x] Rendu complexe de bloc via TESR
“j’ai pourtant suvi le tutoriel là la lettre … Ps: Je suis en Forge 1.7.2”Si tu l’as suivi à la lettre c’est normal que ça ne fontionne pas en 1.7 vu que le tuto est pour 1.6
Sinon je pourrais voir ton TileEntitySpecialRender
-
Je te le donne :
package fr.mrazerty31.MoreFurnitures.proxy; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import fr.mrazerty31.MoreFurnitures.ModelChair; import fr.mrazerty31.MoreFurnitures.TileEntityChair; public class TileEntityChairSpecialRender extends TileEntitySpecialRenderer implements IInventoryRenderer { private final ModelChair model = new ModelChair(); public static final ResourceLocation textureLocation = new ResourceLocation("morefurnitures", "textures/blocks/woodenchair.png"); public TileEntityChairSpecialRender() { } @Override public void renderInventory(double x, double y, double z) { this.renderTileEntityChairAt(null, x, y, z, 0.0F); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) { this.renderTileEntityChairAt((TileEntityChair)te, x, y, z, tick); } public void renderTileEntityChairAt(TileEntityChair te, double x, double y, double z, float tick) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5F, y + 1.5F, z + 0.5F); this.bindTexture(textureLocation); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); this.model.render(0.0625F); GL11.glPopMatrix(); } }Ps : Je n’ai pas mis l’instance dans le constructeur car je n’ai pas trouvé le fonction.
-
public TileEntityChairSpecialRender() { this.func_147497_a(TileEntityRendererDispatcher.instance); }Mets ça dans le constructeur, ça devrait être bon.
-
Ca marche :DD Merci beaucoup encore une fois !!!
-
Question dans le tuto tu dit ne suivez que la partie Création du modèle sur techne sauf que après tu parle du fichier en java alors il faut le mettre en java car dans la partie création c’est écrit de le mettre en png
-
Oui en effet, il faut aussi exporter le modèle en .java, c’est sous entendu par cette phrase :
Une fois votre modèle exporté en java
Il ne faut pas suivre la partie ou je modifie le modèle pour l’appliquer à un mob.
-
Escusez moi j’ai juste un problème quand j’applique les directions, seul deux côtés sont “bon” els autres sont à l’envers. Ah et je vodurait aussi que la direction s’apllique dans 8 direction c’est à dire que le block pivote de 45°.
-
Il faut gérer ça avec la fonction onBlockPlayerBy et il faut modifier la fonction glRotate.
-
Ouai sa j’avais compris mais je n’arrive pas à comprendre ce calcul : int direction = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
-
living.rotationYaw est l’angle du joueur, tu peux faire un System.out.println(living.rotationYaw); pour voir comment cette variable varie en fonction de ta direction. Ensuite tu as juste à exploiter ce que tu as pu constater pour trouver la direction.
Rien ne t’oblige à reprendre la fonction de minecraft. -
Ouai je verrai amis il y a un truc qui me dérange c’est ceci “& 3” quesque sa fait dans un calcule ça ?
-
Si je ne me trompe pas, le & 3, correspond au metadata.
Envoyé de mon AN7DG3-LZ en utilisant Tapatalk
-
http://www.commentcamarche.net/contents/561-java-les-operateurs -> Les opérateurs bit-à-bit
-
Merci j’ai reussi !
-
Hello , je suis en 1.7.2 et j’ai essayé de faire le tuto puis de voir comment régler les soucis j’ai donc faits toutes mes classes et aucune erreur apparaît le problème est quand je lance le jeu il crash voici le report :
–-- Minecraft Crash Report ---- // Quite honestly, I wouldn't worry myself about that. Time: 19/07/14 1:14 Description: Initializing game java.lang.NullPointerException: Initializing game at mod.proxy.BarriereInventoryRenderer$TESRIndex.hashCode(BarriereInventoryRenderer.java:26) at java.util.HashMap.hash(Unknown Source) at java.util.HashMap.put(Unknown Source) at mod.proxy.ClientProxy.registerTileEntityRender(ClientProxy.java:41) at mod.common.ModMinecraft.init(ModMinecraft.java:81) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:585) at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at mod.proxy.BarriereInventoryRenderer$TESRIndex.hashCode(BarriereInventoryRenderer.java:26) at java.util.HashMap.hash(Unknown Source) at java.util.HashMap.put(Unknown Source) at mod.proxy.ClientProxy.registerTileEntityRender(ClientProxy.java:41) at mod.common.ModMinecraft.init(ModMinecraft.java:81) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:585) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_05, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 717832584 bytes (684 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized modminecraft{1.0} [Mod Minecraft] (bin) Unloaded->Constructed->Pre-initialized->Errored Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: GeForce GTX 650/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: ~~ERROR~~ NullPointerException: null Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null Anisotropic Filtering: Off (1)Des idées ? J’ai cherché mais je n’ai rien trouvé

-
tu peux envoyer toute tes classe, n’oublie pas la balise spoiler :D.


