Add constructor that allows passing a custom Block.Settings

This commit is contained in:
modmuss50 2020-03-31 23:14:03 +01:00
parent bb6ff90f9b
commit 49e1ce3c2e

View file

@ -24,6 +24,7 @@
package techreborn.blocks; package techreborn.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import reborncore.api.blockentity.IMachineGuiHandler; import reborncore.api.blockentity.IMachineGuiHandler;
@ -46,6 +47,12 @@ public class GenericMachineBlock extends BlockMachineBase {
this.gui = gui; this.gui = gui;
} }
public GenericMachineBlock(Block.Settings settings, IMachineGuiHandler gui, Supplier<BlockEntity> blockEntityClass) {
super(settings);
this.blockEntityClass = blockEntityClass;
this.gui = gui;
}
@Override @Override
public BlockEntity createBlockEntity(BlockView worldIn) { public BlockEntity createBlockEntity(BlockView worldIn) {
if (blockEntityClass == null) { if (blockEntityClass == null) {