Jump to content

Recommended Posts

Posted (edited)

Hi Everyone ;)

 

I followed some tutorials and examples of existing mods to create my own Duel Furnace with custom recipes, annnnddddd ... It doesn't work (ofc, otherwise i wouldn't be here ^^)

 

I created a first one fully fonctionnal with IInventory, but as i wanted to refresh my code using ItemHandler i created a second one almost fonctional (it keeps items when i log out, drop my stuff when i break it, and doesn't allow me to put items on Output Slot and anything but fuel in FuelSlot),

but i just can't make it burn ...

 

In the code, you may find some useless parts (i started codding only a week ago). You still can point it out if you want.

My hypothesis is that the crash is because there is an hybrid IIventory-IItemHandler method hidden somewhere i didn't find when i tried to refresh my code.

 

 

Here is my block :

Spoiler

package sunsigne.MyMod.blocks;

import java.util.Random;

import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import sunsigne.MyMod.IHasModel;
import sunsigne.MyMod.MyMod;
import sunsigne.MyMod.Reference;
import sunsigne.MyMod.init.ModBlocks;
import sunsigne.MyMod.init.ModItems;
import sunsigne.MyMod.tileentity.FakeBlockTileEntity;
import sunsigne.MyMod.tileentity.ShelfTileEntity;

public class FakeBlock extends BlockContainer implements IHasModel
{
    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final int FAKE_BLOCK_GUI = 80;
    public static final PropertyBool BURNING = PropertyBool.create("burning");
    
    
    public FakeBlock(String name)
    {
    
        super(Material.ROCK);
        setUnlocalizedName(name);
        setRegistryName(name);
        setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
        
        setSoundType(SoundType.STONE);
        setHardness(3.5F);
        setResistance(17.5F);
        setHarvestLevel("pickaxe", 0);
        setLightLevel(0.0F);
        //setLightOpacity(1);
        //setBlockUnbreakable();
        
        ModBlocks.BLOCKS.add(this);
        ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));
        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(BURNING, false));
    }
    
    @Override
    public void registerModels()
    {
    
        MyMod.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory");
    }
    
    
    
    @Override
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }
    @Override
    public boolean isFullCube(IBlockState state)
    {
        return false;
    }
        
    
    //this block is at default state when i drop it
    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune) {
        return Item.getItemFromBlock(ModBlocks.FAKE_BLOCK);
    }
    
    @Override
    public EnumBlockRenderType getRenderType(IBlockState state)
    {
        return EnumBlockRenderType.MODEL;
    }
    
    @Override
    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
        return new ItemStack(ModBlocks.FAKE_BLOCK);
    }
    
    @Override
    public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) 
    {
        if (!worldIn.isRemote) 
        {
            IBlockState north = worldIn.getBlockState(pos.north());
            IBlockState south = worldIn.getBlockState(pos.south());
            IBlockState west = worldIn.getBlockState(pos.west());
            IBlockState east = worldIn.getBlockState(pos.east());
            EnumFacing face = (EnumFacing)state.getValue(FACING);
            if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) face = EnumFacing.SOUTH;
            else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) face = EnumFacing.NORTH;
            else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) face = EnumFacing.EAST;
            else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) face = EnumFacing.WEST;
            worldIn.setBlockState(pos, state.withProperty(FACING, face), 2);
        }
    }
    
    //check the state of the block
        public static void setState(boolean active, World worldIn, BlockPos pos)
        {

            TileEntity tileentity = worldIn.getTileEntity(pos);

            if(tileentity != null) 
            {
                tileentity.validate();
                worldIn.setTileEntity(pos, tileentity);
            }
        }
    
    
    
    // Here is the CONTAINER (tileentity and gui) part
    
    
    @Override
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
       
        if (worldIn.isRemote) {
           return true;
        }
            
        playerIn.openGui(MyMod.instance, Reference.FAKE_BLOCK_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ());
        
        return true;
    }    
    
    @Override
    public boolean canDropFromExplosion(Explosion explosionIn) {
       
        return false;
    }
    
        
    @Override
    public TileEntity createNewTileEntity(World wolrdIn, int meta) {
        return new FakeBlockTileEntity();
    }
    
    @Override
    public boolean hasTileEntity(IBlockState state)
    {
        return true;
    }
    
    @Override
    public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) 
    {
        return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    }
    
    
        
    @Override
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
    }
    
    @Override
    public IBlockState withMirror(IBlockState state, Mirror mirrorIn) 
    {
        return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
    }
    
   
    @Override
    public IBlockState getStateFromMeta(int meta) 
    {
        EnumFacing facing = EnumFacing.getFront(meta);
        if(facing.getAxis() == EnumFacing.Axis.Y) facing = EnumFacing.NORTH;
        return this.getDefaultState().withProperty(FACING, facing).withProperty(BURNING, false);
    }
    
    @Override
    public int getMetaFromState(IBlockState state) {
        return ((EnumFacing)state.getValue(FACING)).getIndex();
    }

    
    @Override
    protected BlockStateContainer createBlockState()
    {
    
        return new BlockStateContainer(this, new IProperty[] {BURNING, FACING});
    }
    
    
    
    @Override
    public void breakBlock(World world, BlockPos pos, IBlockState state)
    {
        FakeBlockTileEntity te = (FakeBlockTileEntity) world.getTileEntity(pos);
        IItemHandler cap = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);

        for (int i = 0; i < cap.getSlots(); ++i)
        {
            ItemStack itemstack = cap.getStackInSlot(i);

            if (!itemstack.isEmpty())
            {
                InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), itemstack);
            }
        }

        super.breakBlock(world, pos, state);
    }
  
       
    
    

// End of the TILEENTITY part
    
}

 

The TileEntity :

Spoiler

package sunsigne.MyMod.tileentity;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityLockableLoot;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import sunsigne.MyMod.Reference;
import sunsigne.MyMod.blocks.EnchantedCraftingTableBlock;
import sunsigne.MyMod.container.EnchantedRecipes;
import sunsigne.MyMod.container.FakeBlockContainer;
import sunsigne.MyMod.container.FakeRecipes;

public class FakeBlockTileEntity extends TileEntity implements ITickable {

        

public static final int SIZE = 4;
    
    private int burnTime;
    private int currentBurnTime;
    private int cookTime;
    private int totalCookTime;
        
    
    private ItemStackHandler itemStackHandler = new ItemStackHandler(SIZE) {
        @Override
        protected void onContentsChanged(int slot) {
            FakeBlockTileEntity.this.markDirty();
        }
    };
    
    ItemStack input1 = this.itemStackHandler.getStackInSlot(0);
    ItemStack input2 = this.itemStackHandler.getStackInSlot(1);
    ItemStack fuel = this.itemStackHandler.getStackInSlot(2);
    ItemStack output = this.itemStackHandler.getStackInSlot(3);
    
    ItemStack result = FakeRecipes.getInstance().getFakeResult(input1, input2);    
    
    
    
    public int getCookTime(ItemStack input1, ItemStack input2) 
    {
        return 20;
//        return 1200
    }
    
    public static int getItemBurnTime(ItemStack fuel) 
    {
        if(fuel.isEmpty()) return 0;
        else 
        {
            Item item = fuel.getItem();
            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.AIR) {}
            
            if(item == Items.DIAMOND) return 20;
//            if(item == Items.LAPIS_LAZULI) return 1200;

            return GameRegistry.getFuelValue(fuel);
        }
    }
    
    
    public static boolean isItemFuel(ItemStack fuel)
    {
        return getItemBurnTime(fuel) > 0;
    }

    

    public boolean isItemValidForSlot(int index, ItemStack fuel) 
    {
        if(index == 3) return false;
        else if(index != 2) return true;
        else 
        {
            return isItemFuel(fuel);
        }
    }
    
    
    
    
    
    @Override
    public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
    {
        return true;
    }


    
    
    public boolean isBurning() 
    {
        return this.burnTime > 0;
    }
    
    
    @SideOnly(Side.CLIENT)
      public static boolean isBurning(FakeBlockTileEntity te) {

        return te.getField(0) > 0;
    }

    
    
    
    public void update() 
    {
        boolean flag = this.isBurning();
        boolean flag1 = false;
        
        if(this.isBurning()) --this.burnTime;
        
        if(!this.world.isRemote) 
        {
        
            
            
            if(this.isBurning() || !fuel.isEmpty() && !input1.isEmpty() || input2.isEmpty())
            {
                if(!this.isBurning() && this.canSmelt()) 
                {
                    this.burnTime = getItemBurnTime(fuel);
                    this.currentBurnTime = this.burnTime;
                    
                    if(this.isBurning()) 
                    {
                        flag1 = true;
                        
                        if(!fuel.isEmpty()) 
                        {
                            Item item = fuel.getItem();
                            fuel.shrink(1);
                            
                            if(fuel.isEmpty()) 
                            {
                                ItemStack item1 = item.getContainerItem(fuel);
                                this.itemStackHandler.setStackInSlot(2, item1);
                            }
                        }
                    }
                } 
                if(this.isBurning() && this.canSmelt()) 
                {
                    ++this.cookTime;
                    
                    if(this.cookTime == this.totalCookTime) 
                    {
                        this.cookTime = 0;
                        this.totalCookTime = this.getCookTime(input1, input2);
                        this.smeltItem();
                        flag1 = true;
                    }
                } 
                else this.cookTime = 0;
            } 
            else if(!this.isBurning() && this.cookTime > 0) 
            {
                this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
            }
            if(flag != this.isBurning()) 
            {
                flag1 = true;
                EnchantedCraftingTableBlock.setState(this.isBurning(), this.world, this.pos);
            }
        } 
        if(flag1) this.markDirty();
    }
    
    
    
    private boolean canSmelt() 
    {
        if(input1.isEmpty() || (input2.isEmpty())) return false;
        else 
        {

            if(result.isEmpty()) return false;
            else
            {
                if(output.isEmpty()) return true;
                if(!output.isItemEqual(result)) return false;
                int res = output.getCount() + result.getCount();
                return res <= getInventoryStackLimit() && res <= output.getMaxStackSize();
            }
        }
    }
    
    
    private int getInventoryStackLimit() {
        return 64;
    
    }

    
    
    public void smeltItem() 
    {
        if(this.canSmelt()) 
        {
            
            if(output.isEmpty()) this.itemStackHandler.setStackInSlot(3, result.copy());
            else if(output.getItem() == result.getItem()) output.grow(result.getCount());
            
            input1.shrink(1);
            input2.shrink(1);
        }
    }
    
    
        

    
     public int getField(int id)
        {
            switch(id)
            {
            case 0:
                return this.burnTime;
            case 1:
                return this.currentBurnTime;
            case 2:
                return this.cookTime;
            case 3:
                return this.totalCookTime;
            default:
                return 0;
            }
        }
            public void setField(int id, int value)
        {
            switch(id)
            {
            case 0:
                this.burnTime = value;
                break;
            case 1:
                this.currentBurnTime = value;
                break;
            case 2:
                this.cookTime = value;
                break;
            case 3:
                this.totalCookTime = value;
            }
        }
    
    
    
    
    
    
    @Override
    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);

        this.burnTime = compound.getInteger("BurnTime");
        this.cookTime = compound.getInteger("CookTime");
        this.totalCookTime = compound.getInteger("CookTimeTotal");
        
         if (compound.hasKey("items")) {itemStackHandler.deserializeNBT((NBTTagCompound) compound.getTag("items"));}
        
        }
    
    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound compound) 
    {
        super.writeToNBT(compound);
        
        compound.setInteger("BurnTime", this.burnTime);
        compound.setInteger("CookTime", this.cookTime);
        compound.setInteger("CookTimeTotal", this.totalCookTime);
        
        compound.setTag("items", itemStackHandler.serializeNBT());
         return compound;
    }
    
        
     @Override
        public boolean hasCapability(Capability<?> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
            else return false;
        }
        
        @Override
        public <T> T getCapability(Capability<T> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
            return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemStackHandler);
            return super.getCapability(capability, facing);
        }
    
        public boolean isUsablebyplayer(EntityPlayer playerIn) {
            return !isInvalid() && playerIn.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D)) <= 64D;
        }

        
        
        
        
    
}
 

 

The Container Part

Spoiler

package sunsigne.MyMod.container;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;
import sunsigne.MyMod.tileentity.EnchantedCraftingTableTileEntity;
import sunsigne.MyMod.tileentity.FakeBlockTileEntity;

public class FakeBlockContainer extends Container
{
    
    
    private final FakeBlockTileEntity fakeblockInventory;
    
    private int cookTime, totalCookTime, burnTime, currentBurnTime;
    
    
    
    
    public FakeBlockContainer(InventoryPlayer player, FakeBlockTileEntity fakeblockInventory) 
    {
        this.fakeblockInventory = fakeblockInventory;
        IItemHandler itemHandler = fakeblockInventory.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
        
        this.addSlotToContainer(new SlotItemHandler(itemHandler, 0, 120, 19));
        this.addSlotToContainer(new SlotItemHandler(itemHandler, 1, 120, 55));
        this.addSlotToContainer(new FakeBlockFuelSlot(itemHandler, 2, 66, 37));
        this.addSlotToContainer(new FakeBlockOutputSlot(player.player, itemHandler, 3, 174, 37));
        
        
        for(int y = 0; y < 3; y++)
        {
            for(int x = 0; x < 9; x++)
            {
                this.addSlotToContainer(new Slot(player, x + y*9 + 9, 48 + x*18, 84 + y*18));
            }
        }
        
        for(int x = 0; x < 9; x++)
        {
            this.addSlotToContainer(new Slot(player, x, 48 + x * 18, 142));
        }
    }
    

    
    
    @Override
    public void detectAndSendChanges() 
    {
        super.detectAndSendChanges();
        
        for(int i = 0; i < this.listeners.size(); ++i) 
        {
            IContainerListener listener = (IContainerListener)this.listeners.get(i);
            
            if(this.cookTime != this.fakeblockInventory.getField(2)) listener.sendWindowProperty(this, 2, this.fakeblockInventory.getField(2));
            if(this.burnTime != this.fakeblockInventory.getField(0)) listener.sendWindowProperty(this, 0, this.fakeblockInventory.getField(0));
            if(this.currentBurnTime != this.fakeblockInventory.getField(1)) listener.sendWindowProperty(this, 1, this.fakeblockInventory.getField(1));
            if(this.totalCookTime != this.fakeblockInventory.getField(3)) listener.sendWindowProperty(this, 3, this.fakeblockInventory.getField(3));
        }
        
        this.cookTime = this.fakeblockInventory.getField(2);
        this.burnTime = this.fakeblockInventory.getField(0);
        this.currentBurnTime = this.fakeblockInventory.getField(1);
        this.totalCookTime = this.fakeblockInventory.getField(3);
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int id, int data) 
    {
        this.fakeblockInventory.setField(id, data);
    }
    
    
    
    @Override
    public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) 
    {
        ItemStack stack = ItemStack.EMPTY;
        Slot slot = (Slot)this.inventorySlots.get(index);
        
        if(slot != null && slot.getHasStack()) 
        {
            ItemStack stack1 = slot.getStack();
            stack = stack1.copy();
            
            if(index == 3) 
            {
                if(!this.mergeItemStack(stack1, 4, 40, true)) return ItemStack.EMPTY;
                slot.onSlotChange(stack1, stack);
            }
            else if(index != 2 && index != 1 && index != 0) 
            {        
                Slot slot1 = (Slot)this.inventorySlots.get(index + 1);
                
                if(!FakeRecipes.getInstance().getFakeResult(stack1, slot1.getStack()).isEmpty())
                {
                    if(!this.mergeItemStack(stack1, 0, 2, false)) 
                    {
                        return ItemStack.EMPTY;
                    }
                    else if(FakeBlockTileEntity.isItemFuel(stack1))
                    {
                        if(!this.mergeItemStack(stack1, 2, 3, false)) return ItemStack.EMPTY;
                    }
                    else if(FakeBlockTileEntity.isItemFuel(stack1))
                    {
                        if(!this.mergeItemStack(stack1, 2, 3, false)) return ItemStack.EMPTY;
                    }
                    else if(FakeBlockTileEntity.isItemFuel(stack1))
                    {
                        if(!this.mergeItemStack(stack1, 2, 3, false)) return ItemStack.EMPTY;
                    }
                    else if(index >= 4 && index < 31)
                    {
                        if(!this.mergeItemStack(stack1, 31, 40, false)) return ItemStack.EMPTY;
                    }
                    else if(index >= 31 && index < 40 && !this.mergeItemStack(stack1, 4, 31, false))
                    {
                        return ItemStack.EMPTY;
                    }
                }
            } 
            else if(!this.mergeItemStack(stack1, 4, 40, false)) 
            {
                return ItemStack.EMPTY;
            }
            if(stack1.isEmpty())
            {
                slot.putStack(ItemStack.EMPTY);
            }
            else
            {
                slot.onSlotChanged();

            }
            if(stack1.getCount() == stack.getCount()) return ItemStack.EMPTY;
            slot.onTake(playerIn, stack1);
        }
        return stack;
    }
    
    
    
    
    
    
     @Override
        public boolean canInteractWith(EntityPlayer playerIn)
        {

            return this.fakeblockInventory.isUsablebyplayer(playerIn);
        }
    
    
    
    
    
    
    
    
}

 

 

And the Fuel & OutPut slots (maybe the problem comes from here ^^ i really don't know) :

Spoiler

 

        

package sunsigne.MyMod.container;

import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;
import sunsigne.MyMod.tileentity.EnchantedCraftingTableTileEntity;
import sunsigne.MyMod.tileentity.FakeBlockTileEntity;

public class FakeBlockFuelSlot extends SlotItemHandler{

    public FakeBlockFuelSlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) {
        super(itemHandler, index, xPosition, yPosition);

    }

    @Override
    public boolean isItemValid(ItemStack fuel) 
    {
        return FakeBlockTileEntity.isItemFuel(fuel);
    }
    
    
}
 

    

Spoiler

package sunsigne.MyMod.container;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class FakeBlockOutputSlot extends SlotItemHandler {

    
    
    
    private final EntityPlayer player;
        
    
    public FakeBlockOutputSlot(EntityPlayer player, IItemHandler itemHandler, int index, int xPosition, int yPosition) {
        
        super(itemHandler, index, xPosition, yPosition);
        this.player = player;
        


    }

    
    @Override
    public boolean isItemValid(ItemStack stack)
    {
        return false;
    }
    
    @Override
    public ItemStack onTake(EntityPlayer thePlayer, ItemStack stack)
    {
        this.onCrafting(stack);
        super.onTake(thePlayer, stack);
        return stack;
    }
    
    
    
}
 

 

Ho and just in case, the recipes :

Spoiler

package sunsigne.MyMod.container;

import java.util.Map;
import java.util.Map.Entry;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Maps;
import com.google.common.collect.Table;

import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemEnchantedBook;
import net.minecraft.item.ItemStack;
import sunsigne.MyMod.init.ModBlocks;

public class FakeRecipes {

    
    private static final FakeRecipes INSTANCE = new FakeRecipes();
    private final Table<ItemStack, ItemStack, ItemStack> smeltingList = HashBasedTable.<ItemStack, ItemStack, ItemStack>create();
    private final Map<ItemStack, Float> experienceList = Maps.<ItemStack, Float>newHashMap();
    
    public static FakeRecipes getInstance()
    {
        return INSTANCE;
    }
    
    public void addFakeRecipe(ItemStack input1, ItemStack input2, ItemStack result) 
    {
        if(getFakeResult(input1, input2) != ItemStack.EMPTY) return;
        this.smeltingList.put(input1, input2, result);

    }
    
    public ItemStack getFakeResult(ItemStack input1, ItemStack input2) 
    {
        for(Entry<ItemStack, Map<ItemStack, ItemStack>> entry : this.smeltingList.columnMap().entrySet()) 
        {
            if(this.compareItemStacks(input1, (ItemStack)entry.getKey())) 
            {
                for(Entry<ItemStack, ItemStack> ent : entry.getValue().entrySet()) 
                {
                    if(this.compareItemStacks(input2, (ItemStack)ent.getKey())) 
                    {
                        return (ItemStack)ent.getValue();
                    }
                }
            }
        }
        return ItemStack.EMPTY;
    }
    
    private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
    {
        return stack2.getItem() == stack1.getItem() && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata());
    }
    
    public Table<ItemStack, ItemStack, ItemStack> getDualSmeltingList() 
    {
        return this.smeltingList;
    }
    

    
    private FakeRecipes() 
    {
        
             
        addFakeRecipe(new ItemStack(Blocks.GOLD_BLOCK), new ItemStack(Blocks.IRON_BLOCK), new ItemStack(Blocks.DIAMOND_BLOCK));
        addFakeRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(Blocks.GOLD_BLOCK), new ItemStack(Blocks.IRON_BLOCK));
        addFakeRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(Blocks.GOLD_BLOCK));
        
    }

}    

 

 

 

 

I'm sorry if you find same mystakes again and again about IIventory and IHasModel, keep in mind i'm currently refreshing my code in purpose to make those parts dissapeared but i didn't finished yet. If I had completly succed I wouldn't be writing and you wouldn't be reading :s 

 

 

Thank by advance to anyone trying to help me ;) even if it's short messages like "don't use it", i can helps me :)

Edited by sunsigne
solved
Posted (edited)

Please use the coding text format when posting code like this, its a pain to read otherwise.

 

extends BlockContainer

I do not think you should be extended BlockContainer, just reimplement hasTileEntity and createNewTileEntity. The reasoning is that BlockContainer contains some useless vanilla code. Probably won't fix your problem.

 

---- Edit ----

 

9 hours ago, sunsigne said:

and doesn't allow me to put items on Output Slot and anything but fuel in FuelSlot

isn't this intended behavior? You shouldn't be able to put things in the output slot, and the fuel slot should be restricted to fuels?

 

9 hours ago, sunsigne said:

is that the crash

 

Please post the crash if you'd like more help other than the thing I said and please reformat your post. I really can't be bothered trying to read plaintext code and digging for a possibly small issue.

Edited by unassigned
Posted
12 hours ago, sunsigne said:

    ItemStack input1 = this.itemStackHandler.getStackInSlot(0);
    ItemStack input2 = this.itemStackHandler.getStackInSlot(1);
    ItemStack fuel = this.itemStackHandler.getStackInSlot(2);
    ItemStack output = this.itemStackHandler.getStackInSlot(3);


    ItemStack result = FakeRecipes.getInstance().getFakeResult(input1, input2);   

Why are these class level properties?

Why are these determined when the class instantiated and not when the class gets an update tick?

12 hours ago, sunsigne said:

if(this.isBurning() || !fuel.isEmpty() && !input1.isEmpty() || input2.isEmpty())

You probably want some parentheses here. Quick, will this entire statement be true or false for the following values:

true, true, true, false (note that I have not performed a ! on any of these).

How about for

false, false, true, false?

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.

Posted (edited)
8 hours ago, unassigned said:

isn't this intended behavior? You shouldn't be able to put things in the output slot, and the fuel slot should be restricted to fuels?

Actually, that's exactly what I said, this part is fonctionnal ^^ didn't you read ?

 

8 hours ago, unassigned said:

Please post the crash

Actually, it's written two lines above your quote of me ... Again, you didn't read.

 

 

//

 

 

5 hours ago, Draco18s said:

Why are these class level properties?

As I had "input1, input2, fuel and output" a little everywhere in my tile entity, i thought it was a good idea to define those as class property instead of copy/paste those everywhere, wasn't it ? (true question)

 

 

 

I don't get your second point ... 

I mean, in my first furnace which works, at this exact part the code is :

Spoiler

if(this.isBurning() || !stack.isEmpty() && !((((ItemStack)this.inventory.get(0)).isEmpty()) || ((ItemStack)this.inventory.get(1)).isEmpty())) 

there are not true and false. Maybe I should adapt ?

 

Ho! And i noticed an little error in my code, right here

Spoiler

if(flag != this.isBurning()) 
            {
                flag1 = true;
                EnchantedCraftingTableBlock.setState(this.isBurning(), this.world, this.pos);

Ofc it couldn't work ! My block is FakeBlock, i forgot to change the name.

 

But now it stills doesn't work :/ it just refuses to cook anything ^^

Edited by sunsigne
spelling
Posted
11 hours ago, unassigned said:

createNewTileEntity

You mean createTileEntity

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)
10 hours ago, sunsigne said:

Actually, it's written two lines above your quote of me ... Again, you didn't read.

 

You say there is a crash, not a logical error.

You should really step through your code and see what is/not running under certain conditions. See what happens when you put in fuel and an item to smelt, see what variables are changing.

Also, do you have a github for this project? I'd take a closer look at it if I could run it through my ide and debug it myself.

 

7 hours ago, Cadiboo said:

You mean createTileEntity

 

Yes. Thanks for catching that.

 

 

Edited by unassigned
Posted
12 hours ago, sunsigne said:

i thought it was a good idea to define those as class property instead of copy/paste those everywhere, wasn't it ? (true question)

No. Worst idea. Because you never update the values. All of them are air, will always be air, and will never be anything BUT air, as you never assign a value to them except during class construction.

  • Like 1

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.

Posted (edited)

I have been programming only for a week and my english isn't perfect, i don't get the difference between a crash and a logical error ?

 

13 hours ago, unassigned said:

Also, do you have a github for this project? I'd take a closer look at it if I could run it through my ide and debug it myself.

 

I just created a GitHub right now, if it can helps you helping me i can do that ^^ but you don't need debug mod imo, my furnace doesn't work but don't crash the game ^^

 

 

10 hours ago, Draco18s said:

No. Worst idea. Because you never update the values. All of them are air, will always be air, and will never be anything BUT air, as you never assign a value to them except during class construction.

I never tought like that but now you're saying it feels logical ^^ I really think you got the core of the problem !

I changed some things in that direction and now my fuel is burning when the recipe is good ! But things aren't cooking ? guess it's cooking "air" again ..

 

 

here is my tile entity now

Spoiler

package sunsigne.MyMod.tileentity;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityLockableLoot;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import sunsigne.MyMod.Reference;
import sunsigne.MyMod.blocks.FakeBlock;
import sunsigne.MyMod.container.FakeBlockContainer;
import sunsigne.MyMod.container.FakeRecipes;

public class FakeBlockTileEntity extends TileEntity implements ITickable {

        

public static final int SIZE = 4;
    
    private int burnTime;
    private int currentBurnTime;
    private int cookTime;
    private int totalCookTime;
        
    
    private ItemStackHandler itemStackHandler = new ItemStackHandler(SIZE) {
        @Override
        protected void onContentsChanged(int slot) {
            FakeBlockTileEntity.this.markDirty();
        }
    };
    
   
    
    
    
    
    public int getCookTime(ItemStack input1, ItemStack input2) 
    {
        return 20;
//        return 1200
    }
    
    public static int getItemBurnTime(ItemStack fuel) 
    {
        if(fuel.isEmpty()) return 0;
        else 
        {
            Item item = fuel.getItem();
            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.AIR) {}
            
            if(item == Items.DIAMOND) return 20;
//            if(item == Items.LAPIS_LAZULI) return 1200;

            return GameRegistry.getFuelValue(fuel);
        }
    }
    
    
    public static boolean isItemFuel(ItemStack fuel)
    {
        return getItemBurnTime(fuel) > 0;
    }

    
    
    
    @Override
    public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
    {
        return true;
    }


    
    
    public boolean isBurning() 
    {
        return this.burnTime > 0;
    }
    
    
    @SideOnly(Side.CLIENT)
      public static boolean isBurning(FakeBlockTileEntity te) {

        return te.getField(0) > 0;
    }

    
    
    
    public void update() 
    {
        boolean flag = this.isBurning();
        boolean flag1 = false;
        
        if(this.isBurning()) --this.burnTime;
        
        if(!this.world.isRemote) 
        {

                ItemStack fuel = this.itemStackHandler.getStackInSlot(2);
            
            
            if(this.isBurning() || !fuel.isEmpty() && !(this.itemStackHandler.getStackInSlot(0)).isEmpty() || (this.itemStackHandler.getStackInSlot(1)).isEmpty())
            {
                if(!this.isBurning() && this.canSmelt()) 
                {
                    this.burnTime = getItemBurnTime(fuel);
                    this.currentBurnTime = this.burnTime;
                    
                    if(this.isBurning()) 
                    {
                        flag1 = true;
                        
                        if(!fuel.isEmpty()) 
                        {
                            Item item = fuel.getItem();
                            fuel.shrink(1);
                            
                            if(fuel.isEmpty()) 
                            {
                                ItemStack item1 = item.getContainerItem(fuel);
                                this.itemStackHandler.setStackInSlot(2, item1);
                            }
                        }
                    }
                } 
                if(this.isBurning() && this.canSmelt()) 
                {
                    ++this.cookTime;
                    
                    if(this.cookTime == this.totalCookTime) 
                    {
                        this.cookTime = 0;
                        this.totalCookTime = this.getCookTime(this.itemStackHandler.getStackInSlot(0), this.itemStackHandler.getStackInSlot(1));
                        this.smeltItem();
                        flag1 = true;
                    }
                } 
                else this.cookTime = 0;
            } 
            else if(!this.isBurning() && this.cookTime > 0) 
            {
                this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
            }
            if(flag != this.isBurning()) 
            {
                flag1 = true;
                FakeBlock.setState(this.isBurning(), this.world, this.pos);
            }
        } 
        if(flag1) this.markDirty();
    }
    
    
    
    private boolean canSmelt() 
    {
            
            
        
        
        if((this.itemStackHandler.getStackInSlot(0)).isEmpty() || ((this.itemStackHandler.getStackInSlot(0)).isEmpty())) return false;
        else 
        {
                
            ItemStack result = FakeRecipes.getInstance().getFakeResult(this.itemStackHandler.getStackInSlot(0), this.itemStackHandler.getStackInSlot(1));    
            
            if(result.isEmpty()) return false;
            else
            {
                ItemStack output = this.itemStackHandler.getStackInSlot(3);
                
                if(output.isEmpty()) return true;
                if(!output.isItemEqual(result)) return false;
                int res = output.getCount() + result.getCount();
                return res <= getInventoryStackLimit() && res <= output.getMaxStackSize();
            }
        }
    }
    
    
    private int getInventoryStackLimit() {
        return 64;
    
    }

    
    
    public void smeltItem() 
    {
                
        if(this.canSmelt()) 
        {
            
            ItemStack input1 = this.itemStackHandler.getStackInSlot(0);
            ItemStack input2 = this.itemStackHandler.getStackInSlot(1);
            ItemStack output = this.itemStackHandler.getStackInSlot(3);
            ItemStack result = FakeRecipes.getInstance().getFakeResult(input1, input2);    
            
            
            if(output.isEmpty()) this.itemStackHandler.setStackInSlot(3, result.copy());
            else if(output.getItem() == result.getItem()) output.grow(result.getCount());
            
            input1.shrink(1);
            input2.shrink(1);
        }
    }
    
    
        

    
     public int getField(int id)
        {
            switch(id)
            {
            case 0:
                return this.burnTime;
            case 1:
                return this.currentBurnTime;
            case 2:
                return this.cookTime;
            case 3:
                return this.totalCookTime;
            default:
                return 0;
            }
        }
            public void setField(int id, int value)
        {
            switch(id)
            {
            case 0:
                this.burnTime = value;
                break;
            case 1:
                this.currentBurnTime = value;
                break;
            case 2:
                this.cookTime = value;
                break;
            case 3:
                this.totalCookTime = value;
            }
        }
    
    
    
    
    
    
    @Override
    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);

        this.burnTime = compound.getInteger("BurnTime");
        this.cookTime = compound.getInteger("CookTime");
        this.totalCookTime = compound.getInteger("CookTimeTotal");
        
         if (compound.hasKey("items")) {itemStackHandler.deserializeNBT((NBTTagCompound) compound.getTag("items"));}
        
        }
    
    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound compound) 
    {
        super.writeToNBT(compound);
        
        compound.setInteger("BurnTime", this.burnTime);
        compound.setInteger("CookTime", this.cookTime);
        compound.setInteger("CookTimeTotal", this.totalCookTime);
        
        compound.setTag("items", itemStackHandler.serializeNBT());
         return compound;
    }
    
        
     @Override
        public boolean hasCapability(Capability<?> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
            else return false;
        }
        
        @Override
        public <T> T getCapability(Capability<T> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
            return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemStackHandler);
            return super.getCapability(capability, facing);
        }
    
        public boolean isUsablebyplayer(EntityPlayer playerIn) {
            return !isInvalid() && playerIn.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D)) <= 64D;
        }

        
        
        
        
    
}

 

 

But you also can see it in my brand new GitHub right here ?

 

Edited by sunsigne
better explanation
Posted (edited)

it's not cooking air, actually it's burning when the recipe is good but it's not "cooking", i maybe didn't define this properly...

 

Even adding thos lines

Spoiler

public void setInventorySlotContents(int index, ItemStack stack) 
    {
        ItemStack itemstack = this.itemStackHandler.getStackInSlot(index);
        boolean flag = !stack.isEmpty() && stack.isItemEqual(itemstack) && ItemStack.areItemStackTagsEqual(stack, itemstack);
        this.itemStackHandler.setStackInSlot(index, stack);
        
        if(stack.getCount() > this.getInventoryStackLimit()) stack.setCount(this.getInventoryStackLimit());
        if(index == 0 && index + 1 == 1 && !flag)
        {
            ItemStack stack1 = this.itemStackHandler.getStackInSlot(index + 1);
            this.totalCookTime = this.getCookTime(stack, stack1);
            this.cookTime = 0;
            this.markDirty();
        }
    }

 

it still doesn't cook :s

 

 

EDIT : if i delete the Cooktime part, it insta gives me the good item following the recipe, i'm currently following this track ^^ i'll give the result soon

Edited by sunsigne
Posted

Good Damn! I finally did it !

 

I don't understand why, but i maganed to make it work ^^ the solution was to delete "totalcooktime" everywhere in my tileentity and replace it by the actual totalcooktime i wanted (here, 20 ticks).

 

I finally can notice this topic as solved !

 

 

Now if people wants to make a custom furnace using ItemHandler instead of IIventory, just copy-paste this tile entity :

Spoiler

package sunsigne.MyMod.tileentity;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityLockableLoot;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import sunsigne.MyMod.Reference;
import sunsigne.MyMod.blocks.FakeBlock;
import sunsigne.MyMod.container.FakeBlockContainer;
import sunsigne.MyMod.container.FakeRecipes;

public class FakeBlockTileEntity extends TileEntity implements ITickable {

        

public static final int SIZE = 4;
    
    private int burnTime;
    private int currentBurnTime;
    private int cookTime;
        
    
    private ItemStackHandler itemStackHandler = new ItemStackHandler(SIZE)
    {
        @Override
        protected void onContentsChanged(int slot) {
            
            FakeBlockTileEntity.this.markDirty();
        }
    };
    

    
    public static int getItemBurnTime(ItemStack fuel) 
    {
        if(fuel.isEmpty()) return 0;
        else 
        {
            Item item = fuel.getItem();
            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.AIR) {}
            
            if(item == Items.DIAMOND) return 20;
//            if(item == Items.LAPIS_LAZULI) return 1200;

            return GameRegistry.getFuelValue(fuel);
        }
    }
    

    
    
    
    
    public static boolean isItemFuel(ItemStack fuel)
    {
        return getItemBurnTime(fuel) > 0;
    }

    
    
    
    @Override
    public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
    {
        return true;
    }


    
    
    public boolean isBurning() 
    {
        return this.burnTime > 0;
    }
    
    
    @SideOnly(Side.CLIENT)
      public static boolean isBurning(FakeBlockTileEntity te) {

        return te.getField(0) > 0;
    }

    
    
    
    public void update() 
    {
        boolean flag = this.isBurning();
        boolean flag1 = false;
        
        if(this.isBurning()) --this.burnTime;
        
        if(!this.world.isRemote) 
        {

                ItemStack fuel = this.itemStackHandler.getStackInSlot(2);
            
            
            if(this.isBurning() || !fuel.isEmpty() && !(this.itemStackHandler.getStackInSlot(0)).isEmpty() || (this.itemStackHandler.getStackInSlot(1)).isEmpty())
            {
                if(!this.isBurning() && this.canSmelt()) 
                {
                    this.burnTime = getItemBurnTime(fuel);
                    this.currentBurnTime = this.burnTime;
                    
                    if(this.isBurning()) 
                    {
                        flag1 = true;
                        
                        if(!fuel.isEmpty()) 
                        {
                            Item item = fuel.getItem();
                            fuel.shrink(1);
                            
                            if(fuel.isEmpty()) 
                            {
                                ItemStack item1 = item.getContainerItem(fuel);
                                this.itemStackHandler.setStackInSlot(2, item1);
                            }
                        }
                    }
                } 
                if(this.isBurning() && this.canSmelt()) 
                {
                    ++this.cookTime;
                    
//the 20 here is the total cook time i want. The cook lasts 20 ticks then the item is cooked
                    
                    if(this.cookTime == 20) 
                    {
                        this.cookTime = 0;
                        this.smeltItem();
                        flag1 = true;
                    }
                } 
                else this.cookTime = 0;
            } 
            else if(!this.isBurning() && this.cookTime > 0) 
                
//same here : 20 is for 20 ticks of cooking                
            {
                this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, 20);
            }
            if(flag != this.isBurning()) 
            {
                flag1 = true;
                FakeBlock.setState(this.isBurning(), this.world, this.pos);
            }
        } 
        if(flag1) this.markDirty();
    }
    
    
    
    private boolean canSmelt() 
    {
            
            
        
        
        if((this.itemStackHandler.getStackInSlot(0)).isEmpty() || ((this.itemStackHandler.getStackInSlot(0)).isEmpty())) return false;
        else 
        {
                
            ItemStack result = FakeRecipes.getInstance().getFakeResult(this.itemStackHandler.getStackInSlot(0), this.itemStackHandler.getStackInSlot(1));    
            
            if(result.isEmpty()) return false;
            else
            {
                ItemStack output = this.itemStackHandler.getStackInSlot(3);
                
                if(output.isEmpty()) return true;
                if(!output.isItemEqual(result)) return false;
                int res = output.getCount() + result.getCount();
                return res <= getInventoryStackLimit() && res <= output.getMaxStackSize();
            }
        }
    }
    
    
    private int getInventoryStackLimit() {
        return 64;
    
    }

    
    
    public void smeltItem() 
    {
                
        if(this.canSmelt()) 
        {
            
            ItemStack input1 = this.itemStackHandler.getStackInSlot(0);
            ItemStack input2 = this.itemStackHandler.getStackInSlot(1);
            ItemStack output = this.itemStackHandler.getStackInSlot(3);
            ItemStack result = FakeRecipes.getInstance().getFakeResult(input1, input2);    
            
            
            if(output.isEmpty()) this.itemStackHandler.setStackInSlot(3, result.copy());
            else if(output.getItem() == result.getItem()) output.grow(result.getCount());
            
            input1.shrink(1);
            input2.shrink(1);
        }
    }
    
    
        

    
     public int getField(int id)
        {
            switch(id)
            {
            case 0:
                return this.burnTime;
            case 1:
                return this.currentBurnTime;
            case 2:
                return this.cookTime;
            default:
                return 0;
            }
        }
            public void setField(int id, int value)
        {
            switch(id)
            {
            case 0:
                this.burnTime = value;
                break;
            case 1:
                this.currentBurnTime = value;
                break;
            case 2:
                this.cookTime = value;
                break;
            }
        }
    
    
    
    
    
    
    @Override
    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);

        this.burnTime = compound.getInteger("BurnTime");
        this.cookTime = compound.getInteger("CookTime");
        
         if (compound.hasKey("items")) {itemStackHandler.deserializeNBT((NBTTagCompound) compound.getTag("items"));}
        
        }
    
    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound compound) 
    {
        super.writeToNBT(compound);
        
        compound.setInteger("BurnTime", this.burnTime);
        compound.setInteger("CookTime", this.cookTime);

        
        compound.setTag("items", itemStackHandler.serializeNBT());
         return compound;
    }
    
        
     @Override
        public boolean hasCapability(Capability<?> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
            else return false;
        }
        
        @Override
        public <T> T getCapability(Capability<T> capability, EnumFacing facing)
        {
            if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
            return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemStackHandler);
            return super.getCapability(capability, facing);
        }
    
        public boolean isUsablebyplayer(EntityPlayer playerIn) {
            return !isInvalid() && playerIn.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D)) <= 64D;
        }

        
        
        
        
    
}
 

 

Posted (edited)

Your code could be cleaned up a bit (you don’t really need set/getField), made more readable (extract logic to functions) and simplified (your hasCapability method) but it looks pretty good IMO

Edited by Cadiboo
  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I'm having a strange crashing issue when I teleport or enter the nether on a modded world, and I can't understand the crash logs well enough to understand what's causing it. I'm hoping someone here can help:   Crash 1: ---- Minecraft Crash Report ---- // Uh... Did I do that? Time: 2024-11-27 17:40:57 Description: Exception ticking world java.util.ConcurrentModificationException: null     at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095) ~[?:?] {}     at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049) ~[?:?] {}     at MC-BOOTSTRAP/[email protected]/com.google.common.collect.Iterators$1.next(Iterators.java:146) ~[guava-32.1.2-jre.jar%23134!/:?] {}     at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?] {re:mixin}     at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.lambda$updateChunkStatus$6(PersistentEntitySectionManager.java:171) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?] {}     at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177) ~[?:?] {}     at java.base/java.util.PrimitiveIterator$OfLong.forEachRemaining(PrimitiveIterator.java:185) ~[?:?] {}     at java.base/java.util.Spliterators$LongIteratorSpliterator.forEachRemaining(Spliterators.java:2144) ~[?:?] {}     at java.base/java.util.Spliterator$OfLong.forEachRemaining(Spliterator.java:777) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:160) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:146) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkMap.onFullChunkStatusChange(ChunkMap.java:1197) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:chunkloading.ChunkMapMixin from mod ae2,pl:mixin:APP:journeymap.mixins.json:server.ChunkMapAccessor from mod journeymap,pl:mixin:APP:ars_nouveau.mixins.json:camera.ChunkMapMixin from mod ars_nouveau,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.demoteFullChunk(ChunkHolder.java:281) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.updateFutures(ChunkHolder.java:335) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.lambda$runAllUpdates$1(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.runAllUpdates(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.runDistanceManagerUpdates(ServerChunkCache.java:279) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.tick(ServerChunkCache.java:318) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:379) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ars_elemental.mixins.json:ServerLevelMixin from mod ars_elemental,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1037) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:917) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:110) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:runtimedistcleaner:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:707) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace:     at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095) ~[?:?] {}     at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049) ~[?:?] {}     at MC-BOOTSTRAP/[email protected]/com.google.common.collect.Iterators$1.next(Iterators.java:146) ~[guava-32.1.2-jre.jar%23134!/:?] {}     at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?] {re:mixin}     at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.lambda$updateChunkStatus$6(PersistentEntitySectionManager.java:171) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?] {}     at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177) ~[?:?] {}     at java.base/java.util.PrimitiveIterator$OfLong.forEachRemaining(PrimitiveIterator.java:185) ~[?:?] {}     at java.base/java.util.Spliterators$LongIteratorSpliterator.forEachRemaining(Spliterators.java:2144) ~[?:?] {}     at java.base/java.util.Spliterator$OfLong.forEachRemaining(Spliterator.java:777) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:160) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:146) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkMap.onFullChunkStatusChange(ChunkMap.java:1197) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:chunkloading.ChunkMapMixin from mod ae2,pl:mixin:APP:journeymap.mixins.json:server.ChunkMapAccessor from mod journeymap,pl:mixin:APP:ars_nouveau.mixins.json:camera.ChunkMapMixin from mod ars_nouveau,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.demoteFullChunk(ChunkHolder.java:281) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.updateFutures(ChunkHolder.java:335) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.lambda$runAllUpdates$1(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.runAllUpdates(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.runDistanceManagerUpdates(ServerChunkCache.java:279) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.tick(ServerChunkCache.java:318) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A} -- Affected level -- Details:     All players: 0 total; []     Chunk stats: 4115     Level dimension: minecraft:overworld     Level spawn location: World: (368,82,-304), Section: (at 0,2,0 in 23,5,-19; chunk contains blocks 368,-64,-304 to 383,319,-289), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,-64,-512 to 511,319,-1)     Level time: 3471732 game time, 5256594 day time     Level name: testing eh     Level game mode: Game mode: survival (ID 0). Hardcore: false. Commands: true     Level weather: Rain time: 1 (now: false), thunder time: 1 (now: false)     Known server brands: neoforge     Removed feature flags:     Level was modded: true     Level storage version: 0x04ABD - Anvil     Loaded entity count: 644 Stacktrace:     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.fillReportDetails(ServerLevel.java:1718) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ars_elemental.mixins.json:ServerLevelMixin from mod ars_elemental,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1040) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:917) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:110) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:runtimedistcleaner:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:707) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {} -- System Details -- Details:     Minecraft Version: 1.21.1     Minecraft Version ID: 1.21.1     Operating System: Windows 10 (amd64) version 10.0     Java Version: 21.0.3, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 1844665656 bytes (1759 MiB) / 6375342080 bytes (6080 MiB) up to 6375342080 bytes (6080 MiB)     CPUs: 16     Processor Vendor: GenuineIntel     Processor Name: 11th Gen Intel(R) Core(TM) i7-11700F @ 2.50GHz     Identifier: Intel64 Family 6 Model 167 Stepping 1     Microarchitecture: Rocket Lake     Frequency (GHz): 2.50     Number of physical packages: 1     Number of physical CPUs: 8     Number of logical CPUs: 16     Graphics card #0 name: NVIDIA GeForce RTX 3060 Ti     Graphics card #0 vendor: NVIDIA     Graphics card #0 VRAM (MiB): 8192.00     Graphics card #0 deviceId: VideoController1     Graphics card #0 versionInfo: 31.0.15.1640     Memory slot #0 capacity (MiB): 16384.00     Memory slot #0 clockSpeed (GHz): 2.67     Memory slot #0 type: DDR4     Virtual memory max (MiB): 21242.80     Virtual memory used (MiB): 18044.57     Swap memory total (MiB): 5021.48     Swap memory used (MiB): 198.77     Space in storage for jna.tmpdir (MiB): available: 116449.34, total: 976134.31     Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): available: 116449.34, total: 976134.31     Space in storage for io.netty.native.workdir (MiB): available: 116449.34, total: 976134.31     Space in storage for java.io.tmpdir (MiB): available: 116449.34, total: 976134.31     Space in storage for workdir (MiB): available: 116449.34, total: 976134.31     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx6080m -Xms256m     Server Running: true     Player Count: 2 / 8; [ServerPlayer['deathray6002'/4, l='ServerLevel[testing eh]', x=75.90, y=59.00, z=-93.98], ServerPlayer['_Fire_Fly_2'/3504, l='ServerLevel[testing eh]', x=81.50, y=59.00, z=-97.63]]     Active Data Packs: vanilla, mod_data, mod/sodium, mod/smartbrainlib (incompatible), mod/ae2jeiintegration, mod/cyclopscore (incompatible), mod/fabric_renderer_api_v1, mod/mekanismcovers, mod/geckolib, mod/sophisticatedstorage (incompatible), mod/jei (incompatible), mod/ae2 (incompatible), mod/ae2wtlib (incompatible), mod/ae2wtlib_api, mod/everlastingabilities (incompatible), mod/commonnetworking (incompatible), mod/doggytalents (incompatible), mod/mcwwindows (incompatible), mod/sophisticatedcore (incompatible), mod/journeymap (incompatible), mod/neoforge, mod/artifacts, mod/fabric_block_view_api_v2, mod/badpackets (incompatible), mod/sophisticatedbackpacks (incompatible), mod/relics (incompatible), mod/mcjtylib, mod/rftoolsbase, mod/xnet, mod/fusion, mod/cloth_config (incompatible), mod/mekanism_extras (incompatible), mod/handcrafted, mod/mekanism_unleashed, mod/mekanism, mod/mekanismgenerators, mod/gmut (incompatible), mod/fabric_api_base, mod/mousetweaks (incompatible), mod/mekanismadditions, mod/ae2things (incompatible), mod/mekanism_lasers (incompatible), mod/supermartijn642corelib, mod/e4mc_minecraft (incompatible), mod/wthit,waila (incompatible), mod/curios (incompatible), mod/ars_nouveau (incompatible), mod/patchouli (incompatible), mod/ars_additions (incompatible), mod/ars_controle (incompatible), mod/ars_elemental (incompatible), mod/elevatorid, mod/ftbultimine (incompatible), mod/ae2qolrecipes (incompatible), mod/modonomicon (incompatible), mod/resourcefullib, mod/dtnpaletteofpaws (incompatible), mod/mekanismtools, mod/architectury (incompatible), mod/ftblibrary (incompatible), mod/octolib, mod/lootr, mod/connectedglass, mod/occultism, mod/ars_ocultas (incompatible), mod/fabric_rendering_data_attachment_v1, mod/appmek (incompatible), mod/expandability, mod/journeymap_api (incompatible)     Available Data Packs: bundle, trade_rebalance, vanilla, mod/ae2 (incompatible), mod/ae2jeiintegration, mod/ae2qolrecipes (incompatible), mod/ae2things (incompatible), mod/ae2wtlib (incompatible), mod/ae2wtlib_api, mod/appmek (incompatible), mod/architectury (incompatible), mod/ars_additions (incompatible), mod/ars_controle (incompatible), mod/ars_elemental (incompatible), mod/ars_nouveau (incompatible), mod/ars_ocultas (incompatible), mod/artifacts, mod/badpackets (incompatible), mod/cloth_config (incompatible), mod/commonnetworking (incompatible), mod/connectedglass, mod/curios (incompatible), mod/cyclopscore (incompatible), mod/doggytalents (incompatible), mod/dtnpaletteofpaws (incompatible), mod/e4mc_minecraft (incompatible), mod/elevatorid, mod/everlastingabilities (incompatible), mod/expandability, mod/fabric_api_base, mod/fabric_block_view_api_v2, mod/fabric_renderer_api_v1, mod/fabric_rendering_data_attachment_v1, mod/ftblibrary (incompatible), mod/ftbultimine (incompatible), mod/fusion, mod/geckolib, mod/gmut (incompatible), mod/handcrafted, mod/jei (incompatible), mod/journeymap (incompatible), mod/journeymap_api (incompatible), mod/lootr, mod/mcjtylib, mod/mcwwindows (incompatible), mod/mekanism, mod/mekanism_extras (incompatible), mod/mekanism_lasers (incompatible), mod/mekanism_unleashed, mod/mekanismadditions, mod/mekanismcovers, mod/mekanismgenerators, mod/mekanismtools, mod/modonomicon (incompatible), mod/mousetweaks (incompatible), mod/neoforge, mod/occultism, mod/octolib, mod/patchouli (incompatible), mod/relics (incompatible), mod/resourcefullib, mod/rftoolsbase, mod/smartbrainlib (incompatible), mod/sodium, mod/sophisticatedbackpacks (incompatible), mod/sophisticatedcore (incompatible), mod/sophisticatedstorage (incompatible), mod/supermartijn642corelib, mod/wthit,waila (incompatible), mod/xnet, mod_data     Enabled Feature Flags: minecraft:vanilla     World Generation: Stable     World Seed: -4893969446266667034     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'neoforge'; Server brand changed to 'neoforge'     Launched Version: neoforge-21.1.73     ModLauncher: 11.0.4+main.d2e20e43     ModLauncher launch target: forgeclient     ModLauncher services:         sponge-mixin-0.15.2+mixin.0.8.7.jar mixin PLUGINSERVICE         loader-4.0.31.jar slf4jfixer PLUGINSERVICE         loader-4.0.31.jar runtime_enum_extender PLUGINSERVICE         at-modlauncher-10.0.1.jar accesstransformer PLUGINSERVICE         loader-4.0.31.jar runtimedistcleaner PLUGINSERVICE         modlauncher-11.0.4.jar mixin TRANSFORMATIONSERVICE         modlauncher-11.0.4.jar fml TRANSFORMATIONSERVICE     FML Language Providers:         [email protected]         [email protected]         [email protected]     Mod List:         ae2jeiintegration-1.2.0.jar                       |AE2 JEI Integration           |ae2jeiintegration             |1.2.0               |Manifest: NOSIGNATURE         ae2qolrecipes-neoforge-1.21.x-1.2.0.jar           |AE2 QoL Recipes               |ae2qolrecipes                 |1.2.0               |Manifest: NOSIGNATURE         AE2-Things-1.4.2-beta.jar                         |AE2 Things                    |ae2things                     |1.4.2-beta          |Manifest: NOSIGNATURE         ae2wtlib-19.1.6-beta.jar                          |AE2WTLib                      |ae2wtlib                      |19.1.6-beta         |Manifest: NOSIGNATURE         de.mari_023.ae2wtlib_api-19.1.6-beta.jar          |AE2WTLib API                  |ae2wtlib_api                  |19.1.6-beta         |Manifest: NOSIGNATURE         appliedenergistics2-19.0.23-beta.jar              |Applied Energistics 2         |ae2                           |19.0.23-beta        |Manifest: NOSIGNATURE         Applied-Mekanistics-1.6.1.jar                     |Applied Mekanistics           |appmek                        |1.6.1               |Manifest: NOSIGNATURE         architectury-13.0.8-neoforge.jar                  |Architectury                  |architectury                  |13.0.8              |Manifest: NOSIGNATURE         ars_additions-1.21.1-21.1.3.jar                   |Ars Additions                 |ars_additions                 |1.21.1-21.1.3       |Manifest: NOSIGNATURE         ars_controle-1.21.0-1.2.0.jar                     |Ars Controle                  |ars_controle                  |1.21.0-1.2.0        |Manifest: NOSIGNATURE         ars_elemental-1.21.1-0.7.0.8.jar                  |Ars Elemental                 |ars_elemental                 |0.7.0.8             |Manifest: NOSIGNATURE         ars_nouveau-1.21.1-5.2.2-all.jar                  |Ars Nouveau                   |ars_nouveau                   |5.2.2               |Manifest: NOSIGNATURE         ars_ocultas-1.21.0-2.0.1.jar                      |Ars Ocultas                   |ars_ocultas                   |2.0.1               |Manifest: NOSIGNATURE         artifacts-neoforge-12.0.5.jar                     |Artifacts                     |artifacts                     |12.0.5              |Manifest: NOSIGNATURE         badpackets-neo-0.8.1.jar                          |Bad Packets                   |badpackets                    |0.8.1               |Manifest: NOSIGNATURE         cloth-config-15.0.140-neoforge.jar                |Cloth Config v15 API          |cloth_config                  |15.0.140            |Manifest: NOSIGNATURE         common-networking-neoforge-1.0.16-1.21.1.jar      |Common Networking             |commonnetworking              |1.0.16-1.21.1       |Manifest: NOSIGNATURE         connectedglass-1.1.12-neoforge-mc1.21.jar         |Connected Glass               |connectedglass                |1.1.12              |Manifest: NOSIGNATURE         curios-neoforge-9.0.14+1.21.1.jar                 |Curios API                    |curios                        |9.0.14+1.21.1       |Manifest: NOSIGNATURE         cyclopscore-1.21.1-neoforge-1.25.2.jar            |Cyclops Core                  |cyclopscore                   |1.25.2              |Manifest: NOSIGNATURE         DoggyTalentsNext-1.21.1-1.18.33.jar               |Doggy Talents Next            |doggytalents                  |1.18.33             |Manifest: NOSIGNATURE         DTNPaletteOfPaws-1.21-1.2.4.jar                   |DTN's Palette Of Paws         |dtnpaletteofpaws              |1.2.4               |Manifest: NOSIGNATURE         e4mc_minecraft-neoforge-5.2.1.jar                 |e4mc                          |e4mc_minecraft                |5.2.1               |Manifest: NOSIGNATURE         elevatorid-neoforge-1.21.1-1.11.3.jar             |ElevatorMod                   |elevatorid                    |1.21.1-1.11.3       |Manifest: NOSIGNATURE         everlastingabilities-1.21.1-neoforge-2.3.0.jar    |EverlastingAbilities          |everlastingabilities          |2.3.0               |Manifest: NOSIGNATURE         expandability-neoforge-12.0.0.jar                 |ExpandAbility                 |expandability                 |12.0.0              |Manifest: NOSIGNATURE         fabric-api-base-0.4.42+d1308ded19.jar             |Forgified Fabric API Base     |fabric_api_base               |0.4.42+d1308ded19   |Manifest: NOSIGNATURE         fabric-block-view-api-v2-1.0.10+9afaaf8c19.jar    |Forgified Fabric BlockView API|fabric_block_view_api_v2      |1.0.10+9afaaf8c19   |Manifest: NOSIGNATURE         fabric-renderer-api-v1-3.4.0+acb05a3919.jar       |Forgified Fabric Renderer API |fabric_renderer_api_v1        |3.4.0+acb05a3919    |Manifest: NOSIGNATURE         fabric-rendering-data-attachment-v1-0.3.48+73761d2|Forgified Fabric Rendering Dat|fabric_rendering_data_attachme|0.3.48+73761d2e19   |Manifest: NOSIGNATURE         ftb-library-neoforge-2101.1.4.jar                 |FTB Library                   |ftblibrary                    |2101.1.4            |Manifest: NOSIGNATURE         ftb-ultimine-neoforge-2101.1.1.jar                |FTB Ultimine                  |ftbultimine                   |2101.1.1            |Manifest: NOSIGNATURE         fusion-1.1.1a-neoforge-mc1.21.jar                 |Fusion                        |fusion                        |1.1.1+a             |Manifest: NOSIGNATURE         geckolib-neoforge-1.21.1-4.6.6.jar                |GeckoLib 4                    |geckolib                      |4.6.6               |Manifest: NOSIGNATURE         GravitationalModulatingAdditionalUnit-1.21.1-6.0.j|Gravitational Modulating Addit|gmut                          |6.0                 |Manifest: NOSIGNATURE         handcrafted-neoforge-1.21.1-4.0.2.jar             |Handcrafted                   |handcrafted                   |4.0.2               |Manifest: NOSIGNATURE         journeymap-neoforge-1.21.1-6.0.0-beta.28.jar      |Journeymap                    |journeymap                    |1.21.1-6.0.0-beta.28|Manifest: NOSIGNATURE         journeymap-api-neoforge-2.0.0-1.21.1-SNAPSHOT.jar |JourneyMap API                |journeymap_api                |2.0.0               |Manifest: NOSIGNATURE         jei-1.21.1-neoforge-19.21.0.247.jar               |Just Enough Items             |jei                           |19.21.0.247         |Manifest: NOSIGNATURE         lootr-neoforge-1.21-1.10.33.85.jar                |Lootr                         |lootr                         |1.21-1.10.33.85     |Manifest: NOSIGNATURE         mcw-windows-2.3.0-mc1.21.1neoforge.jar            |Macaw's Windows               |mcwwindows                    |2.3.2               |Manifest: NOSIGNATURE         mcjtylib-1.21-9.0.4.jar                           |McJtyLib                      |mcjtylib                      |1.21-9.0.4          |Manifest: NOSIGNATURE         Mekanism-1.21.1-10.7.7.64.jar                     |Mekanism                      |mekanism                      |10.7.7              |Manifest: NOSIGNATURE         mekanismcovers-1.1-BETA+1.21.jar                  |Mekanism Covers               |mekanismcovers                |1.1-BETA+1.21       |Manifest: NOSIGNATURE         mekanism_extras-1.21.1-1.0.2.jar                  |Mekanism Extras               |mekanism_extras               |1.21.1-1.0.2        |Manifest: NOSIGNATURE         MekanismLasers-1.21.1-1.1.7.jar                   |Mekanism Lasers               |mekanism_lasers               |1.1.7               |Manifest: NOSIGNATURE         mekanism_unleashed-1.21-0.2.1.jar                 |Mekanism Unleashed            |mekanism_unleashed            |1.21-0.2.1          |Manifest: NOSIGNATURE         MekanismAdditions-1.21.1-10.7.7.64.jar            |Mekanism: Additions           |mekanismadditions             |10.7.7              |Manifest: NOSIGNATURE         MekanismGenerators-1.21.1-10.7.7.64.jar           |Mekanism: Generators          |mekanismgenerators            |10.7.7              |Manifest: NOSIGNATURE         MekanismTools-1.21.1-10.7.7.64.jar                |Mekanism: Tools               |mekanismtools                 |10.7.7              |Manifest: NOSIGNATURE         client-1.21.1-20240808.144430-srg.jar             |Minecraft                     |minecraft                     |1.21.1              |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         modonomicon-1.21.1-neoforge-1.108.1.jar           |Modonomicon                   |modonomicon                   |1.108.1             |Manifest: NOSIGNATURE         MouseTweaks-neoforge-mc1.21-2.26.1.jar            |Mouse Tweaks                  |mousetweaks                   |2.26.1              |Manifest: NOSIGNATURE         neoforge-21.1.73-universal.jar                    |NeoForge                      |neoforge                      |21.1.73             |Manifest: NOSIGNATURE         occultism-1.21.1-neoforge-1.165.0.jar             |Occultism                     |occultism                     |1.165.0             |Manifest: NOSIGNATURE         OctoLib-NEOFORGE-0.4.2.jar                        |OctoLib                       |octolib                       |0.4.2               |Manifest: NOSIGNATURE         Patchouli-1.21-88-NEOFORGE-SNAPSHOT.jar           |Patchouli                     |patchouli                     |1.21-88-NEOFORGE-SNA|Manifest: NOSIGNATURE         relics-1.21-0.9.2.0.jar                           |Relics                        |relics                        |0.9.2.0             |Manifest: NOSIGNATURE         resourcefullib-neoforge-1.21-3.0.11.jar           |Resourceful Lib               |resourcefullib                |3.0.11              |Manifest: NOSIGNATURE         rftoolsbase-1.21-6.0.1.jar                        |RFToolsBase                   |rftoolsbase                   |1.21-6.0.1          |Manifest: NOSIGNATURE         SmartBrainLib-neoforge-1.21.1-1.16.1.jar          |SmartBrainLib                 |smartbrainlib                 |1.16.1              |Manifest: NOSIGNATURE         sodium-neoforge-0.6.0-beta.4+mc1.21.1.jar         |Sodium                        |sodium                        |0.6.0-beta.4+mc1.21.|Manifest: NOSIGNATURE         sophisticatedbackpacks-1.21-3.20.17.1113.jar      |Sophisticated Backpacks       |sophisticatedbackpacks        |3.20.17             |Manifest: NOSIGNATURE         sophisticatedcore-1.21-0.6.45.722.jar             |Sophisticated Core            |sophisticatedcore             |0.6.45              |Manifest: NOSIGNATURE         sophisticatedstorage-1.21-0.10.45.910.jar         |Sophisticated Storage         |sophisticatedstorage          |0.10.45             |Manifest: NOSIGNATURE         supermartijn642corelib-1.1.17i-neoforge-mc1.21.jar|SuperMartijn642's Core Lib    |supermartijn642corelib        |1.1.17+i            |Manifest: NOSIGNATURE         wthit-neo-12.4.2.jar                              |wthit                         |wthit                         |12.4.2              |Manifest: NOSIGNATURE         xnet-1.21-7.0.1.jar                               |XNet                          |xnet                          |1.21-7.0.1          |Manifest: NOSIGNATURE     Crash Report UUID: 04c99056-7645-47e5-8b5f-e5ea4e743bf0     FML: 4.0.31     NeoForge: 21.1.73     Crash 2:   ---- Minecraft Crash Report ---- // Shall we play a game? Time: 2024-11-28 08:49:08 Description: Exception in server tick loop java.util.ConcurrentModificationException: null     at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095) ~[?:?] {}     at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049) ~[?:?] {}     at MC-BOOTSTRAP/[email protected]/com.google.common.collect.Iterators$1.next(Iterators.java:146) ~[guava-32.1.2-jre.jar%23134!/:?] {}     at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?] {re:mixin}     at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.lambda$updateChunkStatus$6(PersistentEntitySectionManager.java:171) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?] {}     at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177) ~[?:?] {}     at java.base/java.util.PrimitiveIterator$OfLong.forEachRemaining(PrimitiveIterator.java:185) ~[?:?] {}     at java.base/java.util.Spliterators$LongIteratorSpliterator.forEachRemaining(Spliterators.java:2144) ~[?:?] {}     at java.base/java.util.Spliterator$OfLong.forEachRemaining(Spliterator.java:777) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:160) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.PersistentEntitySectionManager.updateChunkStatus(PersistentEntitySectionManager.java:146) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkMap.onFullChunkStatusChange(ChunkMap.java:1197) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ae2.mixins.json:chunkloading.ChunkMapMixin from mod ae2,pl:mixin:APP:journeymap.mixins.json:server.ChunkMapAccessor from mod journeymap,pl:mixin:APP:ars_nouveau.mixins.json:camera.ChunkMapMixin from mod ars_nouveau,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.demoteFullChunk(ChunkHolder.java:281) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ChunkHolder.updateFutures(ChunkHolder.java:335) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.lambda$runAllUpdates$1(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}     at TRANSFORMER/[email protected]/net.minecraft.server.level.DistanceManager.runAllUpdates(DistanceManager.java:119) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.runDistanceManagerUpdates(ServerChunkCache.java:279) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.pollTask(ServerChunkCache.java:564) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:classloading}     at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.pollTask(ServerChunkCache.java:275) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:860) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:849) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:825) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:712) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[client-1.21.1-20240808.144430-srg.jar%23237!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}     at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.21.1     Minecraft Version ID: 1.21.1     Operating System: Windows 10 (amd64) version 10.0     Java Version: 21.0.3, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 2253319480 bytes (2148 MiB) / 4714397696 bytes (4496 MiB) up to 6375342080 bytes (6080 MiB)     CPUs: 16     Processor Vendor: GenuineIntel     Processor Name: 11th Gen Intel(R) Core(TM) i7-11700F @ 2.50GHz     Identifier: Intel64 Family 6 Model 167 Stepping 1     Microarchitecture: Rocket Lake     Frequency (GHz): 2.50     Number of physical packages: 1     Number of physical CPUs: 8     Number of logical CPUs: 16     Graphics card #0 name: NVIDIA GeForce RTX 3060 Ti     Graphics card #0 vendor: NVIDIA     Graphics card #0 VRAM (MiB): 8192.00     Graphics card #0 deviceId: VideoController1     Graphics card #0 versionInfo: 31.0.15.1640     Memory slot #0 capacity (MiB): 16384.00     Memory slot #0 clockSpeed (GHz): 2.67     Memory slot #0 type: DDR4     Virtual memory max (MiB): 19165.32     Virtual memory used (MiB): 12895.84     Swap memory total (MiB): 2944.00     Swap memory used (MiB): 0.00     Space in storage for jna.tmpdir (MiB): available: 117624.45, total: 976134.31     Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): available: 117624.45, total: 976134.31     Space in storage for io.netty.native.workdir (MiB): available: 117624.45, total: 976134.31     Space in storage for java.io.tmpdir (MiB): available: 117624.45, total: 976134.31     Space in storage for workdir (MiB): available: 117624.45, total: 976134.31     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx6080m -Xms256m     Server Running: true     Player Count: 2 / 8; [ServerPlayer['deathray6002'/493, l='ServerLevel[testing eh]', x=81.50, y=59.00, z=-97.86], ServerPlayer['_Fire_Fly_2'/9219, l='ServerLevel[testing eh]', x=-13.16, y=50.47, z=16.67]]     Active Data Packs: vanilla, mod_data, mod/sodium, mod/smartbrainlib (incompatible), mod/ae2jeiintegration, mod/cyclopscore (incompatible), mod/fabric_renderer_api_v1, mod/mekanismcovers, mod/geckolib, mod/sophisticatedstorage (incompatible), mod/jei (incompatible), mod/ae2 (incompatible), mod/ae2wtlib (incompatible), mod/ae2wtlib_api, mod/everlastingabilities (incompatible), mod/commonnetworking (incompatible), mod/doggytalents (incompatible), mod/mcwwindows (incompatible), mod/sophisticatedcore (incompatible), mod/journeymap (incompatible), mod/neoforge, mod/artifacts, mod/fabric_block_view_api_v2, mod/badpackets (incompatible), mod/sophisticatedbackpacks (incompatible), mod/relics (incompatible), mod/mcjtylib, mod/rftoolsbase, mod/xnet, mod/fusion, mod/cloth_config (incompatible), mod/mekanism_extras (incompatible), mod/handcrafted, mod/mekanism_unleashed, mod/mekanism, mod/mekanismgenerators, mod/gmut (incompatible), mod/fabric_api_base, mod/mousetweaks (incompatible), mod/mekanismadditions, mod/ae2things (incompatible), mod/mekanism_lasers (incompatible), mod/supermartijn642corelib, mod/e4mc_minecraft (incompatible), mod/wthit,waila (incompatible), mod/curios (incompatible), mod/ars_nouveau (incompatible), mod/patchouli (incompatible), mod/ars_additions (incompatible), mod/ars_controle (incompatible), mod/ars_elemental (incompatible), mod/elevatorid, mod/ftbultimine (incompatible), mod/ae2qolrecipes (incompatible), mod/modonomicon (incompatible), mod/resourcefullib, mod/dtnpaletteofpaws (incompatible), mod/mekanismtools, mod/architectury (incompatible), mod/ftblibrary (incompatible), mod/octolib, mod/lootr, mod/connectedglass, mod/occultism, mod/ars_ocultas (incompatible), mod/fabric_rendering_data_attachment_v1, mod/appmek (incompatible), mod/expandability, mod/journeymap_api (incompatible)     Available Data Packs: bundle, trade_rebalance, vanilla, mod/ae2 (incompatible), mod/ae2jeiintegration, mod/ae2qolrecipes (incompatible), mod/ae2things (incompatible), mod/ae2wtlib (incompatible), mod/ae2wtlib_api, mod/appmek (incompatible), mod/architectury (incompatible), mod/ars_additions (incompatible), mod/ars_controle (incompatible), mod/ars_elemental (incompatible), mod/ars_nouveau (incompatible), mod/ars_ocultas (incompatible), mod/artifacts, mod/badpackets (incompatible), mod/cloth_config (incompatible), mod/commonnetworking (incompatible), mod/connectedglass, mod/curios (incompatible), mod/cyclopscore (incompatible), mod/doggytalents (incompatible), mod/dtnpaletteofpaws (incompatible), mod/e4mc_minecraft (incompatible), mod/elevatorid, mod/everlastingabilities (incompatible), mod/expandability, mod/fabric_api_base, mod/fabric_block_view_api_v2, mod/fabric_renderer_api_v1, mod/fabric_rendering_data_attachment_v1, mod/ftblibrary (incompatible), mod/ftbultimine (incompatible), mod/fusion, mod/geckolib, mod/gmut (incompatible), mod/handcrafted, mod/jei (incompatible), mod/journeymap (incompatible), mod/journeymap_api (incompatible), mod/lootr, mod/mcjtylib, mod/mcwwindows (incompatible), mod/mekanism, mod/mekanism_extras (incompatible), mod/mekanism_lasers (incompatible), mod/mekanism_unleashed, mod/mekanismadditions, mod/mekanismcovers, mod/mekanismgenerators, mod/mekanismtools, mod/modonomicon (incompatible), mod/mousetweaks (incompatible), mod/neoforge, mod/occultism, mod/octolib, mod/patchouli (incompatible), mod/relics (incompatible), mod/resourcefullib, mod/rftoolsbase, mod/smartbrainlib (incompatible), mod/sodium, mod/sophisticatedbackpacks (incompatible), mod/sophisticatedcore (incompatible), mod/sophisticatedstorage (incompatible), mod/supermartijn642corelib, mod/wthit,waila (incompatible), mod/xnet, mod_data     Enabled Feature Flags: minecraft:vanilla     World Generation: Stable     World Seed: -4893969446266667034     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'neoforge'; Server brand changed to 'neoforge'     Launched Version: neoforge-21.1.73     ModLauncher: 11.0.4+main.d2e20e43     ModLauncher launch target: forgeclient     ModLauncher services:         sponge-mixin-0.15.2+mixin.0.8.7.jar mixin PLUGINSERVICE         loader-4.0.31.jar slf4jfixer PLUGINSERVICE         loader-4.0.31.jar runtime_enum_extender PLUGINSERVICE         at-modlauncher-10.0.1.jar accesstransformer PLUGINSERVICE         loader-4.0.31.jar runtimedistcleaner PLUGINSERVICE         modlauncher-11.0.4.jar mixin TRANSFORMATIONSERVICE         modlauncher-11.0.4.jar fml TRANSFORMATIONSERVICE     FML Language Providers:         [email protected]         [email protected]         [email protected]     Mod List:         ae2jeiintegration-1.2.0.jar                       |AE2 JEI Integration           |ae2jeiintegration             |1.2.0               |Manifest: NOSIGNATURE         ae2qolrecipes-neoforge-1.21.x-1.2.0.jar           |AE2 QoL Recipes               |ae2qolrecipes                 |1.2.0               |Manifest: NOSIGNATURE         AE2-Things-1.4.2-beta.jar                         |AE2 Things                    |ae2things                     |1.4.2-beta          |Manifest: NOSIGNATURE         ae2wtlib-19.1.6-beta.jar                          |AE2WTLib                      |ae2wtlib                      |19.1.6-beta         |Manifest: NOSIGNATURE         de.mari_023.ae2wtlib_api-19.1.6-beta.jar          |AE2WTLib API                  |ae2wtlib_api                  |19.1.6-beta         |Manifest: NOSIGNATURE         appliedenergistics2-19.0.23-beta.jar              |Applied Energistics 2         |ae2                           |19.0.23-beta        |Manifest: NOSIGNATURE         Applied-Mekanistics-1.6.1.jar                     |Applied Mekanistics           |appmek                        |1.6.1               |Manifest: NOSIGNATURE         architectury-13.0.8-neoforge.jar                  |Architectury                  |architectury                  |13.0.8              |Manifest: NOSIGNATURE         ars_additions-1.21.1-21.1.3.jar                   |Ars Additions                 |ars_additions                 |1.21.1-21.1.3       |Manifest: NOSIGNATURE         ars_controle-1.21.0-1.2.0.jar                     |Ars Controle                  |ars_controle                  |1.21.0-1.2.0        |Manifest: NOSIGNATURE         ars_elemental-1.21.1-0.7.0.8.jar                  |Ars Elemental                 |ars_elemental                 |0.7.0.8             |Manifest: NOSIGNATURE         ars_nouveau-1.21.1-5.2.2-all.jar                  |Ars Nouveau                   |ars_nouveau                   |5.2.2               |Manifest: NOSIGNATURE         ars_ocultas-1.21.0-2.0.1.jar                      |Ars Ocultas                   |ars_ocultas                   |2.0.1               |Manifest: NOSIGNATURE         artifacts-neoforge-12.0.5.jar                     |Artifacts                     |artifacts                     |12.0.5              |Manifest: NOSIGNATURE         badpackets-neo-0.8.1.jar                          |Bad Packets                   |badpackets                    |0.8.1               |Manifest: NOSIGNATURE         cloth-config-15.0.140-neoforge.jar                |Cloth Config v15 API          |cloth_config                  |15.0.140            |Manifest: NOSIGNATURE         common-networking-neoforge-1.0.16-1.21.1.jar      |Common Networking             |commonnetworking              |1.0.16-1.21.1       |Manifest: NOSIGNATURE         connectedglass-1.1.12-neoforge-mc1.21.jar         |Connected Glass               |connectedglass                |1.1.12              |Manifest: NOSIGNATURE         curios-neoforge-9.0.14+1.21.1.jar                 |Curios API                    |curios                        |9.0.14+1.21.1       |Manifest: NOSIGNATURE         cyclopscore-1.21.1-neoforge-1.25.2.jar            |Cyclops Core                  |cyclopscore                   |1.25.2              |Manifest: NOSIGNATURE         DoggyTalentsNext-1.21.1-1.18.33.jar               |Doggy Talents Next            |doggytalents                  |1.18.33             |Manifest: NOSIGNATURE         DTNPaletteOfPaws-1.21-1.2.4.jar                   |DTN's Palette Of Paws         |dtnpaletteofpaws              |1.2.4               |Manifest: NOSIGNATURE         e4mc_minecraft-neoforge-5.2.1.jar                 |e4mc                          |e4mc_minecraft                |5.2.1               |Manifest: NOSIGNATURE         elevatorid-neoforge-1.21.1-1.11.3.jar             |ElevatorMod                   |elevatorid                    |1.21.1-1.11.3       |Manifest: NOSIGNATURE         everlastingabilities-1.21.1-neoforge-2.3.0.jar    |EverlastingAbilities          |everlastingabilities          |2.3.0               |Manifest: NOSIGNATURE         expandability-neoforge-12.0.0.jar                 |ExpandAbility                 |expandability                 |12.0.0              |Manifest: NOSIGNATURE         fabric-api-base-0.4.42+d1308ded19.jar             |Forgified Fabric API Base     |fabric_api_base               |0.4.42+d1308ded19   |Manifest: NOSIGNATURE         fabric-block-view-api-v2-1.0.10+9afaaf8c19.jar    |Forgified Fabric BlockView API|fabric_block_view_api_v2      |1.0.10+9afaaf8c19   |Manifest: NOSIGNATURE         fabric-renderer-api-v1-3.4.0+acb05a3919.jar       |Forgified Fabric Renderer API |fabric_renderer_api_v1        |3.4.0+acb05a3919    |Manifest: NOSIGNATURE         fabric-rendering-data-attachment-v1-0.3.48+73761d2|Forgified Fabric Rendering Dat|fabric_rendering_data_attachme|0.3.48+73761d2e19   |Manifest: NOSIGNATURE         ftb-library-neoforge-2101.1.4.jar                 |FTB Library                   |ftblibrary                    |2101.1.4            |Manifest: NOSIGNATURE         ftb-ultimine-neoforge-2101.1.1.jar                |FTB Ultimine                  |ftbultimine                   |2101.1.1            |Manifest: NOSIGNATURE         fusion-1.1.1a-neoforge-mc1.21.jar                 |Fusion                        |fusion                        |1.1.1+a             |Manifest: NOSIGNATURE         geckolib-neoforge-1.21.1-4.6.6.jar                |GeckoLib 4                    |geckolib                      |4.6.6               |Manifest: NOSIGNATURE         GravitationalModulatingAdditionalUnit-1.21.1-6.0.j|Gravitational Modulating Addit|gmut                          |6.0                 |Manifest: NOSIGNATURE         handcrafted-neoforge-1.21.1-4.0.2.jar             |Handcrafted                   |handcrafted                   |4.0.2               |Manifest: NOSIGNATURE         journeymap-neoforge-1.21.1-6.0.0-beta.28.jar      |Journeymap                    |journeymap                    |1.21.1-6.0.0-beta.28|Manifest: NOSIGNATURE         journeymap-api-neoforge-2.0.0-1.21.1-SNAPSHOT.jar |JourneyMap API                |journeymap_api                |2.0.0               |Manifest: NOSIGNATURE         jei-1.21.1-neoforge-19.21.0.247.jar               |Just Enough Items             |jei                           |19.21.0.247         |Manifest: NOSIGNATURE         lootr-neoforge-1.21-1.10.33.85.jar                |Lootr                         |lootr                         |1.21-1.10.33.85     |Manifest: NOSIGNATURE         mcw-windows-2.3.0-mc1.21.1neoforge.jar            |Macaw's Windows               |mcwwindows                    |2.3.2               |Manifest: NOSIGNATURE         mcjtylib-1.21-9.0.4.jar                           |McJtyLib                      |mcjtylib                      |1.21-9.0.4          |Manifest: NOSIGNATURE         Mekanism-1.21.1-10.7.7.64.jar                     |Mekanism                      |mekanism                      |10.7.7              |Manifest: NOSIGNATURE         mekanismcovers-1.1-BETA+1.21.jar                  |Mekanism Covers               |mekanismcovers                |1.1-BETA+1.21       |Manifest: NOSIGNATURE         mekanism_extras-1.21.1-1.0.2.jar                  |Mekanism Extras               |mekanism_extras               |1.21.1-1.0.2        |Manifest: NOSIGNATURE         MekanismLasers-1.21.1-1.1.7.jar                   |Mekanism Lasers               |mekanism_lasers               |1.1.7               |Manifest: NOSIGNATURE         mekanism_unleashed-1.21-0.2.1.jar                 |Mekanism Unleashed            |mekanism_unleashed            |1.21-0.2.1          |Manifest: NOSIGNATURE         MekanismAdditions-1.21.1-10.7.7.64.jar            |Mekanism: Additions           |mekanismadditions             |10.7.7              |Manifest: NOSIGNATURE         MekanismGenerators-1.21.1-10.7.7.64.jar           |Mekanism: Generators          |mekanismgenerators            |10.7.7              |Manifest: NOSIGNATURE         MekanismTools-1.21.1-10.7.7.64.jar                |Mekanism: Tools               |mekanismtools                 |10.7.7              |Manifest: NOSIGNATURE         client-1.21.1-20240808.144430-srg.jar             |Minecraft                     |minecraft                     |1.21.1              |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         modonomicon-1.21.1-neoforge-1.108.1.jar           |Modonomicon                   |modonomicon                   |1.108.1             |Manifest: NOSIGNATURE         MouseTweaks-neoforge-mc1.21-2.26.1.jar            |Mouse Tweaks                  |mousetweaks                   |2.26.1              |Manifest: NOSIGNATURE         neoforge-21.1.73-universal.jar                    |NeoForge                      |neoforge                      |21.1.73             |Manifest: NOSIGNATURE         occultism-1.21.1-neoforge-1.165.0.jar             |Occultism                     |occultism                     |1.165.0             |Manifest: NOSIGNATURE         OctoLib-NEOFORGE-0.4.2.jar                        |OctoLib                       |octolib                       |0.4.2               |Manifest: NOSIGNATURE         Patchouli-1.21-88-NEOFORGE-SNAPSHOT.jar           |Patchouli                     |patchouli                     |1.21-88-NEOFORGE-SNA|Manifest: NOSIGNATURE         relics-1.21-0.9.2.0.jar                           |Relics                        |relics                        |0.9.2.0             |Manifest: NOSIGNATURE         resourcefullib-neoforge-1.21-3.0.11.jar           |Resourceful Lib               |resourcefullib                |3.0.11              |Manifest: NOSIGNATURE         rftoolsbase-1.21-6.0.1.jar                        |RFToolsBase                   |rftoolsbase                   |1.21-6.0.1          |Manifest: NOSIGNATURE         SmartBrainLib-neoforge-1.21.1-1.16.1.jar          |SmartBrainLib                 |smartbrainlib                 |1.16.1              |Manifest: NOSIGNATURE         sodium-neoforge-0.6.0-beta.4+mc1.21.1.jar         |Sodium                        |sodium                        |0.6.0-beta.4+mc1.21.|Manifest: NOSIGNATURE         sophisticatedbackpacks-1.21-3.20.17.1113.jar      |Sophisticated Backpacks       |sophisticatedbackpacks        |3.20.17             |Manifest: NOSIGNATURE         sophisticatedcore-1.21-0.6.45.722.jar             |Sophisticated Core            |sophisticatedcore             |0.6.45              |Manifest: NOSIGNATURE         sophisticatedstorage-1.21-0.10.45.910.jar         |Sophisticated Storage         |sophisticatedstorage          |0.10.45             |Manifest: NOSIGNATURE         supermartijn642corelib-1.1.17i-neoforge-mc1.21.jar|SuperMartijn642's Core Lib    |supermartijn642corelib        |1.1.17+i            |Manifest: NOSIGNATURE         wthit-neo-12.4.2.jar                              |wthit                         |wthit                         |12.4.2              |Manifest: NOSIGNATURE         xnet-1.21-7.0.1.jar                               |XNet                          |xnet                          |1.21-7.0.1          |Manifest: NOSIGNATURE     Crash Report UUID: f3418bdd-df7f-43ec-8c12-efd6cf5ef694     FML: 4.0.31     NeoForge: 21.1.73  
    • Add crash-reports with sites like https://mclo.gs/ Make a test without CustomCursor and/or jeg (justenoughguns)
    • An Ostimien mob from it is invalid at pos 170,66,-143 Check the config (lycanitesmobs-spawning.cfg) and temporarily disable Ostimien
    • Backup the world and make a test without alexscaves
  • Topics

×
×
  • Create New...

Important Information

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