Skip to content

Commit

Permalink
fix: wires not connecting to lamps
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Jun 24, 2023
1 parent f581a45 commit ec7c6e3
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package mrtjp.projectred.illumination.block;

import codechicken.multipart.api.RedstoneConnectorBlock;
import mrtjp.projectred.illumination.tile.IllumarLampTile;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.RedstoneTorchBlock;
Expand All @@ -18,7 +20,7 @@
import javax.annotation.Nullable;
import java.util.Random;

public class IllumarLampBlock extends Block implements EntityBlock {
public class IllumarLampBlock extends Block implements EntityBlock, RedstoneConnectorBlock {

public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;

Expand Down Expand Up @@ -86,4 +88,16 @@ public void tick(BlockState state, ServerLevel world, BlockPos pos, Random rand)
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new IllumarLampTile(color, inverted, pos, state);
}

//region Redstone Connector block
@Override
public int getConnectionMask(LevelReader world, BlockPos pos, int side) {
return 0x1F;
}

@Override
public int weakPowerLevel(LevelReader world, BlockPos pos, int side, int mask) {
return 0;
}
//endregion
}

0 comments on commit ec7c6e3

Please sign in to comment.