Jump to content

xwerswoodx

Forge Modder
  • Posts

    80
  • Joined

  • Last visited

Posts posted by xwerswoodx

  1. Ah yes you true, I fixed it thanks and also my block is extend by Block so how can I replace in this code to IBlockState or how can I get it?

     

    I fixed it like

    IBlockState state = (IBlockState)str.getBlockState();

     

    But I am not sure if it is work or not. Anyway, what is the BlockState holds on? I saw some different code like "world.getBlockState(BlockPos)", can I use this like;

     

    if world.getBlockState(BlockPos) == Block.coal_ore

     

    These are very different, we need to learn everything in every version uh. Is there any documentations about new functions n 1.8

  2. Hello All;

     

    at 1.7.10 we use this to generate blocks;

     

    package net.extend.mod.functions;
    
    import java.util.Random;
    
    import net.extend.mod.blockref;
    import net.extend.mod.configref;
    import net.minecraft.block.Block;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.BlockPos;
    import net.minecraft.world.World;
    import net.minecraft.world.chunk.IChunkProvider;
    import net.minecraft.world.gen.feature.WorldGenMinable;
    import net.minecraftforge.fml.common.IWorldGenerator;
    
    public class generation implements IWorldGenerator {
    
    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    
    	switch (world.provider.getDimensionId()) {
    	case -1:
    		generateNether();
    		break;
    	case 0:
    		//generateSurface(world, random, chunkX * 16, chunkZ * 16, blockref.acidOre, 5, 50);
    		generateSurface(world, random, chunkX * 16, chunkZ * 16, blockref.blackDiamondOre, 4, 12);
    		generateSurface(world, random, chunkX * 16, chunkZ * 16, blockref.nightOre, 3, 10);
    		break;
    	case 1:
    		generateEnd();
    		break;
    	}
    }
    
    //generateSurface(WORLD, RANDOM, CHUNKX * 16, CHUNKY * 16, AcidMod.ore.blockID, AMOUNT, Y)
    public void generateSurface(World world, Random random, int chunkX, int chunkZ, Block str, int amount, int chunkY) {
    	for (int i=0; i < 20; i++) {
    		int oreX = chunkX + random.nextInt(16);
    		int oreY = random.nextInt(chunkY);
    		int oreZ = chunkZ + random.nextInt(16);
    		(new WorldGenMinable(str, amount)).generate(world, random, oreX, oreY, oreZ);
    	}
        }
    

     

    But in 1.8 version, we need to use BlockPos, but in here we calculate X, Y and Z's coordinates to place, so how can I update this X, Y, Z to BlockPos?

     

    Edit: also when I add new block, what is it's block state? how can I use it?

  3. I saw some mods use .obj file and I try to add my obj file but I couldn't. I remove all the code and I start again.

     

    I want to give a new texture to my block.

     

     

    public static Block nightBlock;
           	this.nightBlock = new addblock("nightblock", Material.iron, Block.soundTypeStone, 2.0F, "pickaxe", 2);
    

     

    public class addblock extends Block {
    public addblock(String name, Material material, SoundType sound, float hardness, String item, int level) {
    	super(material);
    
    	this.setHardness(hardness);
    	this.setStepSound(sound);
                    this.setCreativeTab(CreativeTabs.tabBlock);
                    this.setBlockName(name);
                    this.setBlockTextureName(name);
                    this.setHarvestLevel(item, level);
                    GameRegistry.registerBlock(this, name);
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister reg) {
    	this.blockIcon = reg.registerIcon(ref.uid + ":" + this.getTextureName());
    }
    }

     

    But I didn't understand how can I add my obj file.

     

    My obj file location is; mod:textures/models/obj/hamit.obj

  4. I solved it with TickHandler onPlayerTick...

     

    I tried;

    @EventHandler
    public void init(FMLInitializationEvent event) {
    //		proxy.registerRenders();
    //		FMLCommonHandler.instance().bus().register(new ServerTickHandler());
        FMLCommonHandler.instance().bus().register(new NewTickHandler());
    //		proxy.registerServerTickHandler();
        MinecraftForge.EVENT_BUS.register(new ModEntityHandler());
        MinecraftForge.EVENT_BUS.register(new DropHandler());
    //	    MinecraftForge.EVENT_BUS.register(new SoundLoadHandler());
        EntityRegistry.registerModEntity(EntityNewFishHook.class, "Entity New Fish Hook", 216, this, 75, 1, true);
    }
    

     

    public class NewTickHandler {
    
    @SubscribeEvent
     public void onPlayerTick(TickEvent.PlayerTickEvent event) {
    	EntityPlayer player = event.player;
    	InventoryPlayer inventory = player.inventory;
    
    	 if (inventory.hasItem(itemref.coalMeter)) {
    		 ((ItemCoalMeter)itemref.coalMeter).initProps();
    	 }
    }
    
    
     //Called when the client ticks. 
     @SubscribeEvent
     public void onClientTick(TickEvent.ClientTickEvent event) {
    
    }
    
     //Called when the server ticks. Usually 20 ticks a second. 
     @SubscribeEvent
     public void onServerTick(TickEvent.ServerTickEvent event) {
    
    }
    
     //Called when a new frame is displayed (See fps) 
     @SubscribeEvent
     public void onRenderTick(TickEvent.RenderTickEvent event) {
    
    }
    
     //Called when the world ticks
     @SubscribeEvent
     public void onWorldTick(TickEvent.WorldTickEvent event) {
    
    }
    }
    

     

  5. When I search at internet I found a code named Diamond Meter and try to understand its method. But Inetworkhandler and customsendpacket sections not work I decode code something like this;

     

    package net.extend.mod.items;
    
    import java.util.ArrayList;
    import java.util.Date;
    
    import javax.swing.Icon;
    
    import sun.rmi.runtime.RuntimeUtil.GetInstanceAction;
    import sun.security.jca.GetInstance;
    import cpw.mods.fml.client.FMLClientHandler;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.extend.mod.ref;
    import net.extend.mod.functions.writeline;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.World;
    
    public class ItemCoalMeter extends Item {
    
    private IIcon[] iconIndexes = new IIcon[5];
    private Long lastUpdate = Long.valueOf(0L);
    private Long millisPerUpdate = Long.valueOf(100L);
    private ArrayList found = new ArrayList();
    private static int distanceShortest = -1;
    private int distanceMax = 8;
    private int[] vectorShortest = new int[3];
    private int distancePerLevel;
    
    public ItemCoalMeter(String name) {
    	super();
    	this.maxStackSize=1;
    	this.setCreativeTab(CreativeTabs.tabTools);
    	this.setUnlocalizedName(name);
    	GameRegistry.registerItem(this, name);
    	writeline.s("hamit.txt", "x1");
    	initProps();
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerIcons(IIconRegister reg) {
    	for (int x=0; x < 5; x++) {
    		iconIndexes[x] = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_" + x);
    	}
    //		iconIndexes[0] = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_0");
    	this.itemIcon = iconIndexes[0];
    }
    
    public void initProps() {
    	Minecraft mc = FMLClientHandler.instance().getClient(); //ModLoader.getMinecraftInstance();
    	writeline.s("hamit.txt", "x2");
    	update(mc);
    }
    
    @SideOnly(Side.CLIENT)
    public void onUpdate(ItemStack stack, World world, EntityPlayer player, int par4, boolean par5) {
    	Minecraft mc = FMLClientHandler.instance().getClient();
    	writeline.s("hamit.txt", "x3");
    	update(mc);
    }
    
    @SideOnly(Side.CLIENT)
    public void update(Minecraft mc) {
    	writeline.s("hamit.txt", "x4");
    
    	if (new Date().getTime() <= lastUpdate.longValue() + millisPerUpdate.longValue()) {
    		return ;
    	}
    	lastUpdate = Long.valueOf(new Date().getTime());
    
    	found.clear();
    	distanceShortest = -1;
    
    	EntityPlayer player = mc.thePlayer;
    	World world = mc.theWorld;
    
    	if ((player == null) || (world == null)) {
    		return;
    	}
    
    	double cur_x = player.posX;
    	double cur_y = player.posY;
    	double cur_z = player.posZ;
    	writeline.d("hamit.txt", player.posX);
    	writeline.d("hamit.txt", player.posY);
    	writeline.d("hamit.txt", player.posZ);
    	int min_x = (int)cur_x - distanceMax - 1;
    	int min_y = (int)cur_y - distanceMax;
    	int min_z = (int)cur_z - distanceMax;
    
    	int max_x = (int)cur_x + distanceMax;
    	int max_y = (int)cur_y + distanceMax;
    	int max_z = (int)cur_z + distanceMax + 1;
    	writeline.i("hamit.txt", min_x);
    	writeline.i("hamit.txt", min_y);
    	writeline.i("hamit.txt", min_z);
    	writeline.i("hamit.txt", max_x);
    	writeline.i("hamit.txt", max_y);
    	writeline.i("hamit.txt", max_z);
    
    	for (int z1 = min_z; z1 < max_z; z1++) {
    		for (int x1 = min_x; x1 < max_x; x1++) {
    			for (int y1 = min_y; y1 < max_y; y1++) {
    				if (world.getBlock(x1, y1, z1) == Blocks.coal_ore) {
    					found.add(new int[] { x1, y1, z1 });
    					writeline.s("hamit.txt", "Bulundu!");
    				}
    			}
    		}
    	}
    
    	for (int i = 0; i < found.size(); i++) {
    		int[] block = (int[])found.get(i);
    
    		double distanceX = block[0] - cur_x;
    		double distanceY = block[1] - cur_y + 1.0D;
    		double distanceZ = block[2] - cur_z;
    
    		distanceX += (distanceX > 0.0D ? 1.0D : 0.0D);
    		distanceZ += (distanceZ > 0.0D ? 1.0D : 0.0D);
    
    		double distance2D = Math.sqrt(Math.pow(distanceX, 2.0D) + Math.pow(distanceZ, 2.0D));
    		double distance3D = Math.sqrt(Math.pow(distance2D, 2.0D) + Math.pow(distanceY, 2.0D));
    
    		if ((int)distance3D > distanceMax) {
    			found.remove(i);
    			i--;
    		} else if ((distanceShortest > distance3D) || (distanceShortest == -1)) {
    			distanceShortest = (int)distance3D;
    			vectorShortest = new int[] { block[0], block[1], block[2] };
    		}
    	}
    
        distancePerLevel = distanceMax / 4;
        if (distancePerLevel < 1) {
          distancePerLevel = 1;
        }
        
    	if (distanceShortest > -1) {
    		int level = (distanceMax - distanceShortest + 1) / distancePerLevel;
    		if (distanceMax < 4) {
    			level +=4 - distanceMax;
    		}
    		this.itemIcon = iconIndexes[level];
    	} else {
    		this.itemIcon = iconIndexes[0];
    	}
    }
    
    @SideOnly(Side.CLIENT)
    public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) {
    	return true;
    }
    }
    

     

    But its not working and Hamit.txt;

     

    x1

    x2

    x4

     

    --> x3 (which is onUpdate) never typed in txt

  6. Halfway the itemclass there is this handy method:

     

        /**
         * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
         * update it's contents.
         */
        public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {}
    

     

    I tried it but it didn't ticked :(

     

    hi

     

    If that doesn't work for you, you could always hook the general tick event and check all the inventory slots to see if your item is in any of them.

     

    -TGG

     

    But which one because I tried TickHandler -> onPlayerTick but I couldn't :/

  7.                 block1.setBlockTextureName(MODID + ":" + "block1.png"); 

     

    if you add .PNG at the end of the name it try to find MODID/textures/blocks/block1.png.png

     

                    block1.setBlockTextureName(MODID + ":block1"); 

     

    try this. And if this isn't work try this;

                    block1.setBlockTextureName("block1"); 

     

    and add block1.java

    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister reg) {
    	this.blockIcon = reg.registerIcon(learning.MODID + ":" + this.getTextureName());
    }
    

     

    Or also you can use my addBlock function

     

    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.extend.mod.ref;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraft.util.IIcon;
    
    public class addblock extends Block {
    public addblock(String name, Material material, SoundType sound, float hardness, String item, int level) {
    	super(material);
    
    	this.setHardness(hardness);
    	this.setStepSound(sound);
    	this.setCreativeTab(CreativeTabs.tabBlock);
    	this.setBlockName(name);
    	this.setBlockTextureName(name);
    	this.setHarvestLevel(item, level);
    	GameRegistry.registerBlock(this, name);
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister reg) {
    	this.blockIcon = reg.registerIcon(ref.uid + ":" + this.getTextureName());
    }
    }
    

     

    when you register;

    public static Block blackDiamondOre;
    public static Block blackDiamondBlock;
    
    this.blackDiamondBlock = new addblock("blackdiamondblock", Material.iron, Block.soundTypeStone, 2.0F, "pickaxe", 2);
           	this.blackDiamondOre = new addore("blackdiamondore", Block.soundTypeStone, 4.0F, "pickaxe", 2);
    

  8. Ok, now I fixed it, I don't know how because I tried many things in same time sorry. However, I think maybe @larsgerrits way is my solution.

     

    Anyway, I have a problem about return items;

     

    When I type foodref.vegTomato at func_149865_P() it return but when I type this.Crop which is protected Item and equals to crop (foodref.vegTomato) it isn't return.

     

    I couldn't explain well, I can try to give an example;

     

    Not Return:

        protected Item func_149865_P() {
            return this.Crop;
        }

     

    Return:

        protected Item func_149865_P() {
            return foodref.vegTomato;
        }

     

    Update: when I try to see String.valueOf(crop) it returns null. I think this is my problem.

     

    Second Update: I find the problem about crash and the problem is blockref(); place. And when I did @larsgerrits it solved. Maybe someone still have a problem like this, this can help them.

  9. java.lang.NullPointerException: Unexpected error
    at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(SourceFile:57)
    at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:595)
    at net.minecraft.world.World.setBlock(World.java:441)
    at net.minecraft.world.World.setBlock(World.java:576)
    at net.extend.mod.functions.addseed.onItemUse(addseed.java:48)

    What's on line 48 in the addseed class?

     

    BTW, You might want to look at some Java Coding Conventions, cause your naming is horrible.

     

        public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
            if (p_77648_7_ != 1) { return false; }
            else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) {
                if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) {
                	p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a);
                    --p_77648_1_.stackSize;
                    return true;
                } else { return false; }
            } else { return false; }
        }
    

     

    Line 48:

                	p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a);
    

     

    All I can see from a cursory look is that you neglect to call your superclass constructors. This is normally a serious omission.

     

    Also, you have no naming convention being used in your mod code. Variable have Searge names, or uppercase names, and classes have any case (upper, lower, whatever) that happens to hit your fancy names. Yeah, this is a hodge-podge of bad code that will always be hard to understand or debug.

     

    Frankly, I don't think you understand how the seed / plant interfaces even work.

    Registering a block or item should not be done in the constructor. Do it after constructing your item/block, then you have a reference to use or compare against.

    Did you even use the FMLPreinitialization event to create your block and item? One thing to note, is your method leads to recursive nullity either you create your seed with a null plant black, or you create your plant with a null seed item. Either way, your gonna fail.

    A seed item has to be associated with a plant block. I don't see that here (plant block created after seed registers it), and so it seems something is trying to place a null block in the world. I recon it's your seed,

     

    Yes i don't really understand honestly, I'm starting to coding maybe 3 months and maybe open eclipse 4 or 5 times because I don't have time so much.

     

    I have preinit;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    
    	configref.Settings(event);
    	new itemref();
    	new armorref();
    	new foodref();
    	new blockref();
    	new reciperef();
            
            //Generation
            GameRegistry.registerWorldGenerator(new generation(), 1);
    }
    

     

    All the registries in *ref classes. The first code I gave at my first post is from itemref()

     

    package net.extend.mod;
    
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraftforge.common.EnumPlantType;
    import net.extend.mod.functions.addaxe;
    import net.extend.mod.functions.addbattleaxe;
    import net.extend.mod.functions.addbow;
    import net.extend.mod.functions.addcrop;
    import net.extend.mod.functions.adddisc;
    import net.extend.mod.functions.addfishingrod;
    import net.extend.mod.functions.addhoe;
    import net.extend.mod.functions.additem;
    import net.extend.mod.functions.addpickaxe;
    import net.extend.mod.functions.addseed;
    import net.extend.mod.functions.addshovel;
    import net.extend.mod.functions.addsword;
    
    public class itemref {
    
    //Items
    public static Item stoneBow;
    public static Item ironBow;
    public static Item goldBow;
    public static Item diamondBow;
    public static Item blackDiamond;
    public static Item blackDiamondSword;
    public static Item blackDiamondAxe;
    public static Item blackDiamondBow;
    public static Item blackDiamondHoe;
    public static Item blackDiamondPickaxe;
    public static Item blackDiamondShovel;
    public static Item nightIngot;
    public static Item nightSword;
    public static Item nightAxe;
    public static Item nightBow;
    public static Item nightHoe;
    public static Item nightPickaxe;
    public static Item nightShovel;
    public static Item blackDiamondBattleAxe;
    public static Item diamondBattleAxe;
    public static Item goldBattleAxe;
    public static Item ironBattleAxe;
    public static Item stoneBattleAxe;
    public static Item woodBattleAxe;
    public static Item nightBattleAxe;
    public static Item cup;
    public static Item discWish;
    public static Item discJingle;
    public static Item discCarol;
    public static Item discBirGorusKabininde;
    public static Item discAhSensiz;
    public static Item discKoNewYear;
    public static Item discNumb;
    public static Item discBeautifulMind;
    public static Item discSomebodyToldMe;
    public static Item discKids;
    public static Item discGhostsNStuff;
    public static Item discVivaLaVida;
    public static Item discApplause;
    public static Item discDiamonds;
    public static Item discMovesLikeJagger;
    public static Item discRapGod;
    public static Item discSetFireToRain;
    public static Item discSurvival;
    public static Item stoneFishingRod;
    public static Item ironFishingRod;
    public static Item goldFishingRod;
    public static Item diamondFishingRod;
    public static Item blackDiamondFishingRod;
    public static Item nightFishingRod;
    public static Item fishBones;
    public static Item tinCan;
    public static Item boundLeather;
    public static Item tannedLeather;
    public static Item zombieLeather;
    
    public static Item tomatoSeed;
    
    public itemref() {
    
            //Add Item
    	stoneBow = new addbow("stonebow", ToolMaterial.STONE);
    	ironBow = new addbow("ironbow", ToolMaterial.IRON);
    	goldBow = new addbow("goldbow", ToolMaterial.GOLD);
    	diamondBow = new addbow("diamondbow", ToolMaterial.EMERALD);
    	blackDiamondBow = new addbow("blackdiamondbow", extend.ToolMaterial_BLACKDIAMOND);
    	blackDiamond = new additem(64, "blackdiamond", CreativeTabs.tabMaterials, false);
    	blackDiamondSword = new addsword("blackdiamondsword", extend.ToolMaterial_BLACKDIAMOND);
    	blackDiamondAxe = new addaxe("blackdiamondaxe", extend.ToolMaterial_BLACKDIAMOND);
    	blackDiamondHoe = new addhoe("blackdiamondhoe", extend.ToolMaterial_BLACKDIAMOND);
    	blackDiamondPickaxe = new addpickaxe("blackdiamondpickaxe", extend.ToolMaterial_BLACKDIAMOND);
    	blackDiamondShovel = new addshovel("blackdiamondshovel", extend.ToolMaterial_BLACKDIAMOND);
    	nightIngot = new additem(64, "nightingot", CreativeTabs.tabMaterials, false);
    	nightSword = new addsword("nightsword", extend.ToolMaterial_NIGHT);
    	nightAxe = new addaxe("nightaxe", extend.ToolMaterial_NIGHT);
    	nightBow = new addbow("nightbow", extend.ToolMaterial_NIGHT);
    	nightHoe = new addhoe("nighthoe", extend.ToolMaterial_NIGHT);
    	nightPickaxe = new addpickaxe("nightpickaxe", extend.ToolMaterial_NIGHT);
    	nightShovel = new addshovel("nightshovel", extend.ToolMaterial_NIGHT);
    	blackDiamondBattleAxe = new addbattleaxe("blackdiamondbattleaxe", extend.ToolMaterial_BLACKDIAMOND);
    	diamondBattleAxe = new addbattleaxe("diamondbattleaxe", ToolMaterial.EMERALD);
    	goldBattleAxe = new addbattleaxe("goldbattleaxe", ToolMaterial.GOLD);
    	ironBattleAxe = new addbattleaxe("ironbattleaxe", ToolMaterial.IRON);
    	stoneBattleAxe = new addbattleaxe("stonebattleaxe", ToolMaterial.STONE);
    	woodBattleAxe = new addbattleaxe("woodbattleaxe", ToolMaterial.WOOD);
    	nightBattleAxe = new addbattleaxe("nightbattleaxe", extend.ToolMaterial_NIGHT);
    	cup = new additem(64, "cup", CreativeTabs.tabMisc, false);
    	discWish = new adddisc("discwish", "wish");
    	discJingle = new adddisc("discjingle", "jingle");
    	discCarol = new adddisc("disccarol", "carol");
    	discBirGorusKabininde = new adddisc("discbirgoruskabininde", "birgoruskabininde");
    	discAhSensiz = new adddisc("discahsensiz", "ahsensiz");
    	discKoNewYear = new adddisc("disckonewyear", "konewyear");
    	discNumb = new adddisc("discnumb", "numb");
    	discBeautifulMind = new adddisc("discbeautifulmind", "beautifulmind");
    	discSomebodyToldMe = new adddisc("discsomebodytoldme", "somebodytoldme");
    	discKids = new adddisc("disckids", "kids");
    	discGhostsNStuff = new adddisc("discghostsnstuff", "ghostsnstuff");
    	discVivaLaVida = new adddisc("discvivalavida", "vivalavida");
    	discApplause = new adddisc("discapplause", "applause");
    	discDiamonds = new adddisc("discdiamonds", "diamonds");
    	discMovesLikeJagger = new adddisc("discmoveslikejagger", "moveslikejagger");
    	discRapGod = new adddisc("discrapgod", "rapgod");
    	discSetFireToRain = new adddisc("discsetfiretorain", "setfiretorain");
    	discSurvival = new adddisc("discsurvival", "survival");
    	stoneFishingRod = new addfishingrod("stonefishingrod", ToolMaterial.STONE);
    	ironFishingRod = new addfishingrod("ironfishingrod", ToolMaterial.IRON);
    	goldFishingRod = new addfishingrod("goldfishingrod", ToolMaterial.GOLD);
    	diamondFishingRod = new addfishingrod("diamondfishingrod", ToolMaterial.EMERALD);
    	blackDiamondFishingRod = new addfishingrod("blackdiamondfishingrod", extend.ToolMaterial_BLACKDIAMOND);
    	nightFishingRod = new addfishingrod("nightfishingrod", extend.ToolMaterial_NIGHT);
    	fishBones = new additem(64, "fishbones", CreativeTabs.tabMisc, false);
    	tinCan = new additem(64, "tincan", CreativeTabs.tabMisc, false);
    	boundLeather = new additem(64, "boundleather", CreativeTabs.tabMisc, false);
    	tannedLeather = new additem(64, "tannedleather", CreativeTabs.tabMisc, false);
    	zombieLeather = new additem(64, "zombieleather", CreativeTabs.tabMisc, false);
    	tomatoSeed = new addseed(64, "tomatoseed", blockref.tomatoCrop, EnumPlantType.Crop);
    }
    }
    

     

    And also blockref;

    package net.extend.mod;
    
    import net.extend.mod.functions.addblock;
    import net.extend.mod.functions.addcrop;
    import net.extend.mod.functions.addore;
    import net.extend.mod.functions.addstair;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraftforge.common.MinecraftForge;
    import net.extend.mod.itemref;
    
    public class blockref {
    
    //Blocks
    public static Block acidBlock;
    public static Block acidOre;
    public static Block blackDiamondOre;
    public static Block blackDiamondBlock;
    public static Block nightOre;
    public static Block nightBlock;
    public static Block nightStair;
    /*	public static Block owen;
    public static Block owenActive; */
    public static Block tomatoCrop;
    
    public blockref() {
    	//Add Block
    	/*this.acidBlock = new addblock(configref.acidBlockID, "acidblock", Material.rock , Block.soundStoneFootstep, 2.0F);
    	MinecraftForge.setBlockHarvestLevel(acidBlock, "pickaxe", 2);
    	this.acidOre = new addore(configref.acidOreID, "acidore", Block.soundStoneFootstep, 2.0F);
    	MinecraftForge.setBlockHarvestLevel(acidOre, "pickaxe", 3);*/
    	this.blackDiamondBlock = new addblock("blackdiamondblock", Material.iron, Block.soundTypeStone, 2.0F, "pickaxe", 2);
           	this.blackDiamondOre = new addore("blackdiamondore", Block.soundTypeStone, 4.0F, "pickaxe", 2);
           	this.nightOre = new addore("nightore", Block.soundTypeStone, 4.0F, "pickaxe", 2);
           	this.nightBlock = new addblock("nightblock", Material.iron, Block.soundTypeStone, 2.0F, "pickaxe", 2);
           	this.nightStair = new addstair("nightstair", this.nightBlock, 0, "pickaxe", 2);
    	this.tomatoCrop = new addcrop("tomato", itemref.tomatoSeed, foodref.vegTomato, 7, 2, true);
    }
    }
    
    

  10. This is the problem my made, normally client say caused by ... but this time it isn't or maybe I couldn't see it. Anyway if you want I can copy for you.

     

    ---- Minecraft Crash Report ----
    // Daisy, daisy...
    
    Time: 24.08.2014 06:04
    Description: Unexpected error
    
    java.lang.NullPointerException: Unexpected error
    at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(SourceFile:57)
    at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:595)
    at net.minecraft.world.World.setBlock(World.java:441)
    at net.minecraft.world.World.setBlock(World.java:576)
    at net.extend.mod.functions.addseed.onItemUse(addseed.java:48)
    at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:127)
    at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:353)
    at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1436)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1942)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:962)
    at net.minecraft.client.Minecraft.run(Minecraft.java:887)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:55)
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(SourceFile:57)
    at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:595)
    at net.minecraft.world.World.setBlock(World.java:441)
    at net.minecraft.world.World.setBlock(World.java:576)
    at net.extend.mod.functions.addseed.onItemUse(addseed.java:48)
    at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:127)
    at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:353)
    at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1436)
    
    -- Affected level --
    Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/267, l='MpServer', x=1032,24, y=5,62, z=-565,69]]
    Chunk stats: MultiplayerChunkCache: 65, 65
    Level seed: 0
    Level generator: ID 01 - flat, ver 0. Features enabled: false
    Level generator options: 
    Level spawn location: World: (1143,4,-606), Chunk: (at 7,0,2 in 71,-38; contains blocks 1136,0,-608 to 1151,255,-593), Region: (2,-2; contains chunks 64,-64 to 95,-33, blocks 1024,0,-1024 to 1535,255,-513)
    Level time: 45829 game time, 53221 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 81 total; [EntityPig['Pig'/143, l='MpServer', x=1089,25, y=4,00, z=-614,06], EntityCow['Cow'/8, l='MpServer', x=971,22, y=4,00, z=-509,38], EntityChicken['Chicken'/129, l='MpServer', x=1083,44, y=4,00, z=-560,56], EntityPig['Pig'/128, l='MpServer', x=1079,22, y=4,00, z=-569,13], EntityPig['Pig'/131, l='MpServer', x=1085,97, y=4,00, z=-544,03], EntityItem['item.item.egg'/130, l='MpServer', x=1072,47, y=4,13, z=-567,59], EntitySlime['Slime'/12, l='MpServer', x=986,13, y=4,47, z=-614,97], EntitySlime['Slime'/133, l='MpServer', x=1085,78, y=4,57, z=-559,82], EntityChicken['Chicken'/13, l='MpServer', x=977,69, y=4,00, z=-605,69], EntityChicken['Chicken'/132, l='MpServer', x=1077,53, y=4,00, z=-558,31], EntitySlime['Slime'/135, l='MpServer', x=1081,40, y=5,24, z=-508,70], EntitySlime['Slime'/14, l='MpServer', x=979,14, y=4,85, z=-604,07], EntityXPOrb['Experience Orb'/15, l='MpServer', x=976,75, y=4,23, z=-578,75], EntitySlime['Slime'/134, l='MpServer', x=1075,32, y=4,00, z=-539,37], EntityChicken['Chicken'/17, l='MpServer', x=990,59, y=4,00, z=-559,38], EntityCow['Cow'/16, l='MpServer', x=983,53, y=4,00, z=-573,59], EntitySlime['Slime'/19, l='MpServer', x=980,56, y=4,00, z=-525,50], EntitySlime['Slime'/18, l='MpServer', x=990,72, y=4,69, z=-549,91], EntitySheep['Sheep'/21, l='MpServer', x=986,19, y=4,00, z=-505,19], EntityClientPlayerMP['ForgeDevName'/267, l='MpServer', x=1032,24, y=5,62, z=-565,69], EntitySheep['Sheep'/20, l='MpServer', x=988,78, y=4,00, z=-498,06], EntityXPOrb['Experience Orb'/23, l='MpServer', x=1007,41, y=4,36, z=-612,07], EntitySheep['Sheep'/144, l='MpServer', x=1098,72, y=4,00, z=-615,50], EntityPig['Pig'/25, l='MpServer', x=1007,84, y=4,00, z=-586,06], EntitySheep['Sheep'/145, l='MpServer', x=1100,03, y=4,00, z=-616,41], EntityChicken['Chicken'/24, l='MpServer', x=1004,47, y=4,00, z=-588,59], EntityPig['Pig'/146, l='MpServer', x=1101,66, y=4,00, z=-606,09], EntityItem['item.item.egg'/27, l='MpServer', x=1005,38, y=4,13, z=-552,09], EntitySlime['Slime'/147, l='MpServer', x=1098,60, y=4,83, z=-554,14], EntityItem['item.item.rottenFlesh'/26, l='MpServer', x=1005,47, y=4,13, z=-557,41], EntityItem['item.item.rottenFlesh'/29, l='MpServer', x=1003,03, y=4,13, z=-528,25], EntityChicken['Chicken'/28, l='MpServer', x=996,81, y=4,00, z=-532,34], EntityPig['Pig'/31, l='MpServer', x=991,91, y=4,00, z=-506,25], EntityPig['Pig'/30, l='MpServer', x=1000,13, y=4,00, z=-535,28], EntityCow['Cow'/32, l='MpServer', x=1004,09, y=4,00, z=-509,06], EntityItem['item.item.arrow'/42, l='MpServer', x=1013,66, y=4,13, z=-546,56], EntityPig['Pig'/43, l='MpServer', x=1017,97, y=4,00, z=-532,03], EntityItem['item.item.egg'/40, l='MpServer', x=1021,69, y=4,13, z=-592,16], EntityPig['Pig'/41, l='MpServer', x=1018,94, y=4,00, z=-597,97], EntitySlime['Slime'/44, l='MpServer', x=1010,14, y=5,06, z=-527,10], EntitySlime['Slime'/51, l='MpServer', x=1032,00, y=4,00, z=-622,53], EntityChicken['Chicken'/50, l='MpServer', x=1030,59, y=4,00, z=-608,41], EntityChicken['Chicken'/55, l='MpServer', x=1026,44, y=4,00, z=-591,47], EntityXPOrb['Experience Orb'/54, l='MpServer', x=1039,47, y=4,25, z=-579,96], EntityXPOrb['Experience Orb'/53, l='MpServer', x=1034,75, y=4,25, z=-587,91], EntityXPOrb['Experience Orb'/52, l='MpServer', x=1030,50, y=4,07, z=-576,64], EntityPig['Pig'/58, l='MpServer', x=1025,41, y=4,00, z=-544,75], EntitySlime['Slime'/57, l='MpServer', x=1030,84, y=4,00, z=-548,00], EntitySlime['Slime'/56, l='MpServer', x=1039,22, y=4,00, z=-565,16], EntityCow['Cow'/68, l='MpServer', x=1048,66, y=4,00, z=-615,13], EntityItem['item.item.egg'/69, l='MpServer', x=1044,00, y=4,13, z=-616,00], EntityItem['item.item.egg'/70, l='MpServer', x=1050,91, y=4,13, z=-611,09], EntityChicken['Chicken'/71, l='MpServer', x=1043,41, y=4,00, z=-611,44], EntityItem['item.item.arrow'/76, l='MpServer', x=1045,75, y=4,13, z=-517,19], EntityItem['item.item.bone'/72, l='MpServer', x=1052,47, y=4,13, z=-597,56], EntityChicken['Chicken'/73, l='MpServer', x=1054,41, y=4,00, z=-604,59], EntityItem['item.item.arrow'/74, l='MpServer', x=1043,53, y=4,13, z=-568,03], EntityCow['Cow'/75, l='MpServer', x=1044,91, y=4,00, z=-568,09], EntityPig['Pig'/93, l='MpServer', x=1066,72, y=4,00, z=-604,22], EntityChicken['Chicken'/92, l='MpServer', x=1058,56, y=4,00, z=-622,66], EntityPig['Pig'/95, l='MpServer', x=1069,91, y=4,00, z=-598,44], EntityCow['Cow'/94, l='MpServer', x=1057,44, y=4,00, z=-601,75], EntityChicken['Chicken'/91, l='MpServer', x=1059,09, y=4,00, z=-621,41], EntityPig['Pig'/90, l='MpServer', x=1062,66, y=4,00, z=-618,78], EntityItem['item.item.bone'/102, l='MpServer', x=1060,28, y=4,13, z=-536,84], EntityChicken['Chicken'/103, l='MpServer', x=1056,38, y=4,00, z=-498,19], EntityItem['item.item.egg'/100, l='MpServer', x=1070,78, y=4,13, z=-550,75], EntityItem['item.item.arrow'/101, l='MpServer', x=1059,91, y=4,13, z=-536,94], EntityItem['item.item.chickenRaw'/98, l='MpServer', x=1065,56, y=4,13, z=-573,91], EntityChicken['Chicken'/99, l='MpServer', x=1070,19, y=4,00, z=-551,38], EntityXPOrb['Experience Orb'/96, l='MpServer', x=1063,46, y=4,25, z=-576,28], EntityItem['item.item.feather'/97, l='MpServer', x=1067,13, y=4,13, z=-573,75], EntitySlime['Slime'/104, l='MpServer', x=1060,37, y=4,91, z=-496,91], EntitySlime['Slime'/127, l='MpServer', x=1081,32, y=4,00, z=-575,87], EntitySlime['Slime'/126, l='MpServer', x=1076,61, y=4,00, z=-588,11], EntityChicken['Chicken'/125, l='MpServer', x=1073,47, y=4,00, z=-595,56], EntitySheep['Sheep'/124, l='MpServer', x=1084,78, y=4,00, z=-596,75], EntitySlime['Slime'/123, l='MpServer', x=1075,60, y=4,00, z=-623,81], EntitySheep['Sheep'/122, l='MpServer', x=1083,97, y=4,00, z=-611,03], EntityPig['Pig'/121, l='MpServer', x=1073,19, y=4,00, z=-617,41], EntityPig['Pig'/120, l='MpServer', x=1078,59, y=4,00, z=-618,81]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
    Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:373)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2433)
    at net.minecraft.client.Minecraft.run(Minecraft.java:916)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:55)
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 808602952 bytes (771 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.25.1205 Minecraft Forge 10.13.0.1205 4 mods loaded, 4 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{7.10.25.1205} [Forge Mod Loader] (forgeBin-1.7.10-10.13.0.1205.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{10.13.0.1205} [Minecraft Forge] (forgeBin-1.7.10-10.13.0.1205.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    extend{0.0.1} [Extend] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Launched Version: 1.7.10
    LWJGL: 2.9.1
    OpenGL: Intel(R) HD Graphics Family GL version 3.1.0 - Build 8.15.10.2476, Intel
    GL Caps: Using GL 1.3 multitexturing.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Anisotropic filtering is supported and maximum anisotropy is 16.
    Shaders are available because OpenGL 2.1 is supported.
    
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)

  11. I don't know why, but when I right click on farmland with Tomato Seed, game crashed;

     

    Codes:

     

    Item;

    	public static Item tomatoSeed;
    tomatoSeed = new addseed(64, "tomatoseed", blockref.tomatoCrop, EnumPlantType.Crop);

     

    Block;

    	public static Block tomatoCrop;
    	this.tomatoCrop = new addcrop("tomato", itemref.tomatoSeed, foodref.vegTomato, 7, 2, true);

     

    addseed;

    package net.extend.mod.functions;
    
    import javax.swing.text.TabableView;
    
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.extend.mod.ref;
    import net.minecraft.block.Block;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    import net.minecraftforge.common.EnumPlantType;
    import net.minecraftforge.common.IPlantable;
    import net.minecraftforge.common.util.ForgeDirection;
    
    public class addseed extends Item implements IPlantable {
    private Block field_150925_a;
    private Block par2Block;
    private EnumPlantType Type;
    
    public addseed(int stack, String name, Block par1, EnumPlantType type) {
    
    	this.setMaxStackSize(stack);
    	this.setCreativeTab(CreativeTabs.tabMaterials);
    	this.setUnlocalizedName(name);
    	this.field_150925_a = par1;
    	this.par2Block = Blocks.farmland;
    	this.Type = type;
    	GameRegistry.registerItem(this, name);
    }
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister reg) {
    	this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)));
    }
    
    
        public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
            if (p_77648_7_ != 1) { return false; }
            else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) {
                if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) {
                	p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a);
                    --p_77648_1_.stackSize;
                    return true;
                } else { return false; }
            } else { return false; }
        }
    
    @Override
    public Block getPlant(IBlockAccess arg0, int arg1, int arg2, int arg3) {
    	return field_150925_a;
    }
    
    @Override
    public int getPlantMetadata(IBlockAccess arg0, int arg1, int arg2, int arg3) {
            return 0;
    }
    
    @Override
    public EnumPlantType getPlantType(IBlockAccess arg0, int arg1, int arg2, int arg3) {
            return this.Type;
    }
    
    }

     

    addcrop;

    package net.extend.mod.functions;
    
    import java.math.MathContext;
    import java.util.ArrayList;
    import java.util.Random;
    
    import scala.reflect.reify.phases.Calculate;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.extend.mod.blockref;
    import net.extend.mod.foodref;
    import net.extend.mod.itemref;
    import net.extend.mod.ref;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockCrops;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.IIcon;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.World;
    
    public class addcrop extends BlockCrops {
    @SideOnly(Side.CLIENT)
    private IIcon[] cropIcon;
    private Item Seed;
    private Item Crop;
    private int MaxSeed;
    private int MaxCrop;
    private boolean SeedReturn;
    
    public addcrop(String name, Item seed, Item crop, int maxseed, int maxcrop, boolean seedreturn) {
    	this.Seed = seed;
    	this.Crop = crop;
    	this.MaxSeed = maxseed;
    	this.MaxCrop = maxcrop;
    	this.SeedReturn = seedreturn;
    //       this.setTickRandomly(true);
    	this.setBlockName(name);
    	this.setStepSound(soundTypeGrass);
    	this.setHardness(0.0F);
    	GameRegistry.registerBlock(this, name);
    }
    
        protected boolean canThisPlantGrowOnThisBlock(Block par1) {
            return par1 == Blocks.farmland;
        }
    
    @SideOnly(Side.CLIENT)
    public IIcon getIIcon(int par1, int par2) {
    	if ((par2 < 0) || (par2 > this.MaxSeed)) {
    		par2 = this.MaxSeed;
    	}
    	return this.cropIcon[par2];
    }
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister reg) {
    	int MaxSeedx = this.MaxSeed;
    	MaxSeedx++;
    	this.cropIcon = new IIcon[MaxSeedx];
    	for (int i = 0; i < this.cropIcon.length; i++) {
    		this.cropIcon[i] = reg.registerIcon(ref.uid + ":textures/blocks/crop/" + (this.getUnlocalizedName().substring(5)) + "_" + i);
    	}
    }
    
    /*
        public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
            super.updateTick(par1World, par2, par3, par4, par5Random);
    
            if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) {
                int l = par1World.getBlockMetadata(par2, par3, par4);
    
                if (l < this.MaxSeed) {
                    float f = this.r(par1World, par2, par3, par4);
    
                    if (par5Random.nextInt((int)(25.0F / f) + 1) == 0)
                    {
                        ++l;
                        par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
                    }
                }
            }
        }
    */
    
    public void fertilize(World par1, int par2, int par3, int par4) {
            int l = par1.getBlockMetadata(par2, par3, par4) + MathHelper.getRandomIntegerInRange(par1.rand, 2, 5);
    
    	if (l > this.MaxSeed) { l = this.MaxSeed; }
    	par1.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
    }
    
    public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
    	ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
    	if (metadata < this.MaxSeed) {
    		ret.add(new ItemStack(this.Seed, 1));			
    	} else if (metadata >= this.MaxSeed) {
    		if (this.SeedReturn) {
    			for (int i = 0; i < 3 + fortune; i++) {
    				if (world.rand.nextInt(15) <= metadata) {
    					ret.add(new ItemStack(this.Seed, 1));
    				}
    			}
    		}
    
    		if ((metadata >= 3) && (metadata <= this.MaxSeed)) {
    			for (int n = 0; n < 3 + fortune; n++) {
    				if (world.rand.nextInt(15) <= metadata) {
    					ret.add(new ItemStack(this.Crop, this.MaxCrop, 1));
    				}
    			}
    		}
    	}		
    	return ret;
    }
    }

  12. I copy fishing rod and edit its code. It's working good, but I have some problem. When I use fishing rod (original one) and don't pull it off, I save game and restart. When I join game, it cancelled and working without problem. However, I try same thing for new fishing rods and this.angler return null and game crashes.

     

    When I use new fishing rods this works and this.angler = player, return player.

    public EntityNewFishHook(World world, EntityPlayer player) {
    super(world);
    this.xTile = -1;
    this.yTile = -1;
    this.zTile = -1;
    this.inTile = 0;
    this.inGround = false;
    this.shake = 0;
    this.ticksInAir = 0;
    this.ticksCatchable = 0;
    this.bobber = null;
    this.ignoreFrustumCheck = true;
    this.angler = player;
    this.angler.fishEntity = this;
    this.setSize(0.25F, 0.25F);
    this.setLocationAndAngles(player.posX, player.posY + 1.62D - (double)player.yOffset, player.posZ, player.rotationYaw, player.rotationPitch);
    this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
    this.posY -= 0.10000000149011612D;
    this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
    this.setPosition(this.posX, this.posY, this.posZ);
    this.yOffset = 0.0F;
    float f = 0.4F;
    this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f);
    this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f);
    this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * f);
    this.calculateVelocity(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
    }
    

     

    But when I restart my game when the rod in use, this not working and return this.angler = null; So game crashes. How can I fix this problem? The problem is;

     

    ---- Minecraft Crash Report ----
    // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]
    
    Time: 10.01.2014 20:15
    Description: Ticking entity
    
    java.lang.NullPointerException
    at acidmod.proxies.EntityNewFishHook.onUpdate(EntityNewFishHook.java:187)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2350)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:721)
    at net.minecraft.world.World.updateEntity(World.java:2311)
    at net.minecraft.world.World.updateEntities(World.java:2157)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:552)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:666)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at acidmod.proxies.EntityNewFishHook.onUpdate(EntityNewFishHook.java:187)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2350)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:721)
    at net.minecraft.world.World.updateEntity(World.java:2311)
    
    -- Entity being ticked --
    Details:
    Entity Type: acidmod.Entity New Fish hook (acidmod.proxies.EntityNewFishHook)
    Entity ID: 108
    Entity Name: entity.acidmod.Entity New Fish hook.name
    Entity's Exact location: 157,16, 62,90, 8,22
    Entity's Block location: World: (157,62,, Chunk: (at 13,3,8 in 9,0; contains blocks 144,0,0 to 159,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Entity's Momentum: -0,00, -0,00, 0,00
    Stacktrace:
    at net.minecraft.world.World.updateEntities(World.java:2157)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:552)
    
    -- Affected level --
    Details:
    Level name: New World
    All players: 0 total; []
    Chunk stats: ServerChunkCache: 625 Drop: 0
    Level seed: -503050008478225795
    Level generator: ID 00 - default, ver 1. Features enabled: true
    Level generator options: 
    Level spawn location: World: (166,64,-, Chunk: (at 6,4,8 in 10,-1; contains blocks 160,0,-16 to 175,255,-1), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
    Level time: 223 game time, 223 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 72937 (now: false), thunder time: 167280 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: true
    Stacktrace:
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:666)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
    
    -- System Details --
    Details:
    Minecraft Version: 1.6.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 841851600 bytes (802 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 1305 (73080 bytes; 0 MB) allocated, 1305 (73080 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
    FML: MCP v8.04 FML v6.2.62.871 Minecraft Forge 9.10.1.871 4 mods loaded, 4 mods active
    mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{6.2.62.871} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{9.10.1.871} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    acidmod{0.0.1} [AcidMod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 1032 (57792 bytes; 0 MB) allocated, 1032 (57792 bytes; 0 MB) used
    Player Count: 0 / 8; []
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    

     

    and the line is;

    			ItemStack itemstack = this.angler.getCurrentEquippedItem();
    

     

    I check this section and this.angler return null; So I know the problem is this.angler returns null.

     

    Thanks.

  13. I have same problem, I didn't want to start new topic,

     

    I open the game, and I use fishing rod but not pull it off, and save game and close, but when I restart game and try to join world, it gives this crash;

     

    ---- Minecraft Crash Report ----
    // On the bright side, I bought you a teddy bear!
    
    Time: 10.01.2014 19:09
    Description: Ticking entity
    
    java.lang.NullPointerException
    at acidmod.proxies.EntityNewFishHook.onUpdate(EntityNewFishHook.java:187)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2350)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:721)
    at net.minecraft.world.World.updateEntity(World.java:2311)
    at net.minecraft.world.World.updateEntities(World.java:2157)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:552)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:666)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at acidmod.proxies.EntityNewFishHook.onUpdate(EntityNewFishHook.java:187)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2350)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:721)
    at net.minecraft.world.World.updateEntity(World.java:2311)
    
    -- Entity being ticked --
    Details:
    Entity Type: acidmod.Entity New Fish hook (acidmod.proxies.EntityNewFishHook)
    Entity ID: 141
    Entity Name: entity.acidmod.Entity New Fish hook.name
    Entity's Exact location: 201,19, 62,90, 291,75
    Entity's Block location: World: (201,62,291), Chunk: (at 9,3,3 in 12,18; contains blocks 192,0,288 to 207,255,303), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Entity's Momentum: -0,00, -0,00, -0,00
    Stacktrace:
    at net.minecraft.world.World.updateEntities(World.java:2157)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:552)
    
    -- Affected level --
    Details:
    Level name: New World
    All players: 0 total; []
    Chunk stats: ServerChunkCache: 625 Drop: 0
    Level seed: 8694363154684539275
    Level generator: ID 00 - default, ver 1. Features enabled: true
    Level generator options: 
    Level spawn location: World: (224,64,216), Chunk: (at 0,4,8 in 14,13; contains blocks 224,0,208 to 239,255,223), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 16500 game time, 517073 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 19172 (now: false), thunder time: 88463 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: true
    Stacktrace:
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:666)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
    
    -- System Details --
    Details:
    Minecraft Version: 1.6.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 802364192 bytes (765 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 1656 (92736 bytes; 0 MB) allocated, 1656 (92736 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
    FML: MCP v8.04 FML v6.2.62.871 Minecraft Forge 9.10.1.871 4 mods loaded, 4 mods active
    mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{6.2.62.871} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{9.10.1.871} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    acidmod{0.0.1} [AcidMod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 759 (42504 bytes; 0 MB) allocated, 759 (42504 bytes; 0 MB) used
    Player Count: 0 / 8; []
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    

     

    187. line is;

     

    187.				ItemStack itemstack = this.angler.getCurrentEquippedItem();
    188.				
    189.				if (this.angler.isDead || !this.angler.isEntityAlive() || itemstack == null || !isNewFishingRod(itemstack) || this.getDistanceSqToEntity(this.angler) > 1024.0D) {
    190.					this.setDead();
    191.					this.angler.fishEntity = null;
    192.					return;
    193.				}
    

     

    and also maybe you need;

    final Item[] newFishingRods = new Item[] { itemref.stoneFishingRod, itemref.ironFishingRod, itemref.goldFishingRod, itemref.diamondFishingRod, itemref.blackDiamondFishingRod, itemref.nightFishingRod };
    public boolean isNewFishingRod(ItemStack item) {
    	for (int x = 0; x < 6; x++) {
    		if (item.getItem() == newFishingRods[x]) {
    			return true;
    		}
    	}
    	return false;
    }
    

  14. I added some items but I have a problem because I add addsmelting but not working on foods.

     

    My drink;

    Configref;

            cupOfMilkyChocolateID = config.get("Drink IDs", "Cup Of Milky Chocolate ID", 3386).getInt();
            cupOfHotMilkyChocolateID = config.get("Drink IDs", "Cup Of Hot Milky Chocolate ID", 3387).getInt();
    

     

    Foodref;

    	this.cupOfMilkyChocolate = new addcanfood(configref.cupOfMilkyChocolateID, "cupofmilkychocolate", 6, 0.5F, false, 0, itemref.cup);
    	this.cupOfHotMilkyChocolate = new addcanfood(configref.cupOfHotMilkyChocolateID, "cupofhotmilkychocolate", 6, 0.8F, false, 1, itemref.cup);	

     

    Smelting;

            GameRegistry.addSmelting(smelt_ore_diamond_black_id, craft_ingot_diamond_black, 0.9f);
            GameRegistry.addSmelting(smelt_ore_night_id, craft_ingot_night, 1.0f);
    
            GameRegistry.addSmelting(smelt_cup_chocolate_id, craft_cup_chocolate_hot, 0.8f);
            GameRegistry.addSmelting(smelt_cup_milk_id, craft_cup_milk_hot, 0.8f);
            GameRegistry.addSmelting(configref.cupOfMilkyChocolateID, new ItemStack(foodref.cupOfHotMilkyChocolate), 0.8f);        
    

     

    And addcanfood;

    package acidmod.functions;
    
    import acidmod.AcidMod;
    import acidmod.ref;
    import cpw.mods.fml.common.network.Player;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemFood;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.util.Icon;
    import net.minecraft.world.World;
    
    public class addcanfood extends ItemFood {
    private Item returnItem;
    private int foodHeal;
    private float foodSaturation;
    private static final int[] potionType = new int[] {Potion.poison.getId(), Potion.regeneration.getId(), Potion.heal.getId(), Potion.harm.getId()};
    
    //addfood(UID, STACK, IMAGE-NAME, HEAL*2, GOOD?, TRUE?|FALSE?, 1|2|3, noRETURN|RETURN)
    public addcanfood(int uid, String name, int heal, float saturation, boolean what, int potion, Item item) {
    	super(uid, heal, saturation, what);
    
    	//Max Stack = 1, because of returns!
    	this.setMaxStackSize(64);
    	this.setCreativeTab(CreativeTabs.tabFood);
    	this.setUnlocalizedName(name);
    		if (potion > 0) {
    			this.setPotionEffect(potionType[potion], 5, 0, 0.6F);
    		}
    	this.foodHeal = heal;
    	this.foodSaturation = saturation;
    	this.returnItem = item;
    	GameRegistry.registerItem(this, name);
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerIcons(IconRegister reg) {
    	this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)));
    }
    
    public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer player) {
    	if (!player.capabilities.isCreativeMode) {
    		itemstack.stackSize -=1;
    		if (itemstack.stackSize > 0) {
    			player.inventory.addItemStackToInventory(new ItemStack(this.returnItem));
    		}
    	}
    	if (!world.isRemote) {
    		player.getFoodStats().addStats(this.foodHeal, this.foodSaturation);
    		world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
    	}
            
            return itemstack.stackSize > 0 ? itemstack : new ItemStack(this.returnItem);
    }
    }
    

     

    The problem is, smelting, the first 2 item which are ores, working but when I try to cook my drinks it isn't possible, I tried to fix it 3 hours but I couldn't because I don't understand where is the mistake.

     

    Can anyone help my about this please, thanks.

  15. I have registerIcon setting under my item class, but I'm not really understand how can I add getIcon settings under this,

     

    package acidmod.functions;
    
    import acidmod.ref;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    
    public class additem extends Item {
    
    //additem(UID, STACK-SIZE, IMAGE-NAME)
    public additem(int uid, int stack, String name, CreativeTabs tab) {
    	super(uid);
    
    	this.setMaxStackSize(stack);
    	this.setCreativeTab(tab);
    	this.setUnlocalizedName(name);
    	GameRegistry.registerItem(this, name);
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerIcons(IconRegister reg) {
    	this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)));
    }
    
    }
    

  16. A Tickhandler basically checks something on an event. For example, I am using my Tickhandler to check if a player falls in my custom dimension, and if they do, then I want the fall damage to be reduced significantly. Here is the outline of a basic Tickhandler:

     

     

     

    public class YOURTICKHANDLER implements ITickHandler {

     

    @Override

    public void tickStart(EnumSet<TickType> type, Object... tickData) {

    }

    //This is an example of an event, you need to put @ForgeSubscribe in front of it so Forge knows It is an event. Then you need to specify an event type in the same way I did the Living fall event.

    @ForgeSubscribe

    public void livingFall(LivingFallEvent event)

    {

    }

     

     

    @Override

    public void tickEnd(EnumSet<TickType> type, Object... tickData) {

     

    }

     

    @Override

    public EnumSet<TickType> ticks() {

     

            return EnumSet.of(TickType.PLAYER, TickType.SERVER);

     

    }

     

    @Override

    public String getLabel() {

     

    return null;

    }

     

    }

     

    And that is your basic Tickhandler. :)

     

    Hope that helps.

     

    EDIT: To register your TH, you need to put this in your main class:

     

    TickRegistry.registerTickHandler(new NAMETickHandler(), What ever side your tickhandler needs to be on, probably Side.SERVER, but it could be Side.CLIENT, I'd recommend Side.SERVER though.);

     

    The tick handler will allow you to "focus" on the player(CJ said it better), allowing you to do neat things like potion effects.

     

    Here is a video showing how to set one up,

     

     

    ...and one showing potion effects

     

     

    Locating blocks can be a bit...tricky.

     

    You have three ways to move, "X", "Y", and "Z"

     

    The "Y" axis is the easiest, it is up/down. Up is represented by positive numbers, down by negative. From the example I gave you,

    (int)player#posY - 1

    you can see that the game is looking one block below the player's feet. (Represented by cobblestone)

     

     

     

     

    I believe "X" is the East direction, and "Z" is South. Unfortunately, my project is acting up at the moment, so I can't get screenshots of those two.  I did, however find a "compass" that may help.

     

     

     

    Coordinates.png

     

     

     

    Play around with them yourself, though! Anyone can tell you how to do it forever, but you are never going to learn unless you actually do something. ;P

     

    Thank you so much, these messages are helpful for me. I check and test something like this;

     

    package acidmod.proxy;
    
    import java.util.EnumSet;
    
    import acidmod.blockref;
    import acidmod.configref;
    import acidmod.itemref;
    import acidmod.functions.writeline;
    import net.minecraft.enchantment.Enchantment;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.potion.PotionEffect;
    import cpw.mods.fml.common.ITickHandler;
    import cpw.mods.fml.common.TickType;
    
    public class ServerTickHandler implements ITickHandler {
    
    private void onPlayerTick(EntityPlayer player) {
    	if (player.getCurrentItemOrArmor(4) != null) {
    		ItemStack helmet = player.getCurrentItemOrArmor(4);			
    		if (helmet.getItem() == itemref.blackDiamondHelmet) {
    			player.addPotionEffect((new PotionEffect(Potion.confusion.getId(), 200, 0)));
    		}
    	}
    
    	int blockItem;
    	blockItem = configref.blackDiamondBlockID;
    	if (player.worldObj.getBlockId((int)player.posX, (int)player.posY - 2, (int)player.posZ) == blockItem) {
    		ItemStack sword = player.getCurrentEquippedItem();
                sword.setItemName("Y");
    	} else if (player.worldObj.getBlockId((int)player.posX -2, (int)player.posY, (int)player.posZ) == blockItem) {
    		ItemStack sword = player.getCurrentEquippedItem();
                sword.setItemName("X");
    	} else if (player.worldObj.getBlockId((int)player.posX, (int)player.posY, (int)player.posZ -2) == blockItem) {
    		ItemStack sword = player.getCurrentEquippedItem();
                sword.setItemName("Z");
    	}
    
    }
    
    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
    	if (type.equals(EnumSet.of(TickType.PLAYER))) {
    		onPlayerTick((EntityPlayer) tickData [0]);
    	}
    
    }
    
    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData) {
    
    }
    
    @Override
    public EnumSet<TickType> ticks() {
    	return EnumSet.of(TickType.PLAYER, TickType.SERVER);
    }
    
    @Override
    public String getLabel() {
    	return null;
    }
    
    }
    

     

    I understand how it works, but I only stuck when I try to change icon, for example I want to change my blackDiamondSword to blackDiamondBow, but I couldn't find registericon, seticon, or something like this. Is it possible to do? And also I don't want only equiped item change, I want if I have in my bag, it change, if its possible :P

     

    If you explain how can I, I can try :)

  17. Hi everyone,

     

    I want to know how can I check close items, or blocks. For example, if I have fire 1 square around me I want to give ench. to my sword. How can I check and change itemicon?

     

    Secondly, when I eat custom foods with BOWL I want to give bowl back to me.  Like water when you use it, it gives bucket back. How can I do this?

     

    Thanks

×
×
  • Create New...

Important Information

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