Jump to content

LemonLake

Members
  • Posts

    30
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Just north of London
  • Personal Text
    Java Game Developer

LemonLake's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. So far, it works like a charm! Thanks!
  2. public int getSpellId(ItemStack stack){ return stack.getTagCompound().getInteger("spell"); } Correct?
  3. Spell should be an int, right? I only really need the object instance for the variables, nothing is stored in it really. Edit: How would I go about storing NBT in an item?
  4. It's not too much of a problem, I can simply use onBlockActivated on the Spell Table block. Unfortunately, I cannot use these functions for other spells
  5. After adding castAir=true; to the constructor of NullItem, and adding your code to castAirEvent, then finally right clicking towards the sky, I just got 2013-08-09 15:25:29 [iNFO] [sTDOUT] client side thinks: true. No mention of serverside.
  6. Description Resource Path Location Type getEffectiveSide cannot be resolved or is not a field Spell.java /Minecraft/src/lemmy/eldercraft line 49 Java Problem Edit: Added parenthasis to the end of getEffectiveSide, testing now. 2013-08-09 15:19:19 [iNFO] [sTDOUT] client side thinks: true
  7. public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { System.out.println("1"); if(!world.isRemote&&world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ System.out.println("2"); if(player.inventory.getStackInSlot(0)!=null){ System.out.println("3"); if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ System.out.println("4"); switch(player.inventory.getStackInSlot(0).itemID){ case 370: System.out.println("5"); player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: System.out.println("6"); player.addChatMessage("§cNo available items found in first slot"); break; } System.out.println("7"); }else{ System.out.println("8"); player.addChatMessage("§cWands cannot be transmuted"); } }else{ System.out.println("9"); player.addChatMessage("§cNo available items found in first slot"); } System.out.println("10"); } System.out.println("11"); } 2013-08-09 15:10:12 [iNFO] [sTDOUT] 1 2013-08-09 15:10:12 [iNFO] [sTDOUT] 11
  8. Here's four classes: ItemWand, Spell, NullSpell (the one I'm referencing in my first post) and SoulSpell: ItemWand.java: Spell.java: NullSpell.ava: SoulSpell.java Summary: There are events in ItemWand. In spell, there are functions such as castSpellBlockFirstEvent. These do a few checks, then call castSpellBlockFirst. The event functions are called in ItemWand, and the non-event functions are overriden in the new spell.
  9. I thought that was the problem, but ignored it because in another spell I used it and thought I used it in my base function. Thanks! EDIT: Now nothing happens when I right click, and I have a similar problem with my Soul Spell. public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { if(!world.isRemote&&world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ if(player.inventory.getStackInSlot(0)!=null){ if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ switch(player.inventory.getStackInSlot(0).itemID){ case 370: player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: player.addChatMessage("§cNo available items found in first slot"); break; } }else{ player.addChatMessage("§cWands cannot be transmuted"); } }else{ player.addChatMessage("§cNo available items found in first slot"); } } }
  10. Google will be your guide through your life. http://dev.bukkit.org/bukkit-plugins/death-messages/
  11. I am having a problem with items in Forge 9.10.0.804. When I create my new item using two old items, I recieve the new one fine, however as soon as I click it my inventory resets to it's previous state. The video explains it better: [flash=640,360]https://youtube.googleapis.com/v/NXLulVE8x8k Here is my code for swapping the items: public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { if(world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ if(player.inventory.getStackInSlot(0)!=null){ if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ switch(player.inventory.getStackInSlot(0).itemID){ case 370: player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: player.addChatMessage("§cNo available items found in first slot"); break; } }else{ player.addChatMessage("§cWands cannot be transmuted"); } }else{ player.addChatMessage("§cNo available items found in first slot"); } } } Any help would be appreciated. If you need any information, just post or PM.
  12. You beat me to it, but then my post disappeared
×
×
  • Create New...

Important Information

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