Hello! I'm right now trying to see how you use tile entities.
But then, I got this error.
error: method create in class Builder<T#2> cannot be applied to given types;
public static final RegistryObject<TileEntityType<BlockMinerTile>> BLOCK_MINER_TILE = TILE_ENTITY_TYPES.register("quarry", TileEntityType.Builder.create(BlockMinerTile::new, RegistryHandler.BlOCK_MINER).build());
^
required: Supplier<? extends T#1>,Block[]
found: BlockMinerTile::new,RegistryObject<Block>
reason: cannot infer type-variable(s) T#1
(varargs mismatch; RegistryObject<Block> cannot be converted to Block)
where T#1,T#2 are type-variables:
T#1 extends TileEntity declared in method <T#1>create(Supplier<? extends T#1>,Block...)
T#2 extends TileEntity declared in class Builder
Here is the code where the error is.
package com.example.examplemod.tile;
import com.example.examplemod.ExampleMod;
import com.example.examplemod.util.RegistryHandler;
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
public class ModTileEntityTypes {
public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, ExampleMod.MOD_ID);
public static final RegistryObject<TileEntityType<BlockMinerTile>> BLOCK_MINER_TILE = TILE_ENTITY_TYPES.register("quarry", TileEntityType.Builder.create(BlockMinerTile::new, RegistryHandler.BlOCK_MINER).build(null));
}
Also, here's the code of the BlockMinerTile.
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.math.BlockPos;
public class BlockMinerTile extends TileEntity implements ITickableTileEntity {
public BlockMinerTile(final TileEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
}
public BlockMinerTile() {
super(ModTileEntityTypes.BLOCK_MINER_TILE.get());
}
@Override
public void tick() {
}
}
That's All. Ask me if you need more information.