Jump to content

[1.8] [SOLVED] Creating entities renderer requires RenderManager. Where?


Elix_x

Recommended Posts

As of 1.8, Entity renderer requires RenderManager instance in Render constructor:

Render.class (top class of render) (YourEntityRenderer extends RenderLiving extends RendererLivingEntity extends Render)

protected Render(RenderManager renderManager)
    {
        this.renderManager = renderManager;
    }

If i give it this:

Minecraft.getMinecraft().getRenderManager()

Game crashes:

[15:42:03] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:86) ~[Render.class:?]
at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:79) ~[Render.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderModel(RendererLivingEntity.java:252) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:168) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:50) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:172) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:370) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:327) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:294) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:631) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1294) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1207) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1032) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1048) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]
at GradleStart.main(GradleStart.java:45) [start/:?]
[15:42:04] [server thread/INFO]: Stopping server
[15:42:04] [server thread/INFO]: Saving players
[15:42:04] [server thread/INFO]: Saving worlds
[15:42:04] [server thread/INFO]: Saving chunks for level 'HHorses'/Overworld
[15:42:04] [server thread/INFO]: Saving chunks for level 'HHorses'/Nether
[15:42:04] [server thread/INFO]: Saving chunks for level 'HHorses'/The End
[15:42:05] [server thread/INFO] [FML]: Unloading dimension 0
[15:42:05] [server thread/INFO] [FML]: Unloading dimension -1
[15:42:05] [server thread/INFO] [FML]: Unloading dimension 1
[15:42:05] [server thread/INFO] [FML]: Applying holder lookups
[15:42:05] [server thread/INFO] [FML]: Holder lookups applied
[15:42:06] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering entity in world
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:418) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:327) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:294) ~[RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:631) ~[RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1294) ~[EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1207) ~[EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1032) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1048) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]
at GradleStart.main(GradleStart.java:45) [start/:?]
Caused by: java.lang.NullPointerException
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:563) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:28) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:157) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.passSpecialRender(RendererLivingEntity.java:481) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:578) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:46) ~[Render.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:198) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:50) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:172) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:370) ~[RenderManager.class:?]
... 17 more
[15:42:06] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 26.02.15 15:42
Description: Rendering entity in world

java.lang.NullPointerException: Rendering entity in world
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:563)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:28)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:157)
at net.minecraft.client.renderer.entity.RendererLivingEntity.passSpecialRender(RendererLivingEntity.java:481)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:578)
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:46)
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:198)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:50)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:172)
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:370)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:327)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:294)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:631)
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1294)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1207)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1032)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1048)
at net.minecraft.client.Minecraft.run(Minecraft.java:345)
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 net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85)
at GradleStart.main(GradleStart.java:45)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:563)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:28)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:157)
at net.minecraft.client.renderer.entity.RendererLivingEntity.passSpecialRender(RendererLivingEntity.java:481)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:578)
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:46)
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:198)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:50)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:172)

-- Entity being rendered --
Details:
Entity Type: New Horse (code.elix_x.mods.btam.core.horses.NewEntityHorse)
Entity ID: 313
Entity Name: Donkey
Entity's Exact location: 184,50, 67,00, 185,50
Entity's Block location: 184,00,67,00,185,00 - World: (184,67,185), Chunk: (at 8,4,9 in 11,11; contains blocks 176,0,176 to 191,255,191), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Entity's Momentum: 0,00, 0,00, 0,00
Entity's Rider: ~~ERROR~~ NullPointerException: null
Entity's Vehicle: ~~ERROR~~ NullPointerException: null

-- Renderer details --
Details:
Assigned renderer: code.elix_x.mods.btam.core.horses.NewEntityHorseRenderer@30dc14e4
Location: 0,22,0,00,1,40 - World: (0,0,1), Chunk: (at 0,0,1 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: 133.70247
Delta: 0.798969
Stacktrace:
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:370)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:327)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:294)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:631)
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1294)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1207)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player751'/227, l='MpServer', x=184,28, y=67,00, z=184,10]]
Chunk stats: MultiplayerChunkCache: 561, 561
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: 192,00,64,00,184,00 - World: (192,64,184), Chunk: (at 0,4,8 in 12,11; contains blocks 192,0,176 to 207,255,191), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 1538 game time, 1538 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: 82 total; [EntityRabbit['Rabbit'/128, l='MpServer', x=181,30, y=89,23, z=114,28], EntitySkeleton['Skeleton'/129, l='MpServer', x=184,47, y=63,00, z=143,09], EntityCreeper['Creeper'/130, l='MpServer', x=189,94, y=53,00, z=130,50], EntityRabbit['Rabbit'/131, l='MpServer', x=180,50, y=75,00, z=134,47], EntitySkeleton['Skeleton'/132, l='MpServer', x=181,69, y=54,00, z=166,44], EntityCreeper['Creeper'/133, l='MpServer', x=185,69, y=54,00, z=167,56], EntityZombie['Zombie'/134, l='MpServer', x=181,50, y=19,00, z=178,50], EntityBat['Bat'/136, l='MpServer', x=185,07, y=22,03, z=261,58], EntityZombie['Zombie'/150, l='MpServer', x=194,74, y=54,00, z=130,23], EntityBat['Bat'/151, l='MpServer', x=211,60, y=32,22, z=155,47], EntityCreeper['Creeper'/152, l='MpServer', x=206,53, y=41,00, z=152,94], EntityZombie['Zombie'/153, l='MpServer', x=193,50, y=50,00, z=149,50], EntityZombie['Zombie'/154, l='MpServer', x=198,00, y=45,00, z=179,56], EntityBat['Bat'/155, l='MpServer', x=206,42, y=33,75, z=186,48], EntityBat['Bat'/156, l='MpServer', x=206,73, y=38,08, z=223,41], EntityBat['Bat'/157, l='MpServer', x=207,75, y=28,10, z=229,50], EntityBat['Bat'/158, l='MpServer', x=208,26, y=31,27, z=265,00], EntityCreeper['Creeper'/159, l='MpServer', x=204,56, y=28,00, z=264,47], EntityBat['Bat'/168, l='MpServer', x=210,25, y=31,10, z=216,66], EntityBat['Bat'/169, l='MpServer', x=213,41, y=35,96, z=214,38], EntityCreeper['Creeper'/170, l='MpServer', x=219,97, y=67,00, z=217,38], EntityCreeper['Creeper'/171, l='MpServer', x=209,47, y=31,00, z=264,31], EntityRabbit['Rabbit'/175, l='MpServer', x=239,53, y=85,00, z=135,78], EntityBat['Bat'/176, l='MpServer', x=230,75, y=26,06, z=184,25], EntityZombie['Zombie'/177, l='MpServer', x=236,64, y=61,00, z=194,51], EntitySkeleton['Skeleton'/178, l='MpServer', x=230,28, y=62,00, z=204,41], EntityRabbit['Rabbit'/180, l='MpServer', x=238,62, y=85,29, z=135,22], EntityRabbit['Rabbit'/181, l='MpServer', x=244,56, y=81,00, z=131,84], EntitySkeleton['Skeleton'/182, l='MpServer', x=244,28, y=15,16, z=191,28], EntitySkeleton['Skeleton'/183, l='MpServer', x=248,44, y=16,00, z=185,91], EntitySkeleton['Skeleton'/184, l='MpServer', x=245,00, y=14,00, z=192,38], EntityCow['Cow'/56, l='MpServer', x=106,78, y=72,00, z=206,25], EntitySkeleton['Skeleton'/185, l='MpServer', x=246,81, y=52,00, z=205,50], NewEntityHorse['Donkey'/313, l='MpServer', x=184,50, y=67,00, z=185,50], EntityCow['Cow'/59, l='MpServer', x=109,22, y=72,00, z=211,25], EntityRabbit['Rabbit'/188, l='MpServer', x=264,34, y=70,00, z=129,34], EntitySkeleton['Skeleton'/189, l='MpServer', x=261,13, y=27,00, z=180,66], EntityZombie['Zombie'/61, l='MpServer', x=111,59, y=15,00, z=236,47], EntityCreeper['Creeper'/191, l='MpServer', x=260,50, y=21,00, z=202,50], EntitySpider['Spider'/192, l='MpServer', x=258,88, y=21,00, z=201,97], EntitySkeleton['Skeleton'/193, l='MpServer', x=259,81, y=52,00, z=201,50], EntityRabbit['Rabbit'/69, l='MpServer', x=122,59, y=64,02, z=145,44], EntityRabbit['Rabbit'/70, l='MpServer', x=125,78, y=65,00, z=137,94], EntityRabbit['Rabbit'/71, l='MpServer', x=125,41, y=63,00, z=149,81], EntityZombie['Zombie'/72, l='MpServer', x=121,69, y=23,00, z=205,34], EntitySkeleton['Skeleton'/73, l='MpServer', x=116,91, y=18,00, z=196,41], EntityBat['Bat'/74, l='MpServer', x=128,39, y=11,39, z=219,64], EntityCreeper['Creeper'/75, l='MpServer', x=124,50, y=23,00, z=214,50], EntitySkeleton['Skeleton'/76, l='MpServer', x=116,91, y=23,00, z=209,44], EntitySpider['Spider'/77, l='MpServer', x=120,28, y=23,00, z=213,31], EntityZombie['Zombie'/78, l='MpServer', x=127,63, y=22,00, z=211,53], EntityCreeper['Creeper'/79, l='MpServer', x=120,91, y=23,00, z=215,22], EntityRabbit['Rabbit'/85, l='MpServer', x=134,39, y=67,08, z=111,50], EntityRabbit['Rabbit'/86, l='MpServer', x=134,28, y=66,02, z=111,50], EntityRabbit['Rabbit'/87, l='MpServer', x=142,69, y=65,00, z=124,50], EntityRabbit['Rabbit'/88, l='MpServer', x=139,06, y=65,00, z=118,03], EntityCow['Cow'/89, l='MpServer', x=144,28, y=66,00, z=133,69], EntityRabbit['Rabbit'/90, l='MpServer', x=128,28, y=64,00, z=139,94], EntityCow['Cow'/91, l='MpServer', x=141,59, y=66,00, z=131,00], EntityRabbit['Rabbit'/92, l='MpServer', x=134,50, y=63,00, z=155,50], EntityRabbit['Rabbit'/93, l='MpServer', x=143,53, y=65,00, z=144,16], EntityCow['Cow'/94, l='MpServer', x=130,28, y=64,00, z=145,08], EntitySkeleton['Skeleton'/95, l='MpServer', x=135,31, y=23,00, z=207,13], EntitySkeleton['Skeleton'/96, l='MpServer', x=132,50, y=23,00, z=206,50], EntitySkeleton['Skeleton'/97, l='MpServer', x=132,69, y=11,03, z=222,69], EntityRabbit['Rabbit'/98, l='MpServer', x=139,36, y=65,19, z=120,04], EntitySkeleton['Skeleton'/99, l='MpServer', x=158,50, y=46,00, z=135,50], EntityCow['Cow'/100, l='MpServer', x=147,53, y=67,16, z=135,41], EntityZombie['Zombie'/101, l='MpServer', x=147,50, y=37,00, z=235,97], EntitySkeleton['Skeleton'/102, l='MpServer', x=146,91, y=37,00, z=246,44], EntityPlayerSP['Player751'/227, l='MpServer', x=184,28, y=67,00, z=184,10], EntitySkeleton['Skeleton'/103, l='MpServer', x=148,50, y=37,00, z=246,50], EntityZombie['Zombie'/104, l='MpServer', x=147,41, y=38,00, z=241,36], EntityZombie['Zombie'/105, l='MpServer', x=172,50, y=53,00, z=112,50], EntitySkeleton['Skeleton'/106, l='MpServer', x=173,47, y=49,00, z=170,69], EntityCreeper['Creeper'/107, l='MpServer', x=170,28, y=36,00, z=230,75], EntityZombie['Zombie'/108, l='MpServer', x=161,88, y=33,00, z=226,92], EntityZombie['Zombie'/109, l='MpServer', x=162,55, y=33,28, z=232,37], EntityCreeper['Creeper'/110, l='MpServer', x=167,34, y=35,00, z=238,03], EntityZombie['Zombie'/111, l='MpServer', x=165,22, y=24,00, z=248,28], EntityZombie['Zombie'/113, l='MpServer', x=171,41, y=32,00, z=263,03], EntityRabbit['Rabbit'/127, l='MpServer', x=181,50, y=90,00, z=119,88]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:351)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2488)
at net.minecraft.client.Minecraft.run(Minecraft.java:367)
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 net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85)
at GradleStart.main(GradleStart.java:45)

-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 561897216 bytes (535 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 5, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.10 FML v8.0.37.1329 Minecraft Forge 11.14.1.1329 6 mods loaded, 6 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{8.0.37.1329} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1329.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{11.14.1.1329} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1329.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
avoidExplodingCreepers{1.0} [Avoid Exploding Creepers] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BTAM{2.0} [block Tools Armor Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
toolscompressor{1.0} [Tools compresser] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Loaded coremods (and transformers): 
Launched Version: 1.8
LWJGL: 2.9.1
OpenGL: AMD Radeon HD 8570D GL version 4.4.13084 Compatibility Profile Context 14.301.1001.0, 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)
[15:42:06] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: #@!@# Game crashed! Crash report saved to: #@!@# C:\my\mcmodding\mods\1.8\eclipse\.\crash-reports\crash-2015-02-26_15.42.06-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

Meanwhile in bindtexture:

public void bindTexture(ResourceLocation location)
    {
        this.renderManager.renderEngine.bindTexture(location);
    }

This render manager is used.

For further info: ResourceLocation (texture), that i give it, isn't null (tested via console output)

Link to comment
Share on other sites

  • 1 month later...

i dont get it.

 

what is this RenderManager where i get it, its something from i must create and objet

 

Minecraft.getMinecraft().getRenderManager() arr = new Minecraft.getMinecraft().getRenderManager(flechaMercenaria.class);

 

RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria.class, new renderFlechaMercenaria(arr));

 

dont seems to work       

Link to comment
Share on other sites

 

i guest this is not whath you are talking about

 

coz 

RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria.class, new renderFlechaMercenaria(Minecraft.getMinecraft().getRenderManager()));

//not work

 

or this

 

RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria.class, new Minecraft.getMinecraft().getRenderManager() );

//either

 

the other think i do was change the contructor in the renderFlechaMercenaria() to look like this

 

 

    public renderFlechaMercenaria()

    {

    super(Minecraft.getMinecraft().getRenderManager() );

   

        //super(p_i46193_1_);

    }

 

nop still not geting it but thanks

 

 

Link to comment
Share on other sites

 

well

 

if i do any of this two ways "registerEntityRenderingHandler"  marks red and say

 

"The method registerEntityRenderingHandler(Class<? extends Entity>, Render) in the type RenderingRegistry is not applicable for the arguments (Class<flechaMercenaria>, renderFlechaMercenaria)"

 

it i forced it

[18:13:45] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[18:13:45] [Client thread/ERROR] [FML]: Caught exception from modmercenario
java.lang.Error: Unresolved compilation problem: 
The method registerEntityRenderingHandler(Class<? extends Entity>, Render) in the type RenderingRegistry is not applicable for the arguments (Class<flechaMercenaria>, renderFlechaMercenaria)

 

 

soo may i have the wrong class import ?

the code im using its just a copy paste from the vanilla arrow , but when wass doing the renderFlechaMercenaria.class this one mark and error and askmy for this import in the constructor

 

im using this

import net.minecraftforge.fml.client.registry.RenderingRegistry;

 

 

Link to comment
Share on other sites

hi  these is the code

 

the  renderFlechaMercenaria.class  is taken from net.minecraft.client.renderer.entity.RenderArrow

i just change the references to "EntityArrow" for "flechaMercenaria_entity"

the RenderArrow.class dont seem to need the import "import net.minecraft.client.renderer.entity.RenderManager;"

and it has the same constructor

 

 

 

 

flechaMercenaria_entity.java

package mercenarymod.items.arcos;

import java.util.List;

import mercenarymod.items.MercenaryModItems;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.play.server.S2BPacketChangeGameState;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class flechaMercenaria_entity extends Entity implements IProjectile
{
    private int xTile = -1;
    private int yTile = -1;
    private int zTile = -1;
    private Block inTile;
    private int inData;
    private boolean inGround;
    /** 1 if the player can pick up the arrow */
    public int canBePickedUp;
    /** Seems to be some sort of timer for animating an arrow. */
    public int arrowShake;
    /** The owner of this arrow. */
    public Entity shootingEntity;
    private int ticksInGround;
    private int ticksInAir;
    
    //Daño causado = (3.68*damage/0.24)   0.24 3.68
    private double damage = 1.50D; // 3.00D=14damage 2.0 vainilla arrow
    
    /** The amount of knockback an arrow applies when it hits a mob. */
    private int knockbackStrength=0;
    private static final String __OBFID = "CL_00001715";

    public flechaMercenaria_entity(World worldIn)
    {
        super(worldIn);
        this.renderDistanceWeight = 10.0D;
        this.setSize(0.5F, 0.5F);
    }

    public flechaMercenaria_entity(World worldIn, double x, double y, double z)
    {
        super(worldIn);
        this.renderDistanceWeight = 10.0D;
        this.setSize(0.5F, 0.5F);
        this.setPosition(x, y, z);
    }

    public flechaMercenaria_entity(World worldIn, EntityLivingBase shooter, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
    {
        super(worldIn);
        this.renderDistanceWeight = 10.0D;
        this.shootingEntity = shooter;

        if (shooter instanceof EntityPlayer)
        {
            this.canBePickedUp = 1;
        }

        this.posY = shooter.posY + (double)shooter.getEyeHeight() - 0.10000000149011612D;
        double d0 = p_i1755_3_.posX - shooter.posX;
        double d1 = p_i1755_3_.getEntityBoundingBox().minY + (double)(p_i1755_3_.height / 3.0F) - this.posY;
        double d2 = p_i1755_3_.posZ - shooter.posZ;
        double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2);

        if (d3 >= 1.0E-7D)
        {
            float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
            float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
            double d4 = d0 / d3;
            double d5 = d2 / d3;
            this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f2, f3);
            float f4 = (float)(d3 * 0.20000000298023224D);
            this.setThrowableHeading(d0, d1 + (double)f4, d2, p_i1755_4_, p_i1755_5_);
        }
    }

    public flechaMercenaria_entity(World worldIn, EntityLivingBase shooter, float p_i1756_3_)
    {
        super(worldIn);
        this.renderDistanceWeight = 10.0D;
        this.shootingEntity = shooter;

        if (shooter instanceof EntityPlayer)
        {
            this.canBePickedUp = 1;
        }

        this.setSize(0.5F, 0.5F);
        this.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch);
        this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
        this.posY -= 0.10000000149011612D;
        this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
        this.setPosition(this.posX, this.posY, this.posZ);
        this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
        this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
        this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
        this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
    }

    protected void entityInit()
    {
        this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
    }

    /**
     * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
     *  
     * @param inaccuracy Higher means more error.
     */
    public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy)
    {
        float f2 = MathHelper.sqrt_double(x * x + y * y + z * z);
        x /= (double)f2;
        y /= (double)f2;
        z /= (double)f2;
        x += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy;
        y += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy;
        z += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy;
        x *= (double)velocity;
        y *= (double)velocity;
        z *= (double)velocity;
        this.motionX = x;
        this.motionY = y;
        this.motionZ = z;
        float f3 = MathHelper.sqrt_double(x * x + z * z);
        this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);
        this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f3) * 180.0D / Math.PI);
        this.ticksInGround = 0;
    }

    @SideOnly(Side.CLIENT)
    public void func_180426_a(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_)
    {
        this.setPosition(p_180426_1_, p_180426_3_, p_180426_5_);
        this.setRotation(p_180426_7_, p_180426_8_);
    }

    /**
     * Sets the velocity to the args. Args: x, y, z
     */
    @SideOnly(Side.CLIENT)
    public void setVelocity(double x, double y, double z)
    {
        this.motionX = x;
        this.motionY = y;
        this.motionZ = z;

        if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
        {
            float f = MathHelper.sqrt_double(x * x + z * z);
            this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch;
            this.prevRotationYaw = this.rotationYaw;
            this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
            this.ticksInGround = 0;
        }
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        super.onUpdate();

        if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
        {
            float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
            this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
            this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
        }

        BlockPos blockpos = new BlockPos(this.xTile, this.yTile, this.zTile);
        IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
        Block block = iblockstate.getBlock();

        if (block.getMaterial() != Material.air)
        {
            block.setBlockBoundsBasedOnState(this.worldObj, blockpos);
            AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, blockpos, iblockstate);

            if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ)))
            {
                this.inGround = true;
            }
        }

        if (this.arrowShake > 0)
        {
            --this.arrowShake;
        }

        if (this.inGround)
        {
            int j = block.getMetaFromState(iblockstate);

            if (block == this.inTile && j == this.inData)
            {
                ++this.ticksInGround;

                if (this.ticksInGround >= 1200)
                {
                    this.setDead();
                }
            }
            else
            {
                this.inGround = false;
                this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
                this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
                this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
                this.ticksInGround = 0;
                this.ticksInAir = 0;
            }
        }
        else
        {
            ++this.ticksInAir;
            Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ);
            Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
            MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false);
            vec31 = new Vec3(this.posX, this.posY, this.posZ);
            vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

            if (movingobjectposition != null)
            {
                vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
            }

            Entity entity = null;
            List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
            double d0 = 0.0D;
            int i;
            float f1;

            for (i = 0; i < list.size(); ++i)
            {
                Entity entity1 = (Entity)list.get(i);

                if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
                {
                    f1 = 0.3F;
                    AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double)f1, (double)f1, (double)f1);
                    MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);

                    if (movingobjectposition1 != null)
                    {
                        double d1 = vec31.distanceTo(movingobjectposition1.hitVec);

                        if (d1 < d0 || d0 == 0.0D)
                        {
                            entity = entity1;
                            d0 = d1;
                        }
                    }
                }
            }

            if (entity != null)
            {
                movingobjectposition = new MovingObjectPosition(entity);
            }

            if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
            {
                EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;

                if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
                {
                    movingobjectposition = null;
                }
            }

            float f2;
            float f3;
            float f4;

            if (movingobjectposition != null)
            {
                if (movingobjectposition.entityHit != null)
                {
                    f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
                    int k = MathHelper.ceiling_double_int((double)f2 * this.damage);

                    if (this.getIsCritical())
                    {
                        k += this.rand.nextInt(k / 2 + 2);
                    }

                    DamageSource damagesource;

                    if (this.shootingEntity == null)
                    {
                        damagesource = DamageSource.causeThrownDamage(this, this);
                    }
                    else
                    {
                        damagesource = DamageSource.causeThrownDamage(this, this.shootingEntity);
                    }

                    if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
                    {
                        movingobjectposition.entityHit.setFire(5);
                    }

                    if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k))
                    {
                        if (movingobjectposition.entityHit instanceof EntityLivingBase)
                        {
                            EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;

                            if (!this.worldObj.isRemote)
                            {
                                entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);
                            }

                            if (this.knockbackStrength > 0)
                            {
                                f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);

                                if (f4 > 0.0F)
                                {
                                    movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4);
                                }
                            }

                            if (this.shootingEntity instanceof EntityLivingBase)
                            {
                                EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
                                EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
                            }

                            if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
                            {
                                ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
                            }
                        }

                        this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));

                        if (!(movingobjectposition.entityHit instanceof EntityEnderman))
                        {
                            this.setDead();
                        }
                    }
                    else
                    {
                        this.motionX *= -0.10000000149011612D;
                        this.motionY *= -0.10000000149011612D;
                        this.motionZ *= -0.10000000149011612D;
                        this.rotationYaw += 180.0F;
                        this.prevRotationYaw += 180.0F;
                        this.ticksInAir = 0;
                    }
                }
                else
                {
                    BlockPos blockpos1 = movingobjectposition.getBlockPos();
                    this.xTile = blockpos1.getX();
                    this.yTile = blockpos1.getY();
                    this.zTile = blockpos1.getZ();
                    iblockstate = this.worldObj.getBlockState(blockpos1);
                    this.inTile = iblockstate.getBlock();
                    this.inData = this.inTile.getMetaFromState(iblockstate);
                    this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
                    this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
                    this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
                    f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
                    this.posX -= this.motionX / (double)f3 * 0.05000000074505806D;
                    this.posY -= this.motionY / (double)f3 * 0.05000000074505806D;
                    this.posZ -= this.motionZ / (double)f3 * 0.05000000074505806D;
                    this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
                    this.inGround = true;
                    this.arrowShake = 7;
                    this.setIsCritical(false);

                    if (this.inTile.getMaterial() != Material.air)
                    {
                        this.inTile.onEntityCollidedWithBlock(this.worldObj, blockpos1, iblockstate, this);
                    }
                }
            }

            if (this.getIsCritical())
            {
                for (i = 0; i < 4; ++i)
                {
                    this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]);
                }
            }

            this.posX += this.motionX;
            this.posY += this.motionY;
            this.posZ += this.motionZ;
            f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
            this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);

            for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
            {
                ;
            }

            while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
            {
                this.prevRotationPitch += 360.0F;
            }

            while (this.rotationYaw - this.prevRotationYaw < -180.0F)
            {
                this.prevRotationYaw -= 360.0F;
            }

            while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
            {
                this.prevRotationYaw += 360.0F;
            }

            this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
            this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
            f3 = 0.99F;
            f1 = 0.05F;

            if (this.isInWater())
            {
                for (int l = 0; l < 4; ++l)
                {
                    f4 = 0.25F;
                    this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ, new int[0]);
                }

                f3 = 0.6F;
            }

            if (this.isWet())
            {
                this.extinguish();
            }

            this.motionX *= (double)f3;
            this.motionY *= (double)f3;
            this.motionZ *= (double)f3;
            this.motionY -= (double)f1;
            this.setPosition(this.posX, this.posY, this.posZ);
            this.doBlockCollisions();
        }
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound tagCompound)
    {
        tagCompound.setShort("xTile", (short)this.xTile);
        tagCompound.setShort("yTile", (short)this.yTile);
        tagCompound.setShort("zTile", (short)this.zTile);
        tagCompound.setShort("life", (short)this.ticksInGround);
        ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile);
        tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
        tagCompound.setByte("inData", (byte)this.inData);
        tagCompound.setByte("shake", (byte)this.arrowShake);
        tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
        tagCompound.setByte("pickup", (byte)this.canBePickedUp);
        tagCompound.setDouble("damage", this.damage);
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    public void readEntityFromNBT(NBTTagCompound tagCompund)
    {
        this.xTile = tagCompund.getShort("xTile");
        this.yTile = tagCompund.getShort("yTile");
        this.zTile = tagCompund.getShort("zTile");
        this.ticksInGround = tagCompund.getShort("life");

        if (tagCompund.hasKey("inTile", )
        {
            this.inTile = Block.getBlockFromName(tagCompund.getString("inTile"));
        }
        else
        {
            this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255);
        }

        this.inData = tagCompund.getByte("inData") & 255;
        this.arrowShake = tagCompund.getByte("shake") & 255;
        this.inGround = tagCompund.getByte("inGround") == 1;

        if (tagCompund.hasKey("damage", 99))
        {
            this.damage = tagCompund.getDouble("damage");
        }

        if (tagCompund.hasKey("pickup", 99))
        {
            this.canBePickedUp = tagCompund.getByte("pickup");
        }
        else if (tagCompund.hasKey("player", 99))
        {
            this.canBePickedUp = tagCompund.getBoolean("player") ? 1 : 0;
        }
    }

    /**
     * Called by a player entity when they collide with an entity
     */
    public void onCollideWithPlayer(EntityPlayer entityIn)
    {
        if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
        {
            boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && entityIn.capabilities.isCreativeMode;

            if (this.canBePickedUp == 1 && !entityIn.inventory.addItemStackToInventory(new ItemStack(MercenaryModItems.flechaMercenaria, 1)))
            {
                flag = false;
            }

            if (flag)
            {
                this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                entityIn.onItemPickup(this, 1);
                this.setDead();
            }
        }
    }

    /**
     * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
     * prevent them from trampling crops
     */
    protected boolean canTriggerWalking()
    {
        return false;
    }

    public void setDamage(double p_70239_1_)
    {
        this.damage = p_70239_1_;
    }

    public double getDamage()
    {
        return this.damage;
    }

    /**
     * Sets the amount of knockback the arrow applies when it hits a mob.
     */
    public void setKnockbackStrength(int p_70240_1_)
    {
        this.knockbackStrength = p_70240_1_;
    }

    /**
     * If returns false, the item will not inflict any damage against entities.
     */
    public boolean canAttackWithItem()
    {
        return false;
    }

    /**
     * Whether the arrow has a stream of critical hit particles flying behind it.
     */
    public void setIsCritical(boolean p_70243_1_)
    {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);

        if (p_70243_1_)
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
        }
        else
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
        }
    }

    /**
     * Whether the arrow has a stream of critical hit particles flying behind it.
     */
    public boolean getIsCritical()
    {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);
        return (b0 & 1) != 0;
    }
}

 

 

renderFlechaMercenaria.java

package mercenarymod.items.render;



import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.entity.Entity;
import mercenarymod.items.arcos.flechaMercenaria_entity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.lwjgl.opengl.GL11;



@SideOnly(Side.CLIENT)
public class renderFlechaMercenaria extends Render
{
    private static final ResourceLocation arrowTextures = new ResourceLocation("modmercenario:textures/entity/arrow.png");
    private static final String __OBFID = "CL_00000978";

    
    public renderFlechaMercenaria(RenderManager p_i46193_1_)
    //public renderFlechaMercenaria()
    {
    	//super(Minecraft.getMinecraft().getRenderManager() );
    	
        super(p_i46193_1_);
    }

    public void doRender(flechaMercenaria_entity p_180551_1_, double p_180551_2_, double p_180551_4_, double p_180551_6_, float p_180551_8_, float p_180551_9_)
    {
        this.bindEntityTexture(p_180551_1_);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)p_180551_2_, (float)p_180551_4_, (float)p_180551_6_);
        GlStateManager.rotate(p_180551_1_.prevRotationYaw + (p_180551_1_.rotationYaw - p_180551_1_.prevRotationYaw) * p_180551_9_ - 90.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(p_180551_1_.prevRotationPitch + (p_180551_1_.rotationPitch - p_180551_1_.prevRotationPitch) * p_180551_9_, 0.0F, 0.0F, 1.0F);
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        byte b0 = 0;
        float f2 = 0.0F;
        float f3 = 0.5F;
        float f4 = (float)(0 + b0 * 10) / 32.0F;
        float f5 = (float)(5 + b0 * 10) / 32.0F;
        float f6 = 0.0F;
        float f7 = 0.15625F;
        float f8 = (float)(5 + b0 * 10) / 32.0F;
        float f9 = (float)(10 + b0 * 10) / 32.0F;
        float f10 = 0.05625F;
        GlStateManager.enableRescaleNormal();
        float f11 = (float)p_180551_1_.arrowShake - p_180551_9_;

        if (f11 > 0.0F)
        {
            float f12 = -MathHelper.sin(f11 * 3.0F) * f11;
            GlStateManager.rotate(f12, 0.0F, 0.0F, 1.0F);
        }

        GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.scale(f10, f10, f10);
        GlStateManager.translate(-4.0F, 0.0F, 0.0F);
        GL11.glNormal3f(f10, 0.0F, 0.0F);
        worldrenderer.startDrawingQuads();
        worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
        worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
        worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
        worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
        tessellator.draw();
        GL11.glNormal3f(-f10, 0.0F, 0.0F);
        worldrenderer.startDrawingQuads();
        worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
        worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
        worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
        worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
        tessellator.draw();

        for (int i = 0; i < 4; ++i)
        {
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GL11.glNormal3f(0.0F, 0.0F, f10);
            worldrenderer.startDrawingQuads();
            worldrenderer.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
            worldrenderer.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
            worldrenderer.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
            worldrenderer.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
            tessellator.draw();
        }

        GlStateManager.disableRescaleNormal();
        GlStateManager.popMatrix();
        super.doRender(p_180551_1_, p_180551_2_, p_180551_4_, p_180551_6_, p_180551_8_, p_180551_9_);
    }

    protected ResourceLocation getEntityTexture(flechaMercenaria_entity p_180550_1_)
    {
        return arrowTextures;
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(Entity entity)
    {
        return this.getEntityTexture((flechaMercenaria_entity)entity);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doe
     */
    public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float partialTicks)
    {
        this.doRender((flechaMercenaria_entity)entity, x, y, z, p_76986_8_, partialTicks);
    }
}

 

 

 

 

 

 

clientProxy.java

package mercenarymod;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import mercenarymod.CommonProxy;
import mercenarymod.blocks.MercenaryModBlocks;
import mercenarymod.gui.NotificationMercenaria;
import mercenarymod.items.MercenaryModItems;
import mercenarymod.items.arcos.flechaMercenaria;
import mercenarymod.items.render.renderFlechaMercenaria;

public class ClientProxy extends CommonProxy {
       
        @Override
        public void registerRenderers() {
                // This is for rendering entities and so forth later on
        }
        
        //@Mod.EventHandler
        //public void preInit(FMLPreInitializationEvent event) {
        
        public void preInit(){
        	System.out.println("########\n\n\n ClientProxy preInit()");	
        //Configuration config = new Configuration(event.getSuggestedConfigurationFile());	
        //MercenaryModBlocks.init();
        //MercenaryModItems.init();
        //MercenaryModRecipes.init();
        
            //keyEvent
            FMLCommonHandler.instance().bus().register(new mercenarymod.eventos.KeyInputHandler());
            mercenarymod.eventos.KeyBindings.init();
            
            

        }
     
        //@Mod.EventHandler
        //public void init(FMLInitializationEvent event) {
  	     	
        @Override
        public void init() {
        	
        	System.out.println("########\n\n\n ClientProxy init()");
        	
        	mercenarymod.MercenaryModTexturas.init();
         
        	
        	    	    
        }
     
        //@Mod.EventHandler
        //public void postInit(FMLPostInitializationEvent event) {
        public void postInit() {	
        		
        	System.out.println("########\n\n\n ClientProxy postInit()");
        	MinecraftForge.EVENT_BUS.register(new NotificationMercenaria(Minecraft.getMinecraft(), null));
        	
        	RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria.class, new renderFlechaMercenaria(Minecraft.getMinecraft().getRenderManager()));
        	
        	
        }

       
}

Link to comment
Share on other sites

For one: Your class is:

flechaMercenaria_entity

You register something different:

RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria.class, ...)

 

Also, PLEASE: Follow naming conventions. Class names start with an uppercase letter.

 

Would be cool if you used english, but... whatever.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

 

arrfff

i must walk over the code like fifteen times whithout notice it

 

now its run but still not loading the textures, no error in the console

so i change the texture to use the vainilla arrow

 

private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png");

still not loading,

 

change the arrow side from 0.5 to 4.5 to atleast have a purple / black cube but no luck whith this

 

alredy test un preiniti init and postinit

 

also test register mi arrow whith the register from vainilla arrow

 

RenderingRegistry.registerEntityRenderingHandler(flechaMercenaria_entity.class, new RenderArrow(Minecraft.getMinecraft().getRenderManager()));

well no errors but no texture

 

and in any of the cases i get the black / purple block  they talk about in another posts

 

now i have this idea like

this need a json to work in 1.8 but not quite well quite sure coz there is not arrow.json apart from the one for arrow icon in the minecraft version folder

 

thanks  im now a little less stresed.

 

 

 

 

 

Link to comment
Share on other sites

You don't need .json - this is if you wanted to make some models maybe.

 

You need to learn OpenGL. This is strictly java, not forge stuff, so without proper preparation I wouldn't ask here for others to write code for you.

 

If you don't want to you can copy arrow and bind its textures to your own, OR just use arrow renderer.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.