Jump to content

ashtonr12

Members
  • Posts

    479
  • Joined

  • Last visited

Everything posted by ashtonr12

  1. sheeeeeeeeet i havent got a clue about this god darned error
  2. i think the problem is the block list that it is getting doesnt have my custom block in it, Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; this is where the blocklist is declared public static final Block[] blocksList = new Block[4096]; but i dont know what the 4096 stands for? its not block id, i think i need to make a new blocklist with my own block in it but i am not sure how? this is my best guess on how to fix this error
  3. i did and as i was i realized that it was hard and i don't know a lot of java, before you go tell me to go learn it i own a java for dummies book already and am starting ok?
  4. so its not immediately obvious to you what the problem it?
  5. whats a breakpoint? and isnt there one specific area of code that allows sugar can to be allowed to be placed on itself?
  6. just make a normal food item but replace the animation and set the food gain to zero, you can then add/change any other features such as potion effects.
  7. ok next problem, this block should be placeable on itself but is not also sometimes when it grows it auto breaks i think this is linked to the first error, it is a sugar cane esq block package ashtonsmod.common; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.IPlantable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockIngotBush extends Block implements IPlantable { protected BlockIngotBush(int par1) { super(par1, Material.plants); float f = 0.375F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); this.setTickRandomly(true); } /** * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (par1World.isAirBlock(par2, par3 + 1, par4)) { int l; for (l = 1; par1World.getBlockId(par2, par3 - l, par4) == this.blockID; ++l) { ; } if (l < 3) { int i1 = par1World.getBlockMetadata(par2, par3, par4); if (i1 == 15) { par1World.setBlock(par2, par3 + 1, par4, this.blockID); par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); } else { par1World.setBlockMetadataWithNotify(par2, par3, par4, i1 + 1, 4); } } } } /** * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; return (block != null && block.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this)); } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { this.checkBlockCoordValid(par1World, par2, par3, par4); } /** * Checks if current block pos is valid, if not, breaks the block as dropable item. Used for reed and cactus. */ protected final void checkBlockCoordValid(World par1World, int par2, int par3, int par4) { if (!this.canBlockStay(par1World, par2, par3, par4)) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); } } /** * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. */ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { return this.canPlaceBlockAt(par1World, par2, par3, par4); } //drops public int idDropped(int par1, Random par2Random, int par3) { int w = par2Random.nextInt(; if (w == 0) { return ashtonsmod.IngotBush.blockID; } if (w == 1) { return ashtonsmod.Amethyst.itemID; } if (w == 2) { return ashtonsmod.LightSteelNugget.itemID; } if (w == 3) { return Item.ingotGold.itemID; } if (w == 4) { return Item.ingotIron.itemID; } if (w == 5) { return Item.emerald.itemID; } if (w == 6) { return Block.obsidian.blockID; } if (w == 7) { return Item.coal.itemID; } else { return Item.diamond.itemID; } } public int quantityDroppedWithBonus(int par1, Random par2Random) { return quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); } public int quantityDropped(Random par1Random) { return 1 + par1Random.nextInt(2); } /** * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } /** * The type of render function that is called for this block */ public int getRenderType() { 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 ashtonsmod.IngotBush.blockID; } @Override public EnumPlantType getPlantType(World world, int x, int y, int z) { return EnumPlantType.Beach; } @Override public int getPlantID(World world, int x, int y, int z) { return blockID; } @Override public int getPlantMetadata(World world, int x, int y, int z) { return world.getBlockMetadata(x, y, z); } @Override public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("ashtonsmod:BlockIngotBush"); }
  8. Sidenote you do knwo you wont be able to play this smp right, you've used modloader. which is not smp friendly
  9. How would i go about making my own bonemeal type item? as in an item that acts like bonemeal but is not bonemeal, the problems i have been having with doing this myself is that the original bonemeal is not a normal item, ie it is a metadata item and i don't know how to use the same code from that class without the metadata. I would like my new bonemeal to work exactly the same as bonemeal itself (all the old uses, saplings, wheat, stems , etc). all i have atm is a basic class file.
  10. partly unrelated to the above but not too the title so eeh, how do i make this item onrightClick take one damage rather that deleting? package ashtonsmod.common; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class BStick extends Item { public BStick(int par1) { super(par1); this.maxStackSize = 64; this.setMaxDamage(32); } public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { par1ItemStack.damageItem(1, par3EntityLiving); par2EntityLiving.setJumping(true); return true; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityPotion(par2World, par3EntityPlayer, 24)); par2World.spawnEntityInWorld(new EntityPotion(par2World, par3EntityPlayer, 10)); } return par1ItemStack ; } @Override public void updateIcons(IconRegister par1IconRegister) { this.iconIndex = par1IconRegister.registerIcon("ashtonsmod:EvilStaff"); }}
  11. how would i make it so that when you use an item it changes one block to another, say stone to sand for example.
  12. so mine should be public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(ashtonsmod:ExampleBlock); } public void updateIcons(IconRegister par1IconRegister) { this.iconIndex = par1IconRegister.registerIcon(ashtonsmod:ExampleItem); }
  13. since you locked the previous topis i will have to start a new one, sorry if this is not allowed or anything but i dont understand what you said and i think you misunderstood me too. i meant the blocka player can reach as in distance away. In creative mode you can reach further than you can in survival so it is easier to buils. i could not find a forgehook to change the players reach distance. the way i wanted to impliment this was if a player is wearing a certain armour increase player reach, i already know you can check for the players armour and weapons he/she is wearing but i could not find a way to extend the players reach in blocks whilst doing so, i hope this clears things up. Lexmanos i hope that is his name said there is already a hook for this, if there is and i am being stupid please can you show me the hook? i think he meant the armour detection though. Thankyou!
  14. all of my get texture code arent working now? i thought 1.51 was just a patch anyway technically it is two errors the item texture code and the block texture code so here; Block; @Override public void func_94332_a(IconRegister par1IconRegister) { this.field_94336_cN = par1IconRegister.func_94245_a("ashtonsmod:BlockExampleBlcok"); } Item @Override public void func_94581_a(IconRegister par1IconRegister){ this.iconIndex = par1IconRegister.func_94245_a("ashtonsmod:ExampleItem"); } the errors are under the functions and the exact error is the block one cannot be resolved to a type and the item one is undefined. Hope someone can help!
  15. nope just want to use the snowball renderer
  16. there is no forgehook for this, as far as i know unless your super fluent in java its not possible to do.
  17. oh thats a shame? here i thought it was connected to spiders walking up walls my aim was to make the player able to do so when holding item X. can you direct me towards the hook for this instead?
  18. there seems to be a forgehook for entity isOnLadder, how would i utilize this hook to make the player able to walk up walls without ladders, i already have the first half i just need the player. or something like that. public boolean isOnLadder() { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); int l = this.worldObj.getBlockId(i, j, k); return ForgeHooks.isLivingOnLadder(Block.blocksList[l], worldObj, i, j, k); }
  19. and the more you do this the more you understand the language, the more you combine and mess with the code the more you understand it.
  20. what is a renderer? i am just curios because whenever i talk about creating custom throw able entity and i get a white box instead people tell me i need a renderer. now i assume the game already has them as i has entities and i was also wondering if it was possible to use an existing renderer with a custom entity? i could not find this information anywhere so i am asking you people
  21. update to 1.5 then look at the trapped chest class
  22. for next time the code tells you where the error is; 2013-03-24 13:21:10 [iNFO] [sTDERR] at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:209) this tells you the line of code that is incorrect then you can look at this line and try and ascertain he error more often than not it is a typo like that
  23. how would i go about useing an existing renderer? like the one for the snowball?
  24. basically you misssed a space in your last recipie on the top line you put "XX" of " XX" or whatever you wanted it to be.
×
×
  • Create New...

Important Information

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