Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12.2] Server Packet Crash


Recommended Posts

Hello,

I've been working on a weapon with extended reach, and have mostly gotten it to work. However, once I send the info to the server, the game crashes.

Quote

---- Minecraft Crash Report ----
// Daisy, daisy...

Time: 10/6/19 11:42 AM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at crimson_twilight.simplerpgtools.common.util.EventHandler.onEvent(EventHandler.java:58)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_28_EventHandler_onEvent_MouseEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:273)
    at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2402)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1927)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1188)
    at net.minecraft.client.Minecraft.run(Minecraft.java:442)
    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:25)


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

-- Head --
Thread: Client thread
Stacktrace:
    at crimson_twilight.simplerpgtools.common.util.EventHandler.onEvent(EventHandler.java:58)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_28_EventHandler_onEvent_MouseEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:273)
    at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2402)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityPlayerSP['Player510'/389, l='MpServer', x=-271.56, y=76.76, z=211.07]]
    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: (-244,64,248), Chunk: (at 12,4,8 in -16,15; contains blocks -256,0,240 to -241,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Level time: 28243 game time, 574 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: 83 total; [EntityZombie['Zombie'/128, l='MpServer', x=-278.50, y=25.00, z=134.29], EntityZombie['Zombie'/769, l='MpServer', x=-233.50, y=16.00, z=221.50], EntityPig['Pig'/130, l='MpServer', x=-279.28, y=70.00, z=153.52], EntityZombie['Zombie'/770, l='MpServer', x=-233.50, y=16.00, z=220.50], EntityItem['item.item.porkchopRaw'/131, l='MpServer', x=-273.52, y=70.00, z=189.29], EntityPig['Pig'/132, l='MpServer', x=-281.70, y=71.00, z=202.47], EntityPig['Pig'/133, l='MpServer', x=-275.29, y=71.00, z=231.23], EntityZombie['Zombie'/773, l='MpServer', x=-325.50, y=42.00, z=217.50], EntityPig['Pig'/134, l='MpServer', x=-279.69, y=72.00, z=228.38], EntityPig['Pig'/135, l='MpServer', x=-282.72, y=72.00, z=227.20], EntityCow['Cow'/136, l='MpServer', x=-279.46, y=74.00, z=278.78], EntityCow['Cow'/137, l='MpServer', x=-275.28, y=74.00, z=289.83], EntitySkeleton['Skeleton'/266, l='MpServer', x=-189.79, y=28.00, z=181.40], EntityZombie['Zombie'/270, l='MpServer', x=-191.48, y=37.00, z=190.79], EntityZombie['Zombie'/654, l='MpServer', x=-215.50, y=22.00, z=215.50], EntityItem['item.item.porkchopRaw'/149, l='MpServer', x=-264.64, y=69.00, z=186.30], EntityItem['item.item.porkchopRaw'/150, l='MpServer', x=-270.48, y=70.00, z=193.86], EntityItem['item.item.porkchopRaw'/151, l='MpServer', x=-261.99, y=67.00, z=204.74], EntityBat['Bat'/154, l='MpServer', x=-257.85, y=25.29, z=209.32], EntityCow['Cow'/155, l='MpServer', x=-265.56, y=69.00, z=280.21], EntityPlayerSP['Player510'/389, l='MpServer', x=-271.56, y=76.76, z=211.07], EntityBat['Bat'/802, l='MpServer', x=-249.50, y=22.00, z=242.50], EntityBat['Bat'/164, l='MpServer', x=-244.45, y=20.10, z=140.25], EntityZombie['Zombie'/165, l='MpServer', x=-247.19, y=38.00, z=165.49], EntityBat['Bat'/166, l='MpServer', x=-245.40, y=40.90, z=163.60], EntitySkeleton['Skeleton'/167, l='MpServer', x=-252.23, y=15.00, z=208.48], EntitySkeleton['Skeleton'/168, l='MpServer', x=-253.56, y=23.00, z=215.15], EntitySkeleton['Skeleton'/169, l='MpServer', x=-253.50, y=28.00, z=251.50], EntitySkeleton['Skeleton'/170, l='MpServer', x=-254.29, y=23.00, z=243.36], EntityCreeper['Creeper'/171, l='MpServer', x=-249.50, y=23.00, z=240.50], EntitySkeleton['Skeleton'/172, l='MpServer', x=-240.49, y=19.00, z=287.23], EntitySkeleton['Skeleton'/692, l='MpServer', x=-235.50, y=37.00, z=151.50], EntityBat['Bat'/187, l='MpServer', x=-235.25, y=25.10, z=134.04], EntitySkeleton['Skeleton'/188, l='MpServer', x=-236.23, y=20.00, z=136.48], EntitySkeleton['Skeleton'/189, l='MpServer', x=-239.78, y=27.00, z=143.49], EntityCreeper['Creeper'/190, l='MpServer', x=-231.50, y=23.00, z=131.63], EntityBat['Bat'/191, l='MpServer', x=-235.25, y=23.10, z=158.57], EntityZombie['Zombie'/192, l='MpServer', x=-235.76, y=31.00, z=152.48], EntitySkeleton['Skeleton'/193, l='MpServer', x=-224.77, y=33.00, z=153.52], EntityEnderman['Enderman'/194, l='MpServer', x=-231.69, y=23.00, z=170.50], EntitySkeleton['Skeleton'/195, l='MpServer', x=-226.29, y=34.00, z=163.50], EntityCreeper['Creeper'/196, l='MpServer', x=-236.78, y=37.00, z=164.40], EntityItem['item.item.porkchopRaw'/197, l='MpServer', x=-227.85, y=68.00, z=171.98], EntityCreeper['Creeper'/198, l='MpServer', x=-237.03, y=36.00, z=190.50], EntityZombie['Zombie'/199, l='MpServer', x=-239.56, y=27.00, z=219.75], EntityBat['Bat'/200, l='MpServer', x=-235.36, y=21.40, z=224.77], EntitySkeleton['Skeleton'/201, l='MpServer', x=-225.51, y=21.00, z=280.73], EntityBat['Bat'/202, l='MpServer', x=-220.30, y=22.63, z=282.30], EntityPig['Pig'/81, l='MpServer', x=-336.36, y=69.00, z=133.75], EntityBat['Bat'/83, l='MpServer', x=-345.48, y=45.10, z=205.22], EntityPig['Pig'/88, l='MpServer', x=-322.67, y=69.00, z=133.75], EntityZombie['Zombie'/216, l='MpServer', x=-220.30, y=11.03, z=139.30], EntityPig['Pig'/89, l='MpServer', x=-321.82, y=71.00, z=266.21], EntityCreeper['Creeper'/217, l='MpServer', x=-211.39, y=18.00, z=136.21], EntityPig['Pig'/90, l='MpServer', x=-323.75, y=71.00, z=263.35], EntityCreeper['Creeper'/218, l='MpServer', x=-208.50, y=15.00, z=220.50], EntityPig['Pig'/91, l='MpServer', x=-326.67, y=70.00, z=278.49], EntityPig['Pig'/221, l='MpServer', x=-208.49, y=71.00, z=288.28], EntityPig['Pig'/100, l='MpServer', x=-307.75, y=72.00, z=136.51], EntitySkeleton['Skeleton'/101, l='MpServer', x=-316.50, y=13.00, z=215.30], EntityPig['Pig'/102, l='MpServer', x=-317.52, y=70.00, z=230.98], EntityCreeper['Creeper'/234, l='MpServer', x=-198.30, y=15.00, z=135.27], EntitySkeleton['Skeleton'/235, l='MpServer', x=-197.48, y=15.00, z=146.52], EntityBat['Bat'/236, l='MpServer', x=-195.25, y=19.10, z=141.52], EntityZombie['Zombie'/237, l='MpServer', x=-208.61, y=18.00, z=138.22], EntityPig['Pig'/239, l='MpServer', x=-204.69, y=70.00, z=141.59], EntityZombie['Zombie'/240, l='MpServer', x=-204.48, y=21.00, z=148.18], EntityPig['Pig'/241, l='MpServer', x=-201.26, y=68.00, z=149.49], EntitySkeleton['Skeleton'/242, l='MpServer', x=-192.43, y=28.00, z=175.24], EntityCreeper['Creeper'/114, l='MpServer', x=-303.88, y=32.25, z=132.50], EntitySkeleton['Skeleton'/243, l='MpServer', x=-196.27, y=29.00, z=177.51], EntityPig['Pig'/115, l='MpServer', x=-291.62, y=72.00, z=131.72], EntityPig['Pig'/116, l='MpServer', x=-295.74, y=70.00, z=202.35], EntityPig['Pig'/244, l='MpServer', x=-209.26, y=68.00, z=243.60], EntityPig['Pig'/117, l='MpServer', x=-293.31, y=72.00, z=224.78], EntityPig['Pig'/245, l='MpServer', x=-191.03, y=71.00, z=259.52], EntityPig['Pig'/118, l='MpServer', x=-301.42, y=72.00, z=246.48], EntityPig['Pig'/246, l='MpServer', x=-195.51, y=70.00, z=264.03], EntityPig['Pig'/247, l='MpServer', x=-213.22, y=67.00, z=263.40], EntitySheep['Sheep'/119, l='MpServer', x=-308.26, y=71.00, z=285.49], EntityPig['Pig'/120, l='MpServer', x=-300.75, y=72.00, z=277.50], EntityPig['Pig'/248, l='MpServer', x=-195.60, y=73.00, z=275.74], EntityPig['Pig'/249, l='MpServer', x=-201.78, y=71.00, z=272.65]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2889)
    at net.minecraft.client.Minecraft.run(Minecraft.java:471)
    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:25)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_201, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 616081552 bytes (587 MB) / 922222592 bytes (879 MB) up to 3817865216 bytes (3641 MB)
    JVM Flags: 1 total; -Xmx4096m
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    FML: MCP 9.42 Powered by Forge 14.23.5.2847 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

    | State  | ID             | Version      | Source                           | Signature |
    |:------ |:-------------- |:------------ |:-------------------------------- |:--------- |
    | LCHIJA | minecraft      | 1.12.2       | minecraft.jar                    | None      |
    | LCHIJA | mcp            | 9.42         | minecraft.jar                    | None      |
    | LCHIJA | FML            | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCHIJA | forge          | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCHIJA | simplerpgtools | 0.1.0        | bin                              | None      |
    | LCHIJA | jei            | 4.15.0.289   | jei_1.12.2-4.15.0.289.jar        | None      |

    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 389.04' Renderer: 'GeForce GTX 1050 Ti/PCIe/SSE2'
    Launched Version: 1.12.2
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 389.04, 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) i5-8300H CPU @ 2.30GHz

---- Minecraft Crash Report ----
// Daisy, daisy...

Time: 10/6/19 11:42 AM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at crimson_twilight.simplerpgtools.common.util.EventHandler.onEvent(EventHandler.java:58)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_28_EventHandler_onEvent_MouseEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:273)
    at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2402)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1927)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1188)
    at net.minecraft.client.Minecraft.run(Minecraft.java:442)
    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:25)


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

-- Head --
Thread: Client thread
Stacktrace:
    at crimson_twilight.simplerpgtools.common.util.EventHandler.onEvent(EventHandler.java:58)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_28_EventHandler_onEvent_MouseEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:273)
    at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2402)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityPlayerSP['Player510'/389, l='MpServer', x=-271.56, y=76.76, z=211.07]]
    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: (-244,64,248), Chunk: (at 12,4,8 in -16,15; contains blocks -256,0,240 to -241,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Level time: 28243 game time, 574 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: 83 total; [EntityZombie['Zombie'/128, l='MpServer', x=-278.50, y=25.00, z=134.29], EntityZombie['Zombie'/769, l='MpServer', x=-233.50, y=16.00, z=221.50], EntityPig['Pig'/130, l='MpServer', x=-279.28, y=70.00, z=153.52], EntityZombie['Zombie'/770, l='MpServer', x=-233.50, y=16.00, z=220.50], EntityItem['item.item.porkchopRaw'/131, l='MpServer', x=-273.52, y=70.00, z=189.29], EntityPig['Pig'/132, l='MpServer', x=-281.70, y=71.00, z=202.47], EntityPig['Pig'/133, l='MpServer', x=-275.29, y=71.00, z=231.23], EntityZombie['Zombie'/773, l='MpServer', x=-325.50, y=42.00, z=217.50], EntityPig['Pig'/134, l='MpServer', x=-279.69, y=72.00, z=228.38], EntityPig['Pig'/135, l='MpServer', x=-282.72, y=72.00, z=227.20], EntityCow['Cow'/136, l='MpServer', x=-279.46, y=74.00, z=278.78], EntityCow['Cow'/137, l='MpServer', x=-275.28, y=74.00, z=289.83], EntitySkeleton['Skeleton'/266, l='MpServer', x=-189.79, y=28.00, z=181.40], EntityZombie['Zombie'/270, l='MpServer', x=-191.48, y=37.00, z=190.79], EntityZombie['Zombie'/654, l='MpServer', x=-215.50, y=22.00, z=215.50], EntityItem['item.item.porkchopRaw'/149, l='MpServer', x=-264.64, y=69.00, z=186.30], EntityItem['item.item.porkchopRaw'/150, l='MpServer', x=-270.48, y=70.00, z=193.86], EntityItem['item.item.porkchopRaw'/151, l='MpServer', x=-261.99, y=67.00, z=204.74], EntityBat['Bat'/154, l='MpServer', x=-257.85, y=25.29, z=209.32], EntityCow['Cow'/155, l='MpServer', x=-265.56, y=69.00, z=280.21], EntityPlayerSP['Player510'/389, l='MpServer', x=-271.56, y=76.76, z=211.07], EntityBat['Bat'/802, l='MpServer', x=-249.50, y=22.00, z=242.50], EntityBat['Bat'/164, l='MpServer', x=-244.45, y=20.10, z=140.25], EntityZombie['Zombie'/165, l='MpServer', x=-247.19, y=38.00, z=165.49], EntityBat['Bat'/166, l='MpServer', x=-245.40, y=40.90, z=163.60], EntitySkeleton['Skeleton'/167, l='MpServer', x=-252.23, y=15.00, z=208.48], EntitySkeleton['Skeleton'/168, l='MpServer', x=-253.56, y=23.00, z=215.15], EntitySkeleton['Skeleton'/169, l='MpServer', x=-253.50, y=28.00, z=251.50], EntitySkeleton['Skeleton'/170, l='MpServer', x=-254.29, y=23.00, z=243.36], EntityCreeper['Creeper'/171, l='MpServer', x=-249.50, y=23.00, z=240.50], EntitySkeleton['Skeleton'/172, l='MpServer', x=-240.49, y=19.00, z=287.23], EntitySkeleton['Skeleton'/692, l='MpServer', x=-235.50, y=37.00, z=151.50], EntityBat['Bat'/187, l='MpServer', x=-235.25, y=25.10, z=134.04], EntitySkeleton['Skeleton'/188, l='MpServer', x=-236.23, y=20.00, z=136.48], EntitySkeleton['Skeleton'/189, l='MpServer', x=-239.78, y=27.00, z=143.49], EntityCreeper['Creeper'/190, l='MpServer', x=-231.50, y=23.00, z=131.63], EntityBat['Bat'/191, l='MpServer', x=-235.25, y=23.10, z=158.57], EntityZombie['Zombie'/192, l='MpServer', x=-235.76, y=31.00, z=152.48], EntitySkeleton['Skeleton'/193, l='MpServer', x=-224.77, y=33.00, z=153.52], EntityEnderman['Enderman'/194, l='MpServer', x=-231.69, y=23.00, z=170.50], EntitySkeleton['Skeleton'/195, l='MpServer', x=-226.29, y=34.00, z=163.50], EntityCreeper['Creeper'/196, l='MpServer', x=-236.78, y=37.00, z=164.40], EntityItem['item.item.porkchopRaw'/197, l='MpServer', x=-227.85, y=68.00, z=171.98], EntityCreeper['Creeper'/198, l='MpServer', x=-237.03, y=36.00, z=190.50], EntityZombie['Zombie'/199, l='MpServer', x=-239.56, y=27.00, z=219.75], EntityBat['Bat'/200, l='MpServer', x=-235.36, y=21.40, z=224.77], EntitySkeleton['Skeleton'/201, l='MpServer', x=-225.51, y=21.00, z=280.73], EntityBat['Bat'/202, l='MpServer', x=-220.30, y=22.63, z=282.30], EntityPig['Pig'/81, l='MpServer', x=-336.36, y=69.00, z=133.75], EntityBat['Bat'/83, l='MpServer', x=-345.48, y=45.10, z=205.22], EntityPig['Pig'/88, l='MpServer', x=-322.67, y=69.00, z=133.75], EntityZombie['Zombie'/216, l='MpServer', x=-220.30, y=11.03, z=139.30], EntityPig['Pig'/89, l='MpServer', x=-321.82, y=71.00, z=266.21], EntityCreeper['Creeper'/217, l='MpServer', x=-211.39, y=18.00, z=136.21], EntityPig['Pig'/90, l='MpServer', x=-323.75, y=71.00, z=263.35], EntityCreeper['Creeper'/218, l='MpServer', x=-208.50, y=15.00, z=220.50], EntityPig['Pig'/91, l='MpServer', x=-326.67, y=70.00, z=278.49], EntityPig['Pig'/221, l='MpServer', x=-208.49, y=71.00, z=288.28], EntityPig['Pig'/100, l='MpServer', x=-307.75, y=72.00, z=136.51], EntitySkeleton['Skeleton'/101, l='MpServer', x=-316.50, y=13.00, z=215.30], EntityPig['Pig'/102, l='MpServer', x=-317.52, y=70.00, z=230.98], EntityCreeper['Creeper'/234, l='MpServer', x=-198.30, y=15.00, z=135.27], EntitySkeleton['Skeleton'/235, l='MpServer', x=-197.48, y=15.00, z=146.52], EntityBat['Bat'/236, l='MpServer', x=-195.25, y=19.10, z=141.52], EntityZombie['Zombie'/237, l='MpServer', x=-208.61, y=18.00, z=138.22], EntityPig['Pig'/239, l='MpServer', x=-204.69, y=70.00, z=141.59], EntityZombie['Zombie'/240, l='MpServer', x=-204.48, y=21.00, z=148.18], EntityPig['Pig'/241, l='MpServer', x=-201.26, y=68.00, z=149.49], EntitySkeleton['Skeleton'/242, l='MpServer', x=-192.43, y=28.00, z=175.24], EntityCreeper['Creeper'/114, l='MpServer', x=-303.88, y=32.25, z=132.50], EntitySkeleton['Skeleton'/243, l='MpServer', x=-196.27, y=29.00, z=177.51], EntityPig['Pig'/115, l='MpServer', x=-291.62, y=72.00, z=131.72], EntityPig['Pig'/116, l='MpServer', x=-295.74, y=70.00, z=202.35], EntityPig['Pig'/244, l='MpServer', x=-209.26, y=68.00, z=243.60], EntityPig['Pig'/117, l='MpServer', x=-293.31, y=72.00, z=224.78], EntityPig['Pig'/245, l='MpServer', x=-191.03, y=71.00, z=259.52], EntityPig['Pig'/118, l='MpServer', x=-301.42, y=72.00, z=246.48], EntityPig['Pig'/246, l='MpServer', x=-195.51, y=70.00, z=264.03], EntityPig['Pig'/247, l='MpServer', x=-213.22, y=67.00, z=263.40], EntitySheep['Sheep'/119, l='MpServer', x=-308.26, y=71.00, z=285.49], EntityPig['Pig'/120, l='MpServer', x=-300.75, y=72.00, z=277.50], EntityPig['Pig'/248, l='MpServer', x=-195.60, y=73.00, z=275.74], EntityPig['Pig'/249, l='MpServer', x=-201.78, y=71.00, z=272.65]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2889)
    at net.minecraft.client.Minecraft.run(Minecraft.java:471)
    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:25)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_201, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 616081552 bytes (587 MB) / 922222592 bytes (879 MB) up to 3817865216 bytes (3641 MB)
    JVM Flags: 1 total; -Xmx4096m
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    FML: MCP 9.42 Powered by Forge 14.23.5.2847 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

    | State  | ID             | Version      | Source                           | Signature |
    |:------ |:-------------- |:------------ |:-------------------------------- |:--------- |
    | LCHIJA | minecraft      | 1.12.2       | minecraft.jar                    | None      |
    | LCHIJA | mcp            | 9.42         | minecraft.jar                    | None      |
    | LCHIJA | FML            | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCHIJA | forge          | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
    | LCHIJA | simplerpgtools | 0.1.0        | bin                              | None      |
    | LCHIJA | jei            | 4.15.0.289   | jei_1.12.2-4.15.0.289.jar        | None      |

    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 389.04' Renderer: 'GeForce GTX 1050 Ti/PCIe/SSE2'
    Launched Version: 1.12.2
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 389.04, 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) i5-8300H CPU @ 2.30GHz

 

I've checked that the information I'm trying to send isn't null, which it isn't. And it runs through the constructor before crashing, but that's about it.

Here's the message class:

package crimson_twilight.simplerpgtools.common.util;

import crimson_twilight.simplerpgtools.SimpleRpgTools;
import crimson_twilight.simplerpgtools.common.util.interfaces.IExtendedReach;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class MessageExtendedReachAttack implements IMessage 
{
    private int entityId ;

    public MessageExtendedReachAttack(int parEntityId) 
    {
    	entityId = parEntityId;
        // DEBUG
        System.out.println("Constructor "+entityId);
    }

    @Override
    public void fromBytes(ByteBuf buf) 
    {
    	// DEBUG
    	System.out.println("fromBytes");
    	entityId = ByteBufUtils.readVarInt(buf, 4);
    }

    @Override
    public void toBytes(ByteBuf buf) 
    {
        // DEBUG
        System.out.println("toBytes encoded");
    	ByteBufUtils.writeVarInt(buf, entityId, 4);
    }

    public static class Handler implements IMessageHandler<MessageExtendedReachAttack, IMessage> 
    {
        @Override
        public IMessage onMessage(final MessageExtendedReachAttack message, MessageContext ctx) 
        {
            // DEBUG
            System.out.println("Message received");
            final EntityPlayerMP player = (EntityPlayerMP) SimpleRpgTools.proxy.getPlayerEntityFromContext(ctx);
            player.getServer().addScheduledTask(
                  new Runnable()
                  {
                      @Override
                      public void run() 
                      {
                          Entity entity = player.world.
                                getEntityByID(message.entityId);
                          // DEBUG
                          System.out.println("Entity = "+entity);
                          
                          // Need to ensure that hackers can't cause trick kills, 
                          // so double check weapon type and reach
                          if (player.getHeldItemMainhand() == null)
                          {
                              return;
                          }
                          if (player.getActiveItemStack().getItem() instanceof IExtendedReach)
                          {
                              IExtendedReach theExtendedReachWeapon = (IExtendedReach)player.getHeldItemMainhand().getItem();
                              double distanceSq = player.getDistanceSq(entity);
                              double reachSq = theExtendedReachWeapon.getReach() * theExtendedReachWeapon.getReach();
                              if (reachSq >= distanceSq)
                              {
                                  player.attackTargetEntityWithCurrentItem(entity);
                              }
                          }
                          return; // no response in this case
                      }
                }
            );
            return null; // no response message
        }
    }
}

 

Edited by Pingun114
Quote trubbles
Link to post
Share on other sites
30 minutes ago, Pingun114 said:

crimson_twilight.simplerpgtools.common.util.EventHandler.onEvent(EventHandler.java:58)

Post this code.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to post
Share on other sites
@Mod.EventBusSubscriber(modid = SimpleRpgTools.MODID)
public class EventHandler 
{
	@SideOnly(Side.CLIENT)
	@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
	public void onEvent(MouseEvent event)
	{
		if(event.getButton() == 0 & event.isButtonstate())
		{
			Minecraft mc = Minecraft.getMinecraft();
			EntityPlayer player = mc.player;
			if(player != null)
			{
				ItemStack stack = player.getHeldItemMainhand();
				IExtendedReach ieri;
				if(stack  != null)
				{
					if(stack.getItem() instanceof IExtendedReach)
					{
						ieri = (IExtendedReach)stack.getItem();
					} else
					{
						ieri = null;
					}
					
					if(ieri != null)
					{
						float reach = ieri.getReach();
						RayTraceResult res = getMouseOverExtended(reach);
						
						if(res != null)
						{
							if(res.entityHit != null && (res.entityHit.hurtResistantTime == 0 || ieri.unblockable()))
							{
								if(res.entityHit != player)
								{
									SimpleRpgTools.network.sendToServer(new MessageExtendedReachAttack(res.entityHit.getEntityId()));
								}
							}
						}
					}
				}
			}
		}
	}
	
	// This is mostly copied from the EntityRenderer#getMouseOver() method
	public static RayTraceResult getMouseOverExtended(float dist)
	{
	    Minecraft mc = FMLClientHandler.instance().getClient();
	    Entity theRenderViewEntity = mc.getRenderViewEntity();
	    AxisAlignedBB theViewBoundingBox = new AxisAlignedBB(
	            theRenderViewEntity.posX-0.5D,
	            theRenderViewEntity.posY-0.0D,
	            theRenderViewEntity.posZ-0.5D,
	            theRenderViewEntity.posX+0.5D,
	            theRenderViewEntity.posY+1.5D,
	            theRenderViewEntity.posZ+0.5D
	            );
	    RayTraceResult returnMOP = null;
	    if (mc.world != null)
	    {
	        double var2 = dist;
	        returnMOP = theRenderViewEntity.rayTrace(var2, 0);
	        double calcdist = var2;
	        Vec3d pos = theRenderViewEntity.getPositionEyes(0);
	        var2 = calcdist;
	        if (returnMOP != null)
	        {
	            calcdist = returnMOP.hitVec.distanceTo(pos);
	        }
	         
	        Vec3d lookvec = theRenderViewEntity.getLook(0);
	        Vec3d var8 = pos.addVector(lookvec.x * var2, 
	              lookvec.y * var2, 
	              lookvec.z * var2);
	        Entity pointedEntity = null;
	        float var9 = 1.0F;
	        @SuppressWarnings("unchecked")
	        List<Entity> list = mc.world.getEntitiesWithinAABBExcludingEntity(
	              theRenderViewEntity, theViewBoundingBox.grow(
	                    lookvec.x * var2, 
	                    lookvec.y * var2, 
	                    lookvec.z * var2).expand(var9, var9, var9));
	        double d = calcdist;

	        for (Entity entity : list)
	        {
	            if (entity.canBeCollidedWith())
	            {
	                float bordersize = entity.getCollisionBorderSize();
	                AxisAlignedBB aabb = new AxisAlignedBB(
	                      entity.posX-entity.width/2, 
	                      entity.posY, 
	                      entity.posZ-entity.width/2, 
	                      entity.posX+entity.width/2, 
	                      entity.posY+entity.height, 
	                      entity.posZ+entity.width/2);
	                aabb.expand(bordersize, bordersize, bordersize);
	                RayTraceResult mop0 = aabb.calculateIntercept(pos, var8);
	                    
	                if (aabb.contains(pos))
	                {
	                    if (0.0D < d || d == 0.0D)
	                    {
	                        pointedEntity = entity;
	                        d = 0.0D;
				            System.out.println(entity);
	                    }
	                } else if (mop0 != null)
	                {
	                    double d1 = pos.distanceTo(mop0.hitVec);
	                        
	                    if (d1 < d || d == 0.0D)
	                    {
	                        pointedEntity = entity;
	                        d = d1;
	                    }
	                }
	            }
	        }
	           
	        if (pointedEntity != null && (d < calcdist || returnMOP == null))
	        {
	             returnMOP = new RayTraceResult(pointedEntity);
	        }
	    }
	    return returnMOP;
	}
}

 

Link to post
Share on other sites

Hmm, I've gotten it to stop crashing, though I've run into a different problem.

FMLIndexedMessageCodec exception caught
io.netty.handler.codec.EncoderException: java.lang.RuntimeException: Undefined discriminator for message type crimson_twilight.simplerpgtools.common.util.MessageExtendedReachAttack in channel simplerpgtools

 

Does it have to do with: 

public void init()
	{
		int packetId = 0;
		SimpleRpgTools.network.registerMessage(MessageExtendedReachAttack.Handler.class, MessageExtendedReachAttack.class, packetId++, Side.SERVER);
	}

 

Edited by Pingun114
Link to post
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.

Guest
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 Privacy Policy.