Résolu Augmeter ses stats de déplacment dans l'eau + Touche personalisée
-
Théoriquement impossible … Ajoute du debug pour comprendre pourquoi.
-
J’ai pas trop compris ce que je devais faire avec le debug, mais j’ai fait un println dans la condition isInWater, et le message s’affiche
Sinon, comment faire pour que cela soit directement géré dans la classe des jambières ?
j’ai essayer avec un if(keyAirBag.isPressed() , sans succèsJe précise également que quelques fois, je crash en appuyant sur ma touche
–-- Minecraft Crash Report ---- // Don't be sad. I'll do better next time, I promise! Time: 07/07/15 23:30 Description: Unexpected error java.lang.NullPointerException: Unexpected error at eryah.usefulthings.proxy.ClientProxy.keyTestTyped(ClientProxy.java:280) at eryah.usefulthings.proxy.ClientProxy.onEvent(ClientProxy.java:273) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_0_ClientProxy_onEvent_KeyInputEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:581) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2040) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) at net.minecraft.client.Minecraft.run(Minecraft.java:376) 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(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at eryah.usefulthings.proxy.ClientProxy.keyTestTyped(ClientProxy.java:280) at eryah.usefulthings.proxy.ClientProxy.onEvent(ClientProxy.java:273) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_0_ClientProxy_onEvent_KeyInputEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:581) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Eryah'/123, l='MpServer', x=181,36, y=64,00, z=298,68]] Chunk stats: MultiplayerChunkCache: 36, 36 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: 182,00,4,00,237,00 - World: (182,4,237), Chunk: (at 6,0,13 in 11,14; contains blocks 176,0,224 to 191,255,239), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 2274468 game time, 1 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: 57 total; [EntityPig['Cochon'/9, l='MpServer', x=139,13, y=64,00, z=253,59], EntityCow['Vache'/10, l='MpServer', x=128,16, y=64,00, z=286,19], EntityRabbit['Lapin'/23, l='MpServer', x=186,91, y=64,00, z=217,06], EntityItemFrame['entity.ItemFrame.name'/24, l='MpServer', x=182,97, y=65,50, z=239,50], EntityItemFrame['entity.ItemFrame.name'/25, l='MpServer', x=182,97, y=65,50, z=241,50], EntityItemFrame['entity.ItemFrame.name'/26, l='MpServer', x=182,97, y=65,50, z=243,50], EntityItemFrame['entity.ItemFrame.name'/27, l='MpServer', x=182,97, y=65,50, z=245,50], EntityItemFrame['entity.ItemFrame.name'/28, l='MpServer', x=182,97, y=65,50, z=247,50], EntityItemFrame['entity.ItemFrame.name'/29, l='MpServer', x=182,97, y=65,50, z=253,50], EntityItemFrame['entity.ItemFrame.name'/30, l='MpServer', x=182,97, y=65,50, z=249,50], EntityItemFrame['entity.ItemFrame.name'/31, l='MpServer', x=182,97, y=65,50, z=251,50], EntityItemFrame['entity.ItemFrame.name'/32, l='MpServer', x=182,97, y=65,50, z=255,50], EntityItemFrame['entity.ItemFrame.name'/33, l='MpServer', x=182,97, y=65,50, z=263,50], EntityItemFrame['entity.ItemFrame.name'/34, l='MpServer', x=182,97, y=65,50, z=257,50], EntityItemFrame['entity.ItemFrame.name'/35, l='MpServer', x=182,97, y=65,50, z=261,50], EntityItemFrame['entity.ItemFrame.name'/36, l='MpServer', x=182,97, y=65,50, z=271,50], EntityItemFrame['entity.ItemFrame.name'/37, l='MpServer', x=182,97, y=65,50, z=265,50], EntityItemFrame['entity.ItemFrame.name'/38, l='MpServer', x=182,97, y=65,50, z=269,50], EntityItemFrame['entity.ItemFrame.name'/39, l='MpServer', x=182,97, y=65,50, z=267,50], EntityItemFrame['entity.ItemFrame.name'/40, l='MpServer', x=182,97, y=65,50, z=259,50], EntityItemFrame['entity.ItemFrame.name'/41, l='MpServer', x=182,97, y=65,50, z=277,50], EntityItemFrame['entity.ItemFrame.name'/42, l='MpServer', x=182,97, y=65,50, z=281,50], EntityItemFrame['entity.ItemFrame.name'/43, l='MpServer', x=182,97, y=65,50, z=285,50], EntityItemFrame['entity.ItemFrame.name'/44, l='MpServer', x=182,97, y=65,50, z=287,50], EntityItemFrame['entity.ItemFrame.name'/45, l='MpServer', x=182,97, y=65,50, z=275,50], EntityItemFrame['entity.ItemFrame.name'/46, l='MpServer', x=182,97, y=65,50, z=283,50], EntityItemFrame['entity.ItemFrame.name'/47, l='MpServer', x=182,97, y=65,50, z=273,50], EntityItemFrame['entity.ItemFrame.name'/48, l='MpServer', x=182,97, y=65,50, z=279,50], EntityItemFrame['entity.ItemFrame.name'/49, l='MpServer', x=182,97, y=65,50, z=303,50], EntityItemFrame['entity.ItemFrame.name'/50, l='MpServer', x=182,97, y=65,50, z=291,50], EntityItemFrame['entity.ItemFrame.name'/51, l='MpServer', x=182,97, y=65,50, z=299,50], EntityItemFrame['entity.ItemFrame.name'/52, l='MpServer', x=182,97, y=65,50, z=301,50], EntityItemFrame['entity.ItemFrame.name'/53, l='MpServer', x=182,97, y=65,50, z=289,50], EntityItemFrame['entity.ItemFrame.name'/54, l='MpServer', x=182,97, y=65,50, z=293,50], EntityItemFrame['entity.ItemFrame.name'/55, l='MpServer', x=182,97, y=65,50, z=297,50], EntityItemFrame['entity.ItemFrame.name'/56, l='MpServer', x=182,97, y=65,50, z=295,50], EntityItemFrame['entity.ItemFrame.name'/57, l='MpServer', x=182,97, y=65,50, z=309,50], EntityItemFrame['entity.ItemFrame.name'/58, l='MpServer', x=182,97, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/59, l='MpServer', x=182,97, y=65,50, z=305,50], EntityItemFrame['entity.ItemFrame.name'/60, l='MpServer', x=182,97, y=65,50, z=313,50], EntityItemFrame['entity.ItemFrame.name'/61, l='MpServer', x=179,03, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/62, l='MpServer', x=182,97, y=65,50, z=317,50], EntityItemFrame['entity.ItemFrame.name'/63, l='MpServer', x=182,97, y=65,50, z=311,50], EntityItemFrame['entity.ItemFrame.name'/64, l='MpServer', x=182,97, y=65,50, z=307,50], EntityItemFrame['entity.ItemFrame.name'/65, l='MpServer', x=182,97, y=65,50, z=315,50], EntityItemFrame['entity.ItemFrame.name'/66, l='MpServer', x=182,97, y=65,50, z=323,50], EntityItemFrame['entity.ItemFrame.name'/67, l='MpServer', x=182,97, y=65,50, z=325,50], EntityItemFrame['entity.ItemFrame.name'/68, l='MpServer', x=182,97, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/69, l='MpServer', x=179,03, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/70, l='MpServer', x=182,97, y=65,50, z=333,50], EntityItemFrame['entity.ItemFrame.name'/71, l='MpServer', x=182,97, y=65,50, z=335,50], EntityItem['item.item.egg'/9831, l='MpServer', x=221,84, y=64,00, z=332,84], EntityChicken['Poule'/104, l='MpServer', x=219,53, y=64,00, z=220,69], EntityItem['item.item.golden_egg'/9832, l='MpServer', x=220,88, y=64,00, z=332,09], EntityCow['Vache'/105, l='MpServer', x=221,13, y=64,00, z=283,19], EntityCow['Vache'/106, l='MpServer', x=209,69, y=64,00, z=307,72], EntityPlayerSP['Eryah'/123, l='MpServer', x=181,36, y=64,00, z=298,68]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2613) at net.minecraft.client.Minecraft.run(Minecraft.java:405) 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(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 866715960 bytes (826 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.99.8.1412 Minecraft Forge 11.14.1.1412 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{8.99.8.1412} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{11.14.1.1412} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available ut{Beta 1.0} [Useful Things] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.2.12420 Compatibility Profile Context 13.151.0.0' Renderer: 'AMD Radeon HD 8240' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 8240 GL version 4.2.12420 Compatibility Profile Context 13.151.0.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: Français (France) Profiler Position: N/A (disabled)
Ligne 280 du clientProxy
if(player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings)
-
if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings)
Il faut un null check.J’ai pas trop compris ce que je devais faire avec le debug, mais j’ai fait un println dans la condition isInWater, et le message s’affiche
afficher par exemple la valeur de player.isInWater, la valeur de player.inventory.armorItemInSlot(1).getItem(), etc …
-
Désolé si sa te parrait évidant, mais j’arrive pas a faire le print
Vivement que je commence OpenClassroom… Mais j’ai pas trop la motiveSystem.out.println(player.*isInWater*);
isInWater cannot be resolved or is not a field
Quel idiot je suis, j’ai oublié les () a la fin
Je crash quand je met le println
Déso, j’ai oubié le CrashReport
---- Minecraft Crash Report ---- // Oops. Time: 08/07/15 00:20 Description: Unexpected error java.lang.NullPointerException: Unexpected error at eryah.usefulthings.proxy.ClientProxy.keyTestTyped(ClientProxy.java:280) at eryah.usefulthings.proxy.ClientProxy.onEvent(ClientProxy.java:273) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_0_ClientProxy_onEvent_KeyInputEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:581) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2040) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) at net.minecraft.client.Minecraft.run(Minecraft.java:376) 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(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at eryah.usefulthings.proxy.ClientProxy.keyTestTyped(ClientProxy.java:280) at eryah.usefulthings.proxy.ClientProxy.onEvent(ClientProxy.java:273) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_0_ClientProxy_onEvent_KeyInputEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:581) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Eryah'/244, l='MpServer', x=181,36, y=64,00, z=298,68]] Chunk stats: MultiplayerChunkCache: 25, 25 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: 182,00,4,00,237,00 - World: (182,4,237), Chunk: (at 6,0,13 in 11,14; contains blocks 176,0,224 to 191,255,239), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 2285409 game time, 1 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: 43 total; [EntityItemFrame['entity.ItemFrame.name'/192, l='MpServer', x=182,97, y=65,50, z=333,50], EntityItemFrame['entity.ItemFrame.name'/193, l='MpServer', x=182,97, y=65,50, z=335,50], EntityItemFrame['entity.ItemFrame.name'/155, l='MpServer', x=182,97, y=65,50, z=263,50], EntityItemFrame['entity.ItemFrame.name'/156, l='MpServer', x=182,97, y=65,50, z=257,50], EntityItemFrame['entity.ItemFrame.name'/157, l='MpServer', x=182,97, y=65,50, z=261,50], EntityItemFrame['entity.ItemFrame.name'/158, l='MpServer', x=182,97, y=65,50, z=271,50], EntityItemFrame['entity.ItemFrame.name'/159, l='MpServer', x=182,97, y=65,50, z=265,50], EntityItemFrame['entity.ItemFrame.name'/160, l='MpServer', x=182,97, y=65,50, z=269,50], EntityItemFrame['entity.ItemFrame.name'/161, l='MpServer', x=182,97, y=65,50, z=267,50], EntityCow['Vache'/226, l='MpServer', x=221,13, y=64,00, z=283,19], EntityItemFrame['entity.ItemFrame.name'/162, l='MpServer', x=182,97, y=65,50, z=259,50], EntityItemFrame['entity.ItemFrame.name'/163, l='MpServer', x=182,97, y=65,50, z=283,50], EntityCow['Vache'/227, l='MpServer', x=211,22, y=64,00, z=304,22], EntityItemFrame['entity.ItemFrame.name'/164, l='MpServer', x=182,97, y=65,50, z=273,50], EntityItemFrame['entity.ItemFrame.name'/165, l='MpServer', x=182,97, y=65,50, z=279,50], EntityItemFrame['entity.ItemFrame.name'/166, l='MpServer', x=182,97, y=65,50, z=277,50], GoldenEggChicken['Poule aux oeufs d'or'/230, l='MpServer', x=221,44, y=64,00, z=332,63], EntityItemFrame['entity.ItemFrame.name'/167, l='MpServer', x=182,97, y=65,50, z=281,50], EntityItemFrame['entity.ItemFrame.name'/168, l='MpServer', x=182,97, y=65,50, z=285,50], EntityItemFrame['entity.ItemFrame.name'/169, l='MpServer', x=182,97, y=65,50, z=287,50], EntityItemFrame['entity.ItemFrame.name'/170, l='MpServer', x=182,97, y=65,50, z=275,50], EntityItemFrame['entity.ItemFrame.name'/171, l='MpServer', x=182,97, y=65,50, z=303,50], EntityItemFrame['entity.ItemFrame.name'/172, l='MpServer', x=182,97, y=65,50, z=291,50], EntityItemFrame['entity.ItemFrame.name'/173, l='MpServer', x=182,97, y=65,50, z=299,50], EntityItemFrame['entity.ItemFrame.name'/174, l='MpServer', x=182,97, y=65,50, z=301,50], EntityItemFrame['entity.ItemFrame.name'/175, l='MpServer', x=182,97, y=65,50, z=289,50], EntityItemFrame['entity.ItemFrame.name'/176, l='MpServer', x=182,97, y=65,50, z=293,50], EntityItemFrame['entity.ItemFrame.name'/177, l='MpServer', x=182,97, y=65,50, z=297,50], EntityItemFrame['entity.ItemFrame.name'/178, l='MpServer', x=182,97, y=65,50, z=295,50], EntityItemFrame['entity.ItemFrame.name'/179, l='MpServer', x=182,97, y=65,50, z=313,50], EntityItemFrame['entity.ItemFrame.name'/180, l='MpServer', x=179,03, y=65,50, z=319,50], EntityPlayerSP['Eryah'/244, l='MpServer', x=181,36, y=64,00, z=298,68], EntityItemFrame['entity.ItemFrame.name'/181, l='MpServer', x=182,97, y=65,50, z=317,50], EntityItemFrame['entity.ItemFrame.name'/182, l='MpServer', x=182,97, y=65,50, z=311,50], EntityItemFrame['entity.ItemFrame.name'/183, l='MpServer', x=182,97, y=65,50, z=307,50], EntityItemFrame['entity.ItemFrame.name'/184, l='MpServer', x=182,97, y=65,50, z=315,50], EntityItemFrame['entity.ItemFrame.name'/185, l='MpServer', x=182,97, y=65,50, z=309,50], EntityItemFrame['entity.ItemFrame.name'/186, l='MpServer', x=182,97, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/187, l='MpServer', x=182,97, y=65,50, z=305,50], EntityItemFrame['entity.ItemFrame.name'/188, l='MpServer', x=182,97, y=65,50, z=323,50], EntityItemFrame['entity.ItemFrame.name'/189, l='MpServer', x=182,97, y=65,50, z=325,50], EntityItemFrame['entity.ItemFrame.name'/190, l='MpServer', x=182,97, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/191, l='MpServer', x=179,03, y=65,50, z=321,50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2613) at net.minecraft.client.Minecraft.run(Minecraft.java:405) 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(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 861728240 bytes (821 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.99.8.1412 Minecraft Forge 11.14.1.1412 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available FML{8.99.8.1412} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Forge{11.14.1.1412} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available ut{Beta 1.0} [Useful Things] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.2.12420 Compatibility Profile Context 13.151.0.0' Renderer: 'AMD Radeon HD 8240' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 8240 GL version 4.2.12420 Compatibility Profile Context 13.151.0.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: Français (France) Profiler Position: N/A (disabled)
J’ai apperçu cei dans les logs avant/pendent le crash
[16:34:36] [Client thread/ERROR] [FML]: Index: 1 Listeners: [16:34:36] [Client thread/ERROR] [FML]: 0: NORMAL [16:34:36] [Client thread/ERROR] [FML]: 1: ASM: eryah.usefulthings.proxy.ClientProxy@2edc6690 onEvent(Lnet/minecraftforge/fml/common/gameevent/InputEvent$KeyInputEvent;)V
-
Bon, je reprend ce topic, car faut VRAIMENT que je corrige ce crash, car si quelqu’un appuie malencontreusement sur la touche Alt sans avoir le pantalon et être dans l’eau, c’est le crash garanti !
Bon alors ce que je voudrais, c’est lorsqu’on appuie sur la touche ( UN FOIS, pas qu’un reste appuyer ), on remonte d’un coup ( Sortie des airbags ), puis on remonte douceument tant qu’on est dans l’eau ( L’air contenue dans les sacs nous font remonter )
Code actuel :
@SubscribeEvent public void onEvent(KeyInputEvent event) { // Si vous remplacez isPressed() par getIsKeyPressed() // Le chat sera inondé à chaque fois que vous presserez la touche if(keyAirBag.isPressed()) { keyTestTyped(FMLClientHandler.instance().getClientPlayerEntity()); // Traitement de la touche } } private void keyTestTyped(EntityPlayer player) { // La touche vient d'être appuyé !! if(player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) { if(player.isInWater()){ player.motionY = 4.0F; while(player.isInWater()) { player.motionY = 2.5F; } = return; } else { return; } }
J’ai tenté quelques trucs pour contrer le systeme, par exemple, rajouter la condition de l’eau avant de la condition de la touvhe, comme ceci :
@SubscribeEvent public void onEvent(KeyInputEvent event) { // Si vous remplacez isPressed() par getIsKeyPressed() // Le chat sera inondé à chaque fois que vous presserez la touche if(player.insInWater()) { if(keyAirBag.isPressed()) { keyTestTyped(FMLClientHandler.instance().getClientPlayerEntity()); // Traitement de la touche } } } private void keyTestTyped(EntityPlayer player) { // La touche vient d'être appuyé !! if(player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) { player.motionY = 4.0F; while(player.isInWater()) { player.motionY = 2.5F; } return; } else { return; } }
Résultat décevant = Un crash
-
if(player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) {
->
if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) { -
AAAh c’est ça ce que tu voulait dire pas le null check… My Bad.
Bon par contre, quand j’appuie sur la touche dans l’eau et avec le pantalon, je crash. Je pense que Minecraft aime pas trop la boucle que j’ai fait. Enfin c’est pas un crash a propreument parlé, c’est plutot un GROS Freeze, suivis d’un Ne Réponds Pas, suivi d’un crash quand tu ferme le jeu. Mais… Pas de crash-report.
Sinon, tous fonctionne (Pantalon = Saute pas - Eau = Saute pas - Pantalon+Eau = Saute/Crash - Rien = Saute pas ) -
C’est surement le boucle while qu’il n’aime pas.
-
Je l’ai enlevé, et ça fontionne. Mais par contre, si on barbotte dans 1 bloc d’eau, et qu’on active les airbags, on décole a plus de vingts blocs de haut… Et donc il y a des chances de décéder…
Comment faire pour que je monte tant que je suis dans l’eau, sans boucles while :S ?
EDIT = on part a 29 bloc de haut -
Renvoi ton code actuel.
-
private void keyTestTyped(EntityPlayer player) { // La touche vient d'être appuyé !! if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) { if(player.isInWater()){ player.motionY = 4.0F; } else { return; } } }
C’est normal que le motionY soit a 4.0F
-
Faudrait mettre un tag dans le joueur (player.getEntityData().setBoolean(“ascend”, true);) lors de l’appuie de la touche s’il a les jambières et qu’il est dans l’eau et ensuite dans un TickEvent.PlayerTickEvent fait que si le joueur à le tag (event.player.getEntityData().getBoolean(“ascend”)) alors s’il n’est pas dans l’eau tu le retire et tu mets son motionY sur 0, sinon s’il est dans l’eau tu mets son motionY sur 2.5F.
-
OMG c’est super complexe…
je vais tenter d’analyser sa plus en profondeur, et voir ce que je peut faire.
Sa me parait super dur !Si je ne me trompe pas, il fau tutiliser les Extends Entity trucs ?
-
Heu non pas du tout.
-
Sans Extand Entity Properties, comment mettre un tag au joueur ?
On peut le mettre directement dans la MainClass/ClientProxy/CommonProxy ? -
@‘robin4002’:
Faudrait mettre un tag dans le joueur (player.getEntityData().setBoolean(“ascend”, true);) lors de l’appuie de la touche s’il a les jambières et qu’il est dans l’eau et ensuite dans un TickEvent.PlayerTickEvent fait que si le joueur à le tag (event.player.getEntityData().getBoolean(“ascend”)) alors s’il n’est pas dans l’eau tu le retire et tu mets son motionY sur 0, sinon s’il est dans l’eau tu mets son motionY sur 2.5F.
Comme l’a dit Robin, tu fais player.getEntityData.setBoolean(“unNom”, taValeur)
-
Comment on fait pour le TickEvent ?
C’est une classe ou une méthode ? -
C’est un event, donc ça s’utilise comme n’importe quel event.
-
Bon, j’ai pas tous compris.
Les events sont trop compliqué pour moi
J’ai improvisé, et j’ai fait a ma sauce.
Sans surprise, ça ne fonctionne pasClient
private void keyTestTyped(EntityPlayer player) { // La touche vient d'être appuyé !! if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == ScaphLeggings.airbag_leggings) { if(player.isInWater()) { player.getEntityData().setBoolean("airbag", true); } else { player.getEntityData().setBoolean("airbag", false); } } }
Jambières
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.getEntityData().getBoolean("ascend")) { player.motionY += 2.5F; } }
-