NaturesAura/src/main/java/de/ellpeck/naturesaura/reg/ModTileType.java

30 lines
779 B
Java
Raw Normal View History

2020-01-22 01:32:26 +01:00
package de.ellpeck.naturesaura.reg;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.registries.ForgeRegistryEntry;
import java.util.function.Supplier;
public class ModTileType<T extends TileEntity> implements IModItem {
public final TileEntityType<T> type;
public final String name;
public ModTileType(Supplier<T> supplier, IModItem block) {
this.type = TileEntityType.Builder.create(supplier, (Block) block).build(null);
this.name = block.getBaseName();
}
@Override
public String getBaseName() {
return this.name;
}
@Override
public ForgeRegistryEntry getRegistryEntry() {
return this.type;
}
}