diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-11-03 02:40:23 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-11-03 02:40:23 -0500 |
commit | 8a6be0ce81d935551ab2ebc9c4e7d41b88297957 (patch) | |
tree | ed194dd70239f4a022d8ee824876cdbcd5c950c7 /src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java | |
parent | f6ecfac78b963a694a13891df06413df104b19fb (diff) |
Diffstat (limited to 'src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java')
-rw-r--r-- | src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java b/src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java new file mode 100644 index 0000000..31ed63b --- /dev/null +++ b/src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java @@ -0,0 +1,31 @@ +package net.cshift.mc.sparkt.block; + +import com.mojang.serialization.MapCodec; + +import net.cshift.mc.sparkt.block.entity.MachineDriverEntity; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.util.math.BlockPos; + +public class DriverElectric extends MachineBlock{ + public static final MapCodec<DriverElectric> CODEC = createCodec(DriverElectric::new); + + public MapCodec<DriverElectric> getCodec() { + return CODEC; + } + + public DriverElectric(Settings settings) { + super(settings); + } + + @Override + public BlockEntity createBlockEntity(BlockPos var1, BlockState var2) { + return new MachineDriverEntity(var1, var2); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return (BlockState)this.getDefaultState().with(FACING, ctx.getPlayerLookDirection().getOpposite()); + } +}
\ No newline at end of file |