Jump to content

UselessRobot

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by UselessRobot

  1. 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?

  2. 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

  3. While testing the server I run for my friends I came across this issue where minecraft would wait for "root.tick" on the client. I expected there to be more lag from the server but after loading into my server moving just a few blocks, likely causing a few new chunks to generate, then spam a line similar to" root.tick took too long". The next line was similar but had repeated root several times, eventually causing minecraft to freeze up, the server is completely unaffected.

    Minecraft log: https://paste.ee/p/YOdbv

    I'm not exactly sure what is wrong and its really becoming a problem.

×
×
  • Create New...

Important Information

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