Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DARKHAWX

Members
  • Joined

  • Last visited

Everything posted by DARKHAWX

  1. Ummm. I don't know much about updating mods, but I did have to update one of my mods. Forge does include ModLoader as far as I know, so you should have much problems there. When I updated the only things that were wrong was all of the imports, but I found a simple solution and that is to go into each file and hover over one the imports that is wrong, if you look at the options that appear one should say 'Organize Imports' Click on that. There still may be some errors but that is fine. Once you have done that Organize Imports for every file there should be some errors. These errors are caused by Mojang renaming some of their functions and variables. You will just have to find out what each one is (although there might be something on the wiki). As for the hyperlink stuff, I don't know either. Since the mod was for 1.2.5 there might be alot of errors and a re-write might be in order. When I converted from ModLoader to Forge I did have to re-write most of my code. Anyway have fun with the updating (if you still will do it).
  2. Some thoughts on your thoughts: 1) Yes I worked that out a while ago. 2) I have been looking for the past few days. I wouldn't be here if had found it. 3) The reason for that is when I set up this file I used the 'How To Make An Achievement' from the forum wiki. 4) I am learning.
  3. Just a question. Does any of your achievements invlove picking up an item?
  4. Code for others: AchievementManager.class package mod.ElementalWorld; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import cpw.mods.fml.common.ICraftingHandler; public class AchievementManager implements ICraftingHandler { @ForgeSubscribe public void onItemPickup(EntityItemPickupEvent event) { if (event.item.entityId == ElementalWorld.magicEco.itemID) { System.out.println("Test"); event.entityPlayer.addStat(ElementalWorld.MagicAchieve, 1); } } @Override public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { // TODO Auto-generated method stub } @Override public void onSmelting(EntityPlayer player, ItemStack item) { // TODO Auto-generated method stub } }
  5. Okay, I have found something interesting. When I was looking at EntityItemPickupEvent I saw this: /** * This event is called when a player collides with a EntityItem on the ground. * The event can be canceled, and no further processing will be done. * * You can set the result of this event to ALLOW which will trigger the * processing of achievements, FML's event, play the sound, and kill the * entity if all the items are picked up. * * setResult(ALLOW) is the same as the old setHandled() */ So I thought I could just add setResult(ALLOW) somewhere, but apparently not. I traced all the way back to Entity.class and looked there. But I still can't figure out what to do. What I'm thinking is that if I get setResult(ALLOW) to work then the Achievement will work. So if anyone knows how to change that please tell me. If someone knows that changing this can be bad then please tell me as well. EDIT: This part here in Event.java: private boolean isCanceled = false; private final boolean isCancelable; private Result result = Result.DEFAULT; private final boolean hasResult; private static ListenerList listeners = new ListenerList(); DO NOT, I repeat DO NOT change private Result result = Result.DEFAULT; to private Result result = Result.ALLOW; . It breaks alot of things
  6. Sorry to say but the func not only doesn't work, it doesn't exist (in EntityItem). :'( I dunno where you found it. I am in 1.4.7 of MCP so maybe you're in another version. Anyway I was looking around in EntityItem and found this: public String getEntityName() { return StatCollector.translateToLocal("item." + this.getEntityItem().getItemName()); } Looking at this I came up with what I thought would work: @ForgeSubscribe public void onItemPickup(EntityItemPickupEvent event) { String item = event.item.getEntityName(); if (item == "item.YourItem") { event.entityPlayer.addStat(YourMainModFile.YouAchievement, 1); } } Sadly that still doesn't work. Looking further I found the code for the achievements again: ItemStack var2 = this.getEntityItem(); int var3 = var2.stackSize; if (this.delayBeforeCanPickup <= 0 && (event.getResult() == Result.ALLOW || var3 <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(var2))) { if (var2.itemID == Block.wood.blockID) { par1EntityPlayer.triggerAchievement(AchievementList.mineWood); } if (var2.itemID == Item.leather.itemID) { par1EntityPlayer.triggerAchievement(AchievementList.killCow); } if (var2.itemID == Item.diamond.itemID) { par1EntityPlayer.triggerAchievement(AchievementList.diamonds); } if (var2.itemID == Item.blazeRod.itemID) { par1EntityPlayer.triggerAchievement(AchievementList.blazeRod); } GameRegistry.onPickupNotification(par1EntityPlayer, this); Now I've been looking at this code trying to figure out how I can implement this. I am posting this now to see if you can figure it out before I can. Hopefully one of us does. So now I'll go and fiddle some more and get back to you when I'm done. Bye, bye, and good luck. P.S. Could you look at the new link I put on the Mod Holding Items post.
  7. *sighs* Yes indeed I did look through the file and then proceed to look through the EntityItem file. I looked through it alot and found a section where it triggered some achievements, looking through that I realised it was using item.itemID. So then I spent the next hour trying to use varying parts of the EntityItem file to trigger the achievement. I got very close on some occasions, but alas to no avail. But I didn't look at the func_92014_d(). Looking at what you have said, I basically had what was there just without the func part. But anyway thank you for that. It will help alot.
  8. *Bump Anybody know what to put inside onItemPickup event???
  9. Okay sorry, here is the new link: http://pastebin.com/dbyCJD3d
  10. Okay. Here: http://pastebin.com/ytN7wQ6f
  11. Yes I know that, but what is the code for checking if the item that has been picked up is the right item
  12. Okay thanks, but at the moment I have no idea what to put in the centre of the event.
  13. No. I've placed it where it was placed in EntityZombie. But it still doesn't work. And I have no idea why.
  14. Here is a video detailing how to use Techne and add the model into Java.
  15. Ummmm.... I've looked on the Wiki but it says that the page on Forge Events was deleted... Anybody know another link to somewhere that can explain it?
  16. Yeah i've tried that. Here is the code that I copied from the zombie but it still doesn't work. Can someone figure out what's wrong? public void initCreature() { this.canPickUpLoot = true; this.setCurrentItemOrArmor(2, new ItemStack(Item.swordSteel)); }
  17. Thank you very much I guess I'll go for the easy route as I know how to do that (not so good with the TileEntity stuff).
  18. Yes I have, that is basically where I got the achievement code from. But I want to know how to get an achievement when picking up an item.
  19. Hello guys, I've been trying to add some wool stairs to the game (I know it's probably been done before) and I was trying to work out how to have one block (Whit Wool Stairs) and then have each different coloured block as a metadata afterwards (is that the right terminology?). But was having a problem and I don't exactly know what is causing it. I basically copied the wool code and then changed some names and such. When I place them I get this: (Click Spoiler) What I think is happening is that the metadata for which position the stair is placed in and the metadata for the colour of the wool is getting mixed up. Here is the code for my block: Hopefully one of you can tell me what is wrong and how to change it. Would I just need to rename some of the variables or something??? Do I really have to make each block seperately??? Is there a way to make each block in my inventory change per-colour??? Any help would be appreciated
  20. I have been but I can't find the code, I've also looked at the code for the Zombie Pigmen and I can't find the code for them either. Any other suggestions?
  21. Maybe I'm doing something wrong here but neither method isn't working. Here is the code I have: package mod.ElementalWorld; import net.minecraft.src.EntityPlayer; import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; import cpw.mods.fml.common.ICraftingHandler; public class AchievementManager implements ICraftingHandler { //This is how you check if a player has crafted something that returns the block/item you want them to gain an achievement for public void EntityItemPickupEvent(EntityPlayer player, ItemStack item, IInventory craftMatrix) { if (item.itemID == ElementalWorld.magicEco.shiftedIndex) { player.addStat(ElementalWorld.MagicAchieve, 1); } } //This is how you check if a player has smelted something that returns the block/item you want them to gain an achievement for @Override public void onSmelting(EntityPlayer player, ItemStack item) { } @Override public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { // TODO Auto-generated method stub } } Do I have to put the code somewhere else? Is that what I'm missing here?
  22. Is it possible to get an achievement when right-clicking an item??? Also what is the code to activate and achievement when picking up an item.
  23. Hey guys just wondering what the code is for making my mob pick up items off the ground and what the code would be for my mob to spawn holding an item (I want it to spawn holding a sword). Any help will be appreciated. P.S. I was also wondering if someone would explain what each section of the setRotationAngles does (what angle does it change): super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); float var8 = MathHelper.sin(this.onGround * (float)Math.PI); float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; this.bipedRightArm.rotateAngleX = -((float)Math.PI / 4F); this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; -DARKHAWX

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.