2018-10-28 17:39:53 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2021-12-04 15:40:09 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityAuraDetector;
|
2020-01-21 23:02:39 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
2018-11-14 16:40:21 +01:00
|
|
|
import net.minecraft.block.SoundType;
|
2018-10-28 17:39:53 +01:00
|
|
|
import net.minecraft.block.material.Material;
|
2021-12-04 15:40:09 +01:00
|
|
|
import net.minecraft.tileentity.BlockEntity;
|
2018-10-28 17:39:53 +01:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2021-12-04 15:40:09 +01:00
|
|
|
import net.minecraft.level.Level;
|
2018-10-28 17:39:53 +01:00
|
|
|
|
|
|
|
public class BlockAuraDetector extends BlockContainerImpl {
|
|
|
|
|
|
|
|
public BlockAuraDetector() {
|
2021-12-04 15:40:09 +01:00
|
|
|
super("aura_detector", BlockEntityAuraDetector::new, Properties.create(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
2018-10-28 17:39:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-20 22:30:49 +02:00
|
|
|
public boolean hasComparatorInputOverride(BlockState state) {
|
2018-10-28 17:39:53 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-12-04 15:40:09 +01:00
|
|
|
public int getComparatorInputOverride(BlockState blockState, Level levelIn, BlockPos pos) {
|
|
|
|
BlockEntity tile = levelIn.getBlockEntity(pos);
|
|
|
|
if (tile instanceof BlockEntityAuraDetector)
|
|
|
|
return ((BlockEntityAuraDetector) tile).redstonePower;
|
2018-10-28 17:39:53 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|