Jump to content

Yagoki

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by Yagoki

  1. i already got this far, just not sure how to use it to detect the double jump, which is the part i'm not sure on. Thanks anyway
  2. Hello All, I'm new to keybinds and can't find a tutorial for them anywhere, I figured out how to register a new KeyHandler and have created this class (Haven't edited any of the contents yet as I'm not sure what to do). This is the class Eclipse made for me: What do I need to change in here so I can code the double jump (I guess this is done in the key down or key up section) Thanks in advance
  3. not sure why but it won't edit the speed of the player using this method (also tried flying but it didn't work)... not sure why as it worked fine for negating fall damage...
  4. Hello All, currently I'm trying to add a custom armour to my mod, i wish to add a custom render to this so that i can make certain parts of this appear to glow, I know how to do this from looking in the enderman render files and looking at the how the eyes are rendered, if you want to know this is done by using disabling the lighting in GL11 or something, I'll figure that out this later by inspecting this a bit more. What I need to know is how to create a custom renderer and make my armour use it, i.e. what would it extend/implement and where do I call/reference it? Thanks in advance
  5. just done a bit of experimenting, and it seems that the onUpdate method does not work for equipped items. I'll look for an alternative method to use but if you find something please let me know as i need this sor the iron man armor i'm trying to make.
  6. Not tried this code yet but it should work if(entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)entity; if(player.inventory.armorInventory.equals(new ItemStack[]{new ItemStack(//helmet),new ItemStack(//body),new ItemStack(//legs), new ItemStack(//boots)})) { //abilities code here } }
  7. Not sure what you mean? there is the EntityLiving, which is the thing being clicked, if you want something to happen when this is clicked on a player simply cast this as EntityPlayer. If you want the entity holding it then i'm not sure, may post an edit if i figure out how to do this. P.S. sorry for the late post, I've not been able to get to my computer due to school work
  8. I'm trying to add HUD elements to an armour in a mod I'm trying to make, but I cant find any pointers to where to start. If anyone can give me pointers to a tutorial for this or an idea of where to start (I want to add elements to show the charge on the armours and the damage on each piece, as well as show the active features on the armour. [i will hopefully be able to figure this out once someone shows me how to add something basic]) Thanks in advance
  9. Put this in your item code, you don't need to edit anything with the entity, just put this in the code for your item public boolean itemInteractionForEntity(ItemStack itemstack, EntityLiving entity) { if (entity.worldObj.isRemote) { return false; } //stuff to do on right click return true; } that's all you need to do. Hope I helped [EDIT] the entity is the entity being clicked, not the clicker. [EDIT #2] if you want to change stuff about the entity with this, look in the code for the sheers.
  10. FIXED IT @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { if(stack.stackTagCompound == null && stack.itemID == ModResorces.decay.shiftedIndex){ setWorldTimer(stack, world); return; }else if(stack.itemID != ModResorces.decay.shiftedIndex){ return; } if(world.getTotalWorldTime() >= stack.stackTagCompound.getLong("EndTime")) { stack.itemID = ModItems.adamantiumBucket.shiftedIndex; for(int i = 0; i < 36; i++){ if (((EntityPlayer)entity).inventory.mainInventory[i] != null){ if(((EntityPlayer)entity).inventory.mainInventory[i] == stack){ ((EntityPlayer)entity).inventory.mainInventory[i] = new ItemStack(Block.stone); } } } }else{ stack.setItemDamage(201 - (int)(stack.stackTagCompound.getLong("EndTime") - world.getTotalWorldTime())); } } Not sure if the null check is needed, but it doesn't hurt to put it there, Thanks for putting me onto the track of looking at what i could do with the inventory Thanks a tonne
  11. sounds reasonable but there doesn't seem to be a method called "detectAndSendChanges()", or anything similar
  12. I attempted that but it wouldn't replace the stack at all
  13. I'm trying to make an item which decays into another item over time. I've managed to get the decaying to work properly, which was a post i put on here a while ago and got no responses to, but now when the stack changes the Item it is replaced with is not of the same type as it should be (i.e. i tried changing it to stone for test purposes but the item it is replaced with will not stack with stone. Anyone know how to fix this? Here's the relevant parts of the code: @Override public void onCreated(ItemStack stack,World world,EntityPlayer player) { if(stack.itemID == ModResorces.decay.shiftedIndex){ setWorldTimer(stack, world); } } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { if(stack.stackTagCompound == null && stack.itemID == ModResorces.decay.shiftedIndex){ setWorldTimer(stack, world); return; }else if(stack.itemID != ModResorces.decay.shiftedIndex){ return; } if(world.getTotalWorldTime() >= stack.stackTagCompound.getLong("EndTime")){ stack.itemID = 1; }else{ stack.setItemDamage(201 - (int)(stack.stackTagCompound.getLong("EndTime") - world.getTotalWorldTime())); } } public void setWorldTimer(ItemStack stack, World world) { if(stack.itemID == ModResorces.decay.shiftedIndex && stack.stackTagCompound == null) { stack.setTagCompound(new NBTTagCompound()); } stack.stackTagCompound.setLong("EndTime", world.getTotalWorldTime() + 200); }
  14. I'm trying to make a set of armour which removes all fire damage, I have managed to do this using the ISpecialArmor interface, but can not stop the hearts flashing and the other effects which happen on the damage ticks, despite the actual damage being prevented. How can I make it so the sound and other stuff does not happen? Here is the existing code for the armour: package yagoki.mods.weapons.items.armor; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraftforge.common.ISpecialArmor; import yagoki.mods.weapons.CommonProxy; public class PyriteArmor extends AdamantiumArmor implements ISpecialArmor { public PyriteArmor(int itemID, EnumArmorMaterial par2EnumArmorMaterial, int renderType, int part) { super(itemID, par2EnumArmorMaterial, renderType, part); } @Override public String getArmorTextureFile(ItemStack itemstack) { if(this.armorType != 2) { return "/yagoki/mods/weapons/textures/armor/pyrite_1.png"; }else { return "/yagoki/mods/weapons/textures/armor/pyrite_2.png"; } } @Override public String getTextureFile() { return CommonProxy.ITEMS_PNG; } @Override public ArmorProperties getProperties(EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot) { ArmorProperties pyrite; if(source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire) { pyrite = new ArmorProperties(1, 1, 100); }else { pyrite = new ArmorProperties(0, 0, 0); } return pyrite; } @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 0; } @Override public void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot) { } }
  15. Just playing with the code as it is i found the item would not decay when in a chest (Haven't checked furnaces). Is there a way i could do this better so that its location does not matter? also would not decay as an entity in the world, could this also be solved?
  16. Fixed it. Changed the code to this and it seems to work fine for now public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { if(stack.getItemDamage() == 1) { stack.itemID = 1; }else if(stack.getItemDamage() > 1 ){ stack.setItemDamage(stack.getItemDamage() - 1); }else{ stack.setItemDamage(20); } } the 1 for the final item id is just temp id to see if it was working, and the method feels a tad hackey, so if anyone can think of a better way let me know
  17. Hi Just thought I would translate as this topic wasn't getting any responses. The following is a translation of the section in German, done as best I could through my GCSE German "hi my problem is: the code is for minecraft version 1.2.3 is it difficult to change a mod from modloader to forge? i would like a complete rewrite, which i will do from forge tutorials or from modloader tutorials and then, based on those rewrite. I have no/little knowledge of forge, and only know form mods i use, therefore please excuse me if this is a stupid question" Hope this helps, I don't personally know much on this topic and can only say that most modloader mods tent to be work with forge, through the forge modloder, so changing from modloader to forge shouldn't be too tricky, hopefully just moving a few methods to different classes and a few more imports/extensions/implementations. not sure how to say the above in German.
  18. I'm trying to make an item which will decay/take damage over time to make a fairly OP branch of my mod a bit harder to reach. At the moment I can only make it decay using the "onUsingItemTick" method. Is there a way I can make it decay when it is just in the inventory or in the world? Thanks in advance
×
×
  • Create New...

Important Information

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