Posted March 20, 20178 yr [SOLUTION] 27 minutes ago, Choonster said: IRenderFactory#createRenderFor is called from the RenderManager constructor, before the RenderManager instance is stored in the Minecraft#renderManager field (used by Minecraft#getRenderManager). This means you're passing null as the RenderManager argument of your RenderShuriken constructor, so Render#bindTexture throws a NullPointerException when it tries to get the RenderManager#renderEngine field from it. You need to use the RenderManager instance passed as an argument to IRenderFactory#createRenderFor instead of trying to get it from Minecraft. This is also a general guideline you should follow: Use the data you've been given rather than trying to get the data yourself (unless you have a specific reason not to). So in my case, in RenderShuriken.java, I changed the createRenderFor(...) in the registerRender() method to look like the following... public static void registerRender() { RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new IRenderFactory() { @Override public Render createRenderFor(RenderManager manager) { return new RenderShuriken(manager); } }); } ================================================================================================================= I'm having issues with my shuriken (ninja star) entity (throwable) that is causing a null pointer exception when spawned into the minecraft world. I believe it happens when it tries to draw the entity because if I don't register the entity, I can throw the shuriken, it'll just be invisible when I do. I appreciate any and all help Potential Causes - things I think could be the issue but aren't sure 1. I'm pretty sure I'm doing something wrong when initializing "new ResourceLocation(<domain>, <path>)". Can someone please verify if I'm doing it correctly? 2. I have a method that registers all of my entities. I think that could be in the wrong place as well (e.g. putting it in "init()" when it should be in "postinit()" or something) PLEASE let me know if I need to post/add anything else. Thank you! CRASH REPORT Reveal hidden contents [22:12:31] [Server thread/INFO] [FML]: Unloading dimension 0 [22:12:31] [Server thread/INFO] [FML]: Unloading dimension -1 [22:12:31] [Server thread/INFO] [FML]: Unloading dimension 1 [22:12:31] [Server thread/INFO] [FML]: Applying holder lookups [22:12:31] [Server thread/INFO] [FML]: Holder lookups applied [22:12:32] [Client thread/FATAL]: Reported exception thrown! net.minecraft.util.ReportedException: Rendering entity in world at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:430) ~[RenderManager.class:?] at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) ~[RenderManager.class:?] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) ~[RenderGlobal.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1106) ~[EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:407) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] 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_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) ~[Render.class:?] at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) ~[Render.class:?] at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) ~[RenderShuriken.class:?] at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) ~[RenderShuriken.class:?] at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) ~[RenderManager.class:?] ... 20 more [22:12:32] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ---- // I'm sorry, Dave. Time: 3/19/17 10:12 PM Description: Rendering entity in world java.lang.NullPointerException: Rendering entity in world at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1106) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140) at net.minecraft.client.Minecraft.run(Minecraft.java:407) at net.minecraft.client.main.Main.main(Main.java:118) 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(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) -- Entity being rendered -- Details: Entity Type: pstest:textures/items/shuriken.png (com.puresalvation.test.entity.EntityShuriken) Entity ID: 685 Entity Name: entity.shuriken.name Entity's Exact location: -69.42, 65.52, 109.60 Entity's Block location: World: (-70,65,109), Chunk: (at 10,4,13 in -5,6; contains blocks -80,0,96 to -65,255,111), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Entity's Momentum: 1.12, -0.08, 1.01 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null -- Renderer details -- Details: Assigned renderer: com.puresalvation.test.render.RenderShuriken@41588a96 Location: 0.00,1.52,0.00 - World: (0,1,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Rotation: 48.0595 Delta: 0.80043745 Stacktrace: at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player74'/426, l='MpServer', x=-69.42, y=64.00, z=109.60]] Chunk stats: MultiplayerChunkCache: 621, 621 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (-92,64,248), Chunk: (at 4,4,8 in -6,15; contains blocks -96,0,240 to -81,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 40433 game time, 6322 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 125 total; [EntitySkeleton['Skeleton'/256, l='MpServer', x=-5.57, y=28.00, z=62.31], EntityCreeper['Creeper'/257, l='MpServer', x=-6.61, y=27.00, z=60.71], EntityChicken['Chicken'/513, l='MpServer', x=-66.13, y=69.00, z=30.39], EntityZombie['Zombie'/258, l='MpServer', x=-8.20, y=38.00, z=58.48], EntityZombie['Zombie'/259, l='MpServer', x=-10.25, y=38.00, z=61.54], EntityZombie['Zombie'/515, l='MpServer', x=-90.22, y=14.00, z=44.53], EntityZombie['Zombie'/260, l='MpServer', x=-6.51, y=14.00, z=67.81], EntitySkeleton['Skeleton'/261, l='MpServer', x=-2.31, y=13.00, z=65.50], EntityChicken['Chicken'/517, l='MpServer', x=-92.13, y=71.00, z=45.55], EntityCreeper['Creeper'/262, l='MpServer', x=-15.53, y=28.00, z=76.83], EntitySkeleton['Skeleton'/263, l='MpServer', x=-13.05, y=24.00, z=65.49], EntityBat['Bat'/264, l='MpServer', x=-1.00, y=20.32, z=71.50], EntitySkeleton['Skeleton'/265, l='MpServer', x=-6.25, y=29.00, z=89.49], EntityZombie['Zombie'/266, l='MpServer', x=-8.50, y=29.00, z=89.50], EntityItem['item.item.egg'/267, l='MpServer', x=-10.13, y=66.00, z=114.28], EntityChicken['Chicken'/268, l='MpServer', x=-12.89, y=67.00, z=119.65], EntityChicken['Chicken'/269, l='MpServer', x=-11.99, y=64.00, z=112.31], EntityChicken['Chicken'/270, l='MpServer', x=-11.43, y=71.00, z=122.40], EntityCreeper['Creeper'/526, l='MpServer', x=-65.50, y=24.00, z=40.82], EntitySpider['Spider'/271, l='MpServer', x=-10.99, y=38.00, z=138.12], EntityChicken['Chicken'/527, l='MpServer', x=-70.81, y=66.92, z=46.51], EntityCreeper['Creeper'/272, l='MpServer', x=-5.21, y=34.00, z=131.50], EntityChicken['Chicken'/529, l='MpServer', x=-75.19, y=71.00, z=39.58], EntityChicken['Chicken'/531, l='MpServer', x=-88.59, y=72.00, z=30.83], EntityPlayerSP['Player74'/426, l='MpServer', x=-69.42, y=64.00, z=109.60], EntityBat['Bat'/287, l='MpServer', x=2.25, y=17.10, z=63.75], EntityCreeper['Creeper'/288, l='MpServer', x=0.16, y=31.00, z=63.53], EntityBat['Bat'/289, l='MpServer', x=7.23, y=16.92, z=64.11], EntityBat['Bat'/290, l='MpServer', x=-1.44, y=18.04, z=65.50], EntityCow['Cow'/294, l='MpServer', x=6.16, y=78.00, z=109.47], EntityCow['Cow'/295, l='MpServer', x=6.20, y=71.00, z=137.50], EntityItem['item.item.egg'/94, l='MpServer', x=-134.19, y=77.00, z=110.68], EntityCreeper['Creeper'/102, l='MpServer', x=-113.29, y=28.00, z=66.23], EntitySkeleton['Skeleton'/103, l='MpServer', x=-112.27, y=34.00, z=92.50], EntitySquid['Squid'/104, l='MpServer', x=-122.32, y=61.10, z=82.09], EntitySquid['Squid'/105, l='MpServer', x=-123.36, y=61.78, z=85.68], EntitySquid['Squid'/106, l='MpServer', x=-115.40, y=62.05, z=88.49], EntitySquid['Squid'/107, l='MpServer', x=-122.07, y=61.56, z=85.64], EntityZombie['Zombie'/108, l='MpServer', x=-122.50, y=37.00, z=102.78], EntitySpider['Spider'/109, l='MpServer', x=-118.53, y=37.00, z=97.06], EntityChicken['Chicken'/110, l='MpServer', x=-124.52, y=77.00, z=109.22], EntityItem['item.item.egg'/111, l='MpServer', x=-120.65, y=74.00, z=105.17], EntityChicken['Chicken'/112, l='MpServer', x=-127.23, y=79.00, z=113.49], EntityChicken['Chicken'/114, l='MpServer', x=-116.15, y=80.00, z=119.50], EntityChicken['Chicken'/129, l='MpServer', x=-104.82, y=68.00, z=50.42], EntitySkeleton['Skeleton'/130, l='MpServer', x=-106.21, y=13.00, z=74.51], EntityZombie['Zombie'/131, l='MpServer', x=-108.40, y=25.00, z=68.77], EntitySkeleton['Skeleton'/132, l='MpServer', x=-103.53, y=34.00, z=90.73], EntityChicken['Chicken'/133, l='MpServer', x=-119.17, y=80.00, z=125.42], EntityItem['item.item.egg'/134, l='MpServer', x=-111.66, y=78.00, z=118.61], EntityWitch['Witch'/135, l='MpServer', x=-106.85, y=22.00, z=139.45], EntityCreeper['Creeper'/136, l='MpServer', x=-96.84, y=24.00, z=140.49], EntitySquid['Squid'/137, l='MpServer', x=-111.45, y=61.03, z=140.27], EntityCreeper['Creeper'/138, l='MpServer', x=-100.41, y=48.00, z=148.78], EntitySquid['Squid'/139, l='MpServer', x=-107.33, y=58.39, z=142.40], EntitySkeleton['Skeleton'/152, l='MpServer', x=-92.48, y=29.00, z=76.34], EntityZombie['Zombie'/153, l='MpServer', x=-91.27, y=20.00, z=82.45], EntityCreeper['Creeper'/154, l='MpServer', x=-92.81, y=41.00, z=81.47], EntityBat['Bat'/155, l='MpServer', x=-87.75, y=12.10, z=134.75], EntityBat['Bat'/162, l='MpServer', x=-75.82, y=38.10, z=73.75], EntityBat['Bat'/163, l='MpServer', x=-73.00, y=42.10, z=91.68], EntityBat['Bat'/164, l='MpServer', x=-76.76, y=39.12, z=88.25], EntityBat['Bat'/165, l='MpServer', x=-66.49, y=41.46, z=88.42], EntityBat['Bat'/166, l='MpServer', x=-65.25, y=34.10, z=102.75], EntityItem['item.item.seeds'/167, l='MpServer', x=-73.88, y=64.00, z=102.88], EntityItem['item.item.seeds'/168, l='MpServer', x=-72.11, y=64.00, z=99.89], EntityItem['item.item.seeds'/169, l='MpServer', x=-75.88, y=65.00, z=110.82], EntitySkeleton['Skeleton'/170, l='MpServer', x=-70.21, y=19.00, z=137.50], EntityZombie['Zombie'/171, l='MpServer', x=-65.01, y=18.00, z=131.30], EntityItem['item.item.egg'/683, l='MpServer', x=-13.73, y=66.00, z=119.88], EntityShuriken['entity.shuriken.name'/685, l='MpServer', x=-69.42, y=65.52, z=109.60], EntityCow['Cow'/179, l='MpServer', x=-49.49, y=63.00, z=58.17], EntityZombie['Zombie'/180, l='MpServer', x=-56.20, y=26.00, z=66.51], EntitySkeleton['Skeleton'/181, l='MpServer', x=-54.11, y=27.00, z=91.50], EntityZombie['Zombie'/182, l='MpServer', x=-53.50, y=32.00, z=101.79], EntityZombie['Zombie'/183, l='MpServer', x=-53.79, y=39.00, z=93.50], EntityItem['item.tile.flower1.dandelion'/184, l='MpServer', x=-50.14, y=62.00, z=92.61], EntityItem['item.tile.mushroom'/185, l='MpServer', x=-54.18, y=63.00, z=94.67], EntityZombie['Zombie'/186, l='MpServer', x=-57.49, y=40.00, z=101.81], EntityZombie['Zombie'/187, l='MpServer', x=-54.62, y=35.00, z=98.99], EntityZombie['Zombie'/188, l='MpServer', x=-54.66, y=35.00, z=99.82], EntityZombie['Zombie'/189, l='MpServer', x=-57.19, y=40.00, z=96.50], EntityZombie['Zombie'/190, l='MpServer', x=-63.29, y=34.00, z=104.81], EntityItem['item.tile.mushroom'/191, l='MpServer', x=-54.55, y=63.00, z=97.06], EntityZombie['Zombie'/192, l='MpServer', x=-57.44, y=32.00, z=115.78], EntitySkeleton['Skeleton'/193, l='MpServer', x=-69.87, y=29.00, z=111.56], EntitySkeleton['Skeleton'/194, l='MpServer', x=-58.51, y=31.00, z=129.31], EntityChicken['Chicken'/450, l='MpServer', x=-101.40, y=71.00, z=44.88], EntitySkeleton['Skeleton'/195, l='MpServer', x=-63.82, y=14.00, z=150.47], EntityZombieVillager['Zombie Villager'/451, l='MpServer', x=-127.52, y=40.00, z=35.77], EntityBat['Bat'/196, l='MpServer', x=-48.25, y=19.10, z=148.45], EntityChicken['Chicken'/455, l='MpServer', x=-103.43, y=73.00, z=30.80], EntityCow['Cow'/212, l='MpServer', x=-37.55, y=63.00, z=69.20], EntityBat['Bat'/213, l='MpServer', x=-20.41, y=15.42, z=85.35], EntityZombie['Zombie'/214, l='MpServer', x=-39.58, y=16.00, z=95.81], EntitySkeleton['Skeleton'/215, l='MpServer', x=-44.30, y=19.00, z=139.70], EntitySkeleton['Skeleton'/216, l='MpServer', x=-45.00, y=19.00, z=138.59], EntityBat['Bat'/217, l='MpServer', x=-47.25, y=19.10, z=144.24], EntitySpider['Spider'/218, l='MpServer', x=-47.30, y=21.00, z=150.79], EntitySkeleton['Skeleton'/219, l='MpServer', x=-37.75, y=19.00, z=144.50], EntityBat['Bat'/220, l='MpServer', x=-40.77, y=39.10, z=147.62], EntitySpider['Spider'/221, l='MpServer', x=-47.28, y=18.00, z=160.70], EntityBat['Bat'/227, l='MpServer', x=-24.02, y=24.68, z=60.48], EntityCow['Cow'/228, l='MpServer', x=-28.48, y=64.00, z=59.18], EntitySkeleton['Skeleton'/229, l='MpServer', x=-26.42, y=41.00, z=108.93], EntitySkeleton['Skeleton'/230, l='MpServer', x=-26.87, y=41.00, z=108.30], EntityCreeper['Creeper'/231, l='MpServer', x=-23.43, y=50.00, z=100.80], EntityZombie['Zombie'/232, l='MpServer', x=-29.77, y=22.00, z=125.16], EntityItem['item.item.egg'/233, l='MpServer', x=-16.01, y=63.00, z=124.88], EntityChicken['Chicken'/234, l='MpServer', x=-21.39, y=63.00, z=115.10], EntityCreeper['Creeper'/490, l='MpServer', x=-11.80, y=26.00, z=34.49], EntityItem['item.item.egg'/235, l='MpServer', x=-19.40, y=64.00, z=116.39], EntityZombieVillager['Zombie Villager'/491, l='MpServer', x=-8.25, y=25.00, z=46.44], EntityBat['Bat'/236, l='MpServer', x=-22.17, y=23.48, z=132.97], EntityCreeper['Creeper'/492, l='MpServer', x=-5.05, y=26.00, z=39.50], EntityCreeper['Creeper'/237, l='MpServer', x=-30.82, y=21.00, z=146.51], EntityCreeper['Creeper'/493, l='MpServer', x=-13.52, y=26.00, z=46.98], EntitySkeleton['Skeleton'/238, l='MpServer', x=-21.50, y=38.00, z=150.47], EntityCreeper['Creeper'/239, l='MpServer', x=-18.22, y=38.00, z=147.47], EntityCow['Cow'/495, l='MpServer', x=-28.53, y=66.00, z=42.85], EntityChicken['Chicken'/240, l='MpServer', x=-21.06, y=78.00, z=171.50], EntityCow['Cow'/496, l='MpServer', x=-27.79, y=66.00, z=39.50], EntityChicken['Chicken'/241, l='MpServer', x=-21.16, y=83.00, z=180.90], EntityCow['Cow'/501, l='MpServer', x=-37.25, y=65.00, z=45.19], EntitySkeleton['Skeleton'/255, l='MpServer', x=-8.49, y=27.00, z=58.71]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2774) at net.minecraft.client.Minecraft.run(Minecraft.java:428) at net.minecraft.client.main.Main.main(Main.java:118) 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(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.11.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_121, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 606828232 bytes (578 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 7, tcache: 6, allocated: 12, tallocated: 94 FML: MCP 9.38 Powered by Forge 13.20.0.2228 6 mods loaded, 6 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA minecraft{1.11.2} [Minecraft] (minecraft.jar) UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) UCHIJAAAA forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) UCHIJAAAA examplemod{1.0} [examplemod] (bin) UCHIJAAAA pstest{1.0} [Test Mod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 376.54' Renderer: 'GeForce GTX 980M/PCIe/SSE2' Launched Version: 1.11.2 LWJGL: 2.9.4 OpenGL: GeForce GTX 980M/PCIe/SSE2 GL version 4.5.0 NVIDIA 376.54, NVIDIA Corporation 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: Yes 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) CPU: 8x Intel(R) Core(TM) i7-6820HK CPU @ 2.70GHz [22:12:32] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\ktsui\Desktop\Minecraft Modding\run\.\crash-reports\crash-2017-03-19_22.12.32-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release ItemShuriken.java package com.puresalvation.test.items; import com.puresalvation.test.Reference; import com.puresalvation.test.TestMod; import com.puresalvation.test.entity.EntityShuriken; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.util.SoundCategory; import net.minecraft.world.World; public class ItemShuriken extends Item { // [CONSTRUCTOR] public ItemShuriken() { setUnlocalizedName(Reference.TestItems.SHURIKEN.getUnlocalizedName()); setRegistryName(Reference.TestItems.SHURIKEN.getRegistryName()); setCreativeTab(TestMod.modTab); } // [METHODS] /* * Item is NOT repairable in an anvil */ @Override public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { return false; } /* * When right-clicked... * (1) Decrement the stack size (if in Survival Mode) * (2) Perform any animation and play sound * (3) Create and Spawn the corresponding entity into the world */ @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { // Create an ItemStack from the item being held in the Main/Offhand of player (Main/Offhand determined by "handIn") ItemStack itemstack = playerIn.getHeldItem(handIn); // (1) Decrement the stack size if NOT in creative mode if (!playerIn.capabilities.isCreativeMode) { itemstack.shrink(1); } // (2) Play the sound worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_ENDERPEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); // (3) Create and Spawn the shuriken entity into the world if (!worldIn.isRemote) { EntityShuriken shuriken = new EntityShuriken(worldIn, playerIn); //EntitySnowball snowball = new EntitySnowball(worldIn, playerIn); // Set the entity's direction, velocity, inaccuracy, rotation, etc. //snowball.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); shuriken.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); //worldIn.spawnEntity(snowball); // spawn the entity into the world worldIn.spawnEntity(shuriken); // spawn the entity into the world } playerIn.addStat(StatList.getObjectUseStats(this)); return new ActionResult(EnumActionResult.SUCCESS, itemstack); //return super.onItemRightClick(worldIn, playerIn, handIn); } } EntityShuriken.java - can someone verify I'm doing "new ResourceLocation(...)" correctly? package com.puresalvation.test.entity; import java.util.Arrays; import com.puresalvation.test.Reference; import com.puresalvation.test.TestMod; import com.puresalvation.test.init.ModItems; import com.puresalvation.test.render.RenderShuriken; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry; public class EntityShuriken extends EntityThrowable { public static final float GRAVITY = 0.03F; public static final Block[] SHURIKEN_BREAKS_THROUGH = {Blocks.TALLGRASS, Blocks.VINE, Blocks.RED_FLOWER, Blocks.YELLOW_FLOWER, Blocks.BROWN_MUSHROOM_BLOCK, Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM, Blocks.REEDS, Blocks.DOUBLE_PLANT, Blocks.DEADBUSH, Blocks.WHEAT, Blocks.WATERLILY, Blocks.CARROTS, Blocks.POTATOES, Blocks.SNOW_LAYER}; // [CONSTRUCTORS] public EntityShuriken(World worldIn) { super(worldIn); } public EntityShuriken(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); } public EntityShuriken(World worldIn, EntityLivingBase throwerIn) { super(worldIn, throwerIn); } // [METHODS] public static void registerEntity() { EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "textures/items/shuriken.png"), EntityShuriken.class, Reference.TestItems.SHURIKEN.getUnlocalizedName(), 0, TestMod.instance, 64, 10, true); } /* Custom Helper Method * * Inflict damage on the entity hit by the shuriken */ private void inflictDamage(RayTraceResult result) { // Get the entity that was hit by the shuriken and inflict damage result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 4); } /* Custom Helper Method * * Destroy the shuriken entity once it hits another entity or a block. Also add a little animation too */ private void destroySelf() { // A little smoke animation this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); // Destroy the shuriken entity and remove it from the world (inherited from the entity class) this.setDead(); } /* * When the shuriken entity hits something... */ @Override protected void onImpact(RayTraceResult result) { if (result.typeOfHit == RayTraceResult.Type.BLOCK) // Shuriken hits a block { // Get the block that the shuriken hit Block block = this.world.getBlockState(result.getBlockPos()).getBlock(); // If the shuriken collides with vegetation and other "quasi" blocks, destroy the thing and continue on its path if (Arrays.asList(SHURIKEN_BREAKS_THROUGH).contains(block)) { // Get info relevant so the broken vegetation block is harvestable BlockPos blockpos = result.getBlockPos(); IBlockState blockstate = this.world.getBlockState(blockpos); TileEntity te = this.world.getTileEntity(blockpos); if (this.getThrower() instanceof EntityPlayer) // if thrower is a player { // Destroy the block but make sure it's harvestable EntityPlayer player = (EntityPlayer)this.getThrower(); this.world.destroyBlock(blockpos, false); block.harvestBlock(this.world, player, blockpos, blockstate, te, new ItemStack(ModItems.shuriken)); // TODO: Verify the last parameter is correct (making a guess on this one) } } // Otherwise it hit a block or entity and can be destroyed else { this.destroySelf(); } } else { if (result.entityHit != null) { this.inflictDamage(result); } this.destroySelf(); } } /* * Override impact of gravity to be minimal */ @Override protected float getGravityVelocity() { return this.GRAVITY; } } RenderShuriken.java - can someone verify I'm doing "new ResourceLocation(...)" correctly? package com.puresalvation.test.render; import org.lwjgl.opengl.GL11; import com.puresalvation.test.Reference; import com.puresalvation.test.entity.EntityShuriken; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; public class RenderShuriken extends Render { // Location of the texture private static final ResourceLocation shurikenTexture = new ResourceLocation(Reference.MOD_ID, "textures/items/shuriken.png"); // [CONSTRUCTORS] public RenderShuriken(RenderManager renderManager) { super(renderManager); } // [METHODS] public static void registerRender() { //RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new RenderShuriken(Minecraft.getMinecraft().getRenderManager())); RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new IRenderFactory() { @Override public Render createRenderFor(RenderManager manager) { return new RenderShuriken(Minecraft.getMinecraft().getRenderManager()); } }); } /* Custom Helper Method * * Return the texture of the shuriken */ protected ResourceLocation getEntityTexture(EntityShuriken shuriken) { return this.shurikenTexture; } /* * Cast the entity to a shuriken and call the helper method to get the texture */ @Override protected ResourceLocation getEntityTexture(Entity entity) { return this.getEntityTexture((EntityShuriken)entity); } @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { doRender((EntityShuriken)entity, x, y, z, entityYaw, partialTicks); } public void doRender(EntityShuriken shuriken, double x, double y, double z, float entityYaw, float partialTicks) { //EntityShuriken shuriken = (EntityShuriken)entity; this.bindEntityTexture(shuriken); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); // set texture color to white // Everything between pushMatrix and popMatrix will affect the render GlStateManager.pushMatrix(); // push Matrix and start operations GlStateManager.translate((float)x, (float)y, (float)z); // Move matrix to the world position of the shuriken //GlStateManager.rotate(shuriken.prevRotationYaw + (shuriken.rotationYaw - shuriken.prevRotationYaw) * entityYaw - 90.0F, 0.0F, 1.0F, 0.0F); // rotate on y-axis to face the direction the player is facing Tessellator tessellator = Tessellator.getInstance(); // Tessellator generates quad faces from a list of vertices VertexBuffer vertexbuffer = tessellator.getBuffer(); // Draws the quad faces GlStateManager.enableRescaleNormal(); // Performs OpenGL operation which sets a flag to enable uniform normal rescaling // Set scale variable to use as a global scaling value for the matrix and normals. Then scale the matrix accordingly float scale = 0.05F; GlStateManager.scale(scale, scale, scale); GL11.glNormal3f(0.0F, 0.0F, scale); // set facing direction of normal. Basically set direction of individual vertices or a quad // ==================================================================== // Draw quads for the shuriken model (will be manually creating quads) // ____________________________________________________________________ // Draw front-facing quad vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX); // start of quad drawing vertexbuffer.pos(-2.0D, -2.0D, 0.0D).tex(0, 0).endVertex(); vertexbuffer.pos(2.0D, -2.0D, 0.0D).tex(1, 0).endVertex(); vertexbuffer.pos(2.0D, 2.0D, 0.0D).tex(1, 1).endVertex(); vertexbuffer.pos(-2.0D, 2.0D, 0.0D).tex(0, 1).endVertex(); tessellator.draw(); // end of quad drawing // Draw back-facing quad (by rotating it 180 degrees and redrawing the same quad) GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); // rotate 180 degrees vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX); vertexbuffer.pos(-2.0D, -2.0D, 0.0D).tex(0, 0).endVertex(); vertexbuffer.pos(2.0D, -2.0D, 0.0D).tex(1, 0).endVertex(); vertexbuffer.pos(2.0D, 2.0D, 0.0D).tex(1, 1).endVertex(); vertexbuffer.pos(-2.0D, 2.0D, 0.0D).tex(0, 1).endVertex(); tessellator.draw(); // ==================================================================== GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); // return matrix to default translation super.doRender(shuriken, x, y, z, entityYaw, partialTicks); } } Main class - included a comment on line 68 (inside "preinit()") pointing out the code causing my crash package com.puresalvation.test; import java.util.Set; import com.google.common.collect.Sets; import com.puresalvation.test.entity.EntityShuriken; import com.puresalvation.test.init.ModCrafting; import com.puresalvation.test.init.ModItems; import com.puresalvation.test.proxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; 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; /* * Most of the initializations will happen here */ @Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = Reference.ACCEPTED_VERSIONS) public class TestMod { @Instance public static TestMod instance; @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; // Creative Tab public static CreativeTabs modTab = new ModTab("tab_mod"); // adds a creative tab for our mod // Tools related public static ToolMaterial SAVAGE_MATERIAL = EnumHelper.addToolMaterial("Savage", 3, 200, 64.0F, 10.0F, 15); // New Tool Material: Savage public static ToolMaterial BASIC_MULTITOOL_MATERIAL = EnumHelper.addToolMaterial("Basic Multi-Tool", 3, 2800, 10.0F, 6.0F, 10); // New Tool Material: Basic Multi-Tool Material public static ToolMaterial MULTITOOL_MATERIAL = EnumHelper.addToolMaterial("Multi-Tool", 3, 85000, 64.0F, 20.0F, 15); // New Tool Material: Multi-Tool public static final Set<Block> MY_EFFECTIVE_ON_1 = Sets.newHashSet(new Block[] {Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE}); public static final Set<Block> MULTITOOL_EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE, Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH, Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE, Blocks.LEAVES}); @EventHandler public void preInit(FMLPreInitializationEvent event) { System.out.println("Pre Init"); // Using Polymorphism, will appropriately call preInit for both client and server side proxy.preInit(); ModItems.init(); ModItems.register(); // Register Entities EntityShuriken.registerEntity(); // !!!!! CAUSING CRASH !!!!! } @EventHandler public void init(FMLInitializationEvent event) { System.out.println("Init"); // Using Polymorphism, will appropriately call init for both client and server side proxy.init(); // Register the crafting recipes ModCrafting.register(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { System.out.println("Post Init"); } } ClientProxy.java package com.puresalvation.test.proxy; import com.puresalvation.test.entity.EntityShuriken; import com.puresalvation.test.init.ModItems; import com.puresalvation.test.render.RenderShuriken; public class ClientProxy implements CommonProxy { @Override public void preInit() { // Called on Client Side RenderShuriken.registerRender(); } @Override public void init() { // Called on the client side ModItems.registerRenders(); } } SCREENSHOT - Class Model Hierarchy Edited March 20, 20178 yr by Sack Of Potatoes
March 20, 20178 yr Post the crash report. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 20, 20178 yr Author Oh of course, I'll do that right now EDIT: Here it is Spoiler [22:12:31] [Server thread/INFO] [FML]: Unloading dimension 0 [22:12:31] [Server thread/INFO] [FML]: Unloading dimension -1 [22:12:31] [Server thread/INFO] [FML]: Unloading dimension 1 [22:12:31] [Server thread/INFO] [FML]: Applying holder lookups [22:12:31] [Server thread/INFO] [FML]: Holder lookups applied [22:12:32] [Client thread/FATAL]: Reported exception thrown! net.minecraft.util.ReportedException: Rendering entity in world at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:430) ~[RenderManager.class:?] at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) ~[RenderManager.class:?] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) ~[RenderGlobal.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1106) ~[EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:407) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] 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_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) ~[Render.class:?] at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) ~[Render.class:?] at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) ~[RenderShuriken.class:?] at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) ~[RenderShuriken.class:?] at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) ~[RenderManager.class:?] ... 20 more [22:12:32] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ---- // I'm sorry, Dave. Time: 3/19/17 10:12 PM Description: Rendering entity in world java.lang.NullPointerException: Rendering entity in world at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1106) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1140) at net.minecraft.client.Minecraft.run(Minecraft.java:407) at net.minecraft.client.main.Main.main(Main.java:118) 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(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:75) at com.puresalvation.test.render.RenderShuriken.doRender(RenderShuriken.java:69) -- Entity being rendered -- Details: Entity Type: pstest:textures/items/shuriken.png (com.puresalvation.test.entity.EntityShuriken) Entity ID: 685 Entity Name: entity.shuriken.name Entity's Exact location: -69.42, 65.52, 109.60 Entity's Block location: World: (-70,65,109), Chunk: (at 10,4,13 in -5,6; contains blocks -80,0,96 to -65,255,111), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Entity's Momentum: 1.12, -0.08, 1.01 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null -- Renderer details -- Details: Assigned renderer: com.puresalvation.test.render.RenderShuriken@41588a96 Location: 0.00,1.52,0.00 - World: (0,1,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Rotation: 48.0595 Delta: 0.80043745 Stacktrace: at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:388) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:372) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:646) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1385) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1299) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player74'/426, l='MpServer', x=-69.42, y=64.00, z=109.60]] Chunk stats: MultiplayerChunkCache: 621, 621 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (-92,64,248), Chunk: (at 4,4,8 in -6,15; contains blocks -96,0,240 to -81,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 40433 game time, 6322 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 125 total; [EntitySkeleton['Skeleton'/256, l='MpServer', x=-5.57, y=28.00, z=62.31], EntityCreeper['Creeper'/257, l='MpServer', x=-6.61, y=27.00, z=60.71], EntityChicken['Chicken'/513, l='MpServer', x=-66.13, y=69.00, z=30.39], EntityZombie['Zombie'/258, l='MpServer', x=-8.20, y=38.00, z=58.48], EntityZombie['Zombie'/259, l='MpServer', x=-10.25, y=38.00, z=61.54], EntityZombie['Zombie'/515, l='MpServer', x=-90.22, y=14.00, z=44.53], EntityZombie['Zombie'/260, l='MpServer', x=-6.51, y=14.00, z=67.81], EntitySkeleton['Skeleton'/261, l='MpServer', x=-2.31, y=13.00, z=65.50], EntityChicken['Chicken'/517, l='MpServer', x=-92.13, y=71.00, z=45.55], EntityCreeper['Creeper'/262, l='MpServer', x=-15.53, y=28.00, z=76.83], EntitySkeleton['Skeleton'/263, l='MpServer', x=-13.05, y=24.00, z=65.49], EntityBat['Bat'/264, l='MpServer', x=-1.00, y=20.32, z=71.50], EntitySkeleton['Skeleton'/265, l='MpServer', x=-6.25, y=29.00, z=89.49], EntityZombie['Zombie'/266, l='MpServer', x=-8.50, y=29.00, z=89.50], EntityItem['item.item.egg'/267, l='MpServer', x=-10.13, y=66.00, z=114.28], EntityChicken['Chicken'/268, l='MpServer', x=-12.89, y=67.00, z=119.65], EntityChicken['Chicken'/269, l='MpServer', x=-11.99, y=64.00, z=112.31], EntityChicken['Chicken'/270, l='MpServer', x=-11.43, y=71.00, z=122.40], EntityCreeper['Creeper'/526, l='MpServer', x=-65.50, y=24.00, z=40.82], EntitySpider['Spider'/271, l='MpServer', x=-10.99, y=38.00, z=138.12], EntityChicken['Chicken'/527, l='MpServer', x=-70.81, y=66.92, z=46.51], EntityCreeper['Creeper'/272, l='MpServer', x=-5.21, y=34.00, z=131.50], EntityChicken['Chicken'/529, l='MpServer', x=-75.19, y=71.00, z=39.58], EntityChicken['Chicken'/531, l='MpServer', x=-88.59, y=72.00, z=30.83], EntityPlayerSP['Player74'/426, l='MpServer', x=-69.42, y=64.00, z=109.60], EntityBat['Bat'/287, l='MpServer', x=2.25, y=17.10, z=63.75], EntityCreeper['Creeper'/288, l='MpServer', x=0.16, y=31.00, z=63.53], EntityBat['Bat'/289, l='MpServer', x=7.23, y=16.92, z=64.11], EntityBat['Bat'/290, l='MpServer', x=-1.44, y=18.04, z=65.50], EntityCow['Cow'/294, l='MpServer', x=6.16, y=78.00, z=109.47], EntityCow['Cow'/295, l='MpServer', x=6.20, y=71.00, z=137.50], EntityItem['item.item.egg'/94, l='MpServer', x=-134.19, y=77.00, z=110.68], EntityCreeper['Creeper'/102, l='MpServer', x=-113.29, y=28.00, z=66.23], EntitySkeleton['Skeleton'/103, l='MpServer', x=-112.27, y=34.00, z=92.50], EntitySquid['Squid'/104, l='MpServer', x=-122.32, y=61.10, z=82.09], EntitySquid['Squid'/105, l='MpServer', x=-123.36, y=61.78, z=85.68], EntitySquid['Squid'/106, l='MpServer', x=-115.40, y=62.05, z=88.49], EntitySquid['Squid'/107, l='MpServer', x=-122.07, y=61.56, z=85.64], EntityZombie['Zombie'/108, l='MpServer', x=-122.50, y=37.00, z=102.78], EntitySpider['Spider'/109, l='MpServer', x=-118.53, y=37.00, z=97.06], EntityChicken['Chicken'/110, l='MpServer', x=-124.52, y=77.00, z=109.22], EntityItem['item.item.egg'/111, l='MpServer', x=-120.65, y=74.00, z=105.17], EntityChicken['Chicken'/112, l='MpServer', x=-127.23, y=79.00, z=113.49], EntityChicken['Chicken'/114, l='MpServer', x=-116.15, y=80.00, z=119.50], EntityChicken['Chicken'/129, l='MpServer', x=-104.82, y=68.00, z=50.42], EntitySkeleton['Skeleton'/130, l='MpServer', x=-106.21, y=13.00, z=74.51], EntityZombie['Zombie'/131, l='MpServer', x=-108.40, y=25.00, z=68.77], EntitySkeleton['Skeleton'/132, l='MpServer', x=-103.53, y=34.00, z=90.73], EntityChicken['Chicken'/133, l='MpServer', x=-119.17, y=80.00, z=125.42], EntityItem['item.item.egg'/134, l='MpServer', x=-111.66, y=78.00, z=118.61], EntityWitch['Witch'/135, l='MpServer', x=-106.85, y=22.00, z=139.45], EntityCreeper['Creeper'/136, l='MpServer', x=-96.84, y=24.00, z=140.49], EntitySquid['Squid'/137, l='MpServer', x=-111.45, y=61.03, z=140.27], EntityCreeper['Creeper'/138, l='MpServer', x=-100.41, y=48.00, z=148.78], EntitySquid['Squid'/139, l='MpServer', x=-107.33, y=58.39, z=142.40], EntitySkeleton['Skeleton'/152, l='MpServer', x=-92.48, y=29.00, z=76.34], EntityZombie['Zombie'/153, l='MpServer', x=-91.27, y=20.00, z=82.45], EntityCreeper['Creeper'/154, l='MpServer', x=-92.81, y=41.00, z=81.47], EntityBat['Bat'/155, l='MpServer', x=-87.75, y=12.10, z=134.75], EntityBat['Bat'/162, l='MpServer', x=-75.82, y=38.10, z=73.75], EntityBat['Bat'/163, l='MpServer', x=-73.00, y=42.10, z=91.68], EntityBat['Bat'/164, l='MpServer', x=-76.76, y=39.12, z=88.25], EntityBat['Bat'/165, l='MpServer', x=-66.49, y=41.46, z=88.42], EntityBat['Bat'/166, l='MpServer', x=-65.25, y=34.10, z=102.75], EntityItem['item.item.seeds'/167, l='MpServer', x=-73.88, y=64.00, z=102.88], EntityItem['item.item.seeds'/168, l='MpServer', x=-72.11, y=64.00, z=99.89], EntityItem['item.item.seeds'/169, l='MpServer', x=-75.88, y=65.00, z=110.82], EntitySkeleton['Skeleton'/170, l='MpServer', x=-70.21, y=19.00, z=137.50], EntityZombie['Zombie'/171, l='MpServer', x=-65.01, y=18.00, z=131.30], EntityItem['item.item.egg'/683, l='MpServer', x=-13.73, y=66.00, z=119.88], EntityShuriken['entity.shuriken.name'/685, l='MpServer', x=-69.42, y=65.52, z=109.60], EntityCow['Cow'/179, l='MpServer', x=-49.49, y=63.00, z=58.17], EntityZombie['Zombie'/180, l='MpServer', x=-56.20, y=26.00, z=66.51], EntitySkeleton['Skeleton'/181, l='MpServer', x=-54.11, y=27.00, z=91.50], EntityZombie['Zombie'/182, l='MpServer', x=-53.50, y=32.00, z=101.79], EntityZombie['Zombie'/183, l='MpServer', x=-53.79, y=39.00, z=93.50], EntityItem['item.tile.flower1.dandelion'/184, l='MpServer', x=-50.14, y=62.00, z=92.61], EntityItem['item.tile.mushroom'/185, l='MpServer', x=-54.18, y=63.00, z=94.67], EntityZombie['Zombie'/186, l='MpServer', x=-57.49, y=40.00, z=101.81], EntityZombie['Zombie'/187, l='MpServer', x=-54.62, y=35.00, z=98.99], EntityZombie['Zombie'/188, l='MpServer', x=-54.66, y=35.00, z=99.82], EntityZombie['Zombie'/189, l='MpServer', x=-57.19, y=40.00, z=96.50], EntityZombie['Zombie'/190, l='MpServer', x=-63.29, y=34.00, z=104.81], EntityItem['item.tile.mushroom'/191, l='MpServer', x=-54.55, y=63.00, z=97.06], EntityZombie['Zombie'/192, l='MpServer', x=-57.44, y=32.00, z=115.78], EntitySkeleton['Skeleton'/193, l='MpServer', x=-69.87, y=29.00, z=111.56], EntitySkeleton['Skeleton'/194, l='MpServer', x=-58.51, y=31.00, z=129.31], EntityChicken['Chicken'/450, l='MpServer', x=-101.40, y=71.00, z=44.88], EntitySkeleton['Skeleton'/195, l='MpServer', x=-63.82, y=14.00, z=150.47], EntityZombieVillager['Zombie Villager'/451, l='MpServer', x=-127.52, y=40.00, z=35.77], EntityBat['Bat'/196, l='MpServer', x=-48.25, y=19.10, z=148.45], EntityChicken['Chicken'/455, l='MpServer', x=-103.43, y=73.00, z=30.80], EntityCow['Cow'/212, l='MpServer', x=-37.55, y=63.00, z=69.20], EntityBat['Bat'/213, l='MpServer', x=-20.41, y=15.42, z=85.35], EntityZombie['Zombie'/214, l='MpServer', x=-39.58, y=16.00, z=95.81], EntitySkeleton['Skeleton'/215, l='MpServer', x=-44.30, y=19.00, z=139.70], EntitySkeleton['Skeleton'/216, l='MpServer', x=-45.00, y=19.00, z=138.59], EntityBat['Bat'/217, l='MpServer', x=-47.25, y=19.10, z=144.24], EntitySpider['Spider'/218, l='MpServer', x=-47.30, y=21.00, z=150.79], EntitySkeleton['Skeleton'/219, l='MpServer', x=-37.75, y=19.00, z=144.50], EntityBat['Bat'/220, l='MpServer', x=-40.77, y=39.10, z=147.62], EntitySpider['Spider'/221, l='MpServer', x=-47.28, y=18.00, z=160.70], EntityBat['Bat'/227, l='MpServer', x=-24.02, y=24.68, z=60.48], EntityCow['Cow'/228, l='MpServer', x=-28.48, y=64.00, z=59.18], EntitySkeleton['Skeleton'/229, l='MpServer', x=-26.42, y=41.00, z=108.93], EntitySkeleton['Skeleton'/230, l='MpServer', x=-26.87, y=41.00, z=108.30], EntityCreeper['Creeper'/231, l='MpServer', x=-23.43, y=50.00, z=100.80], EntityZombie['Zombie'/232, l='MpServer', x=-29.77, y=22.00, z=125.16], EntityItem['item.item.egg'/233, l='MpServer', x=-16.01, y=63.00, z=124.88], EntityChicken['Chicken'/234, l='MpServer', x=-21.39, y=63.00, z=115.10], EntityCreeper['Creeper'/490, l='MpServer', x=-11.80, y=26.00, z=34.49], EntityItem['item.item.egg'/235, l='MpServer', x=-19.40, y=64.00, z=116.39], EntityZombieVillager['Zombie Villager'/491, l='MpServer', x=-8.25, y=25.00, z=46.44], EntityBat['Bat'/236, l='MpServer', x=-22.17, y=23.48, z=132.97], EntityCreeper['Creeper'/492, l='MpServer', x=-5.05, y=26.00, z=39.50], EntityCreeper['Creeper'/237, l='MpServer', x=-30.82, y=21.00, z=146.51], EntityCreeper['Creeper'/493, l='MpServer', x=-13.52, y=26.00, z=46.98], EntitySkeleton['Skeleton'/238, l='MpServer', x=-21.50, y=38.00, z=150.47], EntityCreeper['Creeper'/239, l='MpServer', x=-18.22, y=38.00, z=147.47], EntityCow['Cow'/495, l='MpServer', x=-28.53, y=66.00, z=42.85], EntityChicken['Chicken'/240, l='MpServer', x=-21.06, y=78.00, z=171.50], EntityCow['Cow'/496, l='MpServer', x=-27.79, y=66.00, z=39.50], EntityChicken['Chicken'/241, l='MpServer', x=-21.16, y=83.00, z=180.90], EntityCow['Cow'/501, l='MpServer', x=-37.25, y=65.00, z=45.19], EntitySkeleton['Skeleton'/255, l='MpServer', x=-8.49, y=27.00, z=58.71]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2774) at net.minecraft.client.Minecraft.run(Minecraft.java:428) at net.minecraft.client.main.Main.main(Main.java:118) 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(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.11.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_121, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 606828232 bytes (578 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 7, tcache: 6, allocated: 12, tallocated: 94 FML: MCP 9.38 Powered by Forge 13.20.0.2228 6 mods loaded, 6 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA minecraft{1.11.2} [Minecraft] (minecraft.jar) UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) UCHIJAAAA forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) UCHIJAAAA examplemod{1.0} [examplemod] (bin) UCHIJAAAA pstest{1.0} [Test Mod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 376.54' Renderer: 'GeForce GTX 980M/PCIe/SSE2' Launched Version: 1.11.2 LWJGL: 2.9.4 OpenGL: GeForce GTX 980M/PCIe/SSE2 GL version 4.5.0 NVIDIA 376.54, NVIDIA Corporation 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: Yes 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) CPU: 8x Intel(R) Core(TM) i7-6820HK CPU @ 2.70GHz [22:12:32] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\ktsui\Desktop\Minecraft Modding\run\.\crash-reports\crash-2017-03-19_22.12.32-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release Edited March 20, 20178 yr by Sack Of Potatoes
March 20, 20178 yr Where do you call RenderShuriken.registerRender()? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 20, 20178 yr Author Where do you call RenderShuriken.registerRender()? I called that in clientproxy.java in "preinit()" which I've just added to the original post I'll also include it here ClientProxy.java package com.puresalvation.test.proxy; import com.puresalvation.test.entity.EntityShuriken; import com.puresalvation.test.init.ModItems; import com.puresalvation.test.render.RenderShuriken; public class ClientProxy implements CommonProxy { @Override public void preInit() { // Called on Client Side RenderShuriken.registerRender(); } @Override public void init() { // Called on the client side ModItems.registerRenders(); } } Edited March 20, 20178 yr by Sack Of Potatoes
March 20, 20178 yr IRenderFactory#createRenderFor is called from the RenderManager constructor, before the RenderManager instance is stored in the Minecraft#renderManager field (used by Minecraft#getRenderManager). This means you're passing null as the RenderManager argument of your RenderShuriken constructor, so Render#bindTexture throws a NullPointerException when it tries to get the RenderManager#renderEngine field from it. You need to use the RenderManager instance passed as an argument to IRenderFactory#createRenderFor instead of trying to get it from Minecraft. This is also a general guideline you should follow: Use the data you've been given rather than trying to get the data yourself (unless you have a specific reason not to). Edited March 20, 20178 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 20, 20178 yr Author 9 minutes ago, Choonster said: IRenderFactory#createRenderFor is called from the RenderManager constructor, before the RenderManager instance is stored in the Minecraft#renderManager field (used by Minecraft#getRenderManager). This means you're passing null as the RenderManager argument of your RenderShuriken constructor, so Render#bindTexture throws a NullPointerException when it tries to get the RenderManager#renderEngine field from it. You need to use the RenderManager instance passed as an argument to IRenderFactory#createRenderFor instead of trying to get it from Minecraft. This is also a general guideline you should follow: Use the data you've been given rather than trying to get the data yourself (unless you have a specific reason not to). That seems to have done the trick! I no longer crash when throwing the shuriken. Thank you very much! Curious though, it may be because of the way I'm rendering the shuriken but I can't seem to see the shuriken being thrown. I can see the smoke animation when it hits a block but not the shuriken itself. I'm wondering if that's because of the way I'm initializing "new ResourceLocation(...)". Can you verify that this is the proper way of constructing a resource location? private static final ResourceLocation shurikenTexture = new ResourceLocation(Reference.MOD_ID, "textures/items/shuriken.png"); I can post the code for Reference.java if need be
March 20, 20178 yr 18 minutes ago, Sack Of Potatoes said: That seems to have done the trick! I no longer crash when throwing the shuriken. Thank you very much! Curious though, it may be because of the way I'm rendering the shuriken but I can't seem to see the shuriken being thrown. I can see the smoke animation when it hits a block but not the shuriken itself. I'm wondering if that's because of the way I'm initializing "new ResourceLocation(...)". Can you verify that this is the proper way of constructing a resource location? private static final ResourceLocation shurikenTexture = new ResourceLocation(Reference.MOD_ID, "textures/items/shuriken.png"); I can post the code for Reference.java if need be That's the correct way to create a ResourceLocation, assuming your shuriken texture is located at assets/<modid>/textures/items/shuriken.png. It's not directly related to your issue, but I noticed that you're extending the raw Render type instead of specifying its generic type argument. If you specify the type argument as EntityShuriken, you can delete the getEntityTexture(Entity) and doRender(Entity, ...) methods, since the getEntityTexture(EntityShuriken) and doRender(EntityShuriken, ...) methods will override the corresponding super methods. If you want your entity to render as an item model (like snowballs, ender pearls, eggs, etc.), you can use or extend RenderSnowball. Edited March 20, 20178 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 22, 20178 yr Author On 3/19/2017 at 11:21 PM, Choonster said: That's the correct way to create a ResourceLocation, assuming your shuriken texture is located at assets/<modid>/textures/items/shuriken.png. It's not directly related to your issue, but I noticed that you're extending the raw Render type instead of specifying its generic type argument. If you specify the type argument as EntityShuriken, you can delete the getEntityTexture(Entity) and doRender(Entity, ...) methods, since the getEntityTexture(EntityShuriken) and doRender(EntityShuriken, ...) methods will override the corresponding super methods. If you want your entity to render as an item model (like snowballs, ender pearls, eggs, etc.), you can use or extend RenderSnowball. For the sake of simplicity, let's say I want my entity to render as an item model like snowballs. What would the code supposedly look like? (Sorry I'm pretty unfamiliar with extending generic classes) EDIT: Courtesy of Draco18s I now understand how the generic should be implemented. I will post my interpretation of the what the code would look like for those who might be wondering or who aren't sure how to implement it. FOR THE RECORD: If RenderShuriken were to extend RenderSnowball with the proper generic implementation. public class RenderShuriken extends RenderSnowball<EntityShuriken> { // Location of the texture private static final ResourceLocation shurikenTexture = new ResourceLocation(Reference.MOD_ID, "textures/items/shuriken.png"); // [CONSTRUCTORS] public RenderShuriken(RenderManager renderManager) { // The constructor for the snowball includes two extra paramaters super(renderManager, ModItems.shuriken, Minecraft.getMinecraft().getRenderItem()); } // [METHODS] public static void registerRender() { RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new IRenderFactory() { @Override public Render createRenderFor(RenderManager manager) { return new RenderShuriken(manager); } }); } /* * Return the texture of the shuriken */ @Override protected ResourceLocation getEntityTexture(EntityShuriken shuriken) { return this.shurikenTexture; } /* * Render the shuriken */ @Override public void doRender(EntityShuriken shuriken, double x, double y, double z, float entityYaw, float partialTicks) { //EntityShuriken shuriken = (EntityShuriken)entity; this.bindEntityTexture(shuriken); super.doRender(shuriken, x, y, z, entityYaw, partialTicks); } } Edited March 22, 20178 yr by Sack Of Potatoes
March 22, 20178 yr Your class should be declared like this: public class RenderShuriken extends RenderSnowball<EntityShuriken> { ... } This will fix all of your errors. Remember, this is like ArrayLists: The ArrayList class is defined as public class ArrayList<T> { ... } and you instantiate it by telling it what T is. Same is true for the renderer. So alternatively, you could just instantiate the renderer by saying new RenderSnowball(...); and not having a custom class at all (see: the vanilla usage). Edited March 22, 20178 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 22, 20178 yr Author 16 minutes ago, Draco18s said: Your class should be declared like this: public class RenderShuriken extends RenderSnowball<EntityShuriken> { ... } Remember, this is like ArrayLists: The ArrayList class is defined as public class ArrayList<T> { ... } and you instantiate it by telling it what T is. Same is true for the renderer. So alternatively, you could just instantiate the renderer by saying new RenderSnowball(...); and not having a custom class at all. Ah ok that makes sense! And conceptually I see what you're saying about not needing a custom class at all. However, in practice, I'm not sure where that instantiation would take place (in EntityShuriken.java? ItemShuriken.java?). I can't seem to find where the RenderShuriken class is explicitly called. Also if there's no custom class, how would the renderer know to draw the custom shuriken texture instead of a snowball? Thank you very much for the help and information btw. Apologies for all the questions, I'm really trying to understand the framework. Edited March 22, 20178 yr by Sack Of Potatoes
March 22, 20178 yr Where do you instantiate it? Move your entity rendering registration to literally anywhere (that's client-sided). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 22, 20178 yr Author 21 minutes ago, Draco18s said: Where do you instantiate it? Move your entity rendering registration to literally anywhere (that's client-sided). Ah now I see! For those following this thread, if I were to do this I would move the following code into "preinit()" inside my clientproxy.java class (since this is being called on the client side) RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new IRenderFactory() { @Override public Render createRenderFor(RenderManager manager) { // NOTE: there are 2 new parameters needed // 1. ModItems.shuriken is the instance of the shuriken item // 2. Since you need a RenderItem for the RenderSnowball constructor, I'm using the one from the Minecraft instance return new RenderSnowball(manager, ModItems.shuriken, Minecraft.getMinecraft().getRenderItem()); } }); Edited March 22, 20178 yr by Sack Of Potatoes
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.