generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a137f9e
commit c74bf90
Showing
16 changed files
with
357 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/7383b985a2cdbb3a068dc5fd3ae4ba545545c370
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/com/portingdeadmods/modjam/content/blockentities/LaserJunctionBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.portingdeadmods.modjam.content.blockentities; | ||
|
||
import com.portingdeadmods.modjam.ModJam; | ||
import com.portingdeadmods.modjam.api.blockentities.LaserBlockEntity; | ||
import com.portingdeadmods.modjam.capabilities.IOActions; | ||
import com.portingdeadmods.modjam.content.blocks.LaserJunctionBlock; | ||
import com.portingdeadmods.modjam.registries.MJBlockEntityTypes; | ||
import it.unimi.dsi.fastutil.Pair; | ||
import it.unimi.dsi.fastutil.objects.ObjectArraySet; | ||
import it.unimi.dsi.fastutil.objects.ObjectSet; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.neoforged.neoforge.capabilities.BlockCapability; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Map; | ||
|
||
public class LaserJunctionBlockEntity extends LaserBlockEntity { | ||
public LaserJunctionBlockEntity(BlockPos blockPos, BlockState blockState) { | ||
super(MJBlockEntityTypes.LASER_JUNCTION.get(), blockPos, blockState); | ||
} | ||
|
||
@Override | ||
public ObjectSet<Direction> getLaserInputs() { | ||
return getConnections(LaserJunctionBlock.ConnectionType.INPUT); | ||
} | ||
|
||
@Override | ||
public ObjectSet<Direction> getLaserOutputs() { | ||
return getConnections(LaserJunctionBlock.ConnectionType.OUTPUT); | ||
} | ||
|
||
private ObjectSet<Direction> getConnections(LaserJunctionBlock.ConnectionType type) { | ||
ObjectSet<Direction> connections = new ObjectArraySet<>(); | ||
for (Direction direction : Direction.values()) { | ||
if (getBlockState().getValue(LaserJunctionBlock.CONNECTION[direction.get3DDataValue()]) == type) { | ||
connections.add(direction); | ||
} | ||
} | ||
return connections; | ||
} | ||
|
||
@Override | ||
public <T> Map<Direction, Pair<IOActions, int[]>> getSidedInteractions(BlockCapability<T, @Nullable Direction> capability) { | ||
return Map.of(); | ||
} | ||
|
||
@Override | ||
public void commonTick() { | ||
super.commonTick(); | ||
transmitPower(this.power); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.