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

[1.11.2] Keybinds not Registering properly


2veryicey
 Share

Recommended Posts

I am trying to code a mod that adds random features...but I can't get my first key bind to register, any help would be greatly appreciated...

 

-KeyHandler.java-

package io.github.TooVeryIcey.Frostwave.Utils;

import java.awt.event.InputEvent;

import org.lwjgl.input.Keyboard;

import io.github.TooVeryIcey.Frostwave.Modules.Exploit.PlayerFinder;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class KeyHandler {
	
	private static final KeyBinding[] KeyBindings = null;{
	

	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 
	
	for (int i = 0; i < KeyBindings.length; ++i) 
	{
	    ClientRegistry.registerKeyBinding(KeyBindings[i]);
	}
}
	  @SideOnly(Side.CLIENT)
	    @SubscribeEvent(receiveCanceled = true)
	    public void onKeyEvent(InputEvent event) {
	        if (KeyBindings[0].isPressed()) {
	            PlayerFinder.togglePF();
	        }
	    }
}

Now, this may be because I didn't put it in the client side Initializer, however when I get the following crash report (I believe it gives me the same error if it is in PreInit, or Init):

-Console Output-

Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[10:20:30] [main/INFO] [GradleStart]: Extra: []
[10:20:30] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /Users/2VeryIcey/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[10:20:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[10:20:30] [main/INFO] [FML]: Forge Mod Loader version 13.20.0.2253 for Minecraft 1.11.2 loading
[10:20:30] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_51, running on Mac OS X:x86_64:10.12.1, installed at /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
[10:20:30] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[10:20:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:20:30] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[10:20:30] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[10:20:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:20:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:20:30] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[10:20:32] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[10:20:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:20:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[10:20:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:20:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[10:20:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[10:20:33] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[10:20:35] [Client thread/INFO]: Setting user: Player36
[10:20:41] [Client thread/INFO]: LWJGL Version: 2.9.2
[10:20:41] [Client thread/INFO] [FML]: MinecraftForge v13.20.0.2253 Initialized
[10:20:41] [Client thread/INFO] [FML]: Replaced 232 ore recipes
[10:20:42] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[10:20:42] [Client thread/INFO] [FML]: Searching /Users/2VeryIcey/Documents/Games/Files/Minecraft/MC Clients/Frostwave/Developer-Assets/Forge/forge-1.11.2-13.20.0.2253-mdk/run/mods for mods
[10:20:43] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[10:20:44] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, frostwave] at CLIENT
[10:20:44] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, frostwave] at SERVER
[10:20:45] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Frostwave Client [Private]
[10:20:45] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[10:20:45] [Client thread/INFO] [FML]: Found 444 ObjectHolder annotations
[10:20:45] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[10:20:45] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[10:20:45] [Client thread/INFO] [FML]: Applying holder lookups
[10:20:45] [Client thread/INFO] [FML]: Holder lookups applied
[10:20:45] [Client thread/INFO] [FML]: Applying holder lookups
[10:20:45] [Client thread/INFO] [FML]: Holder lookups applied
[10:20:45] [Client thread/INFO] [FML]: Applying holder lookups
[10:20:45] [Client thread/INFO] [FML]: Holder lookups applied
[10:20:45] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[10:20:45] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[10:20:45] [Client thread/INFO]: [STDOUT]: -=Frostwave Client Pre-Initilization Began=-
[10:20:45] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: OUTDATED Target: 13.20.0.2259
[10:20:48] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Injecting Process Began
[10:20:49] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Modifing File Names
[10:20:50] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Completed...
[10:20:51] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Accessing Root Directory
[10:20:53] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Located...Preparing Directory For Injection
[10:20:54] [Client thread/INFO]: [STDOUT]: -=Frostwave Client=- Completed...Preparing Files To Inject
[10:20:55] [Client thread/INFO]: [STDOUT]: -=Frostwave Client Pre-Initilization Completed=-
[10:20:55] [Client thread/INFO] [FML]: Applying holder lookups
[10:20:55] [Client thread/INFO] [FML]: Holder lookups applied
[10:20:55] [Client thread/INFO] [FML]: Injecting itemstacks
[10:20:55] [Client thread/INFO] [FML]: Itemstack injection complete
[10:20:58] [Sound Library Loader/INFO]: Starting up SoundSystem...
[10:20:58] [Thread-6/INFO]: Initializing LWJGL OpenAL
[10:20:58] [Thread-6/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[10:21:00] [Thread-6/INFO]: OpenAL initialized.
[10:21:00] [Sound Library Loader/INFO]: Sound engine started
[10:21:05] [Client thread/INFO] [FML]: Max texture size: 8192
[10:21:06] [Client thread/INFO]: Created: 16x16 textures-atlas
[10:21:07] [Client thread/INFO]: [STDOUT]: -=Frostwave Client Initilization Began=-
[10:21:07] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[10:21:07] [Client thread/ERROR] [FML]: 
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHI	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
	UCHI	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHI	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2253.jar) 
	UCHI	forge{13.20.0.2253} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2253.jar) 
	UCHE	frostwave{0.1-Alpha} [Frostwave Client [Private]] (bin) 
[10:21:07] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[10:21:07] [Client thread/ERROR] [FML]: Caught exception from Frostwave Client [Private] (frostwave)
java.lang.NullPointerException
	at io.github.TooVeryIcey.Frostwave.Utils.KeyHandler.<init>(KeyHandler.java:19) ~[bin/:?]
	at io.github.TooVeryIcey.Frostwave.proxy.Client.init(Client.java:38) ~[bin/:?]
	at io.github.TooVeryIcey.Frostwave.Main.init(Main.java:47) ~[bin/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643) ~[forgeSrc-1.11.2-13.20.0.2253.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246) ~[forgeSrc-1.11.2-13.20.0.2253.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224) ~[forgeSrc-1.11.2-13.20.0.2253.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:828) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:350) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:562) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
[10:21:07] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ----
// There are four lights!

Time: 3/18/17 10:21 AM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Frostwave Client [Private] (frostwave)
Caused by: java.lang.NullPointerException
	at io.github.TooVeryIcey.Frostwave.Utils.KeyHandler.<init>(KeyHandler.java:19)
	at io.github.TooVeryIcey.Frostwave.proxy.Client.init(Client.java:38)
	at io.github.TooVeryIcey.Frostwave.Main.init(Main.java:47)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:828)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:350)
	at net.minecraft.client.Minecraft.init(Minecraft.java:562)
	at net.minecraft.client.Minecraft.run(Minecraft.java:387)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	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(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


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

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Mac OS X (x86_64) version 10.12.1
	Java Version: 1.8.0_51, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 729292528 bytes (695 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.38 Powered by Forge 13.20.0.2253 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHI	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
	UCHI	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHI	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2253.jar) 
	UCHI	forge{13.20.0.2253} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2253.jar) 
	UCHE	frostwave{0.1-Alpha} [Frostwave Client [Private]] (bin) 
	Loaded coremods (and transformers): 
[10:21:07] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# /Users/2VeryIcey/Documents/Games/Files/Minecraft/MC Clients/Frostwave/Developer-Assets/Forge/forge-1.11.2-13.20.0.2253-mdk/run/./crash-reports/crash-2017-03-18_10.21.07-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

-Client.java (Is used to store Clientside Initialization code) (With KeyHandler being initialized)-

package io.github.TooVeryIcey.Frostwave.proxy;

import io.github.TooVeryIcey.Frostwave.Utils.ChatUtils;
import io.github.TooVeryIcey.Frostwave.Utils.EventManager;
import io.github.TooVeryIcey.Frostwave.Utils.KeyHandler;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class Client extends Common{

	@Override
	public void preInit(FMLPreInitializationEvent event) throws InterruptedException {
		System.out.println("-=Frostwave Client Pre-Initilization Began=-");
		MinecraftForge.EVENT_BUS.register(new ChatUtils());
		Thread.sleep(3000);
		System.out.println("-=Frostwave Client=- Injecting Process Began");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- Modifing File Names");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- Completed...");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- Accessing Root Directory");
		Thread.sleep(2000);
		System.out.println("-=Frostwave Client=- Located...Preparing Directory For Injection");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- Completed...Preparing Files To Inject");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client Pre-Initilization Completed=-");
	}

	@Override
	public void init(FMLInitializationEvent event) throws InterruptedException {
		System.out.println("-=Frostwave Client Initilization Began=-");
		MinecraftForge.EVENT_BUS.register(new KeyHandler());
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client Initilization Completed=-");

	}

	@Override
	public void postinit(FMLPostInitializationEvent event) throws InterruptedException {
		System.out.println("-=Frostwave Client Post-Initilization Began=-");
		Thread.sleep(3000);
		MinecraftForge.EVENT_BUS.register(new EventManager());
		System.out.println("-=Frostwave Client=- Injecting Process Completed");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- Finalizing And Saving Changes");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client=- All files Have Been saved, And the Game Will Finish Loading");
		Thread.sleep(1000);
		System.out.println("-=Frostwave Client Post-Initilization Completed=-");
	}

	
	
}

 

Link to comment
Share on other sites

	private static final KeyBinding[] KeyBindings = null;{
	
	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 

You set your KeyBindings array to null, and then try to access the 0 index. But it doesn't have a 0 index, because it's not an array at all, it's null.

 

It is easy to find the source of the problem by looking at your crash report:

java.lang.NullPointerException
	at io.github.TooVeryIcey.Frostwave.Utils.KeyHandler.<init>(KeyHandler.java:19) ~[bin/:?]

It's a NullPointerException - something is null where it shouldn't be - at line 19 of the KeyHandler class.

Edited by Jay Avery
Link to comment
Share on other sites

  • If you just want to detect when your key is pressed use ClientTickEvent, not the key event.
  • What the actual f*** are those sleeps and messages in your init methods? 
  • Why are you creating and registering your key bindings in an instance initializer?
  • Why is your key bindings array null?
Link to comment
Share on other sites

1 minute ago, diesieben07 said:
  • If you just want to detect when your key is pressed use ClientTickEvent, not the key event.
  • What the actual f*** are those sleeps and messages in your init methods? 
  • Why are you creating and registering your key bindings in an instance initializer?
  • Why is your key bindings array null?
 

Well, I have the message and everything there so I can see when things are initializing (the things inside the start and end messages are for effect), plus They don't break anything. why shouldn't I use key Event; Thank you for doing something useful with your last point; And, finally, I am not, I created a Key handler class for the purpose of key bind management

Link to comment
Share on other sites

7 minutes ago, Jay Avery said:

	private static final KeyBinding[] KeyBindings = null;{
	
	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 

You set your KeyBindings array to null, and then try to access the 0 index. But it doesn't have a 0 index, because it's not an array at all, it's null.

 

It is easy to find the source of the problem by looking at your crash report:


java.lang.NullPointerException
	at io.github.TooVeryIcey.Frostwave.Utils.KeyHandler.<init>(KeyHandler.java:19) ~[bin/:?]

It's a NullPointerException - something is null where it shouldn't be - at line 19 of the KeyHandler class.

 

What Should I Change It With? Do I Set It To The Number of Keybinds I Have At That Moment? 

Link to comment
Share on other sites

1 minute ago, 2veryicey said:

Well, I have the message and everything there so I can see when things are initializing (the things inside the start and end messages are for effect), plus They don't break anything.

For... effect? You are shitting me, right? People install your mod to play the game, not look at stupid log messages for 20 seconds. This is why mod packs suck, because mod makers do stupid shit like this. Your mod literally forces the loading process to wait around for 20 seconds, doing jack all.

 

3 minutes ago, 2veryicey said:

why shouldn't I use key Event;

KeyInputEvent fires for every LWJGL key event (key up, key down). These are already handled for you when you have a key binding and checking if your key binding has changed every time is pointless. Once a tick is enough.

 

4 minutes ago, 2veryicey said:

And, finally, I am not, I created a Key handler class for the purpose of key bind management

What is this referring to?

 

2 minutes ago, 2veryicey said:

What Should I Change It With? Do I Set It To The Number of Keybinds I Have At That Moment? 

If this is not obvious to you, you need to go and learn basic Java before making a mod.

Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

For... effect? You are shitting me, right? People install your mod to play the game, not look at stupid log messages for 20 seconds. This is why mod packs suck, because mod makers do stupid shit like this. Your mod literally forces the loading process to wait around for 20 seconds, doing jack all.

 

KeyInputEvent fires for every LWJGL key event (key up, key down). These are already handled for you when you have a key binding and checking if your key binding has changed every time is pointless. Once a tick is enough.

 

What is this referring to?

 

If this is not obvious to you, you need to go and learn basic Java before making a mod.

1

Here is what is wrong with your FIRST statement: I DO NOT CARE about your opinion, this mod is being privately developed and NOT BY YOU, this is not a modpack, this is a MOD, modpacks have nothing to do with this, it is 17 seconds (which for anyone who isn't IMPATIENT like yourself), it won't matter anyway...for all YOU know I am removing it in the final release...shut up...PLEASE; secondly, Thank you for informing me, however, I don't truly get bothered by efficiency, if you want me to use YOUR system, tell me how to do it; and I quote "if this is not obvious to you"; lastly, I am not entirely aware of how the MINECRAFT code wants it to be, so I am asking for clarification in the sense of "Minecraft says no to this; what does minecraft want...its THIS"...

to sum it up GET OFF THIS THREAD AND LET A COMPETENT PERSON HELP

Link to comment
Share on other sites

4 minutes ago, 2veryicey said:

Alright, thank you :) should i replace it with the number of keybinds?

The 0 doesn't matter, you are trying to access something which you have set to null. To fix that, don't set it to null. Instead set it to something that you want to use, for example an actual array.

Edited by Jay Avery
Link to comment
Share on other sites

I am not going to engage in a fight with you, however please refrain from insults, thank you.

 

6 minutes ago, 2veryicey said:

am not entirely aware of how the MINECRAFT code wants it to be, so I am asking for clarification in the sense of "Minecraft says no to this; what does minecraft want...its THIS"...

Your issue has nothing to do with Minecraft.

Link to comment
Share on other sites

forgive my stupidity, but, would the code now be:

import java.awt.event.InputEvent;

import org.lwjgl.input.Keyboard;

import io.github.TooVeryIcey.Frostwave.Modules.Exploit.PlayerFinder;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class KeyHandler {
	
	public static final KeyBinding[] KeyBindings = KeyBinding[];{
	

	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 
	
	for (int i = 0; i < KeyBindings.length; ++i) 
	{
	    ClientRegistry.registerKeyBinding(KeyBindings[i]);
	}

	  @SideOnly(Side.CLIENT)
	    @SubscribeEvent(receiveCanceled = true)
	    public void onKeyEvent(InputEvent event) {
	        if (KeyBindings[0].isPressed()) {
	            PlayerFinder.togglePF();
	        }
	    }
}
}

Or:

import java.awt.event.InputEvent;

import org.lwjgl.input.Keyboard;

import io.github.TooVeryIcey.Frostwave.Modules.Exploit.PlayerFinder;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class KeyHandler {
	
	public static final KeyBindings = KeyBinding[];{
	

	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 
	
	for (int i = 0; i < KeyBindings.length; ++i) 
	{
	    ClientRegistry.registerKeyBinding(KeyBindings[i]);
	}

	  @SideOnly(Side.CLIENT)
	    @SubscribeEvent(receiveCanceled = true)
	    public void onKeyEvent(InputEvent event) {
	        if (KeyBindings[0].isPressed()) {
	            PlayerFinder.togglePF();
	        }
	    }
}
}

both of them give me errors, in which the top of the two pastes literally breaks EVERY file, and the second one just breaks every reference to the Keybindings in the file

 

Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

I am not going to engage in a fight with you, however please refrain from insults, thank you.

 

Your issue has nothing to do with Minecraft.

 

Okay, well can you give me an EXAMPLE of fixed code? like how I would insert the arraylist

Link to comment
Share on other sites

1 minute ago, 2veryicey said:

public static final KeyBinding[] KeyBindings = KeyBinding[];

This is not valid Java.

 

  • You are still registering and creating your key-bindings in an instance initializer. Why?
  • In both of your versions you are trying to create a method inside an instance initializer. Again: Please learn basic Java before making a mod. This is a requirement, not an option.
2 minutes ago, 2veryicey said:

like how I would insert the arraylist

Your code does not even use an ArrayList.

Link to comment
Share on other sites

9 minutes ago, diesieben07 said:

This is not valid Java.

 

  • You are still registering and creating your key-bindings in an instance initializer. Why?
  • In both of your versions you are trying to create a method inside an instance initializer. Again: Please learn basic Java before making a mod. This is a requirement, not an option.

Your code does not even use an ArrayList.

 
 
 

Okay, because eclipse gets mad at me if I don't, this is my code without the initializer:

package io.github.TooVeryIcey.Frostwave.Utils;

import java.awt.event.InputEvent;

import org.lwjgl.input.Keyboard;

import io.github.TooVeryIcey.Frostwave.Modules.Exploit.PlayerFinder;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class KeyHandler {
	
	public static final KeyBinding[] KeyBindings;
	

	KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); 
	
	for (int i = 0; i < KeyBindings.length; ++i) 
	{
	    ClientRegistry.registerKeyBinding(KeyBindings[i]);
	}

	  @SideOnly(Side.CLIENT)
	    @SubscribeEvent(receiveCanceled = true)
	    public void onKeyEvent(InputEvent event) {
	        if (KeyBindings[0].isPressed()) {
	            PlayerFinder.togglePF();
	        }
	    }
}
}

when doing this, I am errored at the line for creating the arraylist (you know, THE ONE THAT SAYS 

public static final KeyBinding[] KeyBindings;

), it errors me as follows: 

Multiple markers at this line

- Syntax error on token ";", { expected after this token

- The blank final field KeyBindings may not have been 

initialized

 

and the line for my onKeyEvent, I am errored as follows:

Multiple markers at this line

- Syntax error on token ")", ; 

expected

- Syntax error on token "(", ; 

expected

 

 

Any chance instead of yelling at me...you could I don't know...HELP 

Edited by 2veryicey
Misspelled yelling because of accidental key press, and didn't capitalize I
Link to comment
Share on other sites

1 minute ago, 2veryicey said:

Okay, because eclipse gets mad at me if I don't, this is my code without the initializer:

Well, yes, you can't just put code outside a method. Again, basic Java.

 

2 minutes ago, 2veryicey said:

I am errored at the line for creating the arraylist (you know, THE ONE THAT SAYS 


public static final KeyBinding[] KeyBindings;

)

That is an array. Not an ArrayList.

 

2 minutes ago, 2veryicey said:

Any chance instead of bitching at me...you could i don't know...HELP 

Oh, I am the one bitching now?

And I already told you what you need to do: Learn basic Java. This is not a Java school.

  • Like 3
Link to comment
Share on other sites

6 minutes ago, diesieben07 said:

Well, yes, you can't just put code outside a method. Again, basic Java.

 

That is an array. Not an ArrayList.

 

Oh, I am the one bitching now?

And I already told you what you need to do: Learn basic Java. This is not a Java school.

 
 

Yes, you have been from the start...my replies are REACTIVE, not active, but still, whether it is array or ArrayList, this is not grammar school, and you are correct it is not java school :) It is a help forum...which is the opposite of what you are doing...perhaps guide me into the direction of how to fix it if you are too lazy or worried about my learning capabilities to actually fix my code, but IT DOES NOT BLOODY MATTER, I know basic java, if I didn't how the bloody hell did I get this far...I came for a SIMPLE answer to a question, you moan about how I am not using the correct term for a LIST of ordered terms,anyway don't waste your limited life replying to me, your mental inability to provide help to someone who asked a basic question instead of going all Proper wording police is annoying me

Edited by 2veryicey
Link to comment
Share on other sites

5 minutes ago, 2veryicey said:

Yes, you have been from the start...my replies are REACTIVE, not active, but still, whether it is array or ArrayList, this is not grammar school, and you are correct it is not java school :) It is a help forum...which is the opposite of what you are doing...perhaps guide me into the direction of how to fix it if you are too lazy or worried about my learning capabilities to actually fix my code, but IT DOES NOT BLOODY MATTER, I know basic java, if I didn't how the bloody hell did I get this far...I came for a SIMPLE answer to a question, you moan about how I am not using the correct term for a LIST of ordered terms,anyway don't waste your limited life replying to me, your mental inability to provide help to someone who asked a basic question instead of going all Proper wording police is annoying me

The point here is that the problems you are struggling with demonstrate a lack of understanding of basic java. The help you need has nothing to do with the complexities of minecraft and forge code, it only has to do with the basic syntax and function of java code.

  • Failing to initialise a final variable is invalid java
  • Writing a for loop outside of a method is invalid java
  • Trying to access a null variable is invalid java

None of these problems are to do with minecraft. You need to be able to understand basic java issues like this before there is any point in you getting help from a forge forum.

  • Like 2
Link to comment
Share on other sites

5 minutes ago, Jay Avery said:

The point here is that the problems you are struggling with demonstrate a lack of understanding of basic java. The help you need has nothing to do with the complexities of minecraft and forge code, it only has to do with the basic syntax and function of java code.

  • Failing to initialise a final variable is invalid java
  • Writing a for loop outside of a method is invalid java
  • Trying to access a null variable is invalid java

None of these problems are to do with minecraft. You need to be able to understand basic java issues like this before there is any point in you getting help from a forge forum.

 
 

My god! there is not ONE helpful person on these forums, UNLIKE YOU BRATS, I learn by doing, And to do it, I NEED TO KNOW HOW TO DO IT! SO IF YOU TROLLS COULD STFU AND PLEASE...JUST PLEASE help by correcting the issues, or linking me to an example of correcting the mistake, also, for your information you bitches, I remove final....AND GUESS WHAT!!!!13121!!!!!!!11111!!11!!!!!111

IT STILL GIVES ME THE SAME ERROR!!!!!!!!!! go to hell, get off MCForge, and learn to be helpful (not in that order)

Edited by 2veryicey
Link to comment
Share on other sites

3 minutes ago, 2veryicey said:

My god! there is not ONE helpful person on these forums, UNLIKE YOU BRATS, I learn by doing, And to do it, I NEED TO KNOW HOW TO DO IT! SO IF YOU TROLLS COULD STFU AND PLEASE...JUST PLEASE help by correcting the issues, or linking me to an example of correcting the mistake, also, for you information you bitches, i remove final....AND GUESS WHAT!!!!@!#@#$@#$@#$!$%#^%$TW%$^#%TY$#B&^ N$%^$BH&T IT STGILL GIVES ME THE SAME ERROR!!!!!!!!!! go to hell, get off MCForge, and learn to be helpful (not in that order)

https://docs.oracle.com/javase/tutorial/

Link to comment
Share on other sites

4 minutes ago, 2veryicey said:

if I didn't understand java, i would not be here having what I have done done, I simply want to know what to call in my statement instead of the autogenerated null text...if you can't figure that out you are stupider than I possibly imagined

If you understand java, you should know how to initialise an array: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

Link to comment
Share on other sites

35 minutes ago, 2veryicey said:

if I didn't understand java, i would not be here having what I have done done, I simply want to know what to call in my statement instead of the autogenerated null text...if you can't figure that out you are stupider than I possibly imagined

If you already understand Java (and it's painfully obvious that you don't), you would know exactly what you need to replace null with.

 

This forum is for help with Minecraft and Forge, what you are asking for help with is Java, which is neither of the above.

 

So before you keep whining about how nobody will help you, realize that you're in the wrong place. As is stated on this forum all the time, this is not a forum for teaching Java because you should already have a reasonable understanding of Java before you start trying to make mods.

 

You'll find that everyone on here is perfectly helpful, you're just not listening to us.

  • Like 3

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.