Créer un bloc basique
-
@‘robin4002’:
Rien à voir avec le bloc.
Tu as suivis le deuxième bonus ici : http://www.minecraftforgefrance.fr/showthread.php?tid=566#bonus ?
Si oui, tu t’es planté dans ton mdp ou dans ton pseudo / adresse mail.
Si non, il y a un truc qui a fail, ajoute “–accessTocken FML” dans les arguments de lancement.Ah Oui, merci

-
C’est étrange, je ne pense pas avoir fais d’erreur, mais Eclipse me met constamment une erreur à la partie d’initialisation du bloc, sur la partie new StrangeStone(Material.rock)…
Pourtant, je pense ne pas avoir fait d’erreur.
@EventHandler public void preInit(FMLPreInitializationEvent event) { //preinit blocks strangeStone = new StrangeStone(Material.rock).setBlockName("StrangeStone").setHardness(1.5F).setBlockTextureName(MODID + ":StrangeBlock").setCreativeTab(CreativeTabs.tabBlock); //registery blocks GameRegistry.registerBlock(strangeStone, "StrangeStone"); }Si quelqu’un a une explication, qu’il me la dise s’il vous plait !
-
Eclipse indique quoi ?
Tu as quoi dans ta classe StrangeStone ? -
Il me propose de changer la visibilité de StrangeStone sur public…
Dans la classe du block j’ai ceci:package com.sugarshy.harmomod.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class StrangeStone extends Block { protected StrangeStone(Material material) { super(material); } } -
Il faut y changer en public sinon la classe est pas accessible.
-
@‘Diangle’:
Il faut y changer en public sinon la classe est pas accessible.
Pourtant elle n’y est pas sur le github du résultat final…
-
@‘Diangle’:
Il faut y changer en public sinon la classe est pas accessible.
Et bien tu avais raison, merci !
-
Car ta classe StrangeStone n’est pas dans le même package que ta classe main. Si tu utilises des packages différent, il faut toujours mettre en public !
-
Ah, je comprend mieux !
Merci ! -
En faite tu as :
protected, qui peux que être utiliser dans une classe qui hérite
private, qui est dans la classe et pas accessible depuis un autre package
public, c’est les portes ouverte. -
Il faut vraiment que je me mette sérieusement au Java…. en tout cas merci, je le saurai pour la prochaine fois !
-
Bonjour,
j’ai encore un problème, c’est que le bloc n’apparaît pas en jeu.#ma classe principale:(ma classe principale:)
:::
package com.gmail.archerux.technicalenergy.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; 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.registry.GameRegistry; @Mod(modid = "TechnicalEnergy", name = "TechnicalEnergy", version = "1.0.0") public class TechnicalEnergy { @Instance("TechnicalEnergy") public static TechnicalEnergy instance; @SidedProxy(clientSide = "com.gmail.archerux.technicalenergy.client.ClientProxy", serverSide = "com.gmail.archerux.technicalenergy.common.CommonProxy") public static CommonProxy proxy; public static Block CopperOre, TinOre, TitaniumOre, PlatiniumOre, KhoriumOre, ThoriumOre, AdamantiteOre; //public static Block CopperBlock, TinBlock, TitaniumBlock, PlatiniumBlock, KhoriumBlock, ThoriumBlock, AdamantiteBlock; public static CreativeTabs TechnicalEnergy = new CreativeTabs("TechnicalEnergy") { public Item getTabIconItem() { return Items.baked_potato; } @EventHandler public void preInit(FMLPreInitializationEvent event) { // Blocks–-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CopperOre = new CopperOre(Material.rock).setBlockName("CopperOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":Copper_ore"); GameRegistry.registerBlock(CopperOre, "CopperOre"); TinOre = new TinOre(Material.rock).setBlockName("TinOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Tin_ore"); GameRegistry.registerBlock(TinOre, "TinOre"); TitaniumOre = new TitaniumOre(Material.rock).setBlockName("TitaniumOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Titanium_ore"); GameRegistry.registerBlock(TitaniumOre, "TitaniumOre"); PlatiniumOre = new PlatiniumOre(Material.rock).setBlockName("PlatiniumOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Platinium_ore"); GameRegistry.registerBlock(PlatiniumOre, "PlatiniumOre"); KhoriumOre = new KhoriumOre(Material.rock).setBlockName("KhoriumOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Khorium_ore"); GameRegistry.registerBlock(KhoriumOre, "KhoriumOre"); ThoriumOre = new ThoriumOre(Material.rock).setBlockName("ThoriumOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Thorium_ore"); GameRegistry.registerBlock(ThoriumOre, "ThoriumOre"); AdamantiteOre = new AdamantiteOre(Material.rock).setBlockName("AdamantiteOre").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":" + "Adamantite_ore"); GameRegistry.registerBlock(AdamantiteOre, "AdamantiteOre"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public static final String MODID = "TechnicalEnergy"; }; };:::
#la classe de un de mes blocs que je veut ajouter:(la classe de un de mes blocs que je veut ajouter:)
:::
package com.gmail.archerux.technicalenergy.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class CopperOre extends Block { protected CopperOre(Material material) { super(material); } }:::
#la console:(la console:)
:::
[09:51:10] [main/INFO] [GradleStart]: username: Archerux[09:51:10] [main/INFO] [GradleStart]: Extra: []
[09:51:10] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Dylan/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --username, Archerux]
[09:51:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[09:51:10] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading
[09:51:10] [main/INFO] [FML]: Java is Java HotSpot
64-Bit Server VM, version 1.8.0_05, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre8
[09:51:10] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[09:51:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[09:51:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[09:51:10] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[09:51:14] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Dylan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[09:51:14] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[09:51:14] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Dylan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[09:51:14] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[09:51:14] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[09:51:14] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[09:51:15] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[09:51:17] [main/INFO]: Setting user: Archerux
[09:51:19] [Client thread/INFO]: LWJGL Version: 2.9.1
[09:51:21] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[09:51:21] [Client thread/INFO] [FML]: MinecraftForge v10.13.0.1180 Initialized
[09:51:21] [Client thread/INFO] [FML]: Replaced 182 ore recipies
[09:51:21] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[09:51:21] [Client thread/INFO] [FML]: Searching C:\Users\Dylan\Downloads\Minecraft\Modding\forge-1.7.10-10.13.0.1180-src\eclipse\mods for mods
[09:51:22] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on ‘net.minecraft.src’ : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you’re in eclipse, select your source code and ‘refactor’ it into a new package. Go on. DO IT NOW!
[09:51:26] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[09:51:27] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:TechnicalEnergy
[09:51:27] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: %s in %s
[09:51:27] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[09:51:27] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
[09:51:27] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[09:51:27] [Client thread/INFO] [FML]: Applying holder lookups
[09:51:27] [Client thread/INFO] [FML]: Holder lookups appliedStarting up SoundSystem…
Initializing LWJGL OpenAL
(The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
OpenAL initialized.[09:51:28] [Sound Library Loader/INFO]: Sound engine started
[09:51:32] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[09:51:32] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[09:51:32] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[09:51:32] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:TechnicalEnergy
[09:51:32] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: %s in %s
[09:51:33] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[09:51:33] [Client thread/INFO]: Created: 256x256 textures/items-atlasSoundSystem shutting down…
Author: Paul Lamb, www.paulscode.comStarting up SoundSystem…
Initializing LWJGL OpenAL
(The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
OpenAL initialized.[09:51:34] [Sound Library Loader/INFO]: Sound engine started
[09:51:42] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
[09:51:42] [Server thread/INFO]: Generating keypair
[09:51:43] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[09:51:43] [Server thread/INFO] [FML]: Applying holder lookups
[09:51:43] [Server thread/INFO] [FML]: Holder lookups applied
[09:51:43] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@45c2ccd9)
[09:51:43] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@45c2ccd9)
[09:51:44] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@45c2ccd9)
[09:51:44] [Server thread/INFO]: Preparing start region for level 0
[09:51:45] [Server thread/INFO]: Preparing spawn area: 29%
[09:51:45] [Server thread/INFO]: Changing view distance to 12, from 10
[09:51:46] [Netty Client IO #0/INFO] [FML]: Server protocol version 1
[09:51:46] [Netty IO #1/INFO] [FML]: Client protocol version 1
[09:51:46] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@7.10.18.1180,TechnicalEnergy@1.0.0,Forge@10.13.0.1180,mcp@9.05
[09:51:46] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
[09:51:46] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
[09:51:46] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
[09:51:46] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[09:51:46] [Server thread/INFO]: Archerux[local:E:f61f54b4] logged in with entity id 409 at (192.58096737140147, 92.2567204514835, 93.94413640754348)
[09:51:46] [Server thread/INFO]: Archerux joined the game
[09:52:03] [Client thread/INFO]: Stopping!
[09:52:03] [Server thread/INFO]: Stopping server
[09:52:03] [Server thread/INFO]: Saving playersSoundSystem shutting down…
[09:52:03] [Server thread/INFO]: Saving worlds
[09:52:03] [Server thread/INFO]: Saving chunks for level ‘New World’/Overworld
Author: Paul Lamb, www.paulscode.comException in thread “Client Shutdown Thread” java.lang.NullPointerException
at net.minecraftforge.common.ForgeChunkManager.saveWorld(ForgeChunkManager.java:836)
at net.minecraftforge.common.ForgeInternalHandler.onDimensionSave(ForgeInternalHandler.java:70)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_0_ForgeInternalHandler_onDimensionSave_Save.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:875)
at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:370)
at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:405)
at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:266)
at net.minecraft.client.Minecraft.stopIntegratedServer(Minecraft.java:2789)
at net.minecraft.client.main.Main$3.run(Main.java:154)
Java HotSpot
64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
::: -
bonjour j’ai le meme probleme pour mon bloc comment on change en public ? (je débute dsl )___Bonsoir j’ai fini le tuto pour créer un bloc basique , mon bloc est bien dans le jeu seulement la texture ne fonctionne pas , je le vois noir et violet pourtant je n’ai aucune erreur dans le code ni dans le nom de la texture cela correspond bien.
-
Envoie tes logs. Aussi les doubles posts sont interdit, merci de lire le règlement. Je fusionne tes deux messages, la prochaine fois utilise la fonction éditer sinon des avertissements vont tomber.
-
quel double post ? j’ai mis qu’un seul message je comprend pas désolé
par contre les logs je les trouve ou? -
Si si il y avait bien deux messages, je les ai fusionné.
Les logs sont dans la console d’eclipse. -
ah oui j’avais fait un premier message pour un problème que j’ai résolu tout seul donc je l’ai supprimé et ensuite j’ai refait un message pour se nouveau problème de texture , peu-être que tu voyais encore les deux .
j’ai trouvé dans les logs :[Client thread/ERROR]: Unable to parse metadata from modkart:textures/blocks/block_terrepiste.png
java.lang.RuntimeException: broken aspect ratio and not an animation
at net.minecraft.client.renderer.texture.TextureAtlasSprite.loadSprite(TextureAtlasSprite.java:245) ~[TextureAtlasSprite.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:170) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:170) [TextureManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:134) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:118) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:643) [Minecraft.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:303) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:586) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) [start/:?]
at GradleStart.main(GradleStart.java:45) [start/:?] -
Ta texture ne respecte pas le ratio 16x16, 32x32 etc …
-
Super merci bien

-
Bonsoir j’aimerais savoir si il est possible de crée des blocs en pente , comme dans le mod carpenters blocks merci !
