
gellegbs
Members-
Posts
34 -
Joined
-
Last visited
Everything posted by gellegbs
-
[1.8]Crash while running rendering method, items & meta items
gellegbs replied to gellegbs's topic in Modder Support
sorry, I didn't post that I have it initialized here: package com.gellegbs.mlr; import com.gellegbs.mlr.item.ItemRenderRegister; import com.gellegbs.mlr.item.MLRItems; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class CommonProxy { @EventHandler public void preInit(FMLPreInitializationEvent event) { MLRItems.createItems(); } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } here is MLRItems: package com.gellegbs.mlr.item; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public final class MLRItems { public static Item carvingKnife; public static Item silk; public static void createItems(){ CarvingKnife carvingKnife = new CarvingKnife(); Silk silk = new Silk("silk"); GameRegistry.registerItem(carvingKnife, "carving_knife"); GameRegistry.registerItem(silk, "silk"); } } and this is my main class: package com.gellegbs.mlr; import net.minecraft.init.Blocks; import com.gellegbs.mlr.lib.*; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Reference.MODID, version = Reference.VERSION) public class MlrMain { @SidedProxy(clientSide="com.gellegbs.mlr.ClientProxy", serverSide="com.gellegbs.mlr.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { this.proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { this.proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { this.proxy.postInit(event); } } -
strings go in "12345" numbers like 12345
-
[1.8]Crash while running rendering method, items & meta items
gellegbs replied to gellegbs's topic in Modder Support
Unfortunately no change in outcome. changed : package com.gellegbs.mlr.item; import com.gellegbs.mlr.lib.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ItemRenderRegister { public static void registerItemRender(){ reg(MLRItems.carvingKnife); } public static void reg(Item item ){ ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));} } console: [17:05:00] [main/INFO] [GradleStart]: Extra: [] [17:05:00] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/gelle/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [17:05:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:05:00] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:05:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [17:05:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [17:05:00] [main/INFO] [FML]: Forge Mod Loader version 11.14.4.1563 for Minecraft 1.8 loading [17:05:00] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_71, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_71 [17:05:00] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [17:05:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [17:05:01] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [17:05:01] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [17:05:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:05:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:05:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [17:05:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:05:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:05:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:05:01] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [17:05:02] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [17:05:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:05:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:05:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [17:05:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [17:05:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [17:05:02] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [17:05:03] [Client thread/INFO]: Setting user: Player199 [17:05:06] [Client thread/INFO]: LWJGL Version: 2.9.1 [17:05:07] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:246]: ---- Minecraft Crash Report ---- // I let you down. Sorry Time: 1/31/16 5:05 PM Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 863129216 bytes (823 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' [17:05:07] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [17:05:07] [Client thread/INFO] [FML]: MinecraftForge v11.14.4.1563 Initialized [17:05:07] [Client thread/INFO] [FML]: Replaced 204 ore recipies [17:05:07] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [17:05:08] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [17:05:08] [Client thread/INFO] [FML]: Searching E:\workspace\MLR\run\mods for mods [17:05:09] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [17:05:10] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MLR] at CLIENT [17:05:10] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MLR] at SERVER [17:05:10] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Mob Lanterns Redone [17:05:10] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: MLR/ in E:\workspace\MLR\bin [17:05:10] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [17:05:10] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [17:05:10] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [17:05:10] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [17:05:11] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [17:05:11] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [17:05:11] [Client thread/INFO] [FML]: Applying holder lookups [17:05:11] [Client thread/INFO] [FML]: Holder lookups applied [17:05:11] [Client thread/INFO] [FML]: Injecting itemstacks [17:05:11] [Client thread/INFO] [FML]: Itemstack injection complete [17:05:11] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [17:05:11] [Client thread/ERROR] [FML]: States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) [17:05:11] [Client thread/ERROR] [FML]: The following problems were captured during this phase [17:05:11] [Client thread/ERROR] [FML]: Caught exception from MLR java.lang.NullPointerException at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:20) ~[bin/:?] at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:14) ~[bin/:?] at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) ~[bin/:?] at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [17:05:11] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: ---- Minecraft Crash Report ---- // Who set us up the TNT? Time: 1/31/16 5:05 PM Description: Initializing game java.lang.NullPointerException: Initializing game at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:20) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:14) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.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.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:20) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:14) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 748426992 bytes (713 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 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 UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon R9 200 Series GL version 4.5.13416 Compatibility Profile Context 15.300.1025.1001, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No 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) [17:05:11] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: #@!@# Game crashed! Crash report saved to: #@!@# E:\workspace\MLR\run\.\crash-reports\crash-2016-01-31_17.05.11-client.txt Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release crashlog: ---- Minecraft Crash Report ---- // Daisy, daisy... Time: 1/31/16 5:05 PM Description: Initializing game java.lang.NullPointerException: Initializing game at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:20) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:14) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.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.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:20) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:14) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 748426992 bytes (713 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 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 UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon R9 200 Series GL version 4.5.13416 Compatibility Profile Context 15.300.1025.1001, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No 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) -
I crash after some files are loaded and get this error: Crash Log ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 1/31/16 4:19 PM Description: Initializing game java.lang.NullPointerException: Initializing game at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:13) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.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.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:13) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 764941680 bytes (729 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 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 UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon R9 200 Series GL version 4.5.13416 Compatibility Profile Context 15.300.1025.1001, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No 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) It seems to error at .getItemModelMesher() in following class: package com.gellegbs.mlr.item; import com.gellegbs.mlr.lib.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; public class ItemRenderRegister { public static void registerItemRender(){ reg(MLRItems.carvingKnife); } public static void reg(Item item ){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));} } Console Output: [16:19:34] [main/INFO] [GradleStart]: Extra: [] [16:19:34] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/gelle/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [16:19:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:19:34] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:19:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [16:19:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [16:19:35] [main/INFO] [FML]: Forge Mod Loader version 11.14.4.1563 for Minecraft 1.8 loading [16:19:35] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_71, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_71 [16:19:35] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [16:19:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [16:19:35] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [16:19:35] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [16:19:35] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:19:35] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:19:35] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [16:19:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:19:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:19:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:19:36] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [16:19:39] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [16:19:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:19:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:19:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [16:19:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [16:19:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [16:19:41] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [16:19:43] [Client thread/INFO]: Setting user: Player79 [16:19:47] [Client thread/INFO]: LWJGL Version: 2.9.1 [16:19:47] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:246]: ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 1/31/16 4:19 PM Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 870849752 bytes (830 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' [16:19:47] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [16:19:47] [Client thread/INFO] [FML]: MinecraftForge v11.14.4.1563 Initialized [16:19:47] [Client thread/INFO] [FML]: Replaced 204 ore recipies [16:19:48] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [16:19:48] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [16:19:48] [Client thread/INFO] [FML]: Searching E:\workspace\MLR\run\mods for mods [16:19:52] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [16:19:53] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MLR] at CLIENT [16:19:53] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MLR] at SERVER [16:19:54] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Mob Lanterns Redone [16:19:54] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: MLR/ in E:\workspace\MLR\bin [16:19:54] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [16:19:54] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [16:19:54] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [16:19:54] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [16:19:54] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [16:19:54] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [16:19:54] [Client thread/INFO] [FML]: Applying holder lookups [16:19:54] [Client thread/INFO] [FML]: Holder lookups applied [16:19:54] [Client thread/INFO] [FML]: Injecting itemstacks [16:19:54] [Client thread/INFO] [FML]: Itemstack injection complete [16:19:54] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [16:19:54] [Client thread/ERROR] [FML]: States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) [16:19:54] [Client thread/ERROR] [FML]: The following problems were captured during this phase [16:19:54] [Client thread/ERROR] [FML]: Caught exception from MLR java.lang.NullPointerException at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) ~[bin/:?] at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:13) ~[bin/:?] at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) ~[bin/:?] at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.8-11.14.4.1563.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_71] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [16:19:54] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: ---- Minecraft Crash Report ---- // This doesn't make any sense! Time: 1/31/16 4:19 PM Description: Initializing game java.lang.NullPointerException: Initializing game at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:13) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.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.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) at com.gellegbs.mlr.item.ItemRenderRegister.registerItemRender(ItemRenderRegister.java:13) at com.gellegbs.mlr.ClientProxy.preInit(ClientProxy.java:16) at com.gellegbs.mlr.MlrMain.preInit(MlrMain.java:23) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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 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.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 764941680 bytes (729 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 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 UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCH Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCE MLR{0.01} [Mob Lanterns Redone] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon R9 200 Series' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon R9 200 Series GL version 4.5.13416 Compatibility Profile Context 15.300.1025.1001, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No 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) [16:19:55] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: #@!@# Game crashed! Crash report saved to: #@!@# E:\workspace\MLR\run\.\crash-reports\crash-2016-01-31_16.19.54-client.txt Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release I'm conserned about at com.gellegbs.mlr.item.ItemRenderRegister.reg(ItemRenderRegister.java:19) ~[bin/:?] Is it safe to assume its looking in the wrong folder for the json? Also the file path for the json is ...\src\main\resources\assets\MLR\models\item, and the textures are in ...\src\main\resources\assets\MLR\textures\items
-
Thank you that was extremely helpful. I was not aware of the different playSound methods and you really cleared it up for me. I appreciate the help!
-
do I use that even if I am using existing vanilla mob sounds?
-
Changed things up a bit but sound will not work. I do not know how to use the playSound method from Entity.class in this instance that extends BlockDirectional.class and Block.class. Anyone know how to do this? here is the method giving me grief the line errored is "this.playSound(type.sound);": public void updateBlock(World world, int x, int y, int z, int currentMeta) { if (!world.isRemote) { boolean isActive = (currentMeta & > 0; boolean redstoneSignal = world.isBlockIndirectlyGettingPowered(x, y, z); if (redstoneSignal) { if (!isActive) { if (type.sound != null) { this.playSound(type.sound); } currentMeta = (currentMeta & 7) + 8; world.setBlockMetadataWithNotify(x, y, z, currentMeta, 2); } } else { if (isActive) { world.setBlockMetadataWithNotify(x, y, z, (currentMeta & 7), 2); } } }
-
updating mod from 1.6.4 to 1.7.10. The lanterns will not change faces when redstone is emitted and the sounds won't play upon redstone signal. Have an error on return type.sound, but cant figure out how to do it another way. Thanks. package com.gellegbs.lanterns.blocks; import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import com.gellegbs.lanterns.Lanterns; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockMobLantern extends BlockDirectional { private BlockType type; private CreativeTabs displayOnCreativeTab; public BlockMobLantern(BlockType type) { super(Material.gourd); this.type = type; this.setCreativeTab(Lanterns.tabMobLanterns); this.setLightLevel(1F); this.setBlockName(this.type.unlocalizedName); } // icon junk @SideOnly(Side.CLIENT) private IIcon topIcon; @SideOnly(Side.CLIENT) private IIcon faceIcon; @SideOnly(Side.CLIENT) private IIcon blockIcon; @SideOnly(Side.CLIENT) private IIcon activeFaceIcon; @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister register) { topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + type.textureTop); faceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + type.textureFront); blockIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + type.textureSide); activeFaceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + type.textureSideActive); } @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int metadata) { if (side == 0 || side == 1) { return this.topIcon; } // metadata holds the block side with the face on in the lower 3 bits (0xxx), // and if its active or not in the highest bit. (x000) if ((metadata & 7) == side) { boolean isActive = (metadata & > 0; return (isActive) ? this.activeFaceIcon : this.faceIcon; } return this.blockIcon; } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemstack) { int whichDirectionFacing = MathHelper .floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; // map the facing to the block side with the face and store it as metadata. // mapping is as follows: Facing -> BlockSideWithFace // 0 -> 3 // 1 -> 4 // 2 -> 2 // 3 -> 5 // // we just check against 0,1 and 3 as 2 would be fine by itself. int blockSideWithFace = whichDirectionFacing; if (whichDirectionFacing == 0) blockSideWithFace = 3; else if (whichDirectionFacing == 1) blockSideWithFace = 4; else if (whichDirectionFacing == 3) blockSideWithFace = 5; world.setBlockMetadataWithNotify(x, y, z, blockSideWithFace, 2); this.updateBlock(world, x, y, z, blockSideWithFace); } public void onNeighborBlockChange(World world, int x, int y, int z, int par5) { if (!world.isRemote) { this.updateBlock(world, x, y, z, world.getBlockMetadata(x, y, z)); } } @Override public void onBlockAdded(World world, int x, int y, int z) { if (!world.isRemote) { this.updateBlock(world, x, y, z, world.getBlockMetadata(x, y, z)); } } public void updateBlock(World world, int x, int y, int z, int currentMeta) { if (!world.isRemote) { boolean isActive = (currentMeta & > 0; boolean redstoneSignal = world.isBlockIndirectlyGettingPowered(x, y, z); if (redstoneSignal) { if (!isActive) { if (type.sound != null) { return (type.sound); } currentMeta = (currentMeta & 7) + 8; world.setBlockMetadataWithNotify(x, y, z, currentMeta, 2); } } else { if (isActive) { world.setBlockMetadataWithNotify(x, y, z, (currentMeta & 7), 2); } } } } } more relevant classes package com.gellegbs.lanterns.blocks; public enum BlockType { // lanterns BLAZE(BlockIds.BLAZE_BLOCK_NAME, "mob.blaze.breathe", BlockIds.BLAZETOP, BlockIds.BLAZEFRONT, BlockIds.BLAZESIDE, BlockIds.BLAZESIDEACTIVE, 0), CREEPER(BlockIds.CREEPER_BLOCK_NAME, "random.fuse", BlockIds.CREEPERTOP, BlockIds.CREEPERFRONT, BlockIds.CREEPERSIDE, BlockIds.CREEPERSIDEACTIVE, 0), ENDERMEN(BlockIds.ENDERMEN_BLOCK_NAME, "mob.endermen.stare", BlockIds.ENDERMENTOP, BlockIds.ENDERMENFRONT, BlockIds.ENDERMENSIDE, BlockIds.ENDERMENSIDEACTIVE, 0), GHAST(BlockIds.GHAST_BLOCK_NAME, "mob.ghast.scream", BlockIds.GHASTTOP, BlockIds.GHASTFRONT, BlockIds.GHASTSIDE, BlockIds.GHASTSIDEACTIVE, 0), JACKO(BlockIds.JACKOLANTERN_BLOCK_NAME, null, BlockIds.JACKOLANTERNTOP, BlockIds.JACKOLANTERNFRONT, BlockIds.JACKOLANTERNSIDE, BlockIds.JACKOLANTERNFRONT, 0), MAGMA_CUBE(BlockIds.MAGMA_BLOCK_NAME, "mob.slime.attack", BlockIds.MAGMATOP, BlockIds.MAGMAFRONT, BlockIds.MAGMASIDE, BlockIds.MAGMASIDEACTIVE, 0), PIGMEN(BlockIds.PIGMEN_BLOCK_NAME, "mob.zombiepig.zpigangry", BlockIds.PIGMENTOP, BlockIds.PIGMENFRONT, BlockIds.PIGMENSIDE, BlockIds.PIGMENSIDEACTIVE, 0), SKELETON(BlockIds.SKELETON_BLOCK_NAME, "mob.skeleton.say", BlockIds.SKELETONTOP, BlockIds.SKELETONFRONT, BlockIds.SKELETONSIDE, BlockIds.SKELETONSIDEACTIVE, 0), SLIME(BlockIds.SLIME_BLOCK_NAME, "mob.slime.big", BlockIds.SLIMETOP, BlockIds.SLIMEFRONT, BlockIds.SLIMESIDE, BlockIds.SLIMESIDEACTIVE, 0), SPIDER(BlockIds.SPIDER_BLOCK_NAME, "mob.spider.say", BlockIds.SPIDERTOP, BlockIds.SPIDERFRONT, BlockIds.SPIDERSIDE, BlockIds.SPIDERSIDEACTIVE, 0), WITHER_SKELETON(BlockIds.WITHERSKELE_BLOCK_NAME, "mob.skeleton.step", BlockIds.WITHERSKELETOP, BlockIds.WITHERSKELEFRONT, BlockIds.WITHERSKELESIDE, BlockIds.WITHERSKELESIDEACTIVE, 0), ZOMBIE(BlockIds.ZOMBIE_BLOCK_NAME, "mob.zombie.say", BlockIds.ZOMBIETOP, BlockIds.ZOMBIEFRONT, BlockIds.ZOMBIESIDE, BlockIds.ZOMBIESIDEACTIVE, 0), // spawners BLAZESPAWN(BlockIds.BLAZESPAWN_BLOCK_NAME, null, BlockIds.BLAZESPAWNTOP, BlockIds.BLAZESPAWNSIDE, BlockIds.BLAZESPAWNSIDE, BlockIds.BLAZESPAWNSIDE, 61), CREEPERSPAWN(BlockIds.CREEPERSPAWN_BLOCK_NAME, null, BlockIds.CREEPERSPAWNTOP, BlockIds.CREEPERSIDESPAWN, BlockIds.CREEPERSIDESPAWN, BlockIds.CREEPERSIDESPAWN, 50), ENDERMENSPAWN(BlockIds.ENDERMENSPAWN_BLOCK_NAME, null, BlockIds.ENDERMENSPAWNTOP, BlockIds.ENDERMENSPAWNSIDE, BlockIds.ENDERMENSPAWNSIDE, BlockIds.ENDERMENSPAWNSIDE, 58), GHASTSPAWN(BlockIds.GHASTSPAWN_BLOCK_NAME, null, BlockIds.GHASTSPAWNTOP, BlockIds.GHASTSPAWNSIDE, BlockIds.GHASTSPAWNSIDE, BlockIds.GHASTSPAWNSIDE, 56), MAGMASPAWN(BlockIds.MAGMASPAWN_BLOCK_NAME, null, BlockIds.MAGMASPAWNTOP, BlockIds.MAGMASPAWNSIDE, BlockIds.MAGMASPAWNSIDE, BlockIds.MAGMASPAWNSIDE, 62), PIGMENSPAWN(BlockIds.PIGMENSPAWN_BLOCK_NAME, null, BlockIds.PIGMENSPAWNTOP, BlockIds.PIGMENSPAWNSIDE, BlockIds.PIGMENSPAWNSIDE, BlockIds.PIGMENSPAWNSIDE, 57), SKELETONSPAWN(BlockIds.SKELETONSPAWN_BLOCK_NAME, null, BlockIds.SKELETONSPAWNTOP, BlockIds.SKELETONSPAWNSIDE, BlockIds.SKELETONSPAWNSIDE, BlockIds.SKELETONSPAWNSIDE, 51), SLIMESPAWN(BlockIds.SLIMESPAWN_BLOCK_NAME, null, BlockIds.SLIMESPAWNTOP, BlockIds.SLIMESPAWNSIDE, BlockIds.SLIMESPAWNSIDE, BlockIds.SLIMESPAWNSIDE, 55), SPIDERSPAWN(BlockIds.SPIDERSPAWN_BLOCK_NAME, null, BlockIds.SPIDERSPAWNTOP, BlockIds.SLIMESPAWNSIDE, BlockIds.SPIDERSPAWNSIDE, BlockIds.SPIDERSPAWNSIDE, 52), WITHERSKELESPAWN(BlockIds.WITHERSKELESPAWN_BLOCK_NAME, null, BlockIds.WITHERSKELESPAWNTOP, BlockIds.WITHERSKELESPAWNSIDE, BlockIds.WITHERSKELESPAWNSIDE, BlockIds.WITHERSKELESPAWNSIDE, 51), ZOMBIESPAWN(BlockIds.ZSPAWN_BLOCK_NAME, null, BlockIds.ZSPAWNTOP, BlockIds.ZSPAWNSIDE, BlockIds.ZSPAWNSIDE, BlockIds.ZSPAWNSIDE, 54), WITCHSPAWN(BlockIds.WITCHSPAWN_BLOCK_NAME, null, BlockIds.WITCHSPAWN_TOP, BlockIds.WITCHSPAWN_SIDE, BlockIds.WITCHSPAWN_SIDE, BlockIds.WITCHSPAWN_SIDE, 66), GIANTSPAWN(BlockIds.GIANTSPAWN_BLOCK_NAME, null, BlockIds.GIANTSPAWN_TOP, BlockIds.GIANTSPAWN_SIDE, BlockIds.GIANTSPAWN_SIDE, BlockIds.GIANTSPAWN_SIDE, 53); public final String unlocalizedName, sound, textureTop, textureFront, textureSide, textureSideActive; public int spawnerid; BlockType(String unlocalizedName, String sound, String textureTop, String textureFront, String textureSide, String textureSideActive, int spawnerid) { this.unlocalizedName = unlocalizedName; this.sound = sound; this.textureTop = textureTop; this.textureFront = textureFront; this.textureSide = textureSide; this.textureSideActive = textureSideActive; this.spawnerid = spawnerid; } }
-
TheGreyGhost helped me with the exact issue for my lanterns mod. You need this to have the block face you: public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int whichDirectionFacing = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; par1World.setBlockMetadataWithNotify(x, y, z, whichDirectionFacing, 2); } but you also need to get icons for the sides @SideOnly(Side.CLIENT) @Override public Icon getIcon(int side, int metadata){ if (side == 1) return this.topIcon; else if (side == 0) return this.topIcon; else if (metadata == 2 && side == 2) return this.faceIcon; else if (metadata == 3 && side == 5) return this.faceIcon; else if (metadata == 0 && side == 3) return this.faceIcon; else if (metadata == 1 && side == 4) return this.faceIcon; else return this.blockIcon; } and remember before that to call and register them: @SideOnly(Side.CLIENT) private Icon topIcon; @SideOnly(Side.CLIENT) private Icon faceIcon; @SideOnly(Side.CLIENT) private Icon blockIcon; @Override public void registerIcons(IconRegister register){ topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERTOP); faceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERFRONT); blockIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERSIDE); } I use a separate class for my reference stuff like Ids and icons so if that's confusing you I can explain more about my BlockIds class. Good luck.
-
so do I always set unlocalized name in the constructor regardless of block, item, tile entity, etc.?
-
Thank you that worked. I dont know why it worked but it did... If you know why let me know I'd love an explanation of that one.
-
Sure : Jackolantern package lanterns.blocks; import java.util.List; import lanterns.Lanterns; import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockJackolantern extends BlockDirectional{ public BlockJackolantern(int id, Material material) { super(id, material.pumpkin); this.setCreativeTab(CreativeTabs.tabBlock); this.setLightValue(1F); } //icon junk @SideOnly(Side.CLIENT) private Icon topIcon; @SideOnly(Side.CLIENT) private Icon faceIcon; @SideOnly(Side.CLIENT) private Icon blockIcon; @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister register){ topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACOLANTERNTOP); faceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACKOLANTERNFRONT); blockIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACKOLANTERNSIDE); } @SideOnly(Side.CLIENT) @Override /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int side, int metadata) { if (side == 1) return this.topIcon; else if (side == 0) return this.topIcon; else if (metadata == 2 && side == 2) return this.faceIcon; else if (metadata == 3 && side == 5) return this.faceIcon; else if (metadata == 0 && side == 3) return this.faceIcon; else if (metadata == 1 && side == 4) return this.faceIcon; else return this.blockIcon; } public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int whichDirectionFacing = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; par1World.setBlockMetadataWithNotify(x, y, z, whichDirectionFacing, 2); } } Creeper lantern package lanterns.blocks; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCreeperLantern extends BlockDirectional { public BlockCreeperLantern(int id, Material material){ super(id, material.pumpkin); this.setCreativeTab(CreativeTabs.tabBlock); this.setLightValue(1F); } //icon junk @SideOnly(Side.CLIENT) private Icon topIcon; @SideOnly(Side.CLIENT) private Icon faceIcon; @SideOnly(Side.CLIENT) private Icon blockIcon; @Override public void registerIcons(IconRegister register){ topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERTOP); faceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERFRONT); blockIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.CREEPERSIDE); } @SideOnly(Side.CLIENT) @Override public Icon getIcon(int side, int metadata){ if (side == 1) return this.topIcon; else if (side == 0) return this.topIcon; else if (metadata == 2 && side == 2) return this.faceIcon; else if (metadata == 3 && side == 5) return this.faceIcon; else if (metadata == 0 && side == 3) return this.faceIcon; else if (metadata == 1 && side == 4) return this.faceIcon; else return this.blockIcon; } public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int whichDirectionFacing = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; par1World.setBlockMetadataWithNotify(x, y, z, whichDirectionFacing, 2); } } Zombie Lantern package lanterns.blocks; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockZombieLantern extends BlockDirectional { public BlockZombieLantern (int id, Material material) { super(id, Material.pumpkin); this.setCreativeTab(CreativeTabs.tabBlock); this.setLightValue(1F); } //icon junk @SideOnly(Side.CLIENT) private Icon topIcon; @SideOnly(Side.CLIENT) private Icon faceIcon; @SideOnly(Side.CLIENT) private Icon blockIcon; @Override public void registerIcons(IconRegister register){ topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.ZOMBIETOP); faceIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.ZOMBIEFRONT); blockIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.ZOMBIESIDE); } @SideOnly(Side.CLIENT) @Override public Icon getIcon(int side, int metadata){ if (side == 1) return this.topIcon; else if (side == 0) return this.topIcon; else if (metadata == 2 && side == 2) return this.faceIcon; else if (metadata == 3 && side == 5) return this.faceIcon; else if (metadata == 0 && side == 3) return this.faceIcon; else if (metadata == 1 && side == 4) return this.faceIcon; else return this.blockIcon; } public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int whichDirectionFacing = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; par1World.setBlockMetadataWithNotify(x, y, z, whichDirectionFacing, 2); } }
-
I have separate unlocalized names in my Blockids class.
-
Zombie Lantern name is overwriting all other lantern names. Maybe I'm missing something? ~*Blocks class*~ package lanterns.blocks; import lanterns.Reference; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; public class Blocks { public static Block jackolantern; public static Block creeperlantern; public static Block zombielantern; public static void init(){ jackolantern = new BlockJackolantern(BlockIds.JACOLANTERN_ID, Material.pumpkin); GameRegistry.registerBlock(jackolantern, BlockIds.JACKOLANTERN_KEY); creeperlantern = new BlockCreeperLantern(BlockIds.CREEPER_ID, Material.pumpkin); GameRegistry.registerBlock(creeperlantern, BlockIds.CREEPER_KEY); zombielantern = new BlockZombieLantern(BlockIds.ZOMBIE_ID, Material.pumpkin); GameRegistry.registerBlock(zombielantern, BlockIds.ZOMBIE_KEY); } public static void addNames(){ LanguageRegistry.addName(jackolantern, BlockIds.JACKOLANTERN_NAME); LanguageRegistry.addName(creeperlantern, BlockIds.CREEPER_NAME); LanguageRegistry.addName(zombielantern, BlockIds.ZOMBIE_NAME); } public static void recipes(){ GameRegistry.addShapelessRecipe(new ItemStack(Blocks.jackolantern), new ItemStack(Block.pumpkinLantern), new ItemStack(Block.torchWood)); GameRegistry.addShapelessRecipe(new ItemStack(Blocks.creeperlantern), new ItemStack(Block.pumpkinLantern), new ItemStack(Item.gunpowder)); GameRegistry.addShapelessRecipe(new ItemStack(Blocks.zombielantern),new ItemStack(Block.pumpkinLantern), new ItemStack(Item.rottenFlesh)); } } ~*BlockIds*~ package lanterns.blocks; public class BlockIds { public static final String TEXTURE_LOCATION = "lanterns"; //jackolantern public static int JACOLANTERN_ID = 1000; public static final String JACKOLANTERN_UNLOCALIZED_NAME = "jackolantern"; public static final String JACKOLANTERN_KEY = "jackolantern"; public static final String JACKOLANTERN_NAME = "Jack-O-Lantern"; public static final String JACOLANTERNTOP = "jackolantern1"; public static final String JACKOLANTERNSIDE = "jackolantern2"; public static final String JACKOLANTERNFRONT = "jackolantern0"; //creeper lantern public static int CREEPER_ID = 1001; public static final String CREEPER_UNLOCALIZED_NAME = "creeperlantern"; public static final String CREEPER_KEY = "creeperlantern"; public static final String CREEPER_NAME = "Creeper Lantern"; public static final String CREEPERTOP = "creeper_top"; public static final String CREEPERSIDE = "creeper_side"; public static final String CREEPERFRONT = "creeper_front"; //ZOMBIE lantern public static int ZOMBIE_ID = 1002; public static final String ZOMBIE_UNLOCALIZED_NAME = "zombielantern"; public static final String ZOMBIE_KEY = "zombielantern"; public static final String ZOMBIE_NAME = "Zombie Lantern"; public static final String ZOMBIETOP = "zombie_top"; public static final String ZOMBIESIDE = "zombie_side"; public static final String ZOMBIEFRONT = "zombie_front"; } ~*Main Class*~ package lanterns; import lanterns.blocks.BlockJackolantern; import lanterns.blocks.Blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = Reference.ID, name = Reference.NAME, version = Reference.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = Reference.CHANNEL) public class Lanterns { public static final String modid = "lanterns"; @EventHandler public void load(FMLInitializationEvent event){ Blocks.init(); Blocks.addNames(); Blocks.recipes(); } }
-
Getting front of block to face player when placed
gellegbs replied to gellegbs's topic in Modder Support
It worked like a charm. I was going crazy looking for information of the the block face direction map thing you made. I had no clue where 2, 3, 4, etc were and your diagram helped a lot. Everything helped really. Ok I need to know how did you know to use the onBlockPlacedBy method? Is it just experience or are there informative articles about this? -
Getting front of block to face player when placed
gellegbs replied to gellegbs's topic in Modder Support
Thank you your links are exactly what I'm looking for. I will try these methods and post the outcome. -
The block is a jackolantern and I want the front to face the player when he places it like furnaces, pumpkins etc. As of now textures are working on the correct sides but I don't know what methods to use for directional stuff. I have looked through the vanilla pumpkin class code but its kinda confusing, specifically the onBlockAdded method, anyways any help would be appreciated. This is what i have now. package lanterns.blocks; import java.util.List; import lanterns.Lanterns; import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockJackolantern extends BlockDirectional{ public BlockJackolantern(int id, Material material) { super(id, material); this.setCreativeTab(CreativeTabs.tabBlock); this.setLightValue(1F); } //icon junk @SideOnly(Side.CLIENT) private Icon topIcon; @SideOnly(Side.CLIENT) private Icon botIcon; @SideOnly(Side.CLIENT) private Icon frontIcon; @SideOnly(Side.CLIENT) private Icon sideIcon; @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister register){ topIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACOLANTERNTOP); frontIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACKOLANTERNFRONT); sideIcon = register.registerIcon(BlockIds.TEXTURE_LOCATION + ":" + BlockIds.JACKOLANTERNSIDE); } @SideOnly(Side.CLIENT) @Override public Icon getIcon(int side, int meta){ // as the front face if (side == 0) { return topIcon; } if (side == 1) { return topIcon; } if (side == 2) { return frontIcon; }else{ return sideIcon; } } }
-
I wanted to use metadata because I know how annoying it is changing all the ids in the config when multiple mods are added and ids clash. I just want to alieve any fustrations not using metadata would create. Thank you for sharing your code with me. I'm curious what are the 3 parameters for super in the first ItemBaconFood? I am not adding potion effects to my food yet, at least haven't intended to. This mod I'm creating is more of a practice and will be used privately and I won't release it. Yes thank you. Its a good reference, although i may organize things differently I like to see how others implement things. Unfortunately my problem remains with my ItemsFoodUtil class overwriting all my others.
-
Thank you for reminding me about registering items. I do all that in my Items class though not ItemIds I like to keep my ItemIds( or BlockIds) full of references and not methods that do anything. I'm still trying to figure out how I like to structure things like the init method etc., I was thinking of adding the name registry to it, maybe even the recipes but that may be going overboard. Anyways i digress. I saw that healing thing you pointed out and didn't finish fixing all of them, so i did that the Items class now looks like this. package foodstuffs.items; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import foodstuffs.lib.Reference; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; public class Items { public static Item sandwich; public static Item soup; public static Item canned_food; public static Item sweets; public static Item beverage; public static Item food_util; public static Item sides; public static Item glass_jar; public static Item mug; public static void init(){ sandwich = new ItemSandwich(ItemIds.SANDWICH_ID, 0); GameRegistry.registerItem(sandwich, Reference.ID + ItemIds.SANDWICH_UNLOCALIZED_NAME) ; for (int i = 0; i < ItemIds.SANDWICH_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(sandwich, 1, i), ItemIds.SANDWICH_NAMES[i]); } soup = new ItemSoup(ItemIds.SOUP_ID, 0); GameRegistry.registerItem(soup, Reference.ID + ItemIds.SOUP_UNLOCALIZED_NAME); for (int i = 0; i < ItemIds.SOUP_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(soup, 1, i), ItemIds.SOUP_NAMES[i]); } canned_food = new ItemCannedFood(ItemIds.CANNED_FOOD_ID, 0); GameRegistry.registerItem(canned_food, Reference.ID + ItemIds.CANNED_FOOD_UNLOCALIZED_NAME); for (int i = 0; i < ItemIds.CANNED_FOOD_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(canned_food, 1, i), ItemIds.CANNED_FOOD_NAMES[i]); } food_util = new ItemFoodUtil(ItemIds.FOOD_UTIL_ID, 0); GameRegistry.registerItem(canned_food, Reference.ID + ItemIds.FOOD_UTIL_UNLOCALIZED_NAME); for (int i = 0; i < ItemIds.FOOD_UTIL_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(food_util, 1, i), ItemIds.FOOD_UTIL_NAMES[i]); } } // public static void addNames(){ } public static void registerRecipes(){ //sandwiches GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 0), new ItemStack(Item.bread), new ItemStack(Item.chickenCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 0), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 2), new ItemStack(Item.bread), new ItemStack(Item.fishCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 3), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 7), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(Item.beefCooked), new ItemStack(Item.bread)); //soups GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 0), new ItemStack(Item.bowlEmpty), new ItemStack(Item.beefRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 1), new ItemStack(Item.bowlEmpty), new ItemStack(Item.chickenRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 2), new ItemStack(Item.bowlEmpty), new ItemStack(Item.fishRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); FurnaceRecipes.smelting().addSmelting(ItemIds.FOOD_UTIL_DEFAULT, 0, new ItemStack(soup, 1, 3), 0F); //canned //sweets //beverage //food utilities GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.beefRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.chickenRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.fishRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.porkRaw)); //sides //other } } And unfortunately, when i run the instance it does the same thing with itemfoodutil class overwriting soup and sandwich but now the images are broken. But I still think I progressed thanks to you pointing out those two things.
-
ok sorry. main class package foodstuffs; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import foodstuffs.handlers.ConfigHandler; import foodstuffs.items.Items; import foodstuffs.lib.Reference; import foodstuffs.proxy.CommonProxy; @Mod(modid = Reference.ID, name = Reference.NAME, version = Reference.VERSION) //for multiplayer ability @NetworkMod(channels = {Reference.CHANNEL}, clientSideRequired = true, serverSideRequired = false) public class FoodStuffs { //mod instance @Instance(Reference.ID) public static FoodStuffs instance; //note the proxy classes locations are added @SidedProxy(clientSide = "foodstuffs.proxy.ClientProxy", serverSide = "foodstuffs.proxy.CommonProxy" ) public static CommonProxy proxy; //new to 1.6 annotation eventhandler @EventHandler public void preInit(FMLPreInitializationEvent event){ //ConfigHandler.init(event.getSuggestedConfigurationFile()); Items.init(); // Blocks.init(); } @EventHandler public void init(FMLInitializationEvent event){ // Blocks.addNames(); Items.registerRecipes(); // Blocks.registerTileEntities(); } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } Items Class package foodstuffs.items; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; public class Items { public static Item sandwich; public static Item soup; public static Item canned_food; public static Item sweets; public static Item beverage; public static Item food_util; public static Item sides; public static Item glass_jar; public static Item mug; public static void init(){ sandwich = new ItemSandwich(ItemIds.SANDWICH_ID, 0); for (int i = 0; i < ItemIds.SANDWICH_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(sandwich, 1, i), ItemIds.SANDWICH_NAMES[i]); } soup = new ItemSoup(ItemIds.SOUP_ID, 0); for (int i = 0; i < ItemIds.SOUP_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(soup, 1, i), ItemIds.SOUP_NAMES[i]); } canned_food = new ItemCannedFood(ItemIds.CANNED_FOOD_ID, ItemIds.CANNED_FOOD_DEFAULT); for (int i = 0; i < ItemIds.CANNED_FOOD_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(canned_food, 1, i), ItemIds.CANNED_FOOD_NAMES[i]); } food_util = new ItemFoodUtil(ItemIds.FOOD_UTIL_ID, ItemIds.FOOD_UTIL_DEFAULT); for (int i = 0; i < ItemIds.FOOD_UTIL_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(food_util, 1, i), ItemIds.FOOD_UTIL_NAMES[i]); } } // public static void addNames(){ } public static void registerRecipes(){ //sandwiches GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 0), new ItemStack(Item.bread), new ItemStack(Item.chickenCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 0), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 2), new ItemStack(Item.bread), new ItemStack(Item.fishCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 3), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 7), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(Item.beefCooked), new ItemStack(Item.bread)); //soups GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 0), new ItemStack(Item.bowlEmpty), new ItemStack(Item.beefRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 1), new ItemStack(Item.bowlEmpty), new ItemStack(Item.chickenRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 2), new ItemStack(Item.bowlEmpty), new ItemStack(Item.fishRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); FurnaceRecipes.smelting().addSmelting(ItemIds.FOOD_UTIL_DEFAULT, 0, new ItemStack(soup, 1, 3), 0F); //canned //sweets //beverage //food utilities GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.beefRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.chickenRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.fishRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.porkRaw)); //sides //other } } ItemIds Class package foodstuffs.items; public class ItemIds { public static final String TEXTURE_LOCATION = "fm"; public static int SANDWICH_ID; public static final String SANDWICH_KEY = "Sandwich"; public static final int SANDWICH_DEFAULT = 10020; public static final String SANDWICH_UNLOCALIZED_NAME = "sandwich"; public static final String[] SANDWICH_NAMES = {"Chicken Sandwich", "Egg Salad Sandwich", "Fish Sandwich", "Ham Sandwich", "Steak Sandwich"}; public static final String[] SANDWICH_ICONS = {"chicken_sandwich", "eggsalad_sandwich", "fish_sandwich", "ham_sandwich", "steak_sandwich"}; public static int SOUP_ID; public static final String SOUP_KEY = "Soup"; public static final int SOUP_DEFAULT = 10021; public static final String SOUP_UNLOCALIZED_NAME = "soup"; public static final String[] SOUP_NAMES = {"Beef Stew", "Chicken Soup", "Fish Soup", "Broth", "Egg Drop Soup"}; public static final String[] SOUP_ICONS = {"beefstew", "chicken_soup", "fish_soup", "broth", "egg_drop_soup"}; public static int CANNED_FOOD_ID; public static final String CANNED_FOOD_KEY = "Canned_food"; public static final int CANNED_FOOD_DEFAULT = 10022; public static final String CANNED_FOOD_UNLOCALIZED_NAME = "cannedFood"; public static final String[] CANNED_FOOD_NAMES = {"Canned Beef Stew", "Canned Carrots", "Canned Chicken Soup", "Canned Fish Soup", "Canned Nopalitos", "Canned Potatoes", "Spam"}; public static final String[] CANNED_FOOD_ICONS = {"canned_beef_stew", "canned_carrot", "canned_chicken_soup", "canned_fish_soup", "canned_nopalitos", "canned_potato", "spam"}; public static int SWEETS_ID; public static final String SWEETS_KEY = "Sweets"; public static final int SWEETS_DEFAULT = 10023; public static final String SWEETS_UNLOCALIZED_NAME = "sweets"; public static final String[] SWEETS_NAMES = {"Carrot Cake", "Chocolate Cake", "Chocolate Ice Cream", "Chocolate Pudding", "Ice Cream", "Melon Sherbet", "Pumpkin Sherbert", "Vanilla Pudding"}; public static final String[] SWEETS_ICONS = {"carrot cake", "chocolate_cake", "chocolate_icecream", "chocolate_pudding", "icecream", "melon_sherbet", "pumpkin_sherbert", "vanilla_pudding"}; public static int BEVERAGE_ID; public static final String BEVERAGE_KEY = "Beverage"; public static final int BEVERAGE_DEFAULT = 10024; public static final String BEVERAGE_UNLOCALIZED_NAME = "beverage"; public static final String[] BEVERAGE_NAMES = {"Cactus Juice", "Apple Juice", "Melon Juice", "Milk Jug", "Hot Milk", "Hot Chocolate", "Chocolate Milk", "Apple Cider" }; public static final String [] BEVERAGE_ICONS = {"cactus_juice", "apple_juice", "melon juice", "milk_jug", "hot_milk", "hot_chocolate", "chocolate_milk", "apple_cider"}; public static int FOOD_UTIL_ID; public static final String FOOD_UTIL_KEY = "FoodUtil"; public static final int FOOD_UTIL_DEFAULT = 10025; public static final String FOOD_UTIL_UNLOCALIZED_NAME = "foodUtil"; public static final String[] FOOD_UTIL_NAMES = {"Unprepared Broth", "Mayo", "Flour", "Oil", "Coacoa Powder", "Dough", "Potato Dough"}; public static final String[] FOOD_UTIL_ICONS = {"unprepared_broth", "mayo", "flour", "oil", "coacoa", "dough", "potato_dough" }; public static int SIDES_ID; public static final String SIDES_KEY = "Sides"; public static final int SIDES_DEFAULT = 10026; public static final String SIDES_UNLOCALIZED_NAME = "sides"; public static final String[] SIDES_NAMES = {"Cooked Egg", "Egg Salad", "Mashed Potatoes", "Nopalitos","Potato Cake", "Yogurt", "Carrot Souffle", "Apple Cured Ham"}; public static final String[] SIDES_ICONS = {"cooked_egg", "egg_salad", "mashed_potato", "nopalitos", "potato_cake", "yogurt", "carrot_souffle", "apple_pork"} ; public static int GLASS_JAR_ID; public static final String GLASS_JAR_KEY = "Glass_jar"; public static final int GLASS_JAR_DEFAULT = 10027; public static final String GLASS_JAR_UNLOCALIZED_NAME = "glassJar"; public static final String GLASS_JAR_NAME = "Glass Jar"; public static final String GLASS_JAR_ICON = "glass_jar"; public static int MUG_ID; public static final String MUG_KEY = "Mug"; public static final int MUG_DEFAULT = 10028; public static final String MUG_UNLOCALIZED_NAME = "mug"; public static final String MUG_NAME = "Mug"; public static final String MUG_ICON = "mug"; } ItemFoodUtil (the one over writing) package foodstuffs.items; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; public class ItemFoodUtil extends ItemFood{ @SideOnly(Side.CLIENT) private Icon[] icons; public ItemFoodUtil(int id, int heal){ super(id, heal, 0F, false); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.FOOD_UTIL_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister register){ icons = new Icon[itemIds.FOOD_UTIL_ICONS.length]; for (int i = 0; i < icons.length; i++){ icons[i] = register.registerIcon(ItemIds.TEXTURE_LOCATION + ":" + ItemIds.FOOD_UTIL_ICONS[i]); } } @Override @SideOnly(Side.CLIENT) public Icon getIconFromDamage(int dmg){ return icons[dmg]; } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.FOOD_UTIL_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } } ItemSoup class (being overwritten) package foodstuffs.items; import java.util.List; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemSoup extends ItemFood { @SideOnly(Side.CLIENT) private Icon[] icons; public ItemSoup(int id, int heal){ super(id, heal, 4.8F, false); setMaxDamage(0); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public ItemStack onEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ItemStack stack = super.onEaten(par1ItemStack, par2World, par3EntityPlayer); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (par1ItemStack.stackSize <= 0) { return new ItemStack(Item.bowlEmpty); } par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bowlEmpty)); } return stack; } @SideOnly(Side.CLIENT) @Override public Icon getIconFromDamage (int dmg) { return icons[dmg]; } @SideOnly(Side.CLIENT) @Override public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[itemIds.SOUP_NAMES.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons[i] = iconRegister.registerIcon(ItemIds.TEXTURE_LOCATION + ItemIds.SOUP_NAMES[i]); } } @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Mmm mmm good!"); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.SOUP_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.SOUP_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } } ItemSandwich (being overwritten too, not all my itemx classes are made) package foodstuffs.items; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; public class ItemSandwich extends ItemFood{ @SideOnly(Side.CLIENT) private Icon[] icons; public ItemSandwich(int id, int heal){ super(id, heal, 4.8F, false); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.SANDWICH_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @SideOnly(Side.CLIENT) @Override public Icon getIconFromDamage (int dmg) { return icons[dmg]; } @SideOnly(Side.CLIENT) @Override public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[itemIds.SANDWICH_NAMES.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons[i] = iconRegister.registerIcon(ItemIds.TEXTURE_LOCATION + ItemIds.SANDWICH_NAMES[i]); } } @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Sammich"); } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.SANDWICH_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } } In creative the only items that show are the ones from the ItemFoodUtil.class they are named correctly and have the correct icons, but all the recipes that are from the other present item classes are corresponding to the meta from the ItemFoodUtil.class, so instead of 2 bread + fish = fish sandwich, it makes flour which has the same meta 3 as the fish sandwich.
-
Didn't know about them, will research thanks.
-
I want to become a Modder, I need help, i'm begginer
gellegbs replied to Eaglenator's topic in Modder Support
Also the New Boston is a famous Utuber that has tons of tutorials on many programming languages including Java. http://thenewboston.org/tutorials.php I highly suggest (and still use as reference) Oracle's tutorials and references http://docs.oracle.com/javase/tutorial/ One thing I have learned in modding Minecraft , and I'm sure its the same for people who work in the field programming with Java, is that modding is more like working with already written existing code than making your own. That's why its more important for you to understand Java than know how to copy someone's code for a block. What I mean is there is a lot of wonderful tutorials out there on how to make a block or a entity etc., but unless you really understand Java to a decent degree (you don't have to be a wiz) you will be totally lost trying to write your new code. After all, the mod you want to make will be unique and unlike any others out there so you will need to know what the Java is doing to make your mod work, how to read the Vanilla code and understand how to use the methods they already have there, and if you are going for compatibility, how other mods api's are written and how that effects your code. Most well made mods are done in teams. Having a support system is a HUGE thing. Unless you are super talented and can code, make good models and appealing images, know how to create good sounds and great at troubleshooting, I seriously don't think anyone does all this and well.. but you catch my drift. Minecraft may have been made by one guy, but what Minecraft is today is only because of the TEAM of talented people worked long hard hours together to make the game the great success it is today. Enough of that. I wish you well on your pursuit of your mod. Remember to not be afraid to ask if you don't know, and ignore the trolls. Don't give up! -
Forgot to mention this is 1.6.2
-
I have several food items (I haven't finished all my item classes), but the ones i do have running are being overwritten by my ItemFoodUtil class(I think the issue is metadata). Currently trying to get ItemSandwich and ItemSoup to work. Anyways. Main Class [embed=425,349]package foodstuffs; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import foodstuffs.handlers.ConfigHandler; import foodstuffs.items.Items; import foodstuffs.lib.Reference; import foodstuffs.proxy.CommonProxy; @Mod(modid = Reference.ID, name = Reference.NAME, version = Reference.VERSION) //for multiplayer ability @NetworkMod(channels = {Reference.CHANNEL}, clientSideRequired = true, serverSideRequired = false) public class FoodStuffs { //mod instance @Instance(Reference.ID) public static FoodStuffs instance; //note the proxy classes locations are added @SidedProxy(clientSide = "foodstuffs.proxy.ClientProxy", serverSide = "foodstuffs.proxy.CommonProxy" ) public static CommonProxy proxy; //new to 1.6 annotation eventhandler @EventHandler public void preInit(FMLPreInitializationEvent event){ //ConfigHandler.init(event.getSuggestedConfigurationFile()); Items.init(); // Blocks.init(); } @EventHandler public void init(FMLInitializationEvent event){ // Blocks.addNames(); Items.registerRecipes(); // Blocks.registerTileEntities(); } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } [/embed] ItemIds Class [embed=425,349]package foodstuffs.items; public class ItemIds { public static final String TEXTURE_LOCATION = "fm"; public static int SANDWICH_ID; public static final String SANDWICH_KEY = "Sandwich"; public static final int SANDWICH_DEFAULT = 10020; public static final String SANDWICH_UNLOCALIZED_NAME = "sandwich"; public static final String[] SANDWICH_NAMES = {"Chicken Sandwich", "Egg Salad Sandwich", "Fish Sandwich", "Ham Sandwich", "Steak Sandwich"}; public static final String[] SANDWICH_ICONS = {"chicken_sandwich", "eggsalad_sandwich", "fish_sandwich", "ham_sandwich", "steak_sandwich"}; public static int SOUP_ID; public static final String SOUP_KEY = "Soup"; public static final int SOUP_DEFAULT = 10021; public static final String SOUP_UNLOCALIZED_NAME = "soup"; public static final String[] SOUP_NAMES = {"Beef Stew", "Chicken Soup", "Fish Soup", "Broth", "Egg Drop Soup"}; public static final String[] SOUP_ICONS = {"beefstew", "chicken_soup", "fish_soup", "broth", "egg_drop_soup"}; public static int CANNED_FOOD_ID; public static final String CANNED_FOOD_KEY = "Canned_food"; public static final int CANNED_FOOD_DEFAULT = 10022; public static final String CANNED_FOOD_UNLOCALIZED_NAME = "cannedFood"; public static final String[] CANNED_FOOD_NAMES = {"Canned Beef Stew", "Canned Carrots", "Canned Chicken Soup", "Canned Fish Soup", "Canned Nopalitos", "Canned Potatoes", "Spam"}; public static final String[] CANNED_FOOD_ICONS = {"canned_beef_stew", "canned_carrot", "canned_chicken_soup", "canned_fish_soup", "canned_nopalitos", "canned_potato", "spam"}; public static int SWEETS_ID; public static final String SWEETS_KEY = "Sweets"; public static final int SWEETS_DEFAULT = 10023; public static final String SWEETS_UNLOCALIZED_NAME = "sweets"; public static final String[] SWEETS_NAMES = {"Carrot Cake", "Chocolate Cake", "Chocolate Ice Cream", "Chocolate Pudding", "Ice Cream", "Melon Sherbet", "Pumpkin Sherbert", "Vanilla Pudding"}; public static final String[] SWEETS_ICONS = {"carrot cake", "chocolate_cake", "chocolate_icecream", "chocolate_pudding", "icecream", "melon_sherbet", "pumpkin_sherbert", "vanilla_pudding"}; public static int BEVERAGE_ID; public static final String BEVERAGE_KEY = "Beverage"; public static final int BEVERAGE_DEFAULT = 10024; public static final String BEVERAGE_UNLOCALIZED_NAME = "beverage"; public static final String[] BEVERAGE_NAMES = {"Cactus Juice", "Apple Juice", "Melon Juice", "Milk Jug", "Hot Milk", "Hot Chocolate", "Chocolate Milk", "Apple Cider" }; public static final String [] BEVERAGE_ICONS = {"cactus_juice", "apple_juice", "melon juice", "milk_jug", "hot_milk", "hot_chocolate", "chocolate_milk", "apple_cider"}; public static int FOOD_UTIL_ID; public static final String FOOD_UTIL_KEY = "FoodUtil"; public static final int FOOD_UTIL_DEFAULT = 10025; public static final String FOOD_UTIL_UNLOCALIZED_NAME = "foodUtil"; public static final String[] FOOD_UTIL_NAMES = {"Unprepared Broth", "Mayo", "Flour", "Oil", "Coacoa Powder", "Dough", "Potato Dough"}; public static final String[] FOOD_UTIL_ICONS = {"unprepared_broth", "mayo", "flour", "oil", "coacoa", "dough", "potato_dough" }; public static int SIDES_ID; public static final String SIDES_KEY = "Sides"; public static final int SIDES_DEFAULT = 10026; public static final String SIDES_UNLOCALIZED_NAME = "sides"; public static final String[] SIDES_NAMES = {"Cooked Egg", "Egg Salad", "Mashed Potatoes", "Nopalitos","Potato Cake", "Yogurt", "Carrot Souffle", "Apple Cured Ham"}; public static final String[] SIDES_ICONS = {"cooked_egg", "egg_salad", "mashed_potato", "nopalitos", "potato_cake", "yogurt", "carrot_souffle", "apple_pork"} ; public static int GLASS_JAR_ID; public static final String GLASS_JAR_KEY = "Glass_jar"; public static final int GLASS_JAR_DEFAULT = 10027; public static final String GLASS_JAR_UNLOCALIZED_NAME = "glassJar"; public static final String GLASS_JAR_NAME = "Glass Jar"; public static final String GLASS_JAR_ICON = "glass_jar"; public static int MUG_ID; public static final String MUG_KEY = "Mug"; public static final int MUG_DEFAULT = 10028; public static final String MUG_UNLOCALIZED_NAME = "mug"; public static final String MUG_NAME = "Mug"; public static final String MUG_ICON = "mug"; }[/embed] Items Class (int he process of merging addNames method and init method, bad idea?) [embed=425,349]package foodstuffs.items; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; public class Items { public static Item sandwich; public static Item soup; public static Item canned_food; public static Item sweets; public static Item beverage; public static Item food_util; public static Item sides; public static Item glass_jar; public static Item mug; public static void init(){ sandwich = new ItemSandwich(ItemIds.SANDWICH_ID, 0); for (int i = 0; i < ItemIds.SANDWICH_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(sandwich, 1, i), ItemIds.SANDWICH_NAMES); } soup = new ItemSoup(ItemIds.SOUP_ID, 0); for (int i = 0; i < ItemIds.SOUP_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(soup, 1, i), ItemIds.SOUP_NAMES); } canned_food = new ItemCannedFood(ItemIds.CANNED_FOOD_ID, ItemIds.CANNED_FOOD_DEFAULT); for (int i = 0; i < ItemIds.CANNED_FOOD_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(canned_food, 1, i), ItemIds.CANNED_FOOD_NAMES); } food_util = new ItemFoodUtil(ItemIds.FOOD_UTIL_ID, ItemIds.FOOD_UTIL_DEFAULT); for (int i = 0; i < ItemIds.FOOD_UTIL_NAMES.length; i++){ LanguageRegistry.addName(new ItemStack(food_util, 1, i), ItemIds.FOOD_UTIL_NAMES); } } // public static void addNames(){ } public static void registerRecipes(){ //sandwiches GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 0), new ItemStack(Item.bread), new ItemStack(Item.chickenCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 0), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 2), new ItemStack(Item.bread), new ItemStack(Item.fishCooked), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 3), new ItemStack(Item.bread), new ItemStack(ItemIds.SIDES_ID, 1, 7), new ItemStack(Item.bread)); GameRegistry.addShapelessRecipe(new ItemStack(sandwich, 1, 1), new ItemStack(Item.bread), new ItemStack(Item.beefCooked), new ItemStack(Item.bread)); //soups GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 0), new ItemStack(Item.bowlEmpty), new ItemStack(Item.beefRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 1), new ItemStack(Item.bowlEmpty), new ItemStack(Item.chickenRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(soup, 2, 2), new ItemStack(Item.bowlEmpty), new ItemStack(Item.fishRaw), new ItemStack(Item.carrot), new ItemStack(Item.potato), new ItemStack(ItemIds.SOUP_ID, 1, 4)); FurnaceRecipes.smelting().addSmelting(ItemIds.FOOD_UTIL_DEFAULT, 0, new ItemStack(soup, 1, 3), 0F); //canned //sweets //beverage //food utilities GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.beefRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.chickenRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.fishRaw)); GameRegistry.addShapelessRecipe(new ItemStack(food_util, 1, 0), new ItemStack(Item.bucketWater), new ItemStack(Item.porkRaw)); //sides //other } }[/embed] ItemFoodUtil class (overwritting the other items) [embed=425,349]package foodstuffs.items; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; public class ItemFoodUtil extends ItemFood{ @SideOnly(Side.CLIENT) private Icon[] icons; public ItemFoodUtil(int id, int heal){ super(id, heal, 0F, false); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.FOOD_UTIL_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister register){ icons = new Icon[itemIds.FOOD_UTIL_ICONS.length]; for (int i = 0; i < icons.length; i++){ icons = register.registerIcon(ItemIds.TEXTURE_LOCATION + ":" + ItemIds.FOOD_UTIL_ICONS); } } @Override @SideOnly(Side.CLIENT) public Icon getIconFromDamage(int dmg){ return icons[dmg]; } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.FOOD_UTIL_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } } [/embed] ItemSandwich class (being overwritten) [embed=425,349]package foodstuffs.items; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; public class ItemSandwich extends ItemFood{ @SideOnly(Side.CLIENT) private Icon[] icons; public ItemSandwich(int id, int heal){ super(id, heal, 4.8F, false); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.SANDWICH_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @SideOnly(Side.CLIENT) @Override public Icon getIconFromDamage (int dmg) { return icons[dmg]; } @SideOnly(Side.CLIENT) @Override public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[itemIds.SANDWICH_NAMES.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons = iconRegister.registerIcon(ItemIds.TEXTURE_LOCATION + ItemIds.SANDWICH_NAMES); } } @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Sammich"); } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.SANDWICH_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } }[/embed] ItemSoupClass (being overwritten) [embed=425,349]package foodstuffs.items; import java.util.List; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemSoup extends ItemFood { @SideOnly(Side.CLIENT) private Icon[] icons; public ItemSoup(int id, int heal){ super(id, heal, 4.8F, false); setMaxDamage(0); setCreativeTab(CreativeTabs.tabFood); setHasSubtypes(true); this.setAlwaysEdible(); } @Override public ItemStack onEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ItemStack stack = super.onEaten(par1ItemStack, par2World, par3EntityPlayer); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (par1ItemStack.stackSize <= 0) { return new ItemStack(Item.bowlEmpty); } par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bowlEmpty)); } return stack; } @SideOnly(Side.CLIENT) @Override public Icon getIconFromDamage (int dmg) { return icons[dmg]; } @SideOnly(Side.CLIENT) @Override public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[itemIds.SOUP_NAMES.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons = iconRegister.registerIcon(ItemIds.TEXTURE_LOCATION + ItemIds.SOUP_NAMES); } } @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Mmm mmm good!"); } @Override public String getUnlocalizedName(ItemStack itemstack){ return ItemIds.SOUP_UNLOCALIZED_NAME + itemstack.getItemDamage(); } @Override @SideOnly(Side.CLIENT) public void getSubItems(int id, CreativeTabs tabs, List list){ for (int i = 0; i < ItemIds.SOUP_NAMES.length; i++){ ItemStack itemstack = new ItemStack (id, 1, i); list.add(itemstack); } } }[/embed] Thanks!