2018-10-28 17:39:53 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2020-01-21 23:02:39 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities;
|
2018-10-28 17:39:53 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.TileEntityAuraDetector;
|
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;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
public class BlockAuraDetector extends BlockContainerImpl {
|
|
|
|
|
|
|
|
public BlockAuraDetector() {
|
2020-01-21 23:02:39 +01:00
|
|
|
super("aura_detector", ModTileEntities.AURA_DETECTOR, ModBlocks.prop(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
|
2019-10-20 22:30:49 +02:00
|
|
|
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
|
2018-10-28 17:39:53 +01:00
|
|
|
TileEntity tile = worldIn.getTileEntity(pos);
|
|
|
|
if (tile instanceof TileEntityAuraDetector)
|
|
|
|
return ((TileEntityAuraDetector) tile).redstonePower;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|