Jump to content

johnhollowell

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by johnhollowell

  1. I found this on the Enchanted book. might help you. /** * Adds an stored enchantment to an enchanted book ItemStack */ public void addEnchantment(ItemStack par1ItemStack, EnchantmentData par2EnchantmentData) { NBTTagList nbttaglist = this.func_92110_g(par1ItemStack); boolean flag = true; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.tagAt(i); if (nbttagcompound.getShort("id") == par2EnchantmentData.enchantmentobj.effectId) { if (nbttagcompound.getShort("lvl") < par2EnchantmentData.enchantmentLevel) { nbttagcompound.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); } flag = false; break; } } if (flag) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setShort("id", (short)par2EnchantmentData.enchantmentobj.effectId); nbttagcompound1.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); nbttaglist.appendTag(nbttagcompound1); } if (!par1ItemStack.hasTagCompound()) { par1ItemStack.setTagCompound(new NBTTagCompound()); } par1ItemStack.getTagCompound().setTag("StoredEnchantments", nbttaglist); } Hope this helps!
  2. What was causing my bug is that I didn't have this: @Override public boolean renderAsNormalBlock(){ return false; } Once I changed this, it worked perfectly!
  3. I also am trying to get a block to be walk through. I looked at the vanilla blocks that are walk through, namely BlockTallGrass and it's super class, BlockPlant. Both have this: public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } When I use this on my block, I can force my player into the block by having it in a hole, but when there is an open area to the side of the block the block pushes me into the open space. Anyone know how to fix this?
×
×
  • Create New...

Important Information

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