Posted May 19, 20205 yr Hello. I have transferStackInSlot method and use hasRecipe for find if itemstack is present in recipe. @Override public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { ItemStack itemstack = ItemStack.EMPTY; Slot slot = this.inventorySlots.get(index); if(slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if(index == 2) { if(!this.mergeItemStack(itemstack1, 3, 39, true)) { return ItemStack.EMPTY; } slot.onSlotChange(itemstack1, itemstack); } else if(index != 1 && index != 0) { if(this.hasRecipe(itemstack1)) { if(!this.mergeItemStack(itemstack1, 1, 2, false)) { return ItemStack.EMPTY; } } else if(this.isBucket(itemstack1)) { if(!this.mergeItemStack(itemstack1, 0, 1, false)) { return ItemStack.EMPTY; } } else if(index >= 3 && index < 30) { if(!this.mergeItemStack(itemstack1, 30, 39, false)) { return ItemStack.EMPTY; } } else if(index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) { return ItemStack.EMPTY; } } else if(!this.mergeItemStack(itemstack1, 3, 39, false)) { return ItemStack.EMPTY; } if(itemstack1.isEmpty()) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } if(itemstack1.getCount() == itemstack.getCount()) { return ItemStack.EMPTY; } slot.onTake(playerIn, itemstack1); } return itemstack; } protected boolean hasRecipe(ItemStack stack) { return this.world.getRecipeManager().getRecipe(MaltingRecipe.RECIPE_TYPE, new Inventory(stack), world).isPresent(); } But hasRecipe return false for all itemstack, but i have recipe who works. Recipe: { "type": "realistic_beer_brewing:malting", "ingredient": { "item": "realistic_beer_brewing:barley" }, "result": { "item": "realistic_beer_brewing:barley_seed" }, "process_time": 200 } Recipe in this tile entity works.
May 21, 20205 yr On 5/19/2020 at 9:51 AM, grossik said: return this.world.getRecipeManager().getRecipe(MaltingRecipe.RECIPE_TYPE, new Inventory(stack), world).isPresent(); If it returns false for all item stacks, then either: Your MaltingRecipe recipe list is empty You're using the recipe manager incorrectly Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.