Make Industrial Laser Set On Fire

This commit is contained in:
TheBrokenRail 2020-08-19 20:19:27 -04:00
parent f4bb60b819
commit 4799ad5903
1 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package com.thebrokenrail.energonrelics.block.forcefield.laser;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.forcefield.util.AbstractFieldBlock;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import net.minecraft.block.AbstractFireBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
import net.minecraft.entity.Entity;
@ -10,6 +11,7 @@ import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.mob.CreeperEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.math.BlockPos;
@ -47,7 +49,14 @@ public class IndustrialLaserBlock extends AbstractFieldBlock {
if (entity instanceof CreeperEntity) {
((CreeperEntity) entity).ignite();
} else if (entity instanceof LivingEntity) {
entity.damage(DAMAGE_SOURCE, HardcodedConfig.INDUSTRIAL_LASER_BEAM_DAMAGE);
if (!entity.isFireImmune()) {
entity.setFireTicks(entity.getFireTicks() + 1);
if (entity.getFireTicks() == 0) {
entity.setOnFireFor(8);
}
entity.damage(DAMAGE_SOURCE, HardcodedConfig.INDUSTRIAL_LASER_BEAM_DAMAGE);
}
} else if (entity instanceof ItemEntity) {
ItemStack stack = ((ItemEntity) entity).getStack();
if (stack.getItem() == Items.GUNPOWDER) {