mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-09-29 16:01:06 +02:00
30 lines
987 B
Java
30 lines
987 B
Java
package de.ellpeck.naturesaura.blocks;
|
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityAuraDetector;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.block.SoundType;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
|
|
public class BlockAuraDetector extends BlockContainerImpl {
|
|
|
|
public BlockAuraDetector() {
|
|
super("aura_detector", BlockEntityAuraDetector.class, Properties.of().strength(2F).sound(SoundType.STONE));
|
|
}
|
|
|
|
@Override
|
|
@SuppressWarnings("deprecation")
|
|
public boolean hasAnalogOutputSignal(BlockState state) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
@SuppressWarnings("deprecation")
|
|
public int getAnalogOutputSignal(BlockState blockState, Level levelIn, BlockPos pos) {
|
|
var tile = levelIn.getBlockEntity(pos);
|
|
if (tile instanceof BlockEntityAuraDetector detector)
|
|
return detector.redstonePower;
|
|
else
|
|
return 0;
|
|
}
|
|
}
|