/*
 * Copyright  2014 - 2016 | 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 tk.wurst_client.mods;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
import tk.wurst_client.mods.Mod.Bypasses;

@Mod.Info(
	description = "Generates a potion that can kill players in Creative mode.\n"
		+ "Requires Creative mode.",
	name = "KillerPotion",
	tags = "killer potion",
	help = "Mods/KillerPotion")
@Bypasses
public class KillerPotionMod extends Mod
{
	@Override
	public void onEnable()
	{
		if(mc.player.inventory.getStackInSlot(0) != null)
		{
			wurst.chat.error("Please clear the first slot in your hotbar.");
			setEnabled(false);
			return;
		}else if(!mc.player.capabilities.isCreativeMode)
		{
			wurst.chat.error("Creative mode only.");
			setEnabled(false);
			return;
		}
		
		ItemStack stack = new ItemStack(Items.SPLASH_POTION);
		NBTTagList effects = new NBTTagList();
		NBTTagCompound effect = new NBTTagCompound();
		effect.setInteger("Amplifier", 125);
		effect.setInteger("Duration", 2000);
		effect.setInteger("Id", 6);
		effects.appendTag(effect);
		stack.setTagInfo("CustomPotionEffects", effects);
		stack.setStackDisplayName("clKiller6lPotion");
		
		mc.player.connection
			.sendPacket(new CPacketCreativeInventoryAction(36, stack));
		wurst.chat.message("Potion created.");
		setEnabled(false);
	}
}

@@ -462,72 +462,41 @@
 ort 
-net.minecraft.network.play.client.CPacketCreativeInventoryAction
+tk.wurst_client.mods.Mod.Bypasses
 ;%0Aim
@@ -516,32 +516,35 @@
 _client.
-mods.Mod.Bypasse
+utils.InventoryUtil
 s;%0A%0A@Mod
@@ -834,171 +834,28 @@
 %7B%0A%09%09
-if(mc.player.inventory.getStackInSlot(0) != null)%0A%09%09%7B%0A%09%09%09wurst.chat.error(%22Please clear the first slot in your hotbar.%22);%0A%09%09%09setEnabled(false);%0A%09%09%09return;%0A%09%09%7Delse 
+// check gamemode%0A%09%09
 if(!
@@ -981,16 +981,37 @@
 %0A%09%09%7D%0A%09%09%0A
+%09%09// generate potion%0A
 %09%09ItemSt
@@ -1062,49 +1062,8 @@
 N);%0A
-%09%09NBTTagList effects = new NBTTagList();%0A
 %09%09NB
@@ -1214,16 +1214,57 @@
 d%22, 6);%0A
+%09%09NBTTagList effects = new NBTTagList();%0A
 %09%09effect
@@ -1369,117 +1369,105 @@
 me(%22
-clKiller6lPotion%22);%0A%09%09%0A%09%09mc.player.connection%0A%09%09%09.sendPacket(new CPacketCreativeInventoryAction(36, 
+rSplash Potion of 4lDEATH%22);%0A%09%09%0A%09%09// give potion%0A%09%09if(InventoryUtils.placeStackInHotbar(
 stack))
-;
 %0A
+%09
 %09%09wu
@@ -1503,16 +1503,86 @@
 ted.%22);%0A
+%09%09else%0A%09%09%09wurst.chat.error(%22Please clear a slot in your hotbar.%22);%0A%09%09%0A
 %09%09setEna

Update KillerPotionMod