Add constructor that allows passing a custom Block.Settings
This commit is contained in:
parent
bb6ff90f9b
commit
49e1ce3c2e
1 changed files with 7 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue