Résolu Crash double slabs
-
Bonjour ! Je viens de créer des dalles en stained clay. Les singles fonctionnent très bien mais dès que je veut faire des doubles slabs mon jeux crash.
Les logs :
:::–-- Minecraft Crash Report ---- // Shall we play a game? Time: 14/07/15 11:31 Description: Unexpected error java.lang.NullPointerException: Unexpected error at com.heartshadow.mod.slabs.ItemClaySlabs.onItemUse(ItemClaySlabs.java:77) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:143) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:403) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1529) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2044) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) at net.minecraft.client.Minecraft.run(Minecraft.java:962) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.heartshadow.mod.slabs.ItemClaySlabs.onItemUse(ItemClaySlabs.java:77) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:143) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:403) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1529) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player618'/216, l='MpServer', x=159,10, y=5,62, z=-1201,49]] Chunk stats: MultiplayerChunkCache: 623, 623 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (172,4,-1207), Chunk: (at 12,0,9 in 10,-76; contains blocks 160,0,-1216 to 175,255,-1201), Region: (0,-3; contains chunks 0,-96 to 31,-65, blocks 0,0,-1536 to 511,255,-1025) Level time: 68343 game time, 6144 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: 97 total; [EntitySheep['Sheep'/56, l='MpServer', x=93,31, y=4,00, z=-1273,16], EntitySheep['Sheep'/57, l='MpServer', x=86,63, y=4,00, z=-1248,50], EntitySheep['Sheep'/63, l='MpServer', x=120,13, y=4,00, z=-1278,81], EntitySheep['Sheep'/64, l='MpServer', x=112,38, y=4,00, z=-1255,16], EntitySheep['Sheep'/65, l='MpServer', x=115,91, y=4,00, z=-1255,94], EntityCow['Cow'/73, l='MpServer', x=142,94, y=4,00, z=-1252,09], EntitySheep['Sheep'/74, l='MpServer', x=131,81, y=4,00, z=-1135,78], EntityHorse['Horse'/84, l='MpServer', x=158,13, y=4,00, z=-1270,63], EntityItemFrame['entity.ItemFrame.name'/85, l='MpServer', x=155,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/86, l='MpServer', x=156,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/87, l='MpServer', x=157,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/88, l='MpServer', x=158,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/89, l='MpServer', x=159,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/90, l='MpServer', x=159,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/91, l='MpServer', x=158,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/92, l='MpServer', x=158,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/93, l='MpServer', x=157,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/94, l='MpServer', x=156,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/95, l='MpServer', x=155,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/96, l='MpServer', x=155,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/97, l='MpServer', x=156,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/98, l='MpServer', x=157,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/99, l='MpServer', x=157,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/100, l='MpServer', x=158,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/101, l='MpServer', x=159,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/102, l='MpServer', x=159,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/103, l='MpServer', x=158,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/104, l='MpServer', x=158,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/105, l='MpServer', x=157,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/106, l='MpServer', x=156,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/107, l='MpServer', x=155,50, y=4,50, z=-1220,94], EntitySheep['Sheep'/110, l='MpServer', x=164,97, y=4,00, z=-1280,06], EntityHorse['Horse'/111, l='MpServer', x=161,84, y=4,00, z=-1245,56], EntityItemFrame['entity.ItemFrame.name'/112, l='MpServer', x=160,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/113, l='MpServer', x=161,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/114, l='MpServer', x=162,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/115, l='MpServer', x=163,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/116, l='MpServer', x=163,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/117, l='MpServer', x=165,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/118, l='MpServer', x=165,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/119, l='MpServer', x=164,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/120, l='MpServer', x=164,50, y=7,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/121, l='MpServer', x=163,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/122, l='MpServer', x=162,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/123, l='MpServer', x=161,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/124, l='MpServer', x=160,50, y=6,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/125, l='MpServer', x=160,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/126, l='MpServer', x=161,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/127, l='MpServer', x=162,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/128, l='MpServer', x=162,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/129, l='MpServer', x=163,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/130, l='MpServer', x=164,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/131, l='MpServer', x=165,50, y=5,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/132, l='MpServer', x=165,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/133, l='MpServer', x=165,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/134, l='MpServer', x=164,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/135, l='MpServer', x=163,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/136, l='MpServer', x=162,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/137, l='MpServer', x=161,50, y=4,50, z=-1220,94], EntityItemFrame['entity.ItemFrame.name'/138, l='MpServer', x=160,50, y=4,50, z=-1220,94], EntitySheep['Sheep'/139, l='MpServer', x=161,03, y=4,00, z=-1123,78], EntityChicken['Chicken'/143, l='MpServer', x=189,47, y=4,00, z=-1280,44], EntitySheep['Sheep'/146, l='MpServer', x=186,41, y=4,00, z=-1279,22], EntityPig['Pig'/147, l='MpServer', x=177,88, y=4,00, z=-1272,38], EntityPig['Pig'/148, l='MpServer', x=178,94, y=4,00, z=-1258,19], EntityChicken['Chicken'/149, l='MpServer', x=191,47, y=4,00, z=-1233,41], EntitySheep['Sheep'/150, l='MpServer', x=194,76, y=4,00, z=-1196,19], EntitySheep['Sheep'/151, l='MpServer', x=190,03, y=4,00, z=-1182,03], EntitySheep['Sheep'/152, l='MpServer', x=181,84, y=4,00, z=-1171,63], EntityCow['Cow'/163, l='MpServer', x=199,09, y=4,00, z=-1239,03], EntityChicken['Chicken'/164, l='MpServer', x=207,47, y=4,00, z=-1196,47], EntityChicken['Chicken'/165, l='MpServer', x=195,47, y=4,00, z=-1180,41], EntitySheep['Sheep'/166, l='MpServer', x=198,22, y=4,00, z=-1161,13], EntityChicken['Chicken'/176, l='MpServer', x=217,44, y=4,00, z=-1240,56], EntityChicken['Chicken'/177, l='MpServer', x=220,56, y=4,00, z=-1243,38], EntityHorse['Horse'/178, l='MpServer', x=218,22, y=4,00, z=-1243,28], EntitySheep['Sheep'/179, l='MpServer', x=223,03, y=4,00, z=-1220,06], EntityChicken['Chicken'/180, l='MpServer', x=215,44, y=4,00, z=-1220,44], EntityHorse['Horse'/187, l='MpServer', x=225,06, y=4,00, z=-1259,56], EntityCow['Cow'/188, l='MpServer', x=226,31, y=4,00, z=-1255,44], EntityChicken['Chicken'/189, l='MpServer', x=238,41, y=4,00, z=-1235,59], EntityCow['Cow'/190, l='MpServer', x=238,72, y=4,00, z=-1244,44], EntityChicken['Chicken'/191, l='MpServer', x=225,38, y=4,00, z=-1218,56], EntityChicken['Chicken'/192, l='MpServer', x=232,41, y=4,00, z=-1230,59], EntitySheep['Sheep'/193, l='MpServer', x=227,38, y=4,00, z=-1202,34], EntityChicken['Chicken'/194, l='MpServer', x=225,41, y=4,00, z=-1212,44], EntityCow['Cow'/195, l='MpServer', x=230,41, y=4,00, z=-1213,81], EntityChicken['Chicken'/196, l='MpServer', x=227,53, y=4,00, z=-1207,56], EntitySheep['Sheep'/197, l='MpServer', x=231,81, y=4,00, z=-1206,22], EntityCow['Cow'/198, l='MpServer', x=232,09, y=4,00, z=-1189,03], EntityPig['Pig'/199, l='MpServer', x=226,91, y=4,00, z=-1190,91], EntitySheep['Sheep'/200, l='MpServer', x=226,97, y=4,00, z=-1197,94], EntityChicken['Chicken'/201, l='MpServer', x=226,47, y=4,00, z=-1171,53], EntityChicken['Chicken'/202, l='MpServer', x=241,41, y=4,00, z=-1166,44], EntityCow['Cow'/203, l='MpServer', x=240,84, y=4,00, z=-1249,81], EntityCow['Cow'/205, l='MpServer', x=240,19, y=4,00, z=-1200,19], EntityClientPlayerMP['Player618'/216, l='MpServer', x=159,10, y=5,62, z=-1201,49]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566) at net.minecraft.client.Minecraft.run(Minecraft.java:991) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 870840920 bytes (830 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: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1490 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1490-1.7.10.jar) UCHIJAAAA Forge{10.13.4.1490} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1490-1.7.10.jar) UCHIJAAAA hsmod{1.0.0} [HeartShadow MOD] (bin) GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.4.13283 Compatibility Profile Context 14.501.1003.0' Renderer: 'AMD Radeon HD 7000 series' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 7000 series GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. 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: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
:::
Classe Principale :
:::package com.heartshadow.mod; import com.heartshadow.mod.admins.ItemCloud; import com.heartshadow.mod.admins.ItemFrostmourne; import com.heartshadow.mod.admins.ItemMonado; import com.heartshadow.mod.admins.ItemZangetsu; import com.heartshadow.mod.armors.ItemArkanArmor; import com.heartshadow.mod.armors.ItemDeldaArmor; import com.heartshadow.mod.blocks.BlockArkan; import com.heartshadow.mod.blocks.BlockDelda; import com.heartshadow.mod.blocks.OreArkan; import com.heartshadow.mod.blocks.OreDelda; import com.heartshadow.mod.foods.ItemFish; import com.heartshadow.mod.items.ItemArkan; import com.heartshadow.mod.items.ItemDeldarium; import com.heartshadow.mod.proxy.CommonProxy; import com.heartshadow.mod.slabs.BlockClaySlabs; import com.heartshadow.mod.tools.ItemArkanAxe; import com.heartshadow.mod.tools.ItemArkanHoe; import com.heartshadow.mod.tools.ItemArkanPickaxe; import com.heartshadow.mod.tools.ItemArkanShovel; import com.heartshadow.mod.tools.ItemArkanSword; import com.heartshadow.mod.tools.ItemDeldaAxe; import com.heartshadow.mod.tools.ItemDeldaHoe; import com.heartshadow.mod.tools.ItemDeldaPickaxe; import com.heartshadow.mod.tools.ItemDeldaShovel; import com.heartshadow.mod.tools.ItemDeldaSword; import com.heartshadow.mod.world.ArkanGenerator; import com.heartshadow.mod.world.DeldaGenerator; 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 net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; 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 = "hsmod", name = "HeartShadow MOD", version = "1.0.0") public class HSMOD { @Instance("hsmod") public static HSMOD instance; public static final String MODID = "hsmod"; public static CreativeTabs HSCreativeTabs = new HSCreativeTabs("HSCreativeTabs"); DeldaGenerator DeldaGenerator = new DeldaGenerator(); ArkanGenerator ArkanGenerator = new ArkanGenerator(); //Admin public static Item monado; public static ToolMaterial admintool = EnumHelper.addToolMaterial("monatool", 2, 9999999, 10.0F, 90.0F, 50); public static Item frostmourne; public static Item zangetsu; public static Item cloud; //Foods public static Item fish; //slabs public static Block singleClay, doubleClay; //Deldarium public static Item itemDeldarium; public static Item swordDelda, pickaxeDelda, axeDelda, shovelDelda, hoeDelda; public static ToolMaterial toolDelda = EnumHelper.addToolMaterial("toolDelda", 3, 1375, 6.5F, 5.0F, 9); public static Block oreDelda; public static Item deldahelmet, deldachest, deldalegs, deldaboots; public static ArmorMaterial deldaArmor = EnumHelper.addArmorMaterial("deldaArmor", 38, new int[] {3, 6, 6, 3}, 12); public static Block blockDelda; //Arkanite public static Item itemArkan; public static Block oreArkan; public static Block blockArkan; public static Item arkanSword, arkanPickaxe, arkanAxe, arkanShovel, arkanHoe; public static ToolMaterial toolArkan = EnumHelper.addToolMaterial("toolArkan", 3, 1850, 8.5F, 4.0F, 12); public static Item arkanhelmet, arkanchest, arkanlegs, arkanboots; public static ArmorMaterial arkanArmor = EnumHelper.addArmorMaterial("arkanArmor", 43, new int[] {3, 7, 6, 4}, 9); @SidedProxy(clientSide = "com.heartshadow.mod.proxy.ClientProxy", serverSide = "com.heartshadow.mod.proxy.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerWorldGenerator(new DeldaGenerator(), 0); GameRegistry.registerWorldGenerator(new ArkanGenerator(), 0); // singleClay = new BlockClaySlabs(false, Material.rock).setBlockName("singleClay").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(singleClay, com.heartshadow.mod.slabs.ItemClaySlabs.class, "singleClay"); doubleClay = new BlockClaySlabs(true, Material.rock).setBlockName("doubleClay").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(doubleClay, com.heartshadow.mod.slabs.ItemClaySlabs.class, "doubleClay"); //Admin monado = new ItemMonado(admintool).setUnlocalizedName("monado").setTextureName(HSMOD.MODID + ":monado").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(monado, "item_monado"); frostmourne = new ItemFrostmourne(admintool).setUnlocalizedName("frostmourne").setTextureName(HSMOD.MODID + ":frostmourne").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(frostmourne, "item_frostmourne"); zangetsu = new ItemZangetsu(admintool).setUnlocalizedName("zangetsu").setTextureName(HSMOD.MODID + ":zangetsu").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(zangetsu, "item_zangetsu"); cloud = new ItemCloud(admintool).setUnlocalizedName("cloud").setTextureName(HSMOD.MODID + ":cloud").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(cloud, "item_cloud"); //Foods fish = new ItemFish(7, 0.7F, false).setUnlocalizedName("fish").setTextureName(HSMOD.MODID + ":fish").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(fish, "item_fish"); //Deldarium swordDelda = new ItemDeldaSword(toolDelda).setUnlocalizedName("sworddelda").setTextureName(HSMOD.MODID + ":sworddelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(swordDelda, "item_delda_sword"); pickaxeDelda = new ItemDeldaPickaxe(toolDelda).setUnlocalizedName("pickaxedelda").setTextureName(HSMOD.MODID + ":pickaxedelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(pickaxeDelda, "item_delda_pickaxe"); axeDelda = new ItemDeldaAxe(toolDelda).setUnlocalizedName("axedelda").setTextureName(HSMOD.MODID + ":axedelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(axeDelda, "item_delda_axe"); shovelDelda = new ItemDeldaShovel(toolDelda).setUnlocalizedName("shoveldelda").setTextureName(HSMOD.MODID + ":shoveldelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(shovelDelda, "item_delda_shovel"); hoeDelda = new ItemDeldaHoe(toolDelda).setUnlocalizedName("hoedelda").setTextureName(HSMOD.MODID + ":hoedelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(hoeDelda, "item_delda_hoe"); itemDeldarium = new ItemDeldarium().setUnlocalizedName("deldarium").setTextureName(HSMOD.MODID + ":deldarium").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(itemDeldarium, "item_deldarium"); oreDelda = new OreDelda(Material.rock).setBlockName("oredelda").setBlockTextureName(HSMOD.MODID + ":oredelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(oreDelda, "ore_delda"); blockDelda = new BlockDelda(Material.iron).setBlockName("blockdelda").setBlockTextureName(HSMOD.MODID + ":blockdelda").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(blockDelda, "block_delda"); deldahelmet = new ItemDeldaArmor(deldaArmor, 0).setUnlocalizedName("deldahelmet").setTextureName(HSMOD.MODID + ":deldahelmet").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(deldahelmet, "item_delda_helmet"); deldachest = new ItemDeldaArmor(deldaArmor, 1).setUnlocalizedName("deldachest").setTextureName(HSMOD.MODID + ":deldachest").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(deldachest, "item_delda_chestplate"); deldalegs = new ItemDeldaArmor(deldaArmor, 2).setUnlocalizedName("deldalegs").setTextureName(HSMOD.MODID + ":deldalegs").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(deldalegs, "item_delda_leggings"); deldaboots = new ItemDeldaArmor(deldaArmor, 3).setUnlocalizedName("deldaboots").setTextureName(HSMOD.MODID + ":deldaboots").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(deldaboots, "item_delda_boots"); //Arkanite itemArkan = new ItemArkan().setUnlocalizedName("arkanite").setTextureName(HSMOD.MODID + ":arkanite").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(itemArkan, "item_arkanite"); oreArkan = new OreArkan(Material.rock).setBlockName("orearkan").setBlockTextureName(HSMOD.MODID + ":orearkan").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(oreArkan,"ore_arkan"); blockArkan = new BlockArkan(Material.iron).setBlockName("blockarkan").setBlockTextureName(HSMOD.MODID + ":blockarkan").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerBlock(blockArkan, "block_arkan"); arkanSword = new ItemArkanSword(toolArkan).setUnlocalizedName("arkansword").setTextureName(HSMOD.MODID + ":arkansword").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanSword, "item_arkan_sword"); arkanPickaxe = new ItemArkanPickaxe(toolArkan).setUnlocalizedName("arkanpickaxe").setTextureName(HSMOD.MODID + ":arkanpickaxe").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanPickaxe, "item_arkan_pickaxe"); arkanAxe = new ItemArkanAxe(toolArkan).setUnlocalizedName("arkanaxe").setTextureName(HSMOD.MODID + ":arkanaxe").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanAxe, "item_arkan_axe"); arkanShovel = new ItemArkanShovel(toolArkan).setUnlocalizedName("arkanshovel").setTextureName(HSMOD.MODID + ":arkanshovel").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanShovel, "item_arkan_shovel"); arkanHoe = new ItemArkanHoe(toolArkan).setUnlocalizedName("arkanhoe").setTextureName(HSMOD.MODID + ":arkanhoe").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanHoe, "item_arkan_hoe"); arkanhelmet = new ItemArkanArmor(arkanArmor, 0).setUnlocalizedName("arkanhelmet").setTextureName(HSMOD.MODID + ":arkanhelmet").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanhelmet, "item_arkan_helmet"); arkanchest = new ItemArkanArmor(arkanArmor, 1).setUnlocalizedName("arkanchest").setTextureName(HSMOD.MODID + ":arkanchest").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanchest, "item_arkan_chest"); arkanlegs = new ItemArkanArmor(arkanArmor, 2).setUnlocalizedName("arkanlegs").setTextureName(HSMOD.MODID + ":arkanlegs").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanlegs, "item_arkan_legs"); arkanboots = new ItemArkanArmor(arkanArmor, 3).setUnlocalizedName("arkanboots").setTextureName(HSMOD.MODID + ":arkanboots").setCreativeTab(HSMOD.HSCreativeTabs); GameRegistry.registerItem(arkanboots, "item_arkan_boots"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); ///Deldarium GameRegistry.addRecipe(new ItemStack(swordDelda, 1), new Object[] {"X", "X", "Z", 'X', itemDeldarium, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(pickaxeDelda, 1), new Object[] {"XXX", " Z ", " Z ", 'X', itemDeldarium, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(axeDelda, 1), new Object[] {"XXX", "XZX", " Z ", 'X', itemDeldarium, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(shovelDelda, 1), new Object[] {"X", "Z", "Z", 'X', itemDeldarium, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(hoeDelda, 1), new Object[] {"XX ", " Z ", " Z ", 'X', itemDeldarium, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(deldahelmet, 1), new Object[] {"XXX", "X X", 'X', itemDeldarium}); GameRegistry.addRecipe(new ItemStack(deldachest, 1), new Object[] {"X X", "XXX", "XXX", 'X', itemDeldarium}); GameRegistry.addRecipe(new ItemStack(deldalegs, 1), new Object[] {"XXX", "X X", "X X", 'X', itemDeldarium}); GameRegistry.addRecipe(new ItemStack(deldaboots, 1), new Object[] {"X X", "X X", 'X', itemDeldarium}); GameRegistry.addRecipe(new ItemStack(itemDeldarium, 9), new Object[] {"X", 'X', blockDelda}); GameRegistry.addRecipe(new ItemStack(blockDelda, 1), new Object[] {"XXX", "XXX", "XXX", 'X', itemDeldarium}); GameRegistry.addSmelting(oreDelda, new ItemStack(itemDeldarium, 1), 1.2F); //Arkanite GameRegistry.addSmelting(oreArkan, new ItemStack(itemArkan, 1), 1.2F); GameRegistry.addRecipe(new ItemStack(blockArkan, 1), new Object[] {"XXX", "XXX", "XXX", 'X', itemArkan}); GameRegistry.addRecipe(new ItemStack(itemArkan, 9), new Object[] {"X", 'X', blockArkan}); GameRegistry.addRecipe(new ItemStack(arkanSword, 1), new Object[] {"X", "X", "Z", 'X', itemArkan, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(arkanPickaxe, 1), new Object[] {"XXX", " Z ", " Z ", 'X', itemArkan, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(arkanAxe, 1), new Object[] {"XXX", " Z ", " Z ", 'X', itemArkan, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(arkanShovel, 1), new Object[] {"X", "Z", "Z", 'X', itemArkan, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(arkanHoe, 1), new Object[] {"XX ", " Z ", " Z ", 'X', itemArkan, 'Z', Items.stick}); GameRegistry.addRecipe(new ItemStack(arkanhelmet, 1), new Object[] {"XXX", "X X", 'X', itemArkan}); GameRegistry.addRecipe(new ItemStack(arkanchest, 1), new Object[] {"X X", "XXX", "XXX", 'X', itemArkan}); GameRegistry.addRecipe(new ItemStack(arkanlegs, 1), new Object[] {"XXX", "X X", "X X", 'X', itemArkan}); GameRegistry.addRecipe(new ItemStack(arkanboots, 1), new Object[] {"X X", "X X", 'X', itemArkan}); //foods GameRegistry.addRecipe(new ItemStack(fish, 1), new Object[] {" X ", "YZY", " X ", 'X', Items.shears, 'Y', Items.baked_potato, 'Z', Items.cooked_fished}); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
:::
BlockClaySlabs :
:::
package com.heartshadow.mod.slabs; import java.util.List; import java.util.Random; import com.heartshadow.mod.HSMOD; import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockClaySlabs extends BlockSlab { public static final String[] StepTypes = new String[] {"normal", "blanche", "orange", "magenta", "bleuc"}; public BlockClaySlabs(boolean isdouble, Material material) { super(isdouble, material); if(!this.field_150004_a) { this.setLightOpacity(0); } } @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { int k = metadata & 7; return k == 0 ? Blocks.hardened_clay.getBlockTextureFromSide(side) : k == 1 ? Blocks.stained_hardened_clay.getIcon(side, 0) : k == 2 ? Blocks.stained_hardened_clay.getIcon(side, 1) : k == 3 ? Blocks.stained_hardened_clay.getIcon(side, 2) : Blocks.stained_hardened_clay.getIcon(side, 3); } @SideOnly(Side.CLIENT) private static boolean func_150003_a(Block block) { return block == HSMOD.singleClay; } @SideOnly(Side.CLIENT) public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { return func_150003_a(this) ? Item.getItemFromBlock(HSMOD.singleClay) : Item.getItemFromBlock(HSMOD.doubleClay); } public Item getItemDropped(int metadata, Random rand, int fortune) { return Item.getItemFromBlock(Blocks.stone_slab); } protected ItemStack createStackedBlock(int metadata) { return new ItemStack(HSMOD.singleClay, 2, metadata & 7); } @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { if(item != Item.getItemFromBlock(HSMOD.doubleClay)) { for(int i = 0; i < StepTypes.length; i++) { list.add(new ItemStack(item, 1, i)); } } } @Override public String func_150002_b(int metadata) { if(metadata < 0 || metadata >= StepTypes.length) { metadata = 0; } return super.getUnlocalizedName() + "." + StepTypes[metadata]; } }
:::
ItemClaySlabs :
:::
package com.heartshadow.mod.slabs; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import com.heartshadow.mod.HSMOD; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemClaySlabs extends ItemBlock { private final boolean isFullBlock; private final Block theHalfSlab; private final Block doubleSlab; public ItemClaySlabs(Block block) { super(block); this.theHalfSlab = HSMOD.singleClay; this.doubleSlab = HSMOD.doubleClay; if(block == HSMOD.doubleClay) { this.isFullBlock = true; } else { this.isFullBlock = false; } this.setMaxDamage(0); this.setHasSubtypes(true); } @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int metadata) { return this.field_150939_a.getIcon(2, metadata); } public int getMetadata(int metadata) { return metadata; } public String getUnlocalizedName(ItemStack stack) { return ((BlockClaySlabs)theHalfSlab).func_150002_b(stack.getItemDamage()); } public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) { if(this.isFullBlock) { return super.onItemUse(stack, player, world, x, y, z, side, par8, par9, par10); } else if(stack.stackSize == 0) { return false; } else if(!player.canPlayerEdit(x, y, z, side, stack)) { return false; } else { Block i1 = world.getBlock(x, y, z); int j1 = world.getBlockMetadata(x, y, z); int k1 = j1 & 7; boolean flag = (j1 & 8) != 0; if((side == 1 && !flag || side == 0 && flag) && i1 == this.theHalfSlab && k1 == stack.getItemDamage()) { if(world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, this.doubleSlab, k1, 3)) { world.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), this.doubleSlab.stepSound.getStepResourcePath(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); –stack.stackSize; } return true; } else { return this.placeDoubleSlabFromTop(stack, player, world, x, y, z, side) ? true : super.onItemUse(stack, player, world, x, y, z, side, par8, par9, par10); } } } @SideOnly(Side.CLIENT) public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { int i1 = x; int j1 = y; int k1 = z; Block id = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); int j2 = meta & 7; boolean flag = (meta & 8) != 0; if((side == 1 && !flag || side == 0 && flag) && id == this.theHalfSlab && j2 == stack.getItemDamage()) { return true; } else { if(side == 0) { --y; } if(side == 1) { ++y; } if(side == 2) { --z; } if(side == 3) { ++z; } if(side == 4) { --x; } if(side == 5) { ++x; } id = world.getBlock(x, y, z); meta = world.getBlockMetadata(x, y, z); j2 = meta & 7; flag = (meta & 8) != 0; return id == this.theHalfSlab && j2 == stack.getItemDamage() ? true : super.func_150936_a(world, i1, j1, k1, side, player, stack); } } private boolean placeDoubleSlabFromTop(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) { if(side == 0) { --y; } if(side == 1) { ++y; } if(side == 2) { --z; } if(side == 3) { ++z; } if(side == 4) { --x; } if(side == 5) { ++x; } Block i1 = world.getBlock(x, y, z); int j1 = world.getBlockMetadata(x, y, z); int k1 = j1 & 7; if(i1 == this.theHalfSlab && k1 == stack.getItemDamage()) { if(world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, this.doubleSlab, k1, 3)) { world.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), this.doubleSlab.stepSound.getStepResourcePath(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); --stack.stackSize; } return true; } else { return false; } } }
:::
PS : Pour faire ça je me suis aidé du tuto en 1.6 et des sources 1.7 sur GitHub.
Voilà mon problème
-Vhake
-
Tu as un NPE car lorsque la classe item block est initialisé ton double slab est encore null.
Donc tu dois d’abord initialiser les deux blocs puis les enregistrer pour éviter ce problème.
(En gros les deux GameRegistry.registerBlock doivent être après les deux lignes block = new …) -
ça fonctionne merci !