Jump to content

Recommended Posts

Posted

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=-");
	}

	
	
}

 

Posted (edited)
	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
Posted
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

Posted
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? 

Posted
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

Posted
14 minutes ago, Syndaryl said:

It's not the 0 that's the problem, it's that the array is null - it has NO number of keybindings in it, so no number is valid.

 
 
 
 

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

Posted (edited)
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
Posted

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

 

Posted
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

Posted (edited)
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
Posted (edited)
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
Posted
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 1
Posted (edited)
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
Posted
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/

Posted
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

Posted
3 hours ago, 2veryicey said:

if I didn't understand java, i would not be here

java_school.png

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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