Générer des minerais
-
Je viens de trouver pourquoi. Remplace :
private static final IWorldGenerator worldgeneration = null;par :
private static final IWorldGenerator worldgeneration = new WorldGeneration(); -
Sa Crash encore sinon je peut t’envoyer mes sources via Mp ?
-
Tu as toujours le même rapport de crash ?
-
@‘guillaume5001’:
Sa Crash encore sinon je peut t’envoyer mes sources via Mp ?
Sinon tu peux poster les classes ici ^^.
-
Oui a quelques chose pret : voila les logs :
[22:57:49] [main/INFO] [GradleStart]: Extra: [] [22:57:49] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.7.10, --assetsDir, C:/Users/Patrice Andrieux/.gradle/caches/minecraft/assets, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker] [22:57:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [22:57:50] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1272 for Minecraft 1.7.10 loading [22:57:50] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_51, running on Windows 8:amd64:6.2, installed at C:\Users\Patrice Andrieux\Desktop\Important\eclipse-jee-luna-SR1-win32-x86_64\eclipse\jre [22:57:50] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [22:57:50] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [22:57:50] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin [22:57:50] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [22:57:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:57:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [22:57:50] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [22:57:53] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [22:57:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [22:57:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [22:57:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker [22:57:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker [22:57:54] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [22:57:56] [main/INFO]: Setting user: Player391 [22:58:00] [Client thread/INFO]: LWJGL Version: 2.9.1 [22:58:01] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [22:58:01] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1272 Initialized [22:58:01] [Client thread/INFO] [FML]: Replaced 182 ore recipies [22:58:02] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [22:58:02] [Client thread/INFO] [FML]: Searching C:\Users\Patrice Andrieux\Desktop\forge-1.7.10-10.13.2.1272-src\eclipse\mods for mods [22:58:07] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [22:58:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, ykemods] at CLIENT [22:58:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, ykemods] at SERVER [22:58:09] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:YkeServers Mods [22:58:09] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [22:58:09] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations [22:58:09] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [22:58:09] [Client thread/INFO] [FML]: Applying holder lookups [22:58:09] [Client thread/INFO] [FML]: Holder lookups applied [22:58:09] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:09] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem… [22:58:10] [Thread-6/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL [22:58:10] [Thread-6/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [22:58:10] [Thread-6/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized. [22:58:10] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:10] [Sound Library Loader/INFO]: Sound engine started [22:58:14] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [22:58:15] [Client thread/INFO]: Created: 256x256 textures/items-atlas [22:58:15] [Client thread/INFO] [STDOUT]: [ykeservers.ovh.mod.client.proxy.YkeServersClientProxy:registerRender:9]: Methode cote client OK [22:58:15] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [22:58:15] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:YkeServers Mods [22:58:15] [Client thread/INFO]: Created: 256x256 textures/items-atlas [22:58:16] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [22:58:16] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:16] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down… [22:58:16] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]: Author: Paul Lamb, www.paulscode.com [22:58:16] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:16] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:16] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem… [22:58:16] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL [22:58:16] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [22:58:16] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized. [22:58:17] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: [22:58:17] [Sound Library Loader/INFO]: Sound engine started [22:58:26] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10 [22:58:26] [Server thread/INFO]: Generating keypair [22:58:26] [Server thread/INFO]: Converting map! [22:58:26] [Server thread/INFO]: Scanning folders… [22:58:26] [Server thread/INFO]: Total conversion count is 0 [22:58:26] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance [22:58:27] [Server thread/INFO] [FML]: Applying holder lookups [22:58:27] [Server thread/INFO] [FML]: Holder lookups applied [22:58:29] [Server thread/ERROR]: Encountered an unexpected exception net.minecraft.util.ReportedException: Exception getting block type in world at net.minecraft.world.World.<init>(World.java:311) ~[World.class:?] at net.minecraft.world.WorldServer.<init>(WorldServer.java:102) ~[WorldServer.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:63) ~[IntegratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.lang.NullPointerException at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:86) ~[ExtendedBlockStorage.class:?] at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:653) ~[Chunk.class:?] at net.minecraft.world.World.setBlock(World.java:519) ~[World.class:?] at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:79) ~[WorldGenMinable.class:?] at ykeservers.ovh.mod.client.WorldGeneration.addOreSpawn(WorldGeneration.java:73) ~[WorldGeneration.class:?] at ykeservers.ovh.mod.client.WorldGeneration.generateSurface(WorldGeneration.java:48) ~[WorldGeneration.class:?] at ykeservers.ovh.mod.client.WorldGeneration.generate(WorldGeneration.java:31) ~[WorldGeneration.class:?] at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:106) ~[GameRegistry.class:?] at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:314) ~[ChunkProviderServer.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1152) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:208) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:119) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:221) ~[ChunkProviderServer.class:?] at net.minecraft.world.World.getChunkFromChunkCoords(World.java:482) ~[World.class:?] at net.minecraft.world.World.getBlock(World.java:387) ~[World.class:?] at net.minecraft.world.World.isAirBlock(World.java:410) ~[World.class:?] at net.minecraft.world.World.getTopBlock(World.java:371) ~[World.class:?] at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:93) ~[WorldProvider.class:?] at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:794) ~[WorldServer.class:?] at net.minecraft.world.WorldServer.initialize(WorldServer.java:757) ~[WorldServer.class:?] at net.minecraft.world.World.<init>(World.java:296) ~[World.class:?] … 5 more [22:58:29] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Patrice Andrieux\Desktop\forge-1.7.10-10.13.2.1272-src\eclipse\.\crash-reports\crash-2014-12-22_22.58.29-server.txt [22:58:29] [Server thread/INFO] [FML]: Applying holder lookups [22:58:29] [Server thread/INFO] [FML]: Holder lookups applied [22:58:29] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded. [22:58:29] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // I blame Dinnerbone. Time: 22/12/14 22:58 Description: Exception getting block type in world java.lang.NullPointerException: Exception getting block type in world at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:86) at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:653) at net.minecraft.world.World.setBlock(World.java:519) at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:79) at ykeservers.ovh.mod.client.WorldGeneration.addOreSpawn(WorldGeneration.java:73) at ykeservers.ovh.mod.client.WorldGeneration.generateSurface(WorldGeneration.java:48) at ykeservers.ovh.mod.client.WorldGeneration.generate(WorldGeneration.java:31) at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:106) at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:314) at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1152) at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:208) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:119) at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:221) at net.minecraft.world.World.getChunkFromChunkCoords(World.java:482) at net.minecraft.world.World.getBlock(World.java:387) at net.minecraft.world.World.isAirBlock(World.java:410) at net.minecraft.world.World.getTopBlock(World.java:371) at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:93) at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:794) at net.minecraft.world.WorldServer.initialize(WorldServer.java:757) at net.minecraft.world.World.<init>(World.java:296) at net.minecraft.world.WorldServer.<init>(WorldServer.java:102) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:63) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:86) at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:653) at net.minecraft.world.World.setBlock(World.java:519) at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:79) at ykeservers.ovh.mod.client.WorldGeneration.addOreSpawn(WorldGeneration.java:73) at ykeservers.ovh.mod.client.WorldGeneration.generateSurface(WorldGeneration.java:48) at ykeservers.ovh.mod.client.WorldGeneration.generate(WorldGeneration.java:31) at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:106) at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:314) at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1152) at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:208) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:119) at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:221) at net.minecraft.world.World.getChunkFromChunkCoords(World.java:482) -- Requested block coordinates -- Details: Found chunk: true Location: World: (-92,64,309), Chunk: (at 4,4,5 in -6,19; contains blocks -96,0,304 to -81,255,319), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Stacktrace: at net.minecraft.world.World.getBlock(World.java:387) at net.minecraft.world.World.isAirBlock(World.java:410) at net.minecraft.world.World.getTopBlock(World.java:371) at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:93) at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:794) at net.minecraft.world.WorldServer.initialize(WorldServer.java:757) -- Affected level -- Details: Level name: New Worldnnbb All players: 0 total; [] Chunk stats: ServerChunkCache: 22 Drop: 0 Level seed: 3178566840818420823 Level generator: ID 00 - default, ver 1\. Features enabled: true Level generator options: Level spawn location: World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 0 game time, 0 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.world.World.<init>(World.java:296) at net.minecraft.world.WorldServer.<init>(WorldServer.java:102) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:63) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8 (amd64) version 6.2 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 867359944 bytes (827 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 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: 1, tcache: 1, allocated: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.85.1272 Minecraft Forge 10.13.2.1272 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available FML{7.10.85.1272} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1272.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available Forge{10.13.2.1272} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1272.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available ykemods{1.0.2} [YkeServers Mods] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available Profiler Position: N/A (disabled) Player Count: 0 / 8; [] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' [22:58:29] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-12-22_22.58.29-server.txt AL lib: (EE) alc_cleanup: 1 device not closed ```</init></init></init></init></init></init></init>
-
Il y a toujours un NullPointerException, mais plus au même endroit. Tu peux m’envoyer la classe de ton générateur et ta classe principale actuel ?
-
Alors voila la classe principale : ```java
package ykeservers.ovh.mod.client;import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import ykeservers.ovh.mod.client.proxy.YkeServersProxy;
import cpw.mods.fml.common.IWorldGenerator;
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 = “ykemods”, name = “YkeServers Mod”, version = “1.0.2”)
public class Ykemod {
public static final String MODID = “ykemod”;
private static final Block CinabreOre = null;
private static final IWorldGenerator worldgeneration = new WorldGeneration();
@Instance(“ykemods”)
public static Ykemod instance;@SidedProxy(clientSide = “ykeservers.ovh.mod.client.proxy.YkeServersClientProxy”, serverSide = “ykeservers.ovh.mod.client.proxy.YkeServersProxy”)
public static YkeServersProxy proxy;public static ArmorMaterial armorCinabre = EnumHelper.addArmorMaterial(“armorCinabre”, 100, new int []{4, 8, 6 ,3 }, 12);
public static ArmorMaterial armortitanite = EnumHelper.addArmorMaterial(“armortitanite”, 100, new int []{4, 8, 7 ,3 }, 12);
public static ArmorMaterial armortitabre = EnumHelper.addArmorMaterial(“armortitabre”, 100, new int []{6, 8, 7 ,3 }, 5);public static ToolMaterial cinabretool = EnumHelper.addToolMaterial(“cinabretool”, 3, 1724, 10.0F, 4.5F, 10);
public static ToolMaterial titanitetool = EnumHelper.addToolMaterial(“titanitetool”, 3, 1900, 13.0F, 5.0F, 10);
public static ToolMaterial titabretool = EnumHelper.addToolMaterial(“titabretool”, 3, 2900, 15.0F, 7.5F, 5);public static Item Cinabre, helmetcinabre, chestplatecinabre, leggingcinabre, bootscinabre, cinabresword, cinabrepickaxe, cinabreaxe, titanite, helmettitanite, chestplatetitanite, leggingtitanite, bootstitanite, titanitesword, titanitepickaxe, titaniteaxe, titabre, helmettitabre, chestplatetitabre, leggingtitabre, bootstitabre, titabresword, titabrepickaxe, titabreaxe;
public static Block cinabreBlock, titaniteBlock, titabreBlock, cinabreminblock, titaniteminblock, titabreminblock;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
Cinabre = new Cinabre().setUnlocalizedName(“Cinabre”).setTextureName(“ykemods:cinabreitem”).setCreativeTab(CreativeTabs.tabMaterials);
helmetcinabre = new cinabrearmor(armorCinabre, 0).setUnlocalizedName(“cinabrehelmet”).setTextureName(“ykemods:cinabrehelmet”);
chestplatecinabre = new cinabrearmor(armorCinabre, 1).setUnlocalizedName(“cinabrechestplate”).setTextureName(“ykemods:cinabrechestplate”);
leggingcinabre = new cinabrearmor(armorCinabre, 2).setUnlocalizedName(“cinabrelegging”).setTextureName(“ykemods:cinabrelegging”);
bootscinabre = new cinabrearmor(armorCinabre, 3).setUnlocalizedName(“cinabreboots”).setTextureName(“ykemods:cinabreboots”);
cinabresword = new cinabresword(cinabretool).setUnlocalizedName(“cinabresword”).setTextureName(“ykemods:cinabresword”);
cinabrepickaxe = new cinabrepickaxe(cinabretool).setUnlocalizedName(“cinabrepickaxe”).setTextureName(“ykemods:cinabrepickaxe”);
cinabreaxe = new cinabreaxe(cinabretool).setUnlocalizedName(“cinabreaxe”).setTextureName(“ykemods:cinabreaxe”);titanite = new titanite().setUnlocalizedName(“titanite”).setTextureName(“ykemods:titaniteitem”).setCreativeTab(CreativeTabs.tabMaterials);
helmettitanite = new titanitearmor(armortitanite, 0).setUnlocalizedName(“titanitehelmet”).setTextureName(“ykemods:titanitehelmet”);
chestplatetitanite = new titanitearmor(armortitanite, 1).setUnlocalizedName(“titanitechestplate”).setTextureName(“ykemods:titanitechestplate”);
leggingtitanite = new titanitearmor(armortitanite, 2).setUnlocalizedName(“titanitelegging”).setTextureName(“ykemods:titanitelegging”);
bootstitanite = new titanitearmor(armortitanite, 3).setUnlocalizedName(“titaniteboots”).setTextureName(“ykemods:titaniteboots”);
titanitesword = new titanitesword(titanitetool).setUnlocalizedName(“titanitesword”).setTextureName(“ykemods:titanitesword”);
titanitepickaxe = new titanitepickaxe(titanitetool).setUnlocalizedName(“titanitepickaxe”).setTextureName(“ykemods:titanitepickaxe”);
titaniteaxe = new titaniteaxe(titanitetool).setUnlocalizedName(“titaniteeaxe”).setTextureName(“ykemods:titaniteaxe”);titabre = new titabre().setUnlocalizedName(“titabre”).setTextureName(“ykemods:titabreitem”).setCreativeTab(CreativeTabs.tabMaterials);
helmettitabre = new titabrearmor(armortitabre, 0).setUnlocalizedName(“titabrehelmet”).setTextureName(“ykemods:titabrehelmet”);
chestplatetitabre = new titabrearmor(armortitabre, 1).setUnlocalizedName(“titabrechestplate”).setTextureName(“ykemods:titabrechestplate”);
leggingtitabre = new titabrearmor(armortitabre, 2).setUnlocalizedName(“titabrelegging”).setTextureName(“ykemods:titabrelegging”);
bootstitabre = new titabrearmor(armortitabre, 3).setUnlocalizedName(“titabreboots”).setTextureName(“ykemods:titabreboots”);
titabresword = new titabresword(titabretool).setUnlocalizedName(“titabresword”).setTextureName(“ykemods:titabresword”);
titabrepickaxe = new titabrepickaxe(titabretool).setUnlocalizedName(“titabrepickaxe”).setTextureName(“ykemods:titabrepickaxe”);
titabreaxe = new titabreaxe(titabretool).setUnlocalizedName(“titabreeaxe”).setTextureName(“ykemods:titabreaxe”);GameRegistry.registerItem(Cinabre, “Cinabre”);
GameRegistry.registerItem(helmetcinabre, “cinabre_helmet”);
GameRegistry.registerItem(chestplatecinabre, “cinabre_chestplate”);
GameRegistry.registerItem(leggingcinabre, “cinabre_legging”);
GameRegistry.registerItem(bootscinabre, “cinabre_boots”);
GameRegistry.registerItem(cinabresword, “cinabresword”);
GameRegistry.registerItem(cinabreaxe, “cinabreaxe”);
GameRegistry.registerItem(cinabrepickaxe, “cinabrepickaxe”);GameRegistry.registerItem(titanite, “titanite”);
GameRegistry.registerItem(helmettitanite, “titanite_helmet”);
GameRegistry.registerItem(chestplatetitanite, “titanite_chestplate”);
GameRegistry.registerItem(leggingtitanite, “titanite_legging”);
GameRegistry.registerItem(bootstitanite, “titanite_boots”);
GameRegistry.registerItem(titanitesword, “titanitesword”);
GameRegistry.registerItem(titaniteaxe, “titaniteaxe”);
GameRegistry.registerItem(titanitepickaxe, “titanitepickaxe”);GameRegistry.registerItem(titabre, “titabre”);
GameRegistry.registerItem(helmettitabre, “titabre_helmet”);
GameRegistry.registerItem(chestplatetitabre, “titabre_chestplate”);
GameRegistry.registerItem(leggingtitabre, “titabre_legging”);
GameRegistry.registerItem(bootstitabre, “titabre_boots”);
GameRegistry.registerItem(titabresword, “titabresword”);
GameRegistry.registerItem(titabreaxe, “titabreaxe”);
GameRegistry.registerItem(titabrepickaxe, “titabrepickaxe”);cinabreBlock = new CinabreOre().setBlockName(“CinabreOre”).setBlockTextureName(“ykemods:cinabreore”).setCreativeTab(CreativeTabs.tabBlock);
cinabreminblock = new cinabreminblock().setBlockName(“Cinabreblock”).setBlockTextureName(“ykemods:cinabreminblock”).setCreativeTab(CreativeTabs.tabBlock);titaniteBlock = new TitaniteOre().setBlockName(“TitaniteOre”).setBlockTextureName(“ykemods:titaniteore”).setCreativeTab(CreativeTabs.tabBlock);
titaniteminblock = new titaniteminblock().setBlockName(“Titaniteblock”).setBlockTextureName(“ykemods:titaniteminblock”).setCreativeTab(CreativeTabs.tabBlock);titabreBlock = new TitabreOre().setBlockName(“TitabreOre”).setBlockTextureName(“ykemods:titabreore”).setCreativeTab(CreativeTabs.tabBlock);
titabreminblock = new titabreminblock().setBlockName(“Titabreblock”).setBlockTextureName(“ykemods:titabreminblock”).setCreativeTab(CreativeTabs.tabBlock);GameRegistry.registerBlock(cinabreBlock, “cinabreoreBlock”);
GameRegistry.registerBlock(titaniteBlock, “titaniteoreBlock”);
GameRegistry.registerBlock(titabreBlock, “titabreoreBlock”);
GameRegistry.registerBlock(cinabreminblock, “cinabreminblock”);
GameRegistry.registerBlock(titaniteminblock, “titaniteminblock”);
GameRegistry.registerBlock(titabreminblock, “titabreminblock”);GameRegistry.addRecipe(new ItemStack(cinabresword, 1), new Object[] {“X”, “X”, “Y”, ‘X’, Cinabre, ‘Y’, Items.stick});
GameRegistry.addRecipe(new ItemStack(cinabrepickaxe, 1), new Object[]{“WXY”, " S ", " S “, ‘W’, new ItemStack(Cinabre, 0), ‘X’, new ItemStack(Cinabre, 0), ‘Y’, new ItemStack(Cinabre, 0), ‘S’, new ItemStack(Items.stick) });
GameRegistry.addRecipe(new ItemStack (cinabreaxe), new Object [] { “11”, “12”, " 2”, Character.valueOf(‘1’), Cinabre, Character.valueOf(‘2’), new ItemStack(Items.stick) });GameRegistry.addRecipe(new ItemStack(titanitesword, 1), new Object[] {“X”, “X”, “Y”, ‘X’, titanite, ‘Y’, Items.stick});
GameRegistry.addRecipe(new ItemStack(titanitepickaxe, 1), new Object[]{“WXY”, " S ", " S “, ‘W’, new ItemStack(titanite, 0), ‘X’, new ItemStack(titanite, 0), ‘Y’, new ItemStack(titanite, 0), ‘S’, new ItemStack(Items.stick) });
GameRegistry.addRecipe(new ItemStack (titaniteaxe), new Object [] { “11”, “12”, " 2”, Character.valueOf(‘1’), titanite, Character.valueOf(‘2’), new ItemStack(Items.stick) });GameRegistry.addSmelting(cinabreBlock, new ItemStack(Cinabre, 1), 3.5F);
GameRegistry.addSmelting(titaniteBlock, new ItemStack(titanite, 1), 3.5F);
GameRegistry.addSmelting(titabreBlock, new ItemStack(titabre, 1), 3.5F);GameRegistry.addRecipe(new ItemStack(titabre, 1), new Object[] {“XXX”, “YYY”,“XXX”, ‘X’,titanite, ‘Y’, new ItemStack(Cinabre, 0)});
GameRegistry.addRecipe(new ItemStack(cinabreminblock, 1), new Object[] {“XXX”, “XXX”,“XXX”, ‘X’,Cinabre});
GameRegistry.addRecipe(new ItemStack(Cinabre, 9), new Object[] {“X”, ‘X’,cinabreminblock});GameRegistry.addRecipe(new ItemStack(titaniteminblock, 1), new Object[] {“XXX”, “XXX”,“XXX”, ‘X’,titanite});
GameRegistry.addRecipe(new ItemStack(titanite, 9), new Object[] {“X”, ‘X’,titaniteminblock});GameRegistry.addRecipe(new ItemStack(titabreminblock, 1), new Object[] {“XXX”, “XXX”,“XXX”, ‘X’,titabre});
GameRegistry.addRecipe(new ItemStack(titabre, 9), new Object[] {“X”, ‘X’,titabreminblock});GameRegistry.addRecipe(new ItemStack(helmetcinabre, 1), new Object[] {“XXX”, “X X”, ‘X’,Cinabre});
GameRegistry.addRecipe(new ItemStack(chestplatecinabre, 1), new Object[] {“X X”, “XXX”, “XXX”, ‘X’,Cinabre});
GameRegistry.addRecipe(new ItemStack(leggingcinabre, 1), new Object[] {“XXX”, “X X”, “X X”, ‘X’,Cinabre});
GameRegistry.addRecipe(new ItemStack(bootscinabre, 1), new Object[] {“X X”, “X X”, ‘X’,Cinabre});GameRegistry.addRecipe(new ItemStack(helmettitanite, 1), new Object[] {“XXX”, “X X”, ‘X’,titanite});
GameRegistry.addRecipe(new ItemStack(chestplatetitanite, 1), new Object[] {“X X”, “XXX”, “XXX”, ‘X’,titanite});
GameRegistry.addRecipe(new ItemStack(leggingtitanite, 1), new Object[] {“XXX”, “X X”, “X X”, ‘X’,titanite});
GameRegistry.addRecipe(new ItemStack(bootstitanite, 1), new Object[] {“X X”, “X X”, ‘X’,titanite});GameRegistry.addRecipe(new ItemStack(helmettitabre, 1), new Object[] {“XXX”, “X X”, ‘X’,titabre});
GameRegistry.addRecipe(new ItemStack(chestplatetitabre, 1), new Object[] {“X X”, “XXX”, “XXX”, ‘X’,titabre});
GameRegistry.addRecipe(new ItemStack(leggingtitabre, 1), new Object[] {“XXX”, “X X”, “X X”, ‘X’,titabre});
GameRegistry.addRecipe(new ItemStack(bootstitabre, 1), new Object[] {“X X”, “X X”, ‘X’,titabre});}
@EventHandler
public void init(FMLInitializationEvent event)
{
proxy.registerRender();GameRegistry.registerWorldGenerator(worldgeneration, 0);
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{}
}
et voila la classe WorldGeneration : ```java package ykeservers.ovh.mod.client; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGeneration implements IWorldGenerator { private Block CinabreOre; public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateEnd(World world, Random random, int x, int z) { } private void generateSurface(World world, Random random, int x, int z) { this.addOreSpawn(CinabreOre, 0, Blocks.stone, world, random, x, z, 16, 16, 7, 18, 13, 45); } private void generateNether(World world, Random random, int x, int z) { } public void addOreSpawn(Block block, int metadata, Block target, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY) { assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum."; assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16."; assert minY > 0 : "La position Y minimum doit être supérieure à 0."; assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256."; assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16."; for(int i = 0; i < chancesToSpawn; i++) { int posY = random.nextInt(128); if((posY <= maxY) && (posY >= minY)) { (new WorldGenMinable(block, metadata, maxVeinSize, target)).generate(world, random, blockXPos + random.nextInt(16), posY, blockZPos + random.nextInt(16)); } } } }
-
Ok, ça c’est pas bon :
private Block CinabreOre;Et ici :
this.addOreSpawn(CinabreOre, 0, Blocks.stone, world, random, x, z, 16, 16, 7, 18, 13, 45);à la place de CinabreOre tu es sensé mettre l’instance de ton bloc qui se trouve dans ta classe principale. Donc c’est comme ça :
this.addOreSpawn(Ykemod.cinabreBlock, 0, Blocks.stone, world, random, x, z, 16, 16, 7, 18, 13, 45);Et je vois aussi ça dans ta classe principale :
private static final Block CinabreOre = null;Pareil ça n’a rien à faire là, il ne faut pas cliquer sur ce que propose eclipse sans comprendre ce que ça va faire …
-
Le tutoriel fonctionne en 1.7.10 ?
-
Oui, le seul changement depuis la 1.7.2 c’est les UUIDs ainsi que quelques autres choses mineures.
-
bonjour, moi j’ai cette erreur, le WorldGeneration(); ne peut pas être instancié
WorldGeneration worldgeneration = new WorldGeneration();
-
Tu classe se nomme bien WorldGeneration ? Sinon, vérifie que tu utilise pas la classe de minecraft.
-
c’est encore moi, donc voila, le WorldGeneration reste souligné chez moi
WorldGeneration worldgeneration = new WorldGeneration();
pourtant je pense avoir tout ce qu’il faut classe principale :
package fr.craftesys.items.common; 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; import fr.craftesys.items.proxy.commonproxy; 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 net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; @Mod(modid = "moditems", name = "Mod Items", version = "1.7.10") public class ModItems { public static final String MODID = "moditems"; @Instance(MODID) public static ModItems instance; @SidedProxy(clientSide = "fr.craftesys.items.proxy.clientproxy", serverSide = "fr.craftesys.items.proxy.commonproxy") public static commonproxy proxy; public static Item rubis; public static Item itemrubis; public static Item helmetrubis, chestPlaterubis, leggingsrubis, bootsrubis; public static Block blockrubis; public static Block rubyore; WorldGeneration worldgeneration = new WorldGeneration(); public static ArmorMaterial armorrubis = EnumHelper.addArmorMaterial("armorrubis", 85, new int[] {4, 6, 5, 4}, 20); public static Item swordrubis, pickaxerubis, axerubis, shovelrubis, hoerubis; public static ToolMaterial toolrubis = EnumHelper.addToolMaterial("toolrubis",3 , 1499, 12.0F, 4.0F, 18); @EventHandler public void preInit(FMLPreInitializationEvent event) { itemrubis = new RubisItems().setUnlocalizedName("rubis").setTextureName(MODID + ":item_rubis").setCreativeTab(CreativeTabs.tabMaterials); helmetrubis = new ItemRubisArmor(armorrubis, 0).setUnlocalizedName("helmetrubis").setTextureName(MODID + ":helmetrubis"); chestPlaterubis = new ItemRubisArmor(armorrubis, 1).setUnlocalizedName("chestPlaterubis").setTextureName(MODID + ":chestplaterubis"); leggingsrubis = new ItemRubisArmor(armorrubis, 2).setUnlocalizedName("leggingsrubis").setTextureName(MODID + ":leggingsrubis"); bootsrubis = new ItemRubisArmor(armorrubis, 3).setUnlocalizedName("bootsrubis").setTextureName(MODID + ":bootsrubis"); swordrubis = new ItemRubisSword(toolrubis).setUnlocalizedName("swordrubis").setTextureName(MODID + ":sword_rubis"); pickaxerubis = new ItemRubisPickaxe(toolrubis).setUnlocalizedName("pickaxerubis").setTextureName(MODID + ":pickaxe_rubis"); axerubis = new ItemRubisAxe(toolrubis).setUnlocalizedName("axerubis").setTextureName(MODID + ":axe_rubis"); shovelrubis = new ItemRubisShovel(toolrubis).setUnlocalizedName("shovelrubis").setTextureName(MODID + ":shovel_rubis"); hoerubis = new ItemRubisHoe(toolrubis).setUnlocalizedName("hoerubis").setTextureName(MODID + ":hoe_rubis"); blockrubis = new Blockrubis(Material.rock).setBlockName("rubisblock").setBlockTextureName("moditems:block_rubis").setCreativeTab(CreativeTabs.tabBlock);; rubyore = new Blockrubis(Material.rock).setBlockName("oreRuby ").setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypeStone).setBlockTextureName(MODID + ":ruby_ore").setCreativeTab(TutorielTabs); GameRegistry.registerItem(itemrubis, "item_rubis"); GameRegistry.registerItem(helmetrubis, "item_rubis_helmet"); GameRegistry.registerItem(chestPlaterubis, "item_rubis_chestplate"); GameRegistry.registerItem(leggingsrubis, "item_rubis_leggings"); GameRegistry.registerItem(bootsrubis, "item_rubis_boots"); GameRegistry.registerItem(swordrubis, "item_rubis_sword"); GameRegistry.registerItem(pickaxerubis, "item_rubis_pickaxe"); GameRegistry.registerItem(axerubis, "item_rubis_axe"); GameRegistry.registerItem(shovelrubis, "item_rubis_shovel"); GameRegistry.registerItem(hoerubis, "item_rubis_hoe"); GameRegistry.registerBlock(blockrubis, "block_rubis"); GameRegistry.registerBlock(rubyore, "ruby_ore"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); proxy.registerRender(); GameRegistry.addRecipe(new ItemStack(helmetrubis), new Object[]{"XXX", "X X", " ", 'X', new ItemStack(itemrubis)}); GameRegistry.addRecipe(new ItemStack(chestPlaterubis), new Object[]{"X X", "XXX", "XXX", 'X', new ItemStack(itemrubis)}); GameRegistry.addRecipe(new ItemStack(leggingsrubis), new Object[]{"XXX", "X X", "X X", 'X', new ItemStack(itemrubis)}); GameRegistry.addRecipe(new ItemStack(bootsrubis), new Object[]{" ", "X X", "X X", 'X', new ItemStack(itemrubis)}); GameRegistry.addRecipe(new ItemStack(swordrubis), new Object[]{"X", "X", "Y", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(pickaxerubis), new Object[]{"XXX", " Y ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(axerubis), new Object[]{"XX", " XY ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(shovelrubis), new Object[]{" X ", " Y ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(hoerubis), new Object[]{"XX ", " Y ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(blockrubis), new Object[]{"XXX", "XXX", "XXX", 'X', new ItemStack(itemrubis)}); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
classe WorldGeneration :
package fr.craftesys.items.common; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import java.util.Random; import cpw.mods.fml.common.IWorldGenerator; public abstract class WorldGeneration implements IWorldGenerator { public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateEnd(World world, Random random, int x, int z) { } private void generateSurface(World world, Random random, int x, int z) { this.addOreSpawn(ModItems.rubyore, 0, Blocks.stone, world, random, x, z, 16, 16, 50, 25, 16, 64); } private void generateNether(World world, Random random, int x, int z) { } public void addOreSpawn(Block block, int metadata, Block target, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY) { assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum."; assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16."; assert minY > 0 : "La position Y minimum doit être supérieure à 0."; assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256."; assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16."; for(int i = 0; i < chancesToSpawn; i++) { int posY = random.nextInt(128); if((posY <= maxY) && (posY >= minY)) { (new WorldGenMinable(block, metadata, maxVeinSize, target)).generate(world, random, blockXPos + random.nextInt(16), posY, blockZPos + random.nextInt(16)); } } } }
et oui elle se nomme bien WorldGeneration
-
public abstract class WorldGeneration implements IWorldGenerator
Ta classe ne devrait pas être abstraite, les classes abstraites ne peuvent pas être instancier.
-
j’ai honte de mes fautes, surtout que c’est l’une des premières choses qu’on apprend …
j’ai donc fini toutes la partie sur le rubis, maintenant, si je veux un autre minerais, je dois refaire des classes ou je peux reprendre les autres ? car pour certaines fonctions comme :
public boolean getIsRepairable(ItemStack input, ItemStack repair)
{
if(repair.getItem() == ModItems.itemrubis)
{
return true;
}
return false;
}je vois pas comment rajouter d’autres items
-
if(repair.getItem() == ModItems.itemrubis || repair.getItem() == ModItems.secondItem)
-
et je fais ça pour toutes les fonctions ? merci
et pour changer les dégâts des épées on doit refaire tout ?
-
ça dépend des fonctions.
Par contre pas compris ta question avec l’épée. -
Créer une nouvelle épée et mettre plus de dégâts sur la nouvelle épée
puis pour les minerais, j’en ai fait 2 (dans 2 classes différentes que j’ai déclaré dans la classe principale) mais un seul des deux minerais se génère.
j’ai cette ligne : this.addOreSpawn(ModItems.rubyore, 0, Blocks.stone, world, random, x, z, 16, 16, 50, 25, 16, 64);
cela est possible que les deux classes prennent en compte les mêmes blocs de stone et les change en un minerai ?
je veux dire imaginons que WorldGeneration changent les blocs de stone en minerai1 puis le WorldGeneration2 veut prendre les mêmes blocs, mais comme ils ont été transformés en minerai1, il peut pas transformer minerai2
-
Pour créer une nouvelle épée, il faut juste créer une classe extends ItemSword et fournir dans le constructeur un matériau en utilisant EnumHelper.addToolMaterial.
Pour les minerais, envoi les 2 lignes concernées.