Posted July 7, 201312 yr hello i found out why my blocks not will get in game but i don't now how to fix it the problem is in my tickhandler i don't now why but it is here's how i start my tickhandler TickRegistry.registerTickHandler(new ServerTickHandler(), Side.SERVER); and here is my tickhandler package com.dark2222.core.handlers; import java.util.EnumSet; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import com.dark2222.itempack.armor.ModArmor; import com.dark2222.itempack.config.ModConfigCore; import com.dark2222.itempack.lib.Reference; import com.dark2222.itempack.lib.Strings; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.server.FMLServerHandler; public class ServerTickHandler implements ITickHandler{ private static boolean initializedserver = false; private static boolean initialized = false; private void onPlayerTick(EntityPlayer player){ if (player.getCurrentItemOrArmor(3) != null && player.getCurrentItemOrArmor(1) != null){ ItemStack Ochestplate = player.getCurrentItemOrArmor(3); ItemStack OBoots = player.getCurrentItemOrArmor(1); if (Ochestplate.getItem() == ModArmor.ObsidianChestPalte && OBoots.getItem() == ModArmor.ObsidianBoots ){ player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 19, 2)); } } } @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.PLAYER, TickType.SERVER))) { onPlayerTick((EntityPlayer) tickData[0]); } } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if(!initializedserver) { for (TickType ticktype : type) { if (ticktype == TickType.SERVER){ if (FMLServerHandler.instance().getServer() != null) { if(ModConfigCore.ConfigLoadFail != false || ModConfigCore.ConfigLoadFailArmor != false){ initializedserver = true; if(ModConfigCore.ConfigLoadFail == true || ModConfigCore.ConfigLoadFailArmor == true){ FMLServerHandler.instance().getServer().logWarning(Strings.CONFIG_DIFFICULTY_INGAME_CHAT); } } } } } } if(!initialized) { for (TickType ticktype : type) { if (ticktype == TickType.CLIENT){ if (FMLClientHandler.instance().getClient().currentScreen == null) { if(ModConfigCore.ConfigLoadFail != false || ModConfigCore.ConfigLoadFailArmor != false){ initialized = true; if(ModConfigCore.ConfigLoadFail == true || ModConfigCore.ConfigLoadFailArmor == true){ FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(Strings.CONFIG_DIFFICULTY_INGAME_CHAT); System.out.println("Something is wrong!"); } } } } } } } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.PLAYER, TickType.SERVER, TickType.WORLD); } @Override public String getLabel() { return Reference.MOD_NAME + ": " + this.getClass().getSimpleName(); } } fell free too look in my github too see other stuff but it is not 100% up-to-date (maby 5 days old)
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.