package common.init;

import common.attributes.UsageSlot;
import common.block.Block;
import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockLiquid;
import common.block.liquid.BlockStaticLiquid;
import common.block.natural.BlockOre;
import common.color.DyeColor;
import common.color.TextColor;
import common.entity.item.EntityCart;
import common.entity.npc.CharacterInfo;
import common.entity.npc.SpeciesInfo;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemEffect;
import common.item.ItemFragile;
import common.item.ItemMagnetic;
import common.item.ItemRod;
import common.item.ItemSmall;
import common.item.ItemStack;
import common.item.ItemStick;
import common.item.ItemTiny;
import common.item.material.ItemBook;
import common.item.material.ItemDye;
import common.item.material.ItemEnchantedBook;
import common.item.material.ItemMetal;
import common.item.material.ItemNugget;
import common.item.material.ItemRecord;
import common.item.spawner.ItemBoat;
import common.item.spawner.ItemMinecart;
import common.item.spawner.ItemMonsterPlacer;
import common.item.spawner.ItemNpcSpawner;
import common.item.tool.ItemAmmo;
import common.item.tool.ItemAppleGold;
import common.item.tool.ItemArmor;
import common.item.tool.ItemArrow;
import common.item.tool.ItemAxe;
import common.item.tool.ItemBanHammer;
import common.item.tool.ItemBoltgun;
import common.item.tool.ItemBow;
import common.item.tool.ItemBucket;
import common.item.tool.ItemBucketMilk;
import common.item.tool.ItemCamera;
import common.item.tool.ItemCarrotOnAStick;
import common.item.tool.ItemChargedOrb;
import common.item.tool.ItemDie;
import common.item.tool.ItemDynamite;
import common.item.tool.ItemEditWand;
import common.item.tool.ItemEgg;
import common.item.tool.ItemExpBottle;
import common.item.tool.ItemExterminator;
import common.item.tool.ItemFireball;
import common.item.tool.ItemFirework;
import common.item.tool.ItemFireworkCharge;
import common.item.tool.ItemFishFood;
import common.item.tool.ItemFishingRod;
import common.item.tool.ItemFlintAndSteel;
import common.item.tool.ItemFood;
import common.item.tool.ItemGlassBottle;
import common.item.tool.ItemHoe;
import common.item.tool.ItemHorseArmor;
import common.item.tool.ItemInfoWand;
import common.item.tool.ItemKey;
import common.item.tool.ItemLead;
import common.item.tool.ItemLightning;
import common.item.tool.ItemMagnet;
import common.item.tool.ItemNameTag;
import common.item.tool.ItemPickaxe;
import common.item.tool.ItemPotion;
import common.item.tool.ItemSaddle;
import common.item.tool.ItemShears;
import common.item.tool.ItemShovel;
import common.item.tool.ItemSnowball;
import common.item.tool.ItemSoup;
import common.item.tool.ItemSpaceNavigator;
import common.item.tool.ItemSword;
import common.item.tool.ItemWeatherToken;
import common.log.Log;
import common.potion.Potion;
import common.potion.PotionHelper;
import common.util.Pair;
import common.util.Mapping;
import common.util.Util;
import common.world.Weather;

public abstract class ItemRegistry {
	public static final Mapping<Item> REGISTRY = new Mapping();
	
	private static int nextItemId = 4096;

	public static int getIdFromItem(Item item) {
		return item == null ? 0 : REGISTRY.getId(item);
	}

	public static Item getItemById(int id) {
		return REGISTRY.byId(id);
	}

	public static String getNameFromItem(Item item) {
		return REGISTRY.getName(item);
	}

	public static Item getRegisteredItem(String name) {
		return REGISTRY.byName(name);
	}

	private static void registerItem(String name, Item item) {
		if(item.getBlock() != null)
			throw new IllegalArgumentException("Item " + name + " darf keinen Block besitzen");
		REGISTRY.register(nextItemId++, name, item);
	}
	
	private static void registerTools(ToolMaterial material, String name, String prefix) {
		if(material.hasTools()) {
			registerItem(name + "_shovel", (new ItemShovel(material)).setDisplay(prefix + "schaufel"));
			registerItem(name + "_pickaxe", (new ItemPickaxe(material)).setDisplay(prefix + "spitzhacke"));
			registerItem(name + "_axe", (new ItemAxe(material)).setDisplay(prefix + "axt"));
			registerItem(name + "_hoe", (new ItemHoe(material)).setDisplay(prefix + "hacke"));
		}
		if(material.hasExtras()) {
			registerItem(name + "_shears", (new ItemShears(material)).setDisplay(prefix + "schere"));
			registerItem(name + "_horse_armor", (new ItemHorseArmor(material, name)).setDisplay(prefix + "pferderüstung"));
		}
		if(material.hasWeapons()) {
			registerItem(name + "_sword", (new ItemSword(material)).setDisplay(prefix + "schwert"));
		}
		if(material.hasArmor()) {
			registerItem(name + "_helmet", (new ItemArmor(material, name, UsageSlot.HEAD)).setDisplay(prefix == null ? "Kappe" : prefix + "helm"));
			registerItem(name + "_chestplate", (new ItemArmor(material, name, UsageSlot.BODY)).setDisplay(prefix == null ? "Jacke" : prefix + "brustpanzer"));
			registerItem(name + "_leggings", (new ItemArmor(material, name, UsageSlot.LEGS)).setDisplay(prefix == null ? "Hose" : prefix + "beinschutz"));
			registerItem(name + "_boots", (new ItemArmor(material, name, UsageSlot.FEET)).setDisplay(prefix == null ? "Stiefel" : prefix + "stiefel"));
		}
	}

	static void register() {
		for(Block block : BlockRegistry.REGISTRY) {
			Item item = block.registerItem();
			if(item != null)
				REGISTRY.register(BlockRegistry.getIdFromBlock(block), BlockRegistry.getNameFromBlock(block), item);
		}
		
		Item bucket = (new ItemBucket(null, false)).setDisplay("Eimer");
		registerItem("bucket", bucket);
		for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
			registerItem(BlockRegistry.getNameFromBlock(liquid.first()) + 
					"_bucket", new ItemBucket(liquid.second(), false).setDisplay("Eimer")
					.setContainerItem(bucket));
		}
		registerItem("recursive_bucket", (new ItemBucket(null, true)).setDisplay("Unendlicher Eimer"));
		for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
			registerItem("recursive_" + BlockRegistry.getNameFromBlock(liquid.first()) + 
					"_bucket", new ItemBucket(liquid.second(), true).setDisplay("Flutender Eimer"));
		}
		registerItem("milk_bucket", (new ItemBucketMilk()).setDisplay("Milch").setContainerItem(bucket));

		registerItem("boat", (new ItemBoat()).setDisplay("Boot"));
		registerItem("minecart", (new ItemMinecart(EntityCart.EnumMinecartType.RIDEABLE)).setDisplay("Lore"));
		registerItem("chest_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.CHEST)).setDisplay("Güterlore"));
		registerItem("hopper_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.HOPPER)).setDisplay("Trichterlore"));
		registerItem("tnt_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.TNT)).setDisplay("TNT-Lore")
				.setColor(TextColor.RED));
        for(EntityInfo egg : EntityRegistry.SPAWN_EGGS.values()) {
        	registerItem(egg.id().toLowerCase() + "_spawner", (new ItemMonsterPlacer(egg.id()))
        			.setDisplay("Spawner").setMaxAmount(ItemStack.MAX_SIZE));
        }
        for(SpeciesInfo species : SpeciesRegistry.SPECIMEN) {
	        for(CharacterInfo charinfo : species.chars) {
	        	if(charinfo.spawner)
		        	registerItem(charinfo.skin + "_spawner", (new ItemNpcSpawner(charinfo)).setDisplay("NSC-Spawner")
		        			.setMaxAmount(ItemStack.MAX_SIZE));
	        }
        }
		
		registerItem("wand", (new ItemEditWand()).setDisplay("Bearbeitungswerkzeug"));
		registerItem("info_wand", (new ItemInfoWand()).setDisplay("Infowerkzeug"));
		registerItem("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter"));
		registerItem("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung").setTab(CheatTab.TOOLS));
		registerItem("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(128));
		for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
			registerItem("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setDisplay("Würfel").setMaxAmount(128));
		}
		registerItem("chick_magnet", (new ItemMagnet(true)).setDisplay("Kükenmagnet"));
		registerItem("magnet", (new ItemMagnet(false)).setDisplay("Magnet"));
		registerItem("camera", (new ItemCamera()).setDisplay("Kamera").setTab(CheatTab.TOOLS));
		
		for(Weather weather : Weather.values()) {
			registerItem("weather_token_" + weather.getName(), new ItemWeatherToken(weather).setDisplay("Wetterkristall").setTab(CheatTab.TOOLS));
		}

		registerItem("flint_and_steel", (new ItemFlintAndSteel(Blocks.fire)).setDisplay("Feuerzeug"));
		registerItem("burning_soul", (new ItemFlintAndSteel(Blocks.soul_fire)).setDisplay("Brennende Seele"));
		registerItem("dark_lighter", (new ItemFlintAndSteel(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug"));
		registerItem("apple", (new ItemFood(4, false)).setDisplay("Apfel").setMaxAmount(128));
		registerItem("bow", (new ItemBow()).setDisplay("Bogen"));
		registerItem("boltgun", (new ItemBoltgun()).setDisplay("Bolter"));
		registerItem("bolt", (new ItemAmmo(5, 1.0f, 128)).setDisplay("Bolter-Munition"));
		registerItem("arrow", (new ItemArrow()).setDisplay("Pfeil").setTab(CheatTab.COMBAT).setMaxAmount(128));
		Item coal = (new Item()).setDisplay("Kohle").setTab(CheatTab.METALS);
		registerItem("coal", coal);
		registerItem("charcoal", (new Item()).setDisplay("Holzkohle").setTab(CheatTab.METALS));
		registerItem("stick", (new ItemStick()).setDisplay("Stock").setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("bowl", (new ItemSmall()).setDisplay("Schüssel").setTab(CheatTab.MISC));
		registerItem("mushroom_stew", (new ItemSoup(6)).setDisplay("Pilzsuppe"));
		registerItem("feather", (new Item()).setDisplay("Feder").setTab(CheatTab.MATERIALS).setMaxAmount(512));
		registerItem("gunpowder", (new Item()).setDisplay("Schwarzpulver").setPotionEffect(PotionHelper.gunpowderEffect).setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("wheats", (new Item()).setDisplay("Weizen").setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("bread", (new ItemFood(5, false)).setDisplay("Brot"));
		registerItem("flint", (new Item()).setDisplay("Feuerstein").setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("porkchop", (new ItemFood(3, true)).setDisplay("Rohes Schweinefleisch"));
		registerItem("cooked_porkchop", (new ItemFood(8, true)).setDisplay("Gebratenes Schweinefleisch"));
		registerItem("golden_apple", (new ItemAppleGold(4, false)).setPotionEffect(Potion.REGENERATION, 5, 1, 1.0F)
				.setDisplay("Goldener Apfel"));
		registerItem("charged_apple", (new ItemAppleGold(4, true)).setPotionEffect(Potion.REGENERATION, 5, 1, 1.0F)
				.setDisplay("Geladener Apfel"));
		registerItem("saddle", (new ItemSaddle()).setDisplay("Sattel"));
		registerItem("snowball", (new ItemSnowball()).setDisplay("Schneeball").setMaxAmount(128));
		registerItem("leather", (new Item()).setDisplay("Leder").setTab(CheatTab.MATERIALS));
		registerItem("brick", (new Item()).setDisplay("Ziegel").setTab(CheatTab.MATERIALS));
		registerItem("clay_ball", (new Item()).setDisplay("Ton").setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("paper", (new Item()).setDisplay("Papier").setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("book", (new ItemBook()).setDisplay("Buch").setTab(CheatTab.MISC));
		registerItem("slime_ball", (new Item()).setDisplay("Schleimball").setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("egg", (new ItemEgg()).setDisplay("Ei").setMaxAmount(128));
		registerItem("navigator", (new ItemSpaceNavigator()).setDisplay("Elektronischer Navigator").setTab(CheatTab.TOOLS));
		registerItem("exterminator", (new ItemExterminator()).setDisplay("Weltenzerstörer").setTab(CheatTab.TOOLS));
		registerItem("fishing_rod", (new ItemFishingRod()).setDisplay("Angel"));
		registerItem("glowstone_dust", (new Item()).setDisplay("Glowstonestaub").setPotionEffect(PotionHelper.glowstoneEffect)
				.setTab(CheatTab.MATERIALS).setMaxAmount(256));
		for(ItemFishFood.FishType type : ItemFishFood.FishType.values()) {
			registerItem(type.getName(), (new ItemFishFood(false, type)).setDisplay(type.getDisplay()));
			if(type.canCook())
				registerItem("cooked_" + type.getName(), (new ItemFishFood(true, type)).setDisplay(type.getDisplay()));
		}
		Item lapis = null;
		for(DyeColor color : DyeColor.values()) {
			Item dye = (new ItemDye(color)).setDisplay(color.getDyeName()).setMaxAmount(512);
			if(color == DyeColor.BLUE)
				lapis = dye;
			registerItem(color.getDye(), dye);
		}
		registerItem("bone", (new ItemStick()).setDisplay("Knochen").setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("sugar", (new Item()).setDisplay("Zucker").setPotionEffect(PotionHelper.sugarEffect).setTab(CheatTab.MATERIALS).setMaxAmount(512));
		registerItem("cookie", (new ItemFood(2, false)).setDisplay("Keks").setMaxAmount(128));
		registerItem("melon", (new ItemFood(2, false)).setDisplay("Melone"));
		registerItem("beef", (new ItemFood(3, true)).setDisplay("Rohes Rindfleisch"));
		registerItem("cooked_beef", (new ItemFood(8, true)).setDisplay("Steak"));
		registerItem("chicken", (new ItemFood(2, true)).setDisplay("Rohes Hühnchen"));
		registerItem("cooked_chicken", (new ItemFood(6, true)).setDisplay("Gebratenes Hühnchen"));
		registerItem("rotten_flesh", (new ItemFood(4, true)).setDisplay("Verrottetes Fleisch"));
		registerItem("orb", (new ItemFragile()).setDisplay("Kugel").setTab(CheatTab.TOOLS));
		registerItem("blaze_rod", (new ItemRod()).setDisplay("Lohenrute").setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("tear", (new ItemTiny()).setDisplay("Träne").setPotionEffect(PotionHelper.tearEffect).setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("gold_nugget", (new ItemNugget()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(256));
		for(int data : ItemPotion.getValidDataValues()) {
			ItemPotion potion = new ItemPotion(data);
			registerItem(ItemPotion.getPotionName(potion), potion.setDisplay("Trank"));
		}
		registerItem("glass_bottle", (new ItemGlassBottle()).setDisplay("Glasflasche"));
		registerItem("spider_eye", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 1.0F).setDisplay("Spinnenauge")
				.setPotionEffect(PotionHelper.spiderEyeEffect).setMaxAmount(128));
		registerItem("fermented_spider_eye", (new Item()).setDisplay("Fermentiertes Spinnenauge")
				.setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setTab(CheatTab.MISC).setMaxAmount(128));
		registerItem("blazing_powder", (new Item()).setDisplay("Glühender Staub").setPotionEffect(PotionHelper.blazingPowderEffect)
				.setTab(CheatTab.MATERIALS).setMaxAmount(256));
		registerItem("magma_cream", (new Item()).setDisplay("Magmacreme").setPotionEffect(PotionHelper.magmaCreamEffect).setTab(CheatTab.MATERIALS).setMaxAmount(128));
		registerItem("charged_orb", (new ItemChargedOrb()).setDisplay("Geladene Kugel"));
		registerItem("speckled_melon", (new Item()).setDisplay("Glitzernde Melone").setPotionEffect(PotionHelper.speckledMelonEffect)
				.setTab(CheatTab.MISC));
		registerItem("experience_bottle", (new ItemExpBottle()).setDisplay("Erfahrungsfläschchen"));
		registerItem("fire_charge", (new ItemFireball()).setDisplay("Feuerkugel"));
		registerItem("writable_book", (new Item()).setDisplay("Buch und Feder").setTab(CheatTab.TOOLS));
		registerItem("written_book", (new Item()).setDisplay("Beschriebenes Buch").setTab(CheatTab.MISC));
		Item emerald = (new Item()).setDisplay("Smaragd").setTab(CheatTab.METALS);
		registerItem("emerald", emerald);
		registerItem("baked_potato", (new ItemFood(5, false)).setDisplay("Ofenkartoffel").setMaxAmount(128));
		registerItem("poisonous_potato", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 0.6F).setDisplay("Giftige Kartoffel").setMaxAmount(128));
		registerItem("golden_carrot", (new ItemFood(6, false)).setDisplay("Goldene Karotte")
				.setPotionEffect(PotionHelper.goldenCarrotEffect).setTab(CheatTab.MISC));
		registerItem("carrot_on_a_stick", (new ItemCarrotOnAStick()).setDisplay("Karottenrute"));
		registerItem("charge_crystal", (new ItemEffect()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA));
		registerItem("pumpkin_pie", (new ItemFood(8, false)).setDisplay("Kürbiskuchen").setTab(CheatTab.MISC));
		registerItem("fireworks", (new ItemFirework()).setDisplay("Feuerwerksrakete"));
		registerItem("firework_charge", (new ItemFireworkCharge()).setDisplay("Feuerwerksstern").setTab(CheatTab.MATERIALS));
		registerItem("enchanted_book", (new ItemEnchantedBook()).setMaxAmount(1).setDisplay("Verzaubertes Buch").setTab(CheatTab.MAGIC));
		registerItem("bloodbrick", (new Item()).setDisplay("Blutroter Ziegel").setTab(CheatTab.MATERIALS));
		registerItem("blackbrick", (new Item()).setDisplay("Schwarzer Ziegel").setTab(CheatTab.MATERIALS));
		Item quartz = (new Item()).setDisplay("Quarz").setTab(CheatTab.METALS);
		registerItem("quartz", quartz);
		Item bquartz = (new Item()).setDisplay("Schwarzes Quarz").setTab(CheatTab.METALS);
		registerItem("black_quartz", bquartz);
		registerItem("lead", (new ItemLead()).setDisplay("Leine").setMaxAmount(128));
		registerItem("name_tag", (new ItemNameTag()).setDisplay("Namensschild"));
		for(int z = 0; z < ItemDynamite.DYNAMITE.length; z++) {
			registerItem("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
		}
		registerItem("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS));
		
		for(OreType ore : OreType.values()) {
			Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS);
			registerItem(ore.item, itm);
			((BlockOre)BlockRegistry.getRegisteredBlock(ore.name + "_ore")).setDropItem(new ItemStack(itm, ore.dropQuantity),
					ore.bonusChance, ore.experience);
			registerTools(ore.material, ore.name, ore.display);
		}
		for(MetalType metal : MetalType.values()) {
			if(metal.isPowder) {
				Item itm = (new ItemMetal(metal)).setDisplay(metal.display + "pulver").setTab(CheatTab.METALS);
				registerItem(metal.name + "_powder", itm);
				((BlockOre)BlockRegistry.getRegisteredBlock(metal.name + "_ore")).setDropItem(new ItemStack(itm), 0, 2);
			}
			else {
				Item itm = (new ItemMetal(metal)).setDisplay(metal.display + "barren").setTab(CheatTab.METALS);
				registerItem(metal.name + "_ingot", itm);
				((BlockOre)BlockRegistry.getRegisteredBlock(metal.name + "_ore")).setSmeltItem(new ItemStack(itm));
			}
			if(metal.material != null)
				registerTools(metal.material, metal.name, metal.display);
		}
		for(ToolType tool : ToolType.values()) {
			registerTools(tool.material, tool.name, tool.display);
		}

		registerItem("record_13", (new ItemRecord()).setDisplay("Protokoll #1 - 13 Tage ohne Kaffee"));
		registerItem("record_cat", (new ItemRecord()).setDisplay("Protokoll #2 - Versuchskatzen"));
		registerItem("record_blocks", (new ItemRecord()).setDisplay("Protokoll #3 - Blöcke und mehr Experimente"));
		registerItem("record_chirp", (new ItemRecord()).setDisplay("Protokoll #4 - Experimente mit Vögeln: Eine gute Idee?"));
		registerItem("record_far", (new ItemRecord()).setDisplay("Protokoll #5 - Haben wir es mit dem Design übertrieben?"));
		registerItem("record_mall", (new ItemRecord()).setDisplay("Protokoll #6 - Wocheneinkauf und mehr Kaffee"));
		registerItem("record_mellohi", (new ItemRecord()).setDisplay("Protokoll #7 - Explosion: Hoffe auf Versicherungsersatz"));
		registerItem("record_stal", (new ItemRecord()).setDisplay("Protokoll #8 - Fortschritt stagniert"));
		registerItem("record_strad", (new ItemRecord()).setDisplay("Protokoll #9 - Neue Strategie"));
		registerItem("record_ward", (new ItemRecord()).setDisplay("Protokoll #10 - Neue Lösung: Seelenwarzen??"));
		registerItem("record_11", (new ItemRecord()).setDisplay("Protokoll #11 - Wir waren erfolgreich"));
		registerItem("record_wait", (new ItemRecord()).setDisplay("Protokoll #12 - Warte auf Bezahlung"));
		registerItem("record_delay", (new ItemRecord()).setDisplay("Protokoll #13 - Verzögerung der Umsetzung"));
		registerItem("record_extend", (new ItemRecord()).setDisplay("Protokoll #14 - Explosive Erweiterung unseres Labors"));

		((BlockOre)BlockRegistry.getRegisteredBlock("coal_ore")).setDropItem(new ItemStack(coal), 0);
		((BlockOre)BlockRegistry.getRegisteredBlock("emerald_ore")).setDropItem(new ItemStack(emerald), 3);
		((BlockOre)BlockRegistry.getRegisteredBlock("lapis_ore")).setDropItem(new ItemStack(lapis, 4), 4, 2);
		((BlockOre)BlockRegistry.getRegisteredBlock("quartz_ore")).setDropItem(new ItemStack(quartz), 2);
		((BlockOre)BlockRegistry.getRegisteredBlock("black_quartz_ore")).setDropItem(new ItemStack(bquartz), 3);
		
		REGISTRY.finish();
		
		Log.SYSTEM.debug("%d Gegenstände registriert", nextItemId - 4096);
	}
}
