package net.geforcemods.securitycraft.blocks;

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.FlowingFluid;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class FakeLavaBlock extends FlowingFluidBlock
{
	private static final EffectInstance SHORT_FIRE_RESISTANCE = new EffectInstance(Effects.FIRE_RESISTANCE, 1);
	private static final EffectInstance SHORT_REGENERATION = new EffectInstance(Effects.REGENERATION, 1);

	public FakeLavaBlock(Block.Properties properties, Supplier<? extends FlowingFluid> fluid)
	{
		super(fluid, properties);
	}

	@Override
	public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
	{
		super.onEntityCollision(state, world, pos, entity);

		if(entity instanceof LivingEntity)
		{
			LivingEntity lEntity = (LivingEntity)entity;

			lEntity.extinguish();

			if(!world.isRemote)
			{
				lEntity.addPotionEffect(SHORT_FIRE_RESISTANCE);
				lEntity.addPotionEffect(SHORT_REGENERATION);
			}
		}
	}
}

@@ -657,112 +657,8 @@
 1);%0D
-%0A%09private static final EffectInstance SHORT_REGENERATION = new EffectInstance(Effects.REGENERATION, 1);%0D
 %0A%0D%0A%09
@@ -1157,16 +1157,74 @@
 ANCE);%0D%0A
+%0D%0A%09%09%09%09if(!lEntity.isPotionActive(Effects.REGENERATION))%0D%0A%09
 %09%09%09%09lEnt
@@ -1243,22 +1243,43 @@
 nEffect(
-SHORT_
+new EffectInstance(Effects.
 REGENERA
@@ -1282,16 +1282,24 @@
 NERATION
+, 20, 2)
 );%0D%0A%09%09%09%7D

fix fake lava regeneration