/*
 * 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.init.Blocks;
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({"crash chest"})
@HelpPage("Mods/CrashChest")
@Mod.Bypasses
public final class CrashChestMod extends Mod
{
	public CrashChestMod()
	{
		super("CrashChest",
			"Generates a CrashChest. Give a lot of these to another\n"
				+ "player to make them crash. They will not be able to join the server\n"
				+ "ever again!");
	}
	
	@Override
	public void onEnable()
	{
		if(!InventoryUtils.isSlotEmpty(36))
		{
			if(WMinecraft.getPlayer().inventory.getStackInSlot(36)
				.getDisplayName().equals("6lCOPY ME"))
				ChatUtils.error("You already have a CrashChest.");
			else
				ChatUtils.error("Please take off your shoes.");
			setEnabled(false);
			return;
		}else if(!WMinecraft.getPlayer().capabilities.isCreativeMode)
		{
			ChatUtils.error("Creative mode only.");
			setEnabled(false);
			return;
		}
		ItemStack stack = new ItemStack(Blocks.CHEST);
		NBTTagCompound nbtTagCompound = new NBTTagCompound();
		NBTTagList nbtList = new NBTTagList();
		for(int i = 0; i < 40000; i++)
			nbtList.appendTag(new NBTTagList());
		nbtTagCompound.setTag("www.wurstclient.net", nbtList);
		stack.setTagInfo("www.wurstclient.net", nbtTagCompound);
		InventoryUtils.placeStackInArmor(0, stack);
		stack.setStackDisplayName("6lCOPY ME");
		ChatUtils.message("A CrashChest was placed in your shoes slot.");
		setEnabled(false);
	}
}

@@ -519,50 +519,8 @@
 ft;%0A
-import net.wurstclient.features.HelpPage;%0A
 impo
@@ -715,37 +715,8 @@
 %22%7D)%0A
-@HelpPage(%22Mods/CrashChest%22)%0A
 @Mod
@@ -841,593 +841,368 @@
 s a 
-CrashChest. Give a lot of these to another%5Cn%22%0A%09%09%09%09+ %22player to make them crash. They will not be able to join the server%5Cn%22%0A%09%09%09%09+ %22ever again!%22);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onEnable()%0A%09%7B%0A%09%09if(!InventoryUtils.isSlotEmpty(36))%0A%09%09%7B%0A%09%09%09if(WMinecraft.getPlayer().inventory.getStackInSlot(36)%0A%09%09%09%09.getDisplayName().equals(%226lCOPY ME%22))%0A%09%09%09%09ChatUtils.error(%22You already have a CrashChest.%22);%0A%09%09%09else%0A%09%09%09%09ChatUtils.error(%22Please take off your shoes.%22);%0A%09%09%09setEnabled(false);%0A%09%09%09return;%0A%09%09%7Delse if(!WMinecraft.getPlayer().capabilities.isCreativeMode)%0A%09%09%7B%0A%09%09%09ChatUtils.error(%22Creative mode onl
+chest that can kick people from the server if they have too many copies of it.%22);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onEnable()%0A%09%7B%0A%09%09if(!WMinecraft.getPlayer().capabilities.isCreativeMode)%0A%09%09%7B%0A%09%09%09ChatUtils.error(%22Creative mode only.%22);%0A%09%09%09setEnabled(false);%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09if(!InventoryUtils.isSlotEmpty(36))%0A%09%09%7B%0A%09%09%09ChatUtils.error(%22Your shoes slot must be empt
 y.%22)
@@ -1240,16 +1240,38 @@
 rn;%0A%09%09%7D%0A
+%09%09%0A%09%09// generate item%0A
 %09%09ItemSt
@@ -1327,27 +1327,24 @@
 Compound nbt
-Tag
 Compound = n
@@ -1483,19 +1483,16 @@
 );%0A%09%09nbt
-Tag
 Compound
@@ -1577,19 +1577,16 @@
 et%22, nbt
-Tag
 Compound
@@ -1588,16 +1588,34 @@
 pound);%0A
+%09%09%0A%09%09// give item%0A
 %09%09Invent
@@ -1656,50 +1656,8 @@
 k);%0A
-%09%09stack.setStackDisplayName(%226lCOPY ME%22);%0A
 %09%09Ch

Update CrashChestMod