Jump to content

[SOLVED] Modded server crashes: not referenced class not found exception


Elix_x

Recommended Posts

When i launch my mod on server, it crashes and i get this error:

al.jar) Unloaded->Constructed->Pre-initialized
        blocktoolsarmormod{alpha 1.1.2} [block Tools Armor Mod] (BTAM-1.1.2.jar)
Unloaded->Constructed->Errored
        InstantStructuresMod{1.0} [instant Structures Mod] (IS.jar) Unloaded->Co
nstructed->Pre-initialized
[12:38:41] [server thread/ERROR] [FML]: The following problems were captured dur
ing this phase
[12:38:41] [server thread/ERROR] [FML]: Caught exception from blocktoolsarmormod

java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP

        at code.blocktoolsarmormod.registry.RegistryHandler.preinit(RegistryHand
ler.java:32) ~[RegistryHandler.class:?]
        at code.blocktoolsarmormod.BaseBlockToolsArmorMod.preinit(BaseBlockTools
ArmorMod.java:30) ~[baseBlockToolsArmorMod.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContain
er.java:513) ~[FMLModContainer.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadContro
ller.java:208) ~[LoadController.class:?]
        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadControll
er.java:187) ~[LoadController.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadControl
ler.java:118) [LoadController.class:?]
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) [Loader
.class:?]
        at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHand
ler.java:88) [FMLServerHandler.class:?]
        at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.j
ava:314) [FMLCommonHandler.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(Dedicated
Server.java:117) [lt.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) [M
inecraftServer.class:?]
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
[li.class:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityC
lientPlayerMP
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLo
ader.java:191) ~[launchwrapper-1.11.jar:?]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        ... 34 more
Caused by: java.lang.NullPointerException
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLo
ader.java:182) ~[launchwrapper-1.11.jar:?]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        ... 34 more
[12:38:41] [server thread/ERROR]: Encountered an unexpected exception
cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecra
ft/client/entity/EntityClientPlayerMP
        at cpw.mods.fml.common.LoadController.transition(LoadController.java:162
) ~[LoadController.class:?]
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:515) ~[Loade
r.class:?]
        at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHand
ler.java:88) ~[FMLServerHandler.class:?]
        at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.j
ava:314) ~[FMLCommonHandler.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(Dedicated
Server.java:117) ~[lt.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) [M
inecraftServer.class:?]
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
[li.class:?]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityCli
entPlayerMP
        at code.blocktoolsarmormod.registry.RegistryHandler.preinit(RegistryHand
ler.java:32) ~[RegistryHandler.class:?]
        at code.blocktoolsarmormod.BaseBlockToolsArmorMod.preinit(BaseBlockTools
ArmorMod.java:30) ~[baseBlockToolsArmorMod.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContain
er.java:513) ~[FMLModContainer.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadContro
ller.java:208) ~[LoadController.class:?]
        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadControll
er.java:187) ~[LoadController.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadControl
ler.java:118) ~[LoadController.class:?]
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) ~[Loade
r.class:?]
        ... 5 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityC
lientPlayerMP
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLo
ader.java:191) ~[launchwrapper-1.11.jar:?]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at code.blocktoolsarmormod.registry.RegistryHandler.preinit(RegistryHand
ler.java:32) ~[RegistryHandler.class:?]
        at code.blocktoolsarmormod.BaseBlockToolsArmorMod.preinit(BaseBlockTools
ArmorMod.java:30) ~[baseBlockToolsArmorMod.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContain
er.java:513) ~[FMLModContainer.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadContro
ller.java:208) ~[LoadController.class:?]
        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadControll
er.java:187) ~[LoadController.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadControl
ler.java:118) ~[LoadController.class:?]
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) ~[Loade
r.class:?]
        ... 5 more
Caused by: java.lang.NullPointerException
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLo
ader.java:182) ~[launchwrapper-1.11.jar:?]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
        at code.blocktoolsarmormod.registry.RegistryHandler.preinit(RegistryHand
ler.java:32) ~[RegistryHandler.class:?]
        at code.blocktoolsarmormod.BaseBlockToolsArmorMod.preinit(BaseBlockTools
ArmorMod.java:30) ~[baseBlockToolsArmorMod.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContain
er.java:513) ~[FMLModContainer.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadContro
ller.java:208) ~[LoadController.class:?]
        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadControll
er.java:187) ~[LoadController.class:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscribe
r.java:74) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(Sy
nchronizedEventSubscriber.java:47) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[min
ecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.jav
a:304) ~[minecraft_server.1.7.10.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecra
ft_server.1.7.10.jar:?]
        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadControl
ler.java:118) ~[LoadController.class:?]
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) ~[Loade
r.class:?]
        ... 5 more
[12:38:41] [server thread/ERROR]: This crash report has been saved to: C:\my\pro
grams\minecraft\server-1.7-mods\.\crash-reports\crash-2014-11-09_12.38.41-server
.txt
[12:38:41] [server thread/WARN] [FML]: Can't revert to frozen GameData state wit
hout freezing first.
[12:38:41] [server thread/INFO] [FML]: Applying holder lookups
[12:38:41] [server thread/INFO] [FML]: Holder lookups applied
[12:38:41] [server thread/INFO] [FML]: The state engine was in incorrect state E
RRORED and forced into state SERVER_STOPPED. Errors may have been discarded.
[12:38:41] [server thread/INFO] [FML]: The state engine was in incorrect state E
RRORED and forced into state AVAILABLE. Errors may have been discarded.

C:\my\programs\minecraft\server-1.7-mods>

It says that class RegistryHandler is errored on EntityPlayerMP, but RegistryHandler has no any reference to EntityPlayerMP.

RegistryHandler.java:

package code.blocktoolsarmormod.registry;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import code.blocktoolsarmormod.world.worldgen.BlockToolsArmorModWorldGen;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

public class RegistryHandler {
//worldgen
static BlockToolsArmorModWorldGen eventWorldGen = new BlockToolsArmorModWorldGen();
//creative tabs
public static CreativeTabs blocktoolsarmortab;

public static void preinit(FMLPreInitializationEvent event)
{ //tabs
	blocktoolsarmortab = new CreativeTabs("blocktoolsarmortabtab"){
		public Item getTabIconItem() {
			return ItemBlockRegistry.bedrockpickaxe;
		}
	};
	//worldgen
	GameRegistry.registerWorldGenerator(eventWorldGen, 1);
	ItemBlockRegistry.preinit(event);
	ExplosivesRegistry.preinit(event);
	RecipesRegistry.preinit(event);
	BiomesRegistry.preinit(event);
	DimensionRegistry.preinit(event);
	FMLCommonHandler.instance().bus().register(new BTAMKeyRegistry());

}

public static void init(FMLInitializationEvent event)
{ 
	ItemBlockRegistry.init(event);
	ExplosivesRegistry.init(event);
	RecipesRegistry.init(event);
	BiomesRegistry.init(event);
	DimensionRegistry.init(event);

}

public static void postinit(FMLPostInitializationEvent event)
{ 
	ItemBlockRegistry.postinit(event);
	ExplosivesRegistry.postinit(event);
	RecipesRegistry.postinit(event);
	BiomesRegistry.postinit(event);
	DimensionRegistry.postinit(event);
}
}

Link to comment
Share on other sites

EntityPlayerMP is client class, i know. But in RegistryHandler there is no any reference at all to it.

package code.blocktoolsarmormod.registry;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import code.blocktoolsarmormod.world.worldgen.BlockToolsArmorModWorldGen;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

public class RegistryHandler {
//worldgen
static BlockToolsArmorModWorldGen eventWorldGen = new BlockToolsArmorModWorldGen();
//creative tabs
public static CreativeTabs blocktoolsarmortab;

public static void preinit(FMLPreInitializationEvent event)
{ //tabs
	blocktoolsarmortab = new CreativeTabs("blocktoolsarmortabtab"){
		public Item getTabIconItem() {
			return ItemBlockRegistry.bedrockpickaxe;
		}
	};
	//worldgen
	GameRegistry.registerWorldGenerator(eventWorldGen, 1);
	ItemBlockRegistry.preinit(event);
	ExplosivesRegistry.preinit(event);
	RecipesRegistry.preinit(event);
	BiomesRegistry.preinit(event);
	DimensionRegistry.preinit(event);
	FMLCommonHandler.instance().bus().register(new BTAMKeyRegistry());

}

public static void init(FMLInitializationEvent event)
{ 
	ItemBlockRegistry.init(event);
	ExplosivesRegistry.init(event);
	RecipesRegistry.init(event);
	BiomesRegistry.init(event);
	DimensionRegistry.init(event);

}

public static void postinit(FMLPostInitializationEvent event)
{ 
	ItemBlockRegistry.postinit(event);
	ExplosivesRegistry.postinit(event);
	RecipesRegistry.postinit(event);
	BiomesRegistry.postinit(event);
	DimensionRegistry.postinit(event);
}
}

Link to comment
Share on other sites

BTAMKeyRegistry doesn't contain EntityPlayerMP too. How ever i'll try to register key bindings only on client side.

package code.blocktoolsarmormod.registry;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;

import org.lwjgl.input.Keyboard;

import code.blocktoolsarmormod.explosives.entities.EntityCTNTPrimed;
import code.blocktoolsarmormod.items.tools.Axes;
import code.blocktoolsarmormod.items.tools.Hoes;
import code.blocktoolsarmormod.items.tools.Pickaxes;
import code.blocktoolsarmormod.items.tools.Shovels;
import code.blocktoolsarmormod.items.tools.Swords;
import code.blocktoolsarmormod.items.tools.UltimateTools;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;

public class BTAMKeyRegistry {

private static final String desc = "BTAM universal key";
private static final int keyValues = Keyboard.KEY_B ;
public static KeyBinding keys;

public BTAMKeyRegistry() {
	keys = new KeyBinding(desc, keyValues, "BTAM");
	ClientRegistry.registerKeyBinding(keys);
}

@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
	if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
		if (keys.isPressed()) {
			EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
			World world = entity.worldObj;
			boolean field_14256_a = true;

			if(entity.getHeldItem().getItem() == ItemBlockRegistry.ultimateunstablestar || entity.getHeldItem().getItem() == ItemBlockRegistry.bigultimateunstablestar){
				if(((UltimateTools) entity.getHeldItem().getItem()).mode == 0){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 2;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 3;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 4;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((UltimateTools) entity.getHeldItem().getItem()).mode = 5;
				}	
			} else if(entity.getHeldItem().getItem() == ItemBlockRegistry.unstablestaraxe || entity.getHeldItem().getItem() == ItemBlockRegistry.bigunstablestaraxe){
				if(((Axes) entity.getHeldItem().getItem()).mode == 0){
					((Axes) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((Axes) entity.getHeldItem().getItem()).mode = 1;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((Axes) entity.getHeldItem().getItem()).mode = 2;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((Axes) entity.getHeldItem().getItem()).mode = 3;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((Axes) entity.getHeldItem().getItem()).mode = 4;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((Axes) entity.getHeldItem().getItem()).mode = 5;
				}	
			}else if(entity.getHeldItem().getItem() == ItemBlockRegistry.unstablestarpickaxe || entity.getHeldItem().getItem() == ItemBlockRegistry.bigunstablestarpickaxe){
				if(((Pickaxes) entity.getHeldItem().getItem()).mode == 0){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 1;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 2;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 3;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 4;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((Pickaxes) entity.getHeldItem().getItem()).mode = 5;
				}	
			}else if(entity.getHeldItem().getItem() == ItemBlockRegistry.unstablestarshovel || entity.getHeldItem().getItem() == ItemBlockRegistry.bigunstablestarshovel){
				if(((Shovels) entity.getHeldItem().getItem()).mode == 0){
					((Shovels) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((Shovels) entity.getHeldItem().getItem()).mode = 1;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((Shovels) entity.getHeldItem().getItem()).mode = 2;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((Shovels) entity.getHeldItem().getItem()).mode = 3;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((Shovels) entity.getHeldItem().getItem()).mode = 4;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((Shovels) entity.getHeldItem().getItem()).mode = 5;
				}	
			}else if(entity.getHeldItem().getItem() == ItemBlockRegistry.unstablestarsword || entity.getHeldItem().getItem() == ItemBlockRegistry.bigunstablestarsword){
				if(((Swords) entity.getHeldItem().getItem()).mode == 0){
					((Swords) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((Swords) entity.getHeldItem().getItem()).mode = 1;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((Swords) entity.getHeldItem().getItem()).mode = 2;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((Swords) entity.getHeldItem().getItem()).mode = 3;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((Swords) entity.getHeldItem().getItem()).mode = 4;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((Swords) entity.getHeldItem().getItem()).mode = 5;
				}	
			}else if(entity.getHeldItem().getItem() == ItemBlockRegistry.unstablestarhoe || entity.getHeldItem().getItem() == ItemBlockRegistry.bigunstablestarhoe){
				if(((Hoes) entity.getHeldItem().getItem()).mode == 0){
					((Hoes) entity.getHeldItem().getItem()).mode = 1;
				}
				if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)){
					((Hoes) entity.getHeldItem().getItem()).mode = 1;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)){
					((Hoes) entity.getHeldItem().getItem()).mode = 2;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)){
					((Hoes) entity.getHeldItem().getItem()).mode = 3;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)){
					((Hoes) entity.getHeldItem().getItem()).mode = 4;
				} else if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)){
					((Hoes) entity.getHeldItem().getItem()).mode = 5;
				}	
			}else if(entity.getHeldItem().getItem() == ItemBlockRegistry.lightsaber){
				world.playSound(entity.posX, entity.posY, entity.posZ, "blocktoolsarmormod:lightsaber_off", 1.0f, 1.0f, true);
				NBTTagCompound tag = new NBTTagCompound();
				entity.getHeldItem().writeToNBT(tag);
				tag.setShort("id", (short) Item.getIdFromItem(ItemBlockRegistry.lightsaberoff));
				entity.getHeldItem().readFromNBT(tag);
			} else if(entity.getHeldItem().getItem() == ItemBlockRegistry.lightsaberoff){
				world.playSound(entity.posX, entity.posY, entity.posZ, "blocktoolsarmormod:lightsaber_on", 1.0f, 1.0f, true);
				NBTTagCompound tag = new NBTTagCompound();
				entity.getHeldItem().writeToNBT(tag);
				tag.setShort("id", (short) Item.getIdFromItem(ItemBlockRegistry.lightsaber));
				entity.getHeldItem().readFromNBT(tag);
			} else {

			}
		}
	}
}

}

Link to comment
Share on other sites

Not exactly, i made it different way, i just changed this:

if(event.getSide() == Side.CLIENT)
		FMLCommonHandler.instance().bus().register(new BTAMKeyRegistry());

And now it works fine...

MORE THEN THAT: Code in BTAMKeyRegistry still works without packets...

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.
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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • The version of what? I just imported the MDK into Eclipse. I haven't made any edits to the Java code in it or even any other files. I haven't even gotten to changing the modid from "examplemod" yet.
    • Captain WebGenesis is a Cyber skilled hacker with special abilities and skills that enact penetration to help victims of Crypto Fraudulent activities who are faced with cyber challenges get back their lost funds. Simply file your complaint through the website (https://captainwebgenesis. com) and have all your crypto recovered back.
    • The crash log keeps saying something about the tick rate. Can someone please help me fix?   ---- Minecraft Crash Report ---- // Everything's going to plan. No, really, that was supposed to happen. Time: 2024-06-21 16:24:55 Description: Exception in server tick loop java.lang.NullPointerException: Cannot invoke "com.cobblemon.mod.common.api.conditional.RegistryLikeCondition.fits(Object, net.minecraft.core.Registry)" because "condition" is null at com.cobblemon.mod.common.api.spawning.condition.SpawningCondition.fits(SpawningCondition.java:85) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.condition.AreaTypeSpawningCondition.fits(AreaTypeSpawningCondition.java:30) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.condition.GroundedTypeSpawningCondition.fits(GroundedTypeSpawningCondition.java:28) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.condition.GroundedTypeSpawningCondition.fits(GroundedTypeSpawningCondition.java:24) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.condition.SpawningCondition.isSatisfiedBy(SpawningCondition.java:68) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.detail.SpawnDetail.isSatisfiedBy(SpawnDetail.java:78) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.spawner.Spawner$DefaultImpls.getMatchingSpawns(Spawner.java:42) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.spawner.TickingSpawner.getMatchingSpawns(TickingSpawner.java:31) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.selection.FlatContextWeightedSelector.getSelectionData(FlatContextWeightedSelector.java:79) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.selection.FlatContextWeightedSelector.select(FlatContextWeightedSelector.java:106) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.spawner.AreaSpawner.run(AreaSpawner.java:94) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.spawner.TickingSpawner.tick(TickingSpawner.java:71) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.spawning.SpawnerManager.onServerTick(SpawnerManager.java:58) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.events.ServerTickHandler.onTick(ServerTickHandler.java:20) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.Cobblemon$initialize$7.invoke(Cobblemon.java:368) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.Cobblemon$initialize$7.invoke(Cobblemon.java:368) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.reactive.ObservableSubscription.handle(ObservableSubscription.java:16) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.common.api.reactive.SimpleObservable.emit(SimpleObservable.java:39) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.forge.event.ForgePlatformEventHandler.onTick(ForgePlatformEventHandler.kt:172) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading} at com.cobblemon.mod.forge.event.__ForgePlatformEventHandler_onTick_ServerTickEvent.invoke(.dynamic) ~[Cobblemon-forge-1.5.2+1.20.1.jar%23121!/:?] {re:classloading,pl:eventbus:B} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.event.ForgeEventFactory.onPostServerTick(ForgeEventFactory.java:950) ~[forge-1.20.1-47.2.17-universal.jar%23138!/:?] {re:classloading} at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:835) ~[server-1.20.1-20230612.114412-srg.jar%23133!/:?] {re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23133!/:?] {re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23133!/:?] {re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:840) ~[?:?] {re:mixin}
    • okay i've managed to fix it. looks like i made the stupidest error known to man. i hadn't installed forge to the client, which i assumed only affected the launcher which wouldn't affect me because i used a third party one. evidently not. the more you know
    • tried a fresh install of above and beyond with java 8 installed. got a popup that says "Error: Unable to access jarfile forge-1.16.5-36.2.8.jar". every good programmer knows getting a different error means you've made progress!
  • Topics

×
×
  • Create New...

Important Information

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