Jump to content

[SOLVED] TickEvent doesn't fire


Link_

Recommended Posts

So , well my onTick(TickEvent) function doens't work, I don't know why, the other 2 events in the same class work just fine.

 

Code:

EventHandler:

 

 

package defence.mc.craftyutils;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import defence.mc.craftyutils.items.ItemLambRaw;

public class EventHandlerCraftyUtils {

@SubscribeEvent
public void onEntityDeath(LivingDeathEvent par1LivingDeathEvent) {
	if (par1LivingDeathEvent.entityLiving instanceof EntitySheep) {
		if (par1LivingDeathEvent.entityLiving.isChild()) {
			par1LivingDeathEvent.entityLiving.dropItem(ItemLambRaw.item, 1);
		}
	}
}

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onGuiOpen(GuiOpenEvent par1GuiOpenEvent) {
	if (par1GuiOpenEvent.gui instanceof GuiMainMenu) {
		CallQueue.addToQueue(new QueueElement(2) {

			@Override
			public void onCall() {
				// TODO Auto-generated method stub
				Minecraft.getMinecraft().displayGuiScreen(new GuiMultiplayer(null));
			}
		});

	}
} 

@SubscribeEvent
public void onTick(TickEvent par1TickEvent) {
	System.out.println("hi");
	CallQueue.onTick();
}
}

 

 

 

Main Class

 

 

package defence.mc.craftyutils;

import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import defence.mc.craftyutils.server.CommonProxy;

@Mod(modid="CraftyUtils", name="Crafty Utils", version="r0")
public class CraftyUtils {

@Instance(value="CraftyUtils")
public static CraftyUtils instance;

@SidedProxy(clientSide="defence.mc.craftyutils.client.ClientProxy", serverSide="defence.mc.craftyutils.server.CommonProxy")
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	MinecraftForge.EVENT_BUS.register(new EventHandlerCraftyUtils());
}

@EventHandler
public void load(FMLInitializationEvent event) {
	proxy.registerRenderers();

	Utils.addItems();
	Utils.addBlocks();
	Recipes.add();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {

}
}

 

 

Please help!

 

-Link

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.

Announcements



×
×
  • Create New...

Important Information

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