Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. I am sorry, I do not know how to be more obvious. getRemainingItems is the list of INGREDIENTS that REMAIN in the slots AFTER the crafting is done. It doesn't consume anything. It is what's LEFT in the slots. The ingredients currently in the crafting table are passed to you in the parameter of the method. The default implementation goes through all ingredients and does the following: If the item has a container item(like a bucket of milk has an empty bucket as it's container item) then the container item is added, otherwise an ampty stack is. You can see how the vanilla's crafting system handles it in SlotCrafting#onTake. It iterates through all items in the crafting matrix, decreasing their stack size by 1. Then if the stack in the slot is empty but the getRemainingItems has a non-empty stack at that position then that stack in the list is inserted into the slot. If the stack in the slot isn't empty but is identical(NBT + meta) to the one returned by the getRemainingItems then the stack in the slot's count is incremented by the size of the stack in the list. Otherwise the item in the list is either added to the player's inventory or dropped.
  2. The OP stated that they are using 1.13.2 in the title. You are making a custom class in your first option... Yeah, this does nothing. This is 1.12 only. This is an internal forge hook for setting harvest tool/level for vanilla blocks. The method even says that modders shouldn't use it so...
  3. This should not be the case. Could you provide screenshots of the use animation from a FP perspective and a TP perspective as well as the entire code for said item?
  4. I repeat myself yet again returns a list of itemstacks that are "left" after the craft is done. If you have a recipe of AB = C and you want A to be consumed then the list would return just B. Assuming A's max stack is 1. It is a NonNullList though, so all empty slots are ItemStack.EMPTY. By default all items are consumed if their container item is empty, otherwise their container item is returned.
  5. No. In this case a custom block class is acceptable. I mean, the fields are technically not final, just private, so you could use reflection but why? see https://github.com/MinecraftForge/MinecraftForge/issues/5560 for reasons as to why there isn't a setter.
  6. Oh, you are right, I totally missed them cloning the array. They do clone the itemstacks from said array which is what made me miss this issue:
  7. What? No, the "best" way is to have ONE enum property and have your rotation depend on that. You know, the way it is done literally everywhere, even for vanilla blocks like a dispenser. Nothing? I take it you are a mod user, not a developer? In that case you would need to find a mod that has that functionality, you can't just change something in the built jar file. Well, technically you can but never do that. If you are a developer then look at vanilla's dispenser or some other block that can rotate in all 6 directions.
  8. No. Don't ever do that. Don't use static initializers for registry entries, this can and WILL break stuff. There are many ways to get the reference to your EntityType, like the ObjectHolder annotation or simply a field.
  9. Just ditch all of those things and simply interact with an ItemStackHandler as your inventory. That's it.
  10. Override Item#getUseAction
  11. The only thing being null at that point is the world of the TE. Use the debugger to figure out why it is null. Also your TE's code is an insane mess. Don't do this, use forge's provided capabilities, like ItemStackHandler. Don't. This makes you do the unnecesarry IInventory implementation. Just use capabilities. Don't do any of this. Just do this in your gui handler.
  12. returns a list of itemstacks that are "left" after the craft is done.
  13. If you are just using it to register your ONE particular recipe that handles all kind of cases then just return a new instance of your IRecipe implementation since you don't need to parse anything
  14. The proper way is to make a _factories.json file where you would register a factory for your custom IRecipe implementation and register it though json. It may still be just one file, just registered via a json and not via a registry event. The reason for that is once you are migrating to 1.13 and up all recipes must have a json file defining them(so they can be disabled by a datapack).
  15. You would need to spawn it manually with World#spawnEntity. Probably have a server tick handler, check the spawn conditions at a random block + the amount of entities in the world + additional conditions, if everything is good spawn the entity. Or you could extend EntityLiving and just block all interactions/features you don't need by providing a NOOP implementation
  16. Don't use a CommonProxy, it makes no sense. Proxies exist to separate sided only code. If your code is common it goes anywhere else but your proxy. This might be the cause of your issue, but Don't use this overload, it's deprecated. Use the one that takes in a Callable as it's last parameter. I think that this is the case of your issue since you don't provide a public parameterless constructor in your implementation. Don't use IHasModel?
  17. Loops exist. But in your usecase sure, NBT may be preferrable. You can make a custom IRecipe implementation that deals with the ingredients passed and determines the results.
  18. This issue should be impossible. Please show your entire log, I have a suspicion that there are more errors to this than just this one
  19. If your fluid is both itemless and blockless you need to manually add it's texture to the atlas map in the TextureStitchEvent
  20. Vanilla uses simple exponent for a lava fog I believe. It uses exp2 for water though. Play around with it to see which function suits you
  21. They... are not expecting it to work the way you are expecting them to expect it to work(my, that's a confusing sentence). Look at their implementation: public ItemStack[] getResults(ItemStack input) { for(Map.Entry<ItemStack, ItemStack[]> entry : this.recipesList.entrySet()) { if(this.compareItemStacks(input, entry.getKey())) { return entry.getValue(); } } return null; } private boolean compareItemStacks(ItemStack stack1, ItemStack stack2) { return stack2.getItem() == stack1.getItem() && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata()); } I mean yeah, there are better structures than a Map here, sure, but they can change it later.
  22. net.minecraft.client.renderer.GlStateManager. If you don't have this class then you are using 1.6 or lower. Or your setup is broken.
  23. To be more specifically GlStateManager.fogMode
  24. Because they are the worst thing ever created, end of story. Pretty much all youtube modding tutorial are absolute garbage, teaching you horrible practices that can and will break things all over the place. That happens because those people having no idea how to code properly, with a very limited knowledge of java and forge made their first item and decided to share their knowledge with the world. They are akin to a person who made a water-pressure rocket for the first time in their life and decided to teach the world how to make real rockets. There are plenty of online java tutorials, most being free. I assume you know how to use the search engine of your preference.
×
×
  • Create New...

Important Information

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