/*
 * 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.items;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.wurstclient.compatibility.WMinecraft;
import net.wurstclient.features.HelpPage;
import net.wurstclient.features.Mod;
import net.wurstclient.features.SearchTags;
import net.wurstclient.utils.ChatUtils;
import net.wurstclient.utils.InventoryUtils;

@SearchTags({"troll potion"})
@HelpPage("Mods/TrollPotion")
@Mod.Bypasses
public final class TrollPotionMod extends Mod
{
	public TrollPotionMod()
	{
		super("TrollPotion", "Generates an incredibly annoying potion.\n"
			+ "Tip: AntiBlind makes you partially immune to it.");
	}
	
	@Override
	public void onEnable()
	{
		// check gamemode
		if(!WMinecraft.getPlayer().capabilities.isCreativeMode)
		{
			ChatUtils.error("Creative mode only.");
			setEnabled(false);
			return;
		}
		
		// generate potion
		ItemStack stack = InventoryUtils.createSplashPotion();
		NBTTagList effects = new NBTTagList();
		for(int i = 1; i <= 23; i++)
		{
			NBTTagCompound effect = new NBTTagCompound();
			effect.setInteger("Amplifier", Integer.MAX_VALUE);
			effect.setInteger("Duration", Integer.MAX_VALUE);
			effect.setInteger("Id", i);
			effects.appendTag(effect);
		}
		stack.setTagInfo("CustomPotionEffects", effects);
		stack.setStackDisplayName("rSplash Potion of Trolling");
		
		// give potion
		if(InventoryUtils.placeStackInHotbar(stack))
			ChatUtils.message("Potion created.");
		else
			ChatUtils.error("Please clear a slot in your hotbar.");
		
		setEnabled(false);
	}
}

@@ -485,50 +485,8 @@
 ft;%0A
-import net.wurstclient.features.HelpPage;%0A
 impo
@@ -518,16 +518,16 @@
 es.Mod;%0A
+
 import n
@@ -682,38 +682,8 @@
 %22%7D)%0A
-@HelpPage(%22Mods/TrollPotion%22)%0A
 @Mod
@@ -790,17 +790,20 @@
 Potion%22,
- 
+%0A%09%09%09
 %22Generat
@@ -810,91 +810,45 @@
 es a
-n incredibly annoying potion.%5Cn%22%0A%09%09%09+ %22Tip: AntiBlind makes you partially immune to
+ potion with many annoying effects on
  it.

Update TrollPotionMod