Jump to content

Nitus

Members
  • Posts

    165
  • Joined

  • Last visited

Everything posted by Nitus

  1. IconIndex is only for icon of items (don't quote me on that). Block use a different code to render.
  2. Yes I used the code of wheat, the problem is that blocks like wheat don't use iconIndex (i think). I still need to do further research on this problem.
  3. I believe you might be right. The problem is that i do not have any fucking clue on how to had the differend stages of growth..
  4. It has to be in the CottonPlant code which is the second code I uploaded (the 1st post on the thread), also I dont have any idea of what the getUniqueSpriteIndex means.... yeah i'm new to coding...
  5. Ok let me actually tell exacly what my problem is. Everything works fine, the cotton seed the cotton item, the buffalo even spawns (need to fix that though) but when i reach the cotton plant block it makes the game crash. Apparently it only happens when I make the cotton seed plant that block. It just straight A crashes. This is the crash report: ---- Minecraft Crash Report ---- // I let you down. Sorry Time: 10-03-2013 18:12 Description: Invalid request to getUniqueSpriteIndex java.lang.Exception: Invalid getUniqueSpriteIndex call for texture: /gfx/ifarm at cpw.mods.fml.client.SpriteHelper.getUniqueSpriteIndex(SpriteHelper.java:100) at cpw.mods.fml.client.registry.RenderingRegistry.addTextureOverride(RenderingRegistry.java:95) at net.minecraft.src.ModLoader.addOverride(ModLoader.java:236) at iFarm.iFarm.<clinit>(iFarm.java:37) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:416) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) at cpw.mods.fml.common.Loader.loadMods(Loader.java:479) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:161) at net.minecraft.client.Minecraft.startGame(Minecraft.java:410) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:744) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.4.7 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_15, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 799022712 bytes (762 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.26 FML v4.7.4.520 Minecraft Forge 6.6.0.497 4 mods loaded, 4 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML [Forge Mod Loader] (coremods) Unloaded->Constructed Forge [Minecraft Forge] (coremods) Unloaded->Constructed modid [iFarm] (bin) Unloaded
  6. The buffalo is still a work-in-progress thing, ain't really what im aiming at. And as i said i don't have a clue of what is wrong. I basically copied the Crops (wheat) block class and costumized it.
  7. So I'm having a horrible problem when trying to make a new crop. Honestly I don't know wtf is wrong in the code. Here it is: package iFarm; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.BlockCrops; import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.Item; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraft.src.ModLoader; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; 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 cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "modid", name = "iFarm", version = "0.0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class iFarm { public static final Item cotton = (new ItemCotton(30078)).setIconIndex(0).setItemName("cotton"); public static final Item seedsCotton = (new ItemCottonSeeds(30079, Block.cottonPlant.blockID, Block.tilledField.blockID)).setIconIndex(1).setItemName("cotton seeds"); public static final Block cottonPlant = (new BlockCottonPlant(59, 88)).setBlockName("cottonPlant"); @Instance("modid") public static iFarm instance; @SidedProxy(clientSide="iFarm.ClientProxy", serverSide="iFarm.CommonProxy") public static CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { } @Init public void init(FMLInitializationEvent event) { LanguageRegistry.addName(cotton, "Cotton"); LanguageRegistry.addName(seedsCotton, "Cotton Seed"); MinecraftForge.addGrassSeed(new ItemStack (seedsCotton), 10); GameRegistry.registerBlock(cottonPlant, "cottonPlant"); //register the entity ModLoader.registerEntityID(EntityBuffalo.class, "Buffalo", ModLoader.getUniqueEntityId()); ModLoader.addSpawn("Buffalo", 100, 3, 6, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.plains }); } @PostInit public static void postInit(FMLPostInitializationEvent event) { } } Here is the crop code: package iFarm; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; public class BlockCottonPlant extends BlockFlower { protected BlockCottonPlant(int par1, int par2) { super(par1, par2); this.blockIndexInTexture = par2; this.setTickRandomly(true); float var3 = 0.5F; this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3); this.setCreativeTab((CreativeTabs)null); this.setHardness(0.0F); this.setStepSound(soundGrassFootstep); this.disableStats(); this.setRequiresSelfNotify(); } /** * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of * blockID passed in. Args: blockID */ protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == Block.tilledField.blockID; } /** * Ticks the block if it's been scheduled */ 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 var6 = par1World.getBlockMetadata(par2, par3, par4); if (var6 < 7) { float var7 = this.getGrowthRate(par1World, par2, par3, par4); if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0) { ++var6; par1World.setBlockMetadataWithNotify(par2, par3, par4, var6); } } } } /** * Apply bonemeal to the crops. */ public void fertilize(World par1World, int par2, int par3, int par4) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 7); } /** * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below * this one). Args: x, y, z */ private float getGrowthRate(World par1World, int par2, int par3, int par4) { float var5 = 1.0F; int var6 = par1World.getBlockId(par2, par3, par4 - 1); int var7 = par1World.getBlockId(par2, par3, par4 + 1); int var8 = par1World.getBlockId(par2 - 1, par3, par4); int var9 = par1World.getBlockId(par2 + 1, par3, par4); int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1); int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1); int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1); int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1); boolean var14 = var8 == this.blockID || var9 == this.blockID; boolean var15 = var6 == this.blockID || var7 == this.blockID; boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID; for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17) { for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18) { int var19 = par1World.getBlockId(var17, par3 - 1, var18); float var20 = 0.0F; if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this)) { var20 = 1.0F; if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18)) { var20 = 3.0F; } } if (var17 != par2 || var18 != par4) { var20 /= 4.0F; } var5 += var20; } } if (var16 || var14 && var15) { var5 /= 2.0F; } return var5; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSideAndMetadata(int par1, int par2) { if (par2 < 0) { par2 = 7; } return this.blockIndexInTexture + par2; } /** * The type of render function that is called for this block */ public int getRenderType() { return 6; } /** * Generate a seed ItemStack for this crop. */ protected int getSeedItem() { return iFarm.seedsCotton.itemID; } /** * Generate a crop produce ItemStack for this crop. */ protected int getCropItem() { return iFarm.cotton.itemID; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); } @Override public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) { ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune); if (metadata >= 7) { for (int n = 0; n < 3 + fortune; n++) { if (world.rand.nextInt(15) <= metadata) { ret.add(new ItemStack(this.getSeedItem(), 1, 0)); } } } return ret; } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return par1 == 7 ? this.getCropItem() : this.getSeedItem(); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random par1Random) { return 1; } @SideOnly(Side.CLIENT) /** * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) */ public int idPicked(World par1World, int par2, int par3, int par4) { return this.getSeedItem(); } } If anyone can help, please do.
  8. What do you mean by changing the login screen? You mean the launcher screen? The game startup screen?
  9. Green the Mana Constructors are being ass holes to make and the textures will be even worse. Im going to try and make it as close to your idea as possible though!
  10. It's not ghey if it's on the moon!

  11. User was warned for this post: Don't sign your posts. How did you make the same mistake twice in the same thread with that big warning sign?
  12. Technic Platform, have it the end user way!
  13. I love your mod man but...why were you kellered?
  14. Nitus

    Helen Keller

    He apparently tried to hide everything he said but the most important one is here: This shit is just too funny to hide!
  15. Nitus

    Helen Keller

    ACTUALLY IT MAKES YOU READ AS IF YOU WERE SHOUTING, BUT NOT IN A ANGRY POINT OF VIEW!
  16. Nitus

    Helen Keller

    Finally the double personnality hits! I was waiting for this too! CAPS LOCK RAGE!!!!!!!!!!!!!!!!!! QUICK CALL THE INTERNET POLICE!
  17. Nitus

    Helen Keller

    I'm just waiting for CheapShot to come here with his smart and funny ass sentences to close this thread in style...any minute now...
  18. Nitus

    Helen Keller

    Can you make a special avatar for him Kakermix? This little boy is special...very very special...
  19. Nitus

    Helen Keller

    *facedesk* Please continue cuz i want to break my nose today. P.S: You can't close a thread you moron!!
  20. Nitus

    Helen Keller

    How the fuck wouldn't they be? You were kellered cuz you broke them rules!
  21. Nitus

    Helen Keller

    That woud be weed, the mighty part is cuz i have an IQ above 60....
  22. Nitus

    Helen Keller

    This guys just keeps on repeating himself "Blah Blah bullied blah blah mean blah blah bullied". I mean common try to get new sentences!
  23. Nitus

    Helen Keller

    No!!! Comeback! The fun just started! Let us have our moment of laughs!
  24. You do realize that a big amount of Minecraft Harlem Shake videos where already done right?
  25. I remember the days of the war...the screams, the gunfire, the mortars... We couldn't save them, no one could...
×
×
  • Create New...