Jump to content

yariplus

Members
  • Posts

    44
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    US
  • Personal Text
    I am new!

yariplus's Achievements

Tree Puncher

Tree Puncher (2/8)

13

Reputation

  1. @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int x = random.nextInt(16); int z = random.nextInt(16); this.generate(world, random, x, world.getHeightValue(x, z), z); } Umm, this is placing every single tree at chunk 0,0 It should be int x = chunkX*16 + random.nextInt(16); int z = chunkZ*16 + random.nextInt(16);
  2. This is the Itemstack writeToNBT method: /** * Write the stack fields to a NBT object. Return the new NBT object. */ public NBTTagCompound writeToNBT(NBTTagCompound p_77955_1_) { p_77955_1_.setShort("id", (short)Item.getIdFromItem(this.field_151002_e)); p_77955_1_.setByte("Count", (byte)this.stackSize); p_77955_1_.setShort("Damage", (short)this.itemDamage); if (this.stackTagCompound != null) { p_77955_1_.setTag("tag", this.stackTagCompound); } return p_77955_1_; } It checks and stores the stackTagCompound, which you store a second time in your writeToNBT: nbt.setTag("ItemStack"+i,NBT); // Stores the NBT.stackTagCompound Tag nbt.setTag("ItemStackData"+i, inv[i].stackTagCompound); // Duplicate Tag markDirty() is a method on TileEntity. It ensures that the TileEntity is saved. Even if Minecraft would normally not save it, for example, when no blocks have changed.
  3. I see a few of problems, You're storing the ItemStack's NBTTagCompound twice. You never call markDirty() You never do null checks. You do a lot of stuff on both Sides, which can cause one Side to have the wrong information. You are setting the player's held Item, without making sure it's empty first.
  4. Static variables don't work like that, you need to get the entity from the event that is passed. You also need to make sure it's a player, because lots of things are entities.
  5. Is the ide giving any errors? Also, did you create an .mcmeta file?
  6. Not sure if this is related to your error, but, when an item is used, you generally do not want to set the slot to null, you want to decrement the stackSize. The game will work out if the slot should be null or not.
  7. the error only gets thrown when I take the item out of my block. Show us the block class.
  8. Looks like you may have used the wrong command. "gradlew setupDevWorkspace eclipse--refresh-dependancies" ^ there should be a space there. eclipse --refresh-dependancies
  9. This is the code from EntityBlaze I put into my own mob. It works perfectly, as I will explain below. (Hopefully accurately.) @Override public void attackEntityWithRangedAttack(EntityLivingBase entity, float distance) { double d0 = entity.posX - this.posX; double d1 = entity.boundingBox.minY + (double)(entity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); double d2 = entity.posZ - this.posZ; This calculates the x,y,z DISTANCE between the projectile and the target. getLook() only gives the DIRECTION. float f1 = MathHelper.sqrt_float(distance) * 0.5F; This is calculating the accuracy (randomness) of the projectile. (The square root of the total distance divided by half. So, larger distances are more accurately fired.) this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)this.posX, (int)this.posY, (int)this.posZ, 0); for (int i = 0; i < 1; ++i) { This part has a for loop because the Blaze can fire three fireballs at a time, but it's not needed in this case. EntitySmallFireball entitysmallfireball = new EntitySmallFireball(this.worldObj, this, d0 + this.rand.nextGaussian() * (double)f1, d1, d2 + this.rand.nextGaussian() * (double)f1); This is the important part. This sets the x,y,z vector of the projectile, it uses the distance numbers calculated above, times a random number. (Because the Blaze fires randomly), you can take out "this.rand.nextGaussian() * (double)f1" and the projectile will always hit you dead on. entitysmallfireball.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; This is where the projectile starts, the 0.5 is added to half the height to place it near the mobs mouth area. this.worldObj.spawnEntityInWorld(entitysmallfireball); } } Done. My class extends EntitySkeleton and nothing but this method is in it. I spawned it in, and now I have a skelington that shoots (Inaccurate) fireballs instead of arrows.
  10. Well, then you have to make Baubles a dependency. This is how I do it. Delete the API folder from your mod, instead, add the built jar of the mod to your build.gradle dependencies block. This will add it to your classpath when building. If you run gradle --refresh-dependencies (I think that's the command.) it should add the jar as an external library in your dev environment (if not add it manually). Make sure your ide has the jar set to "do not compile" or "provided". Then link the library to the source or dev jar (so you can see the code inside your ide.), lastly, add the dev jar to your run/mods folder. If there is no dev jar, you can put the built jar and CCC in run/mods instead.
  11. this.func_77010_a(p_76986_1_, 16, 16, 0, 0); This line is not the same, try using the original maybe? this.func_77010_a(p_76986_1_, enumart.sizeX, enumart.sizeY, enumart.offsetX, enumart.offsetY);
  12. Copy just the API folder, not the whole mod. Yes, anywhere in your mod.
  13. Move your CraftingManager.MainRegistry() to the load method. You need to wait until the blocks and items are all registered before you register the recipes.
  14. That's completely wrong man. In EntityLargeFireball, the last three arguments are the direction vector. Also, EntityLargeFireball sets the acceleration for you. Look at the EntityBlaze class. I started to write some code but diesieben yelled at me last time.
×
×
  • Create New...

Important Information

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