Jump to content

XxArchangelz

Members
  • Posts

    49
  • Joined

  • Last visited

  • Days Won

    1

XxArchangelz last won the day on September 22 2020

XxArchangelz had the most liked content!

Converted

  • Gender
    Undisclosed

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

XxArchangelz's Achievements

Tree Puncher

Tree Puncher (2/8)

9

Reputation

  1. look, this is what I use and it works just fine. package archangel.necromancy.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import archangel.necromancy.Necromancy; import archangel.necromancy.lib.GuiIds; import archangel.necromancy.lib.Strings; public class ItemNecronomicon extends ItemNC { public ItemNecronomicon(int id) { super(id); this.setUnlocalizedName(Strings.NECRONOMICON_NAME); this.setCreativeTab(Necromancy.tabsNecro); maxStackSize = 1; } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { if (!world.isRemote) { entityPlayer.openGui(Necromancy.instance, GuiIds.NECRONOMICON, entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ); } return itemStack; } } This pretty much makes it so when this item in hand is right-clicked, it will open a gui defined in my guihandler (GuiIds) class. This ONLY allows you to open the gui, you still need to make a container class, a gui class and set this up in your proxy
  2. You have to pastebin us what the crash says, or we cannot help you with this.
  3. That only changes the GUI if I rightclick with the item in hand, I need it to switch as I place the item in the slot which I had working, but it only changes after reopening the gui with the item already in the slot
  4. I'm using a custom rendered item though so I have two image files (one with one without), I got it working in the ModelAltar class, but when you disconnect/reconnect the block shows up as it were empty then switches back to having a book when you right click it opening the gui.
  5. Okay I see, I got that all working now thanks so much. I have one last problem. I made it in my proxy to switch GUI's if an item is present with a similar method and separate gui classes, but the gui only switches after opening and closing the gui. Where would I have to do this to make it work instantly?
  6. Okay so now how would I call the texture from my sprites class? I have been trying to figure out a way to get that working, but It wants me to make the method a string.
  7. Oh duh my bad, I thought that was the entire thing so I never put it with the method. Now with SLOT_NO, I'm thinking that means SlotNecronomicon from my container class that is set to only allow a certain item in the slot, should be placed there, or no? Because when I try that it tells me that it cannot be resolved to a variable, so would I need to make a variable for it, and like how? Also when I try to call the texture file assigned in my Sprites class, it throws me an error because the method is an int and to call it from my sprites class would require it be a string.
  8. I'm getting errors on blockAccess being unable to be resolved, and the variables. Is that something missing from the TileEntity class?
  9. I'm sorry not entirely sure what I am doing. I have this for my block class I don't know if I'm putting this correctly, but I am getting syntax errors on the variables and I don't know how to word it to make it change the texture and the gui when the item is present.
  10. I have 2 items, a tile entity/block/container and a container/item. I have it so far that the block (altar) will only accept the item (book), but I want to have it so that when the book is present in the altar, the block will render a different model and the gui will switch (if book is in slot make altar have book on top and new gui otherwise show original gui with empty slot and empty altar without book) I figure I need to do if statements but I don't know where and how to go about it. I was thinking it needed to be in GuiAltar or ItemAltarRender but I don't know. GuiAltar ItemAltarRender I don't know squat about OpenGL and i'm still fairly new to modding so I am trying to learn as much as I can to better myself as modding and java. Thanks for the help
  11. NINJA EDIT I figured it all out. The solution is to create a custom slot (non vanilla slot) and specify it in the class to only allow said items example the slot inside container class
  12. I figured it out and fixed the shift right click crash I use But I don't entirely understand it and I still cannot restrict ONLY allowing a specific item into the slot
  13. I have a tile entity/container for a block and I want to be able to restrict what can go in its inventory slot to a specific item in my mod, but for the life of me I cannot figure out how. I also have it so that shift clicking crashes the game (not supposed to happen ) and I can see that I need to have something like public boolean mergeItemStack(itemStack, start, end, backwards) But I don't know exactly where to put it and what it does. Here is my tile entity class and the container class
  14. Awesome then, Thank you so much for the help. It will have to be server side, odds are I will have more questions but I will try to figure this out. Again thank you so much
×
×
  • Create New...

Important Information

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