/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package net.wurstclient.features.mods.retro;

import net.minecraft.network.play.client.CPacketPlayer;
import net.wurstclient.compatibility.WConnection;
import net.wurstclient.compatibility.WMinecraft;
import net.wurstclient.events.listeners.UpdateListener;
import net.wurstclient.features.HelpPage;
import net.wurstclient.features.Mod;
import net.wurstclient.features.SearchTags;

@SearchTags({"GodMode", "god mode"})
@HelpPage("Mods/Regen")
@Mod.Bypasses(ghostMode = false, latestNCP = false, olderNCP = false)
public final class RegenMod extends RetroMod implements UpdateListener
{
	public RegenMod()
	{
		super("Regen", "Regenerates your health 1000 times faster.\n"
			+ "Can cause unwanted \"Flying is not enabled!\" kicks.");
	}
	
	@Override
	public void onEnable()
	{
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onDisable()
	{
		wurst.events.remove(UpdateListener.class, this);
	}
	
	@Override
	public void onUpdate()
	{
		if(!WMinecraft.getPlayer().capabilities.isCreativeMode
			&& WMinecraft.getPlayer().getFoodStats().getFoodLevel() > 17
			&& WMinecraft.getPlayer().getHealth() < 20
			&& WMinecraft.getPlayer().getHealth() != 0
			&& WMinecraft.getPlayer().onGround)
			for(int i = 0; i < 1000; i++)
				WConnection.sendPacket(new CPacketPlayer());
	}
}

@@ -560,24 +560,19 @@
 eatures.
-HelpPage
+Mod
 ;%0Aimport
@@ -584,36 +584,48 @@
 wurstclient.
-features.Mod
+settings.CheckboxSetting
 ;%0Aimport net
@@ -641,90 +641,92 @@
 ent.
-features.SearchTags;%0A%0A@SearchTags(%7B%22GodMode%22, %22god mode%22%7D)%0A@HelpPage(%22Mods/Regen%22)
+settings.SliderSetting;%0Aimport net.wurstclient.settings.SliderSetting.ValueDisplay;%0A
 %0A@Mo
@@ -865,16 +865,223 @@
 tener%0A%7B%0A
+%09private final SliderSetting speed =%0A%09%09new SliderSetting(%22Speed%22, 1000, 50, 1000, 50, ValueDisplay.INTEGER);%0A%09private final CheckboxSetting pauseInMidAir =%0A%09%09new CheckboxSetting(%22Pause in mid-air%22, true);%0A%09%0A
 %09public 
@@ -1140,18 +1140,12 @@
 lth 
-1000 times
+much
  fas
@@ -1166,22 +1166,36 @@
 Can 
-cause unwanted
+sometimes get you kicked for
  %5C%22F
@@ -1218,19 +1218,113 @@
 bled
-!
 %5C%22
- kicks.%22
+.%22);%0A%09%7D%0A%09%0A%09@Override%0A%09public void initSettings()%0A%09%7B%0A%09%09settings.add(speed);%0A%09%09settings.add(pauseInMidAir
 );%0A%09
@@ -1556,17 +1556,16 @@
 %09%7B%0A%09%09if(
-!
 WMinecra
@@ -1606,26 +1606,26 @@
 tiveMode%0A%09%09%09
-&&
+%7C%7C
  WMinecraft.
@@ -1643,46 +1643,124 @@
 .get
-FoodStats().getFoodLevel() %3E 17%0A%09%09%09&& 
+Health() == 0)%0A%09%09%09return;%0A%09%09%0A%09%09if(pauseInMidAir.isChecked() && !WMinecraft.getPlayer().onGround)%0A%09%09%09return;%0A%09%09%0A%09%09if(
 WMin
@@ -1785,28 +1785,60 @@
 .get
-Health
+FoodStats().getFoodLevel
 () %3C 
-20
+18)
 %0A%09%09%09
-&& 
+return;%0A%09%09%0A%09%09if(
 WMin
@@ -1872,18 +1872,10 @@
 h() 
-!= 0%0A%09%09%09&&
+%3E=
  WMi
@@ -1893,29 +1893,52 @@
 Player()
-.onGround)
+%0A%09%09%09.getMaxHealth())%0A%09%09%09return;
 %0A%09%09
+%0A%09
 %09for(int
@@ -1953,20 +1953,32 @@
 i %3C 
-1000
+speed.getValueI()
 ; i++)%0A
-%09
 %09%09%09W

Update RegenMod