-
Posts
1773 -
Joined
-
Last visited
-
Days Won
61
Everything posted by V0idWa1k3r
-
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.
-
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?
-
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.
-
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:
-
Being able to place a block on all directions
V0idWa1k3r replied to mineman12's topic in Modder Support
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. -
[1.13.2] Examples on how to register and make a new Entity?
V0idWa1k3r replied to iLaysChipz's topic in Modder Support
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. -
[1.13.2] BlockState giving NullPointerException
V0idWa1k3r replied to MyRedAlien43's topic in Modder Support
Just ditch all of those things and simply interact with an ItemStackHandler as your inventory. That's it. -
Override Item#getUseAction
-
[1.13.2] BlockState giving NullPointerException
V0idWa1k3r replied to MyRedAlien43's topic in Modder Support
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. -
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).
-
[1.12.2] How to make non-living entity spawn in the world?
V0idWa1k3r replied to GloriousAlpaca's topic in Modder Support
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 -
[1.12.2] Player Capability null pointer exception
V0idWa1k3r replied to SaltStation's topic in Modder Support
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?- 1 reply
-
- 1
-
[1.12.2] problem with sending fluidtank to client
V0idWa1k3r replied to Tieso2001's topic in Modder Support
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 -
[1.12.2] Blockless fluid universal bucket missing texture
V0idWa1k3r replied to MrJake's topic in Modder Support
If your fluid is both itemless and blockless you need to manually add it's texture to the atlas map in the TextureStitchEvent -
Whow your code.
-
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
-
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.
-
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.
-
To be more specifically GlStateManager.fogMode
-
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.