Jump to content

AndrewSherman

Members
  • Posts

    44
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

AndrewSherman's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Haha thanks anyway, at least this whole 'dilemma' has got me looking in the correct locations now!
  2. /** * Register a block to be harvested by a tool class. This is the metadata * sensitive version, use it if your blocks are using metadata variants. * By default, this sets the block class as effective against that type. * * @param block The block to register. * @param metadata The metadata for the block subtype. * @param toolClass The tool class to register as able to remove this block. * You may register the same block multiple times with different tool * classes, if multiple tool types can be used to harvest this block. * @param harvestLevel The minimum tool harvest level required to successfully * harvest the block. * @see MinecraftForge#setToolClass for details on tool classes. */ public static void setBlockHarvestLevel(Block block, int metadata, String toolClass, int harvestLevel) { List key = Arrays.asList(block, metadata, toolClass); ForgeHooks.toolHarvestLevels.put(key, harvestLevel); ForgeHooks.toolEffectiveness.add(key); } Just found this. Posting before looking but hey, I'll see if it's actually useful in a sec! Ok, yes it's useful and yes it works! I know what to look out for in the future now, thanks everyone for you help!
  3. I don't want to sound like a total noob but is a forge hook just a line of code in a base file that can be accessed by anyone to edit parts of the base file remotely (:. Reducing likelihood of compatibility errors) or is it something else entirely?
  4. Apparently Forestry mod got things to spawn in villages, but I can't work out how you could do that without editing the vanilla files...sucks that I'm not adept enough to figure it out but hey.
  5. Oh, I don't know lol...bit weird... I think I extended block dirt at one point to see if that would help with anything...not sure if that would've done it or if it's just my own stupidity! Making it public still didn't change anything though by the way!
  6. Would you include 'some way' (a hook or something) to add to the components used in spawning NPC villages? I can get by without having this functionality, but some people on my forum post asked me if I would make my graveyards spawn as a part of an NPC village (rather than just randomly in the wilderness as it were). At the moment I think (I may be wrong) that the only way to achieve this is to edit base classes...but I may be wrong because apparently TC3 added mage towers and Forestry added the Apiarist house.
  7. Is there a way to add a new component to an NPC village without having to edit base files? If not, would it be a good idea to add hooks?
  8. Yeah, that's not actually working! I'm using this as the constructor: protected BlockGraveDirt(int par1) { super(par1, Material.ground); } And with a (vanilla) efficiency shovel it doesn't make a difference... (Actually, it doesn't matter what I use to dig it, it always takes the same time to break!)
  9. Hi, I was just wondering if there was a way to make a block affected by the efficiency enchantment. I thought that setting Material.ground would make this work but apparently not...thanks for the help!
  10. What is the difference between render and entity classes to make it stop working?
  11. So...? What do I do? Set it all to client side?
  12. I'm using the IBossDisplayData interface and BossStatus.func_82824_a(this, true); I have it set up so that the BossStatus.func_82824_a(this, true); is called from onLivingUpdate() This is what I used for Boss Health: public int getBossHealth() { return this.getHealth(); } For some reason, every other update, getHealth() returns the max health... I don't know why though I have bug tested and it's not getBossHealth() it's getHealth() which is bad... [spoiler=EntityCustomZombie] package Graveyards_Mod; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.boss.BossStatus; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class EntityCustomZombie extends EntityZombie implements IBossDisplayData{ private ItemStack chest = new ItemStack(Item.plateDiamond, 1), sword = new ItemStack(Item.swordDiamond, 1); public EntityCustomZombie(World par1World) { super(par1World); this.setEntityHealth(this.getMaxHealth()); if (this.worldObj.difficultySetting == 3) { EnchantmentHelper.addRandomEnchantment(rand, sword, 30); EnchantmentHelper.addRandomEnchantment(rand, chest, 30); } else { EnchantmentHelper.addRandomEnchantment(rand, sword, 20); EnchantmentHelper.addRandomEnchantment(rand, chest, 20); } this.setCurrentItemOrArmor(0, sword); this.setCurrentItemOrArmor(1, new ItemStack(Item.helmetDiamond)); this.setCurrentItemOrArmor(3, chest); this.setCurrentItemOrArmor(2, new ItemStack(Item.legsDiamond)); this.setCurrentItemOrArmor(4, new ItemStack(Item.bootsDiamond)); for(int i = 0; i<5;i++){ this.equipmentDropChances[i] = 0.0F; } } protected int getDropItemId() { return Item.swordDiamond.itemID; } protected void dropFewItems(boolean par1, int par2) { this.entityDropItem(chest, 1); this.entityDropItem(sword, 1); } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(16, new Integer(this.getMaxHealth())); } public int getMaxHealth() { return 20; } protected void addRandomArmor() {} private Entity targetedEntity = null; private int explosionStrength; @SideOnly(Side.CLIENT) protected void updateEntityActionState() { explosionStrength = rand.nextInt(3)+1; double d4 = 64.0D; this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) { double d5 = this.targetedEntity.posX - this.posX; double d6 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); double d7 = this.targetedEntity.posZ - this.posZ; this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(d5, d7)) * 180.0F / (float)Math.PI; if (this.canEntityBeSeen(this.targetedEntity)) { this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7); entitylargefireball.field_92057_e = this.explosionStrength; double d8 = 4.0D; Vec3 vec3 = this.getLook(1.0F); entitylargefireball.posX = this.posX + vec3.xCoord * d8; entitylargefireball.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; entitylargefireball.posZ = this.posZ + vec3.zCoord * d8; this.worldObj.spawnEntityInWorld(entitylargefireball); } } } int i = 0; @SideOnly(Side.CLIENT) public void onLivingUpdate() { i++; super.onLivingUpdate(); if(i>=20){i=0;BossStatus.func_82824_a(this, true);BossStatus.func_82824_a(this, true);System.out.println("Boss Health: "+this.getBossHealth()+"`Just Health: "+this.getHealth());} int f = rand.nextInt(30); if (f==0){ updateEntityActionState(); } } @Override @SideOnly(Side.CLIENT) public int getBossHealth() { return this.getHealth(); } } I realise you're not supposed to use it here but either way is there an explanation for the alternation between the maximum health and the actual health?
  13. For Blocks: Use Block.[blockname].getBlockTextureFromSide(par1) EG/ The crafting table uses the planks texture here: public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? [b]Block.planks.getBlockTextureFromSide(par1)[/b] : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); } For Items: I don't know sorry. Some items (like the bow) use the forge registerIcons method, in which case you can just steal that...but most others don't! Sorry!
×
×
  • Create New...

Important Information

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