/*
 * This file is part of TechReborn, licensed under the MIT License (MIT).
 *
 * Copyright (c) 2018 TechReborn
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package techreborn.entities;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.explosion.RebornExplosion;

/**
 * Created by Mark on 13/03/2016.
 */
public class EntityNukePrimed extends EntityTNTPrimed {

	public int fuse = 400;

	public EntityNukePrimed(World world) {
		super(world);
	}

	public EntityNukePrimed(World world, double x, double y, double z, EntityLivingBase tntPlacedBy) {
		super(world, x, y, z, tntPlacedBy);
	}

	@Override
	public void onUpdate() {

		this.prevPosX = this.posX;
		this.prevPosY = this.posY;
		this.prevPosZ = this.posZ;
		this.motionY -= 0.03999999910593033D;
		this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
		this.motionX *= 0.9800000190734863D;
		this.motionY *= 0.9800000190734863D;
		this.motionZ *= 0.9800000190734863D;
		if (this.onGround) {
			this.motionX *= 0.699999988079071D;
			this.motionZ *= 0.699999988079071D;
			this.motionY *= -0.5D;
		}
		if (this.fuse-- <= 0) {
			this.setDead();
			if (!this.world.isRemote) {
				this.explodeNuke();
			}
		} else {
			this.handleWaterMovement();
			this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY + 0.5D, this.posZ, 0.0D,
				0.0D, 0.0D, new int[0]);
		}
	}

	public void explodeNuke() {
		RebornExplosion nukeExplosion = new RebornExplosion(new BlockPos(this.posX, this.posY, this.posZ), world,
			40);
		nukeExplosion.setLivingBase(getTntPlacedBy());
		nukeExplosion.explode();
	}

}

@@ -1522,16 +1522,160 @@
 plosion;
+%0Aimport reborncore.common.registration.RebornRegistry;%0Aimport reborncore.common.registration.impl.ConfigRegistry;%0Aimport techreborn.lib.ModInfo;
 %0A%0A/**%0A *
@@ -1710,16 +1710,56 @@
 16.%0A */%0A
+@RebornRegistry(modID = ModInfo.MOD_ID)%0A
 public c
@@ -1807,24 +1807,127 @@
 imed %7B%0A%0A
+%09@ConfigRegistry(config = %22misc%22, category = %22nuke%22, key = %22fuse%22, comment = %22Nuke fuse time (ticks)%22)%0A
 %09public 
 int fuse
@@ -1918,16 +1918,23 @@
 %09public 
+static 
 int fuse
@@ -1942,16 +1942,338 @@
 = 400;%0A%0A
+%09@ConfigRegistry(config = %22misc%22, category = %22nuke%22, key = %22radius%22, comment = %22Nuke explision radius%22)%0A%09public static int radius = 40;%0A%0A%09@ConfigRegistry(config = %22misc%22, category = %22nuke%22, key = %22enabled%22, comment = %22Should the nuke explode, set to false to prevent block damage%22)%0A%09public static boolean enabled = true;%0A%0A
 %09public 
@@ -3268,16 +3268,47 @@
 uke() %7B%0A
+%09%09if(!enabled)%7B%0A%09%09%09return;%0A%09%09%7D%0A
 %09%09Reborn
@@ -3410,18 +3410,22 @@
 rld,%0A%09%09%09
-40
+radius
 );%0A%09%09nuk

Add configs to the nuke, closes #1594