Jump to content

[1.7.10][SOLVED] 2 impossible reported crashes?


Recommended Posts

Posted

Hello everybody.

Today, users of my mods reported me 2 crashes, both null pointers. Strange thing is, null pointers are thrown on lines, where nothing can be null.

First one:

Crash: http://paste.ee/p/ntuPb

Line concerened: https://github.com/elix-x/Colourful-Blocks/blob/master/src/main/java/code/elix_x/coremods/colourfulblocks/color/material/ColoringMaterialsManager.java#L546

As you can see, on that line, the only argument that can be null is

langDir

, but it is initalised just above!

Second one:

Crash:

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

Time: 10/31/15 8:38 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at code.elix_x.mods.keybindingsoverhaul.api.input.InputHandler.isPressed(InputHandler.java:31)
at code.elix_x.mods.keybindingsoverhaul.api.keys.AdvancedKeyBinding.updateState(AdvancedKeyBinding.java:66)
at code.elix_x.mods.keybindingsoverhaul.api.keys.KeyBindingsHandler.tickPre(KeyBindingsHandler.java:48)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi.tick(KBOApi.java:79)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi.access$100(KBOApi.java:17)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi$OnClientTickEvent.onTick(KBOApi.java:70)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_308_OnClientTickEvent_onTick_ClientTickEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
at cpw.mods.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:325)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1587)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


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

-- Head --
Stacktrace:
at code.elix_x.mods.keybindingsoverhaul.api.input.InputHandler.isPressed(InputHandler.java:31)
at code.elix_x.mods.keybindingsoverhaul.api.keys.AdvancedKeyBinding.updateState(AdvancedKeyBinding.java:66)
at code.elix_x.mods.keybindingsoverhaul.api.keys.KeyBindingsHandler.tickPre(KeyBindingsHandler.java:48)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi.tick(KBOApi.java:79)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi.access$100(KBOApi.java:17)
at code.elix_x.mods.keybindingsoverhaul.api.KBOApi$OnClientTickEvent.onTick(KBOApi.java:70)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_308_OnClientTickEvent_onTick_ClientTickEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
at cpw.mods.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:325)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Stormalisk'/382, l='MpServer', x=48.74, y=77.29, z=-300.85]]
Chunk stats: MultiplayerChunkCache: 49, 49
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (56,64,-222), Chunk: (at 8,4,2 in 3,-14; contains blocks 48,0,-224 to 63,255,-209), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Level time: 1732 game time, 1732 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: 63 total; [EntityPeafowl['Peafowl'/143, l='MpServer', x=13.88, y=69.00, z=-299.13], EntityPlagueZombie['Plague Zombie'/258, l='MpServer', x=104.50, y=57.00, z=-346.50], EntityGrue['Grue'/259, l='MpServer', x=106.38, y=15.09, z=-335.41], EntityZombieVillager['Villager Zombie'/256, l='MpServer', x=103.50, y=57.00, z=-346.50], Entity_SpecialZombie['Zombie'/257, l='MpServer', x=103.50, y=57.00, z=-346.50], EntityChupacabra['Chupacabra'/155, l='MpServer', x=26.50, y=45.00, z=-326.50], Entity_SpecialZombie['Zombie'/262, l='MpServer', x=105.69, y=30.00, z=-315.22], EntityItem['item.item.seeds'/1112, l='MpServer', x=47.59, y=67.69, z=-296.44], Entity_SpecialCreeper['Creeper'/263, l='MpServer', x=100.50, y=37.00, z=-314.50], EntityGrue['Grue'/260, l='MpServer', x=109.50, y=18.00, z=-324.50], EntityItem['item.item.seeds'/261, l='MpServer', x=101.66, y=70.13, z=-332.28], EntityPeafowl['Peafowl'/144, l='MpServer', x=12.50, y=70.00, z=-301.00], EntityKobold['Kobold'/264, l='MpServer', x=111.41, y=27.00, z=-285.56], EntityPeafowl['Peafowl'/265, l='MpServer', x=96.41, y=69.00, z=-246.50], EntityItem['item.tile.gravel'/171, l='MpServer', x=59.13, y=62.13, z=-316.88], Entity_SpecialSkeleton['Skeleton'/170, l='MpServer', x=58.50, y=11.00, z=-346.50], EntityCephignis['Cephignis'/175, l='MpServer', x=56.50, y=50.00, z=-264.50], EntityAfrit['Afrit'/174, l='MpServer', x=56.97, y=49.00, z=-267.03], EntityItem['item.item.seeds'/173, l='MpServer', x=51.16, y=67.13, z=-313.50], EntityItem['item.item.barley.seed'/172, l='MpServer', x=53.78, y=66.13, z=-313.53], EntitySquid['Squid'/163, l='MpServer', x=39.34, y=62.00, z=-247.94], EntityItem['item.item.seeds'/162, l='MpServer', x=40.94, y=61.13, z=-242.28], EntityItem['item.item.seeds'/161, l='MpServer', x=46.31, y=66.13, z=-292.47], EntitySquid['Squid'/165, l='MpServer', x=36.59, y=61.09, z=-252.88], EntitySquid['Squid'/164, l='MpServer', x=40.50, y=62.00, z=-248.50], EntityBat['Bat'/186, l='MpServer', x=58.25, y=25.69, z=-248.44], EntityBat['Bat'/187, l='MpServer', x=61.16, y=23.94, z=-247.78], EntityPeafowl['Peafowl'/184, l='MpServer', x=56.69, y=67.00, z=-271.63], EntityItem['item.item.barley.seed'/185, l='MpServer', x=54.34, y=67.13, z=-256.13], EntityEnderman['Enderman'/1145, l='MpServer', x=96.50, y=56.00, z=-344.50], EntityItem['item.tile.extrabiomes.waterplant.eelgrass'/188, l='MpServer', x=57.38, y=64.13, z=-252.25], EntityEnderman['Enderman'/1144, l='MpServer', x=94.50, y=56.00, z=-350.50], EntityItem['item.item.cotton.seed'/189, l='MpServer', x=57.19, y=66.13, z=-255.31], EntityCephignis['Cephignis'/178, l='MpServer', x=58.50, y=50.00, z=-263.50], EntityCephignis['Cephignis'/179, l='MpServer', x=59.63, y=49.03, z=-264.91], EntityCephignis['Cephignis'/176, l='MpServer', x=62.00, y=50.00, z=-258.50], EntityCephignis['Cephignis'/177, l='MpServer', x=56.50, y=50.00, z=-266.50], EntityAfrit['Afrit'/182, l='MpServer', x=59.50, y=49.00, z=-267.50], EntityPeafowl['Peafowl'/183, l='MpServer', x=50.50, y=67.00, z=-265.50], EntityCephignis['Cephignis'/180, l='MpServer', x=56.50, y=49.00, z=-265.50], EntityAfrit['Afrit'/181, l='MpServer', x=58.50, y=50.00, z=-267.50], Entity_SpecialEnderman['Enderman'/1153, l='MpServer', x=101.50, y=28.00, z=-324.50], EntityItem['item.item.cotton.seed'/205, l='MpServer', x=67.66, y=64.13, z=-246.47], EntityBat['Bat'/204, l='MpServer', x=72.63, y=27.13, z=-242.44], EntityItem['item.item.seeds'/203, l='MpServer', x=74.75, y=69.13, z=-328.38], EntityDoomCreeper['Doom Creeper'/220, l='MpServer', x=87.41, y=56.00, z=-345.94], EntityShade['Shade'/221, l='MpServer', x=85.50, y=57.00, z=-347.50], Entity_SpecialZombie['Zombie'/222, l='MpServer', x=87.31, y=25.00, z=-308.28], Entity_SpecialZombie['Zombie'/223, l='MpServer', x=85.66, y=24.00, z=-309.16], Entity_SpecialCreeper['Creeper'/219, l='MpServer', x=88.94, y=56.00, z=-344.69], EntityClientPlayerMP['Stormalisk'/382, l='MpServer', x=48.74, y=77.29, z=-300.85], EntityPeafowl['Peafowl'/228, l='MpServer', x=92.44, y=69.00, z=-249.53], EntityPeafowl['Peafowl'/227, l='MpServer', x=88.28, y=68.00, z=-259.31], EntityPeafowl['Peafowl'/226, l='MpServer', x=92.50, y=68.00, z=-267.50], EntityPeafowl['Peafowl'/225, l='MpServer', x=88.28, y=68.00, z=-274.25], Entity_SpecialZombie['Zombie'/224, l='MpServer', x=84.50, y=25.00, z=-301.50], Entity_SpecialCreeper['Creeper'/254, l='MpServer', x=102.97, y=16.00, z=-344.44], EntityBat['Bat'/255, l='MpServer', x=105.75, y=22.09, z=-346.75], EntityMystic['Mystic Enderman'/252, l='MpServer', x=105.56, y=16.00, z=-344.63], EntityMystic['Mystic Enderman'/253, l='MpServer', x=104.06, y=16.00, z=-346.41], EntityManaElemental['Mana Elemental'/250, l='MpServer', x=101.50, y=27.00, z=-347.50], Entity_SpecialZombie['Zombie'/251, l='MpServer', x=106.50, y=27.00, z=-344.50], EntityMystic['Mystic Enderman'/249, l='MpServer', x=104.59, y=15.00, z=-341.50]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373)
at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2444)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:927)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Linux (i386) version 3.19.0-31-generic
Java Version: 1.7.0_85, Oracle Corporation
Java VM Version: OpenJDK Server VM (mixed mode), Oracle Corporation
Memory: 422085928 bytes (402 MB) / 770727936 bytes (735 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 5 total; -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1448 84 mods loaded, 84 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1448-1.7.10.jar) 
UCHIJAAAA Forge{10.13.4.1448} [Minecraft Forge] (forge-1.7.10-10.13.4.1448-1.7.10.jar) 
UCHIJAAAA AM2-Preloader{0.0.2} [AMCore] (minecraft.jar) 
UCHIJAAAA CodeChickenCore{1.0.4.35} [CodeChicken Core] (minecraft.jar) 
UCHIJAAAA itemphysic{1.1.5} [itemPhysic] (minecraft.jar) 
UCHIJAAAA NotEnoughItems{1.0.4.83} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.4.83-universal.jar) 
UCHIJAAAA ImmibisMicroblocks{59.1.1} [immibis's Microblocks] (Rimmibis-microblocks-59.1.1.jar) 
UCHIJAAAA AnimationAPI{1.2.4} [AnimationAPI] (AnimationAPI-1.7.10-1.2.4.jar) 
UCHIJAAAA arsmagica2{1.4.0.008} [Ars Magica 2] (1.7.10_AM2-1.4.0.008.jar) 
UCHIJAAAA bspkrsCore{6.15} [bspkrsCore] ([1.7.10]bspkrsCore-universal-6.15.jar) 
UCHIJAAAA StartingInventory{1.7.10.r03} [startingInventory] ([1.7.10]StartingInventory-universal-1.7.10.r03.jar) 
UCHIJAAAA chisel{2.9.2.8} [Chisel] (AChisel-2.9.2.8.zip) 
UCHIJAAAA Backpack{2.0.1} [backpack] (backpack-2.0.1-1.7.x.jar) 
UCHIJAAAA BiblioCraft{1.11.2} [biblioCraft] (BiblioCraft[v1.11.2][MC1.7.10].jar) 
UCHIJAAAA CarpentersBlocks{3.3.7} [Carpenter's Blocks] (Carpenter's Blocks v3.3.7 - MC 1.7.10.jar) 
UCHIJAAAA chococraft{4.1.5} [Clienthax's ChocoCraft] (ChocoCraft-4.1.5.jar) 
UCHIJAAAA nandocore{1.7.10_dev} [NandoCore] (coralmod-1.7.10-3.14.jar) 
UCHIJAAAA coralmod{1.7.10_dev} [CoralReef Mod] (coralmod-1.7.10-3.14.jar) 
UCHIJAAAA dldungeonsjdg{1.8.7} [Doomlike Dungeons] (DoomlikeDungeons-1.8.7-MC1.7.10.jar) 
UCHIJAAAA dungeonpack{1.7.10-1.0} [Dungeon Pack] (dungeonpack-1.7.10-1.0.jar) 
UCHIJAAAA das{1.0} [DyeAble Swords Mod] (DyeAbleSwords-1.0.jar) 
UCHIJAAAA DynamicLights{1.3.9} [Dynamic Lights] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_onFire{1.0.5} [Dynamic Lights Burning Entity Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_creepers{1.0.4} [Dynamic Lights Creeper Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_dropItems{1.0.8} [Dynamic Lights EntityItem Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_entityClasses{1.0.1} [Dynamic Lights Entity Light Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_mobEquipment{1.0.8} [Dynamic Lights Mob Equipment Light Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_flameArrows{1.0.0} [Dynamic Lights Fiery Arrows Light Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_floodLights{1.0.2} [Dynamic Lights Flood Light] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_otherPlayers{1.0.8} [Dynamic Lights OtherPlayers Light Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA DynamicLights_thePlayer{1.1.4} [Dynamic Lights Player Light Module] (DynamicLights-1.7.10.jar) 
UCHIJAAAA eplus{3.0.2-d} [Enchanting Plus] (EnchantingPlus-1.7.10-3.0.2-d.jar) 
UCHIJAAAA etfuturum{1.4.4} [Et Futurum] (Et Futurum-1.4.4.jar) 
UCHIJAAAA exnihilo{1.38-46} [Ex Nihilo] (Ex-Nihilo-1.38-46.jar) 
UCHIJAAAA exoticbirds{1.0} [Exotic Birds] (Exotic Birds 1.0.2b-1.7.10.jar) 
UCHIJAAAA ExtrabiomesXL{3.16.3} [ExtrabiomesXL] (extrabiomesxl_1.7.10-3.16.3.jar) 
UCHIJAAAA Baubles{1.0.1.10} [baubles] (Baubles-1.7.10-1.0.1.10.jar) 
UCHIJAAAA ExtraUtilities{1.2.1} [Extra Utilities] (extrautilities-1.2.1.jar) 
UCHIJAAAA farlanders{1.2b} [The Farlanders] (farlanders-1.7.10-v1.2b.jar) 
UCHIJAAAA FastCraft{1.21} [FastCraft] (fastcraft-1.21.jar) 
UCHIJAAAA ganysend{1.11.1} [Gany's End] (Ganys End-1.11.1.jar) 
UCHIJAAAA ganysnether{1.8.1} [Gany's Nether] (Ganys Nether-1.8.1.jar) 
UCHIJAAAA glass_shards{1.4} [Glass Shards] (glass_shards_mc1.7.10-1.4.jar) 
UCHIJAAAA haycraftmod{1.7} [Haycraft] (Haycraftmod 1.7 - 1.7.10 Forge.jar) 
UCHIJAAAA IronChest{6.0.62.742} [iron Chest] (ironchest-1.7.10-6.0.62.742-universal.jar) 
UCHIJAAAA excore{1.1.2} [EXCore] (Excore-1.1.2-1.7.10.jar) 
UCHIJAAAA KBO{2.0} [Key Bindings Overhaul] (KeyBindingsOveraul-ALPHA-2.0-1.7.10.jar) 
UCHIJAAAA lycanitesmobs{1.13.0.3 - MC 1.7.10} [Lycanites Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA arcticmobs{1.13.0.3 - MC 1.7.10} [Lycanites Arctic Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA demonmobs{1.13.0.3 - MC 1.7.10} [Lycanites Demon Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA desertmobs{1.13.0.3 - MC 1.7.10} [Lycanites Desert Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA forestmobs{1.13.0.3 - MC 1.7.10} [Lycanites Forest Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA freshwatermobs{1.13.0.3 - MC 1.7.10} [Lycanites Freshwater Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA infernomobs{1.13.0.3 - MC 1.7.10} [Lycanites Inferno Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA junglemobs{1.13.0.3 - MC 1.7.10} [Lycanites Jungle Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA mountainmobs{1.13.0.3 - MC 1.7.10} [Lycanites Mountain Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA plainsmobs{1.13.0.3 - MC 1.7.10} [Lycanites Plains Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA saltwatermobs{1.13.0.3 - MC 1.7.10} [Lycanites Saltwater Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA shadowmobs{1.13.0.3 - MC 1.7.10} [Lycanites Shadow Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA swampmobs{1.13.0.3 - MC 1.7.10} [Lycanites Swamp Mobs] (LycanitesMobsComplete 1.13.0.3 [1.7.10].jar) 
UCHIJAAAA MapWriter{2.1.8} [MapWriter] (MapWriter-1.7.10-2.1.10.jar) 
UCHIJAAAA MetallurgyCore{4.0.4} [Metallurgy Core] (MetallurgyCore-1.7.10-4.0.4.18.jar) 
UCHIJAAAA Metallurgy{4.0.8} [Metallurgy 4] (Metallurgy-1.7.10-4.0.8.97.jar) 
UCHIJAAAA examplemod{1.0} [examplemod] (More Health Enchanted-1.7.10-6.3.jar) 
UCHIJAAAA morehealth{6.3} [More Health Forge] (More Health Enchanted-1.7.10-6.3.jar) 
UCHIJAAAA GollumCoreLib{2.0.0} [Gollum Core Lib] (GollumCoreLib-2.0.0Beta1.0-1.7.10.jar) 
UCHIJAAAA MorePistons{2.0.0 Beta 1.0} [More Pistons] (MorePistons-2.0.0Beta1.0-1.7.10.jar) 
UCHIJAAAA AS_MultiMine{1.4.3} [Multi Mine] (MultiMine-1.7.10.jar) 
UCHIJAAAA musicchoices{1.2_for_1.7.10} [Music Choices] (MusicChoices-1.2_for_1.7.10.jar) 
UCHIJAAAA Mantle{1.7.10-0.3.2.jenkins184} [Mantle] (Mantle-1.7.10-0.3.2.jar) 
UCHIJAAAA Natura{2.2.0} [Natura] (natura-1.7.10-2.2.0.1.jar) 
UCHIJAAAA harvestcraft{1.7.10j} [Pam's HarvestCraft] (Pam's HarvestCraft 1.7.10k.jar) 
UCHIJAAAA ImmibisCore{59.1.2} [immibis Core] (immibis-core-59.1.2.jar) 
UCHIJAAAA RedLogic{59.1.11} [RedLogic] (redlogic-59.1.11.jar) 
UCHIJAAAA soundfilters{0.8_for_1.7.X} [sound Filters] (SoundFilters-0.8_for_1.7.X.jar) 
UCHIJAAAA SpecialMobs{3.2.0} [special Mobs] (SpecialMobs-1.7.10-3.2.0.jar) 
UCHIJAAAA farseek{1.0.10} [Farseek] (Farseek-1.0.10.jar) 
UCHIJAAAA streams{0.1.6} [streams] (Streams-0.1.6.jar) 
UCHIJAAAA torchLevers{1.4.2} [Torch Levers] (TorchLevers-V1.4.2-MC1.7.10.jar) 
UCHIJAAAA Waila{1.5.10} [Waila] (Waila-1.5.10_1.7.10.jar) 
UCHIJAAAA woodstuff{1.2.1} [WoodStuff] (WoodStuff-1.2.1.jar) 
UCHIJAAAA creativecore{1.2.0} [CreativeCore] (CreativeCore v1.3.8 mc1.7.10.jar) 
UCHIJAAAA zzzzzcustomconfigs{2.3.0} [ZZZZZ Custom Configs] (ZZZZZ Custom Configs-2.3.0.jar) 
GL info: ' Vendor: 'Intel Open Source Technology Center' Version: '2.1 Mesa 10.5.9' Renderer: 'Mesa DRI Mobile Intel® GM45 Express Chipset x86/MMX/SSE2'
Mantle Environment: Environment healthy.
Launched Version: 1.7.10-Forge10.13.4.1448-1.7.10
LWJGL: 2.9.1
OpenGL: Mesa DRI Mobile Intel® GM45 Express Chipset x86/MMX/SSE2 GL version 2.1 Mesa 10.5.9, Intel Open Source Technology Center
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: [stormalisk's Extras.zip, Stormalisk's Music Choices Pack.zip]
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

Code and line concerned: https://gist.github.com/elix-x/78c2f4ee9533eb07328e#file-inputhandler-java-L21

Only object that can be null here is

keyStatesMap

, but it is initalised "automatically" and it's value is never changed.

 

Am i missing something obvious here?

Also,  i cannot reproduce these crashes myself.

 

What else can be null on these lines and how to fix this?

 

Thanks for help!

If you have any questions - just ask!

Posted

1. One of possibilities:

http://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles%28%29

If this abstract pathname does not denote a directory, then this method returns null

Is it possible that you made this mistake? (Sry, no time to look deep into code, but that is only null that can be returned there).

 

2. My guess:

Your method has boolean return. Map are Object-oriented, "Boolean != boolean", therefore if you ask Map about something and return is null, null cannot be cast to generic type boolean - and: crash (NPE).

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

Posted

1. One of possibilities:

http://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles%28%29

If this abstract pathname does not denote a directory, then this method returns null

2. My guess:

Your method has boolean return. Map are Object-oriented, "Boolean != boolean", therefore if you ask Map about something and return is null, null cannot be cast to generic type boolean - and: crash (NPE).

Int that can be get as parameter is id of key on keyboard. Above there's method that fills map with states of keys on keyboard, which is called each tick. And this method is never called before map is updated. So apearently, this user has something wrong with his keyboard???

Posted

No. The Map is empty (means null for all keys!) initially. Unless you put something in it first.

As i said above, each tick i call method that fills (or updates) map using key states from key board ([ulr=https://gist.github.com/elix-x/78c2f4ee9533eb07328e#file-inputhandler-java-L11]Line 11[/url]). And this get state method is never called before tick method. So map is filled at this moment.

 

Also for some reasons, half of my post above got deleted, so:

langDir can only be directory. Unless user created file named "lang" without extension... I'll check that.

Posted

Just because the Keyboard has 125 (arbitrary number) keys, does not mean that it uses key-codes 0-124.

But it neither throws exception in tick method. Meaning that when is not here, it is simply always unpressed.

It is still weird that for some reasons code accesed this method with key that is not on key board. Because all key ids are restored from vanilla key bindings default values and negative are automatically considered as mouse keys...

 

Your code is highly suboptimal, really. You should be using FMLs input events.

Let's say that when overhauling something completely, it is not the best idea to rely on what was there before...

Posted

But it neither throws exception in tick method. Meaning that when is not here, it is simply always unpressed.

Correct.

It is still weird that for some reasons code accesed this method with key that is not on key board. Because all key ids are restored from vanilla key bindings default values and negative are automatically considered as mouse keys...
I have no idea what you are trying to say here. Yes, vanilla uses negative IDs for mouse buttons, but that's just an internal encoding and has nothing to with LWJGL.

I mean that thoeretically it is impossible that something calls this method with value not present in map.

Unless user manually goes and messes up save file.

Let's say that when overhauling something completely, it is not the best idea to rely on what was there before...

What on earth are you trying to do? :o

If you are trying to implement keyboard handling from scratch using

isKeyDown

is a bad idea. It will make you miss key-presses eventually.

I'm still experimenting with code and will try keyboard events (by LWJGL, not FML) handling method too.

 

I'm rewriting my mod that used ASM before, because i found a way to avoid it. Although i still need some hacky mehtods, but not as "deep" as ASM...

Posted

I mean that thoeretically it is impossible that something calls this method with value not present in map.

Unless user manually goes and messes up save file.

No!

You put values 0-<keyCount> into the map. But there can be a Key with KeyCode > keyCount. Again: Just because you have 60 keys on your keyboard does not mean there isn't a key with KeyCode 127.

Then how do i get lates key id? Or do i just iterate up to "big number"?

I mean that thoeretically it is impossible that something calls this method with value not present in map.

Unless user manually goes and messes up save file.

No!

You put values 0-<keyCount> into the map. But there can be a Key with KeyCode > keyCount. Again: Just because you have 60 keys on your keyboard does not mean there isn't a key with KeyCode 127.

I'm still experimenting with code and will try keyboard events (by LWJGL, not FML) handling method too.

FML's KeyInputEvent and MouseInputEvent literally have no other purpose but to notify you about "hey we are inside the LWJGL Keyboard/Mouse loop". There are no fields in these events, you have to use
Keyboard.getEventKey

, etc. to get the information. Check out where these events are fired. There is no way to use just the LWJGL events in Minecraft, because they are designed to be handled in a central place. And this central place happens to be Minecraft's tick loop. FML gives you the opportunity to step in here.

Why can't i in my method use same code as mc uses?

while(Keyboard.next()))...

I'm rewriting my mod that used ASM before, because i found a way to avoid it. Although i still need some hacky mehtods, but not as "deep" as ASM...

Which tells nothing about what you are actually trying to achieve...

I'm making possible to assign multiple keys to one key binding. You have to press all of them in order for key binding to activate. Like ctrl+I or X+Y+Z...

There for i need to use my own key binding system, as vanilla is not made for this.

In order for my system to work properly, i have to desactivate vanilla. It's done by setting all vanilla keys key code to 0 in post init phase.

Because of negative keys being for mouse and positive for keyboard and for some other reasons, i have to map them before my key bindings can be updated with values taken from this map.

Posted

Then how do i get lates key id? Or do i just iterate up to "big number"?

You don't. You just do it dynamically. No need to pre-reserve space for all the numbers.

Not big number as Integer.max how ever, like 200...

Why can't i in my method use same code as mc uses?
while(Keyboard.next()))...

Because
Keyboard.next()

consumes the event. If Minecraft calls it, you can no longer receive the same keyboard event.

Oh cool, if it does that. Kinda exactly what i want.

I'm making possible to assign multiple keys to one key binding. You have to press all of them in order for key binding to activate. Like ctrl+I or X+Y+Z...

There for i need to use my own key binding system, as vanilla is not made for this.

In order for my system to work properly, i have to desactivate vanilla. It's done by setting all vanilla keys key code to 0 in post init phase.

Because of negative keys being for mouse and positive for keyboard and for some other reasons, i have to map them before my key bindings can be updated with values taken from this map.

You should be able to do this easily on top of the vanilla system. Just make a custom KeyBinding class that ignores all the calls from vanilla and then reacts to your own calls which you do from the FML Keyboard event.

I do not want to create new system, but i want to change vanilla system.

If i wanted to create new system, i would not be here asking these questions, i would use what FML gives me.

But when changing, i can't... While i want to support other mods easily and not integrating them through api or something else.

Also, my mod supports by user key states emulations via java scripts. That's main reason why i created map. Otherwise i would just use Keyboard.isPressed and Mouse.isPressed.

Posted

Not big number as Integer.max how ever, like 200...

Same deal. There is no "list of available key IDs". What if the user changes their keyboard while the play? Unlikely, yes. But possible.

Oh cool, if it does that. Kinda exactly what i want.

You are going about this completely wrong...

I do not want to create new system, but i want to change vanilla system.

If i wanted to create new system, i would not be here asking these questions, i would use what FML gives me.

But when changing, i can't... While i want to support other mods easily and not integrating them through api or something else.

Also, my mod supports by user key states emulations via java scripts. That's main reason why i created map. Otherwise i would just use Keyboard.isPressed and Mouse.isPressed.

You have not stated any actual reason why you cannot do what I told you.

What you are suggesting is to create a new system. What I am suggesting is to modify the existing one.

I have 2 events for updating my keybindings each tick (i cannot do this in input event, because they are modular): client tick pre and client tick post. I must update keys before world is updated and values are sent, because otherwise, there will be delay.

Client tick pre is fired before everything is updated. Post - after. So i have to use pre.

Because there's no events between input updates and world updates, i cannot update scripts and key bindings after input events are fired and before world is updated.

 

Why can't i notify all key bindings when input event gets fired?

Because scripts can emulate states of keys (and key bindings). And can change other things too (via for scripts api, provided externally for them). Execution order of mod is following (each tick) :

-Update key states

-Run script pre (can change key states, but not only).

-Update key bindings states.

-Run script post (can change key binding states, but not only).

-Update key binding actions (basically, key binding performs action it's made for).

And i can't just create scirpt which is run when input event is fired, because then if it depends on other keys, it will get old key values and delay i'm trying to avoid will reappear.

 

If i had event between key updates and world updates, i could do update key states step with fml input events.

And you can never tell, if fml input event currently fired is the last one...

Posted

I do not see a problem here...

The problem was map of id to states. And that i didn't know that last id is not always equal to count of keys, and may be higher.

I solved it by using max between "small big number" and two times key count, as highest key id value. It still may not be exact and rarely smaller then two times key count and "small big number", but i don't think i can do anything about it.

Posted

but i don't think i can do anything about it.

Sure you can:

 

boolean isKeyPressed(int key) {
    Boolean res = map.get(key);
    return res == null ? false : res;
}
void setKeyState(int key, boolean state) {
    map.put(key, state);
}

 

Done. No need to preemptively fill the map or anything.

Sure, this will work, although keys with ids higher then key count still will not work.

Posted

Sure, this will work, although keys with ids higher then key count still will not work.

What makes you think that?

I just need to iterate thorught map correctly...

And i found a way to: each get/set request id value is compared to maxId, if it is less then current max, then current maxId is set to id. Meanwhile, in map filling loop, i just iterate up to maxId. Like that, map is not filled with not used high ids and used high ids are supported.

Posted

Do you mean i should or should not do this?

You should do what I posted.

Also, i meant this:

for(int nextId = 0; nextId <= maxId; nextId++

.

This is a bad idea. This may work for a list (because that's what a List is, it has a fixed length).

But for a Map this doesn't work. Just because ID 128 is in the Map does not mean that 125 is also in it.

To update values. Not to get.

Posted

Why do you need to iterate to put?

Do you mean why do i have to store values in map? Why do i have to iterate using for int loop instead of for entry loop?

In general, i'm iterating each tick through ints up to maxId which is highest key id requested and filling/updating map with key id - key state pairs. Because i can't use input events, as i described above.

Posted

Do you mean why do i have to store values in map?

No. I said nothing even remotely close to this.

Ok.

Why do i have to iterate using for int loop instead of for entry loop?
This is not a question of preference. An index-based loop will simply not work here.

Entry iteration will not work, because when map is empty intially, it will simply not be updated, because it is empty.

In general, i'm iterating each tick through ints up to maxId which is highest key id requested and filling/updating map with key id - key state pairs.

I don't know where you got this ID of a "maxID". There is no such thing and you cannot detect it in any reliable way.

In initialisation it is 2 times number of keys.

Then whenever somebody requests a key state, key id is compared to current max key id. If it is bigger, max key id is set to id requested.

Like that, if high ids are used, they will be updated in map, and not simply ignored.

Because i can't use input events, as i described above.
Which I still do not understand.

I cannot because there's no tick event fired after key events and before world updates.

And how scripts are working (they can emulate state of any key or keybinding. If i use input events, i'll have to call script for each event and if those are relying on other key states, there will be a delay).

 

Note: i could update map per-key-used, and if key is not present, add it so it is updated. But i prefer going way i'm currently going...

Posted

Entry iteration will not work, because when map is empty intially, it will simply not be updated, because it is empty.

No. It would only be empty if there is no KeyBinding registered. You have to fill the Map with the key-bindings you load from a configuration when the game starts up.

In initialisation it is 2 times number of keys.

Then whenever somebody requests a key state, key id is compared to current max key id. If it is bigger, max key id is set to id requested.

Like that, if high ids are used, they will be updated in map, and not simply ignored.

Or you could just go through whatever is in the map...

I cannot because there's no tick event fired after key events and before world updates.

And how scripts are working (they can emulate state of any key or keybinding. If i use input events, i'll have to call script for each event and if those are relying on other key states, there will be a delay).

 

Note: i could update map per-key-used, and if key is not present, add it so it is updated. But i prefer going way i'm currently going...

I have no idea what these "scripts" are that you are talking about. But it sounds to me like they should be completely separate from key handling.

 

In the key input event update the state of each key. Then in ClientTick Post (after everything) you first run these "scripts", which can potentially further modify the key state. Then you do whatever needs to happen based on the keys. I don't see a problem here...

Let's look into everything one by one:

-Keys - ints representing key on keyboard, mouse or gamepad.

-Key Bindings - Objects represnting key bindings, which are activated when all keys that depend on them are pressed.

-Scripts - user programmable java scripts that are run between each update. They can emulate keys states and key bindings states.

 

Running order, each tick:

-Update key states (read key states in to keyboard from map).

-Run pre script (can change keys states by accessing map, but can also interact with other code).

-Update key bindings states (key bindings update their state based on their requirements (API), but default ones update it based on pressing of all keys they are bound to).

-Run post script (can change key bindings states, but can also interact with other code).

-Update key bindings action (key bindings perform their action based on their state, which could be modified by post script).

 

Why modify key states and keybinding states. Why not just one of them?

-Because key bindings are modular, cases where one is R+L and other alt+R can happen. In this case, modifying R key state via script, will affect both first and second key binding.

 

What's the problem with using fml input events?

-As there's no code after input events and before world update, all i can use is post tick event. This will produce delay in actions to user presses.

 

And post tick event?

-"This will produce delay in actions to user presses".

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.

Announcements



×
×
  • Create New...

Important Information

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