forked from TheBrokenRail/EnergonRelics
43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
|
package com.thebrokenrail.energonrelics.block.forcefield;
|
||
|
|
||
|
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||
|
import com.thebrokenrail.energonrelics.block.forcefield.util.AbstractFieldBlock;
|
||
|
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||
|
import net.minecraft.block.BlockState;
|
||
|
import net.minecraft.block.ShapeContext;
|
||
|
import net.minecraft.entity.Entity;
|
||
|
import net.minecraft.entity.LivingEntity;
|
||
|
import net.minecraft.entity.damage.DamageSource;
|
||
|
import net.minecraft.util.math.BlockPos;
|
||
|
import net.minecraft.util.shape.VoxelShape;
|
||
|
import net.minecraft.util.shape.VoxelShapes;
|
||
|
import net.minecraft.world.BlockView;
|
||
|
import net.minecraft.world.World;
|
||
|
|
||
|
public class IndustrialLaserBlock extends AbstractFieldBlock {
|
||
|
public IndustrialLaserBlock() {
|
||
|
super(false);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected BlockState getProjectorBlockState() {
|
||
|
return EnergonRelics.INDUSTRIAL_LASER_PROJECTOR_BLOCK.getDefaultState();
|
||
|
}
|
||
|
|
||
|
@SuppressWarnings("deprecation")
|
||
|
@Override
|
||
|
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
||
|
super.onEntityCollision(state, world, pos, entity);
|
||
|
|
||
|
if (entity instanceof LivingEntity) {
|
||
|
entity.damage(DamageSource.IN_FIRE, HardcodedConfig.INDUSTRIAL_LASER_BEAM_DAMAGE);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@SuppressWarnings("deprecation")
|
||
|
@Override
|
||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||
|
return VoxelShapes.empty();
|
||
|
}
|
||
|
}
|