summaryrefslogtreecommitdiff
path: root/src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-11-03 02:40:23 -0500
committerKyle Gunger <kgunger12@gmail.com>2024-11-03 02:40:23 -0500
commit8a6be0ce81d935551ab2ebc9c4e7d41b88297957 (patch)
treeed194dd70239f4a022d8ee824876cdbcd5c950c7 /src/main/java/net/cshift/mc/sparkt/block/DriverElectric.java
parentf6ecfac78b963a694a13891df06413df104b19fb (diff)
Update to currentHEADmain
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.java31
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