Jump to content

AndrewSherman

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by AndrewSherman

  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. Cool sounds good, thanks!
  5. 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.
  6. 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!
  7. 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.
  8. 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?
  9. 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!)
  10. 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!
  11. What is the difference between render and entity classes to make it stop working?
  12. So...? What do I do? Set it all to client side?
  13. 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?
  14. 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!
  15. do you have to do this.captureDrops=true; in the constructor?
  16. But isn't there something to do with NBT files? People that make adventure maps use it don't they? Yeah, I could make a new mob though
  17. Is there a way to make a specific instance of Entity drop an additional item (to what is set in the vanilla class). Basically I want a Zombie to spawn when a block is broken (which I have done and it works), and I want that Entity to hold and then drop an enchanted sword. How would one do this? I have tried capturedDrops.add(ENTITYITEMvariable) and that didnt work...
  18. Why don't you just put 'this.setCurrentItemOrArmor(0, new ItemStack(Deadworld.scythe));' in the constructor?
  19. Haha, wow I'm an idiot apparently. BTW I think it should be made clearer that the mods folder that you put your resources in is inside the .zip file rather than just putting the resources folder in the actual mods folder (.minecraft/mods).
  20. Ok, so I zipped together the two folders: Graveyard_Mod (which contains the .class files) and the mods folder (containing GraveyardResources/textures/blocks/xyz.png). And I got the same result as last time. No textures. Ok, here is my mod file! I know it's a big ask, but could you please check the files and set up? (try installing it normally first then check the source, as it could just be my computer somehow) Excuse the abismal coding http://www.mediafire.com/?41prnkr12ir77m7
  21. Whoah there! When I reobfuscate I get this [MCP]/reobf/minecraft/Graveyards_Mod/**list of class files** Because I made my own package for my mod, I just copy the Graveyards_Mod folder into minecraft.jar for it to work right? Not zipped or anything, just the folder with the compiled class files inside. The resources I took the folder inside the mods folder in eclipse (which is called GraveyardResources) and I put it in the directory shown in the image.
  22. No, the reobfuscated file was my Graveyards_Mod folder, which contains all of the .class files. I simply copied the GraveyardResources folder from where I had it in the MCP/src/mod/...etc into the directory in the picture! EDIT: Sorry for the late reply, I'm surprised at the quick responses! PS: What time zone are the majority of people here on? I'm in the UK so it's now 13:19
  23. SOLVED: The directory for resources is minecraft/mods/[YOURMOD.zip]/mods/resources/textures/blocks/.png. Rather than just .minecraft/mods/resources/textures/blocks/.png/ MCP 751 I'm on a mac (not by free choice though ) Ok so here's the deal. I only found out yesterday that the whole Item/Block texture system has completely changed from what it was when I was last modding (around January 2013). So I hastily looked up how to do it. An example of my code is here: http://i1227.photobucket.com/albums/ee437/AndrewShermans/Screenshot2013-06-13at120046_zps074f2109.png[/img] Now this works fine in Eclipse, with the directory for the image files as [mcp751]/src/minecraft/mods/GraveyardResources/textures/blocksORitems/icon.png But as soon as I put my mod folder into minecraft.jar (after reobfuscating obviously), the mod works fine but all of the textures have the mysterious white texture which says 'Missing Texture'( or whatever). This is the directory of my resources folder: http://i1227.photobucket.com/albums/ee437/AndrewShermans/Screenshot2013-06-13at115941_zps80fd819c.png[/img] Anyone know what the problem is? Either code or directories, I'm open to suggestions! PS: Could it be something to do with the Mac?
  24. When I run the makefile I get: Last login: Sun May 13 15:47:25 on ttys001 The-Shermans-iMac:~ Andrew$ /Users/Andrew/Desktop/astyle/build/mac/Makefile ; exit; /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 7: SRC: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 15: vpath: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 16: vpath: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 20: ifndef: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 21: JAVA_HOME: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 22: endif: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 25: ifndef: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 27: endif: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 28: prefix: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 31: prefix: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 34: dylib: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 35: dynamiclib: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 36: bindir: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 37: objdir: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 38: prefix: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 39: CBASEFLAGS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 40: JAVA_HOME: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 40: JAVAINCS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 41: CXX: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 42: USER: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 42: USER: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 42: -o: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 46: ifdef: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 47: dylib: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 48: dynamiclib: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 49: endif: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 54: ifdef: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 55: CBASEFLAGS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 55: CFLAGS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 55: CFLAGSr: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 56: CBASEFLAGS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 56: CFLAGS: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 56: CFLAGSd: command not found /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 57: syntax error near unexpected token `else' /Users/Andrew/Desktop/astyle/build/mac/Makefile: line 57: `else ' logout [Process completed]
×
×
  • Create New...

Important Information

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