Posted March 14, 20223 yr I've been trying to make a tile entity that extends AbstractFurnaceTileEntity but have run into a bump with getting the recipe from the smelting recipetype. I've had a look at some older posts about getting recipes from existing recipetypes but I can't quite make out what I'm missing. I've been able to narrow down my issue to my "implementation" of burn below: Spoiler protected boolean canBurn(@Nullable IRecipe<?> recipe) { if(recipe == null) { TileEntityOnly.LOGGER.info("recipe is null."); } if (!itemHandler.getStackInSlot(0).isEmpty() && recipe != null) { //recipes are null fix this part ItemStack resultStack = ((IRecipe<ISidedInventory>) recipe).assemble(this); if (resultStack.isEmpty()) { return false; } else { ItemStack outputStack = itemHandler.getStackInSlot(2); if (outputStack.isEmpty()) { return true; } else if (!outputStack.sameItem(resultStack)) { return false; } else if ( outputStack.getCount() + resultStack.getCount() <= this.getMaxStackSize() && outputStack.getCount() + resultStack.getCount() <= outputStack.getMaxStackSize() ) { // Forge fix: make furnace respect stack sizes in furnace recipes return true; } else { return outputStack.getCount() + resultStack.getCount() <= resultStack.getMaxStackSize(); // Forge fix: make furnace respect stack sizes in furnace recipes } } } else { return false; } } Any help would be appreciated. Repository link: https://github.com/Lucidcream/tile_entity_only-1.16
March 15, 20223 yr Author That's something big I missed. Considering the purpose of this mod I think it'd be better for me to not use AbstractFurnaceTileEntity and instead extend TileEntity and just use the smelting RecipeType. Thanks for the help EDIT: After a closer look, RecipeTypes is also based on IInventory so it'd be more convenient to extend AbstractFurnaceTileEntity anyway. Though the main reason I had done this was that I was unable to get the burnProgress and litTime from AbstractFurnaceTileEntity. Is there anything stopping me from sending this information to my block's Screen? Edited March 15, 20223 yr by UselessRobot
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.