TheBrokenRail
fbaf0308da
All checks were successful
EnergonRelics/pipeline/head This commit looks good
29 lines
996 B
Java
29 lines
996 B
Java
package com.thebrokenrail.energonrelics.block.util;
|
|
|
|
import com.thebrokenrail.energonrelics.EnergonRelics;
|
|
import net.fabricmc.loader.api.FabricLoader;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.item.BlockItem;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.util.Identifier;
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
public class SimpleBlock extends Block {
|
|
public SimpleBlock(Settings settings) {
|
|
super(settings);
|
|
}
|
|
|
|
public void register(String name) {
|
|
Registry.register(Registry.BLOCK, new Identifier(EnergonRelics.NAMESPACE, name), this);
|
|
Item.Settings settings = new Item.Settings();
|
|
if (addToItemGroup() || FabricLoader.getInstance().isDevelopmentEnvironment()) {
|
|
settings.group(EnergonRelics.ITEM_GROUP);
|
|
}
|
|
Registry.register(Registry.ITEM, new Identifier(EnergonRelics.NAMESPACE, name), new BlockItem(this, settings));
|
|
}
|
|
|
|
protected boolean addToItemGroup() {
|
|
return true;
|
|
}
|
|
}
|