Jump to content

Skelyvelocirap

Members
  • Posts

    51
  • Joined

  • Last visited

Skelyvelocirap's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. Alright well i have absolutely no clue what happened but i saw that yet somehow misread resource location as... frankly i have no clue what. And the only thing i have to say about this is... UGHHHHHHHHHHHHHHHHHHHHH. I was about to say that it still didn't work but as it turns out i just had an if statement that was made to check for something irrelevent. It wouldn't have changed the fact that i needed to ask help for this but could at least have save me quite a few minutes of headaches. Either way thank you it works perfectly now! I haven't tested it with modded biomes yet so ill just ask instead, Registries#BIOME does detect modded biomes as well correct? I know that in older versions vanilla and modded registries were seperated. Although thank you once again for the help!
  2. Alright, so. I tried looking through the topic you sent and i can't quite figure it out. The thing is that its converting a Biome to a Holder<Biome> which isn't quite what i need it to do. The actual problem im having is the i need to store the Biome as NBT and somehow retrive it. The only way i can think of doing that is with the registryName which if memory serves me right was able to be used to get a biome with and the biome could be used to get that. I assume that it uses the Registries#BIOME which i believe you mentioned, but im not quite sure what to do from there as there doesn't seem to be any usefull methods for it. It's been a while since ive worked with forge so im sorry if im just failing at something simple.
  3. Huh. I have no clue why i couldn't find those then. My google results have always been terrible so that might be why. Either way, i actually realized i had asked the same question for 1.16 so i kinda had a hint as for what to look for except i would never have guessed they changed that class too. Either way thanks for the help and ill go and try that out right now
  4. I need to store a biome as NBT for an item. Unfortunately that does not seem to be possible, and even if it were if would probably be horribly inneficient. So I decided to opt for a different method. I want to try and store the name of the biome instead, or an ID of some sort. The issue is that whatever i try it never seems to work. I tried looking for some sort of getName() function inside of the Biome class to no avail. I also tried to use ForgeRegistries.BIOMES.getKey(biome).getPath(); And other similar functions such as using the resourceKey and resource location but for some reason those simply return an empty string. I did verify and biome is an actual biome. Please help me ive been stuck on this problem for about 2 days now and no one seems to have had this problem before, at least not in 1.19.
  5. Alright so, ive gotten it to work but now im a bit confused as to how i add items to the inventory. Im guessing its not as simple as inventoryHandler#setStackInSlot() is it? Would this add it to the item or itemstack?
  6. I am really confused tbh. How exactly am I supposed to do that?
  7. How do i check the type of capability its returning for with this method though?
  8. Hmmm, it still doesn't work. The type ParcelItem does not define ParcelItem() that is applicable here Im guessing this is due to the argument in the constructor but im not really sure how to fix that.
  9. public class ParcelItem extends Item implements ICapabilityProvider { LazyOptional<ItemStackHandler> inventoryHandler = LazyOptional.of(this); public ParcelItem(Properties properties) { super(properties); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return inventoryHandler.cast(); } return null; } } Alright, i will make sure to use that instead, although, this is currently what I have. From the docs i understand i have to use a lazy optional and use the IItemHandler(im guessing replacing it with ItemStackHandler is fine consider it uses IItemHandler as a base). I thought i could pass the class as the supplier though but it seems i was mistaken. What exactly am i supposed to pass to it? Am i even supposed to do it like this?
  10. Ohhhhhhh, thats how you get access to those methods. I knew you used to get those in 1.12.2 but completely forgot how, that answers that! So now i simply add an IInventory to the item along with implementing the capability right?
  11. This is pretty self explanatory but i am trying to attach an inventory to one of my items. I know that i should be using capabilities for this but I'm not sure where i should put it for an item. Would it go inside of initCapabilities(), and if so how would i use that? I tried to take a look at how other mods do this but every mod seems to do it a different way and all of which require some kind of GUI(which I do not want). Of course there is the forge docs but their isn't enough documentations for doing so to items, it mostly explains for tile entities. Anything else i could find is too old to be any use with the complete API reworks basically every other version. Could someone help me with this? I was able to solve this issue last time i encountered it by simply adding the name of the stored item to the nbt but I'm afraid this wont work for this as I need to be able to have more than one slots.
  12. Oops, my bad. I accidentally put it in the wrong spot. It works just fine now! Thank you very much for your help!
  13. Hmmm, for some reason it doesn't work. I know the password and username are both correct and i did exactly what i just mentioned. Am i supposed to run something other than genEclipseRuns?
  14. So for the latter, would this be correct? args '--username', 'insert_username' For the former though, its simply just writing a variable? So something like that: password_variable="this_is_my_password" And then using this as the value for args?
×
×
  • Create New...

Important Information

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