Un bloc basique
-
Autre Erreur au lancement du RUN
–-- Minecraft Crash Report ---- // Shall we play a game? Time: 02/02/14 16:29 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:75) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:112) at cpw.mods.fml.common.Loader.loadMods(Loader.java:511) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) at net.minecraft.client.Minecraft.startGame(Minecraft.java:473) at net.minecraft.client.Minecraft.run(Minecraft.java:808) at net.minecraft.client.main.Main.main(Main.java:93) 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:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) ... 33 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Windows 8 (x86) version 6.2 Java Version: 1.7.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 884633840 bytes (843 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 4 mods loaded, 4 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed SylaenTool{1.0.0} [Sylaen Tool] (bin) Unloaded->ErroredJe ne Comprend toujours pas ce qui ce passe voila la classe principal:
package sylaentool.common; import net.minecraft.block.Block; import sylaentool.proxy.SyltCommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "SylaenTool", name = "Sylaen Tool", version = "1.0.0", acceptedMinecraftVersions = "[1.6.4,)") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class SylaenTool { @SidedProxy(clientSide = "sylaentool.proxy.SyltClientProxy", serverSide = "sylaentool.proxy.SyltCommonProxy") @Instance("SylaenTool") public static SylaenTool instance; public static Block MineraisAcier; @EventHandler public void PreInit(FMLPreInitializationEvent event) { MineraisAcier = new MineraisAcier(3000).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep) .setUnlocalizedName("MineraisAcier").setTextureName("sylaentool:MineraisAcier"); GameRegistry.registerBlock(MineraisAcier,"MineraisAcier"); } @EventHandler public void Init (FMLInitializationEvent event) { } @EventHandler public void PostInit(FMLPostInitializationEvent event) { } }Common proxy :
package sylaentool.proxy; public class SyltCommonProxy { public void registerRender () { } }Client Proxy :
package sylaentool.proxy; import net.minecraftforge.client.MinecraftForgeClient; public class SyltClientProxy extends SyltCommonProxy { @Override public void registerRender() { } }Et voila la classe du block que je viens de faire :
package sylaentool.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class MineraisAcier extends Block { public MineraisAcier(int id) { super(id, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } } -
Toujours un problème de proxy, pourquoi as-tu enlevé la ligne public static SyltCommonProxy proxy; ?
Elle doit être en dessus du @SidedProxy(clientSide = “sylaentool.proxy.SyltClientProxy”, serverSide = “sylaentool.proxy.SyltCommonProxy”). -
En dessous de:```java
@SidedProxy(clientSide = “sylaentool.proxy.SyltClientProxy”, serverSide = “sylaentool.proxy.SyltCommonProxy”)rajoute: ```java public static SyltCommonProxy proxy;EDIT: Doublé par robin4002

-
Merci beaucoup !
Maintenant ça marche !
Petite question :
Comment on peut faire pour qu’un fois en jeu mon Item s’appel Minerais d’Acier au lieu de tile.MineraisAcier.name -
Il faut passer par les fichiers de lang, mais tu as lu le tuto ou pas?
-
Oui mais j’ai eu un peu de mal a comprendre …
Merci de ta réponse. -
Ok
-
Salut, pourrait tu faire ce tutoriel pour la version 1.7.2 de forge ?
-
C’est prévu.
-
Patience, on sort un tutoriel chaque mercredi et samedi.
-
Ok, merci pour l’info
-
@‘robin4002’:
Patience, on sort un tutoriel chaque mercredi et samedi.
Les updates de tutoriel comptent aussi, pas juste du nouveau hein /!\
-
Normal que il y a une erreur sur .setUnlocalizedName(“”) ?
(Je suis en 1.7.2) -
Le tutoriel n’est pas fait pour la 1.7.
-
C’est possible que notre bloc puisse réagir au balise ?
Enfaite mon bloc c’est un bloc de cuivre je voudrais qu’on puisse faire une balise avec !
Si vous pouvez m’aider ce serait cool !Bye !
-
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; }Dans la classe de ton bloc (en tout cas en 1.7.2), mais c’est sûrement la même chose en 1.6
-
Salut, c’est encore moi !
Comme dit plus haut j’ai crée un bloc de cuivre maintenant j’ai crée un bloc de saphir mais voilà il y a un petit problème !
Il n’y à que le bloc de cuivre qui s’affiche dans les onglets créatives et je ne peut pas me le donner (/give) pourtant il n’y a aucune erreur dans mes codes !
PS²: Excusez-moi des fautes d’orthographes !EDIT: Problème résolu : j’avais oublié le GameRegistry x)
Bye !
@‘robin4002’:
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; }Dans la classe de ton bloc (en tout cas en 1.7.2), mais c’est sûrement la même chose en 1.6
J’essaye sa et je vous dit !
EDIT: Vous allez me prendre pour un “nul”, j’ai des trucs à modifer sur le code ? si oui voici mon code :
package alphis.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.world.IBlockAccess; public class block1 extends Block { public block1(int id) { super(id, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public boolean isBeaconBase(IBlockAccess block1, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; } }Bye !
-
Normalement c’est bon comme ça. Renomme juste IBlockAccess block1 en IBlockAccess world. C’est plus logique.
-
Le code ne fonctionne pas en 1.6, si vous en avez un autre ! C’est super important pour moi que mon bloc puisse faire une balise !
Bye !
EDIT: Je peut attendre ^^’ et il y a-t-il un topic de demande de tutoriel ?
-
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; }Pourtant elle existe aussi en 1.6.4.
Oui, il y une discussion pour les demandes de tuto, mais je vais pas faire un tutoriel pour une fonction …
