Beispiel #1
0
        public PlayerInventory(Player player)
        {
            _player = player;
            Armor = new MetadataSlots();
            Slots = new MetadataSlots();
            ItemHotbar = new MetadataInts();
            ItemInHand = new MetadataSlot(new ItemStack());

            Armor[0] = new MetadataSlot(new ItemStack());
            Armor[1] = new MetadataSlot(new ItemStack());
            Armor[2] = new MetadataSlot(new ItemStack());
            Armor[3] = new MetadataSlot(new ItemStack());

            for (byte i = 0; i < 44; i++)
            {
                Slots[i] = new MetadataSlot(new ItemStack((short)(i + 1), 10));
            }

            byte c = 0;
            Slots[c++] = new MetadataSlot(new ItemStack(54, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(58, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(61, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(325, 1, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(173, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(263, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(268, 10));
            Slots[c++] = new MetadataSlot(new ItemStack(280, 10));

            for (byte i = 0; i < 6; i++)
            {
                ItemHotbar[i] = new MetadataInt(i + 9);
            }
            //ItemHotbar[0] = new MetadataInt(9);
        }
Beispiel #2
0
        public override MetadataDictionary GetMetadata()
        {
            MetadataDictionary metadata = base.GetMetadata();
            metadata[18] = new MetadataInt(IsAngry ? 1 : 0);
            metadata[20] = new MetadataByte(CollarColor);

            return metadata;
        }
Beispiel #3
0
		public override MetadataDictionary GetMetadata()
		{
			MetadataDictionary metadata = new MetadataDictionary();
			metadata[0] = new MetadataByte((byte) (HealthManager.IsOnFire ? 1 : 0));
			metadata[1] = new MetadataShort(HealthManager.Air);
			metadata[2] = new MetadataString(NameTag ?? Name);
			metadata[3] = new MetadataByte(!HideNameTag);
			metadata[4] = new MetadataByte(Silent);
			metadata[7] = new MetadataInt(0); // Potion Color
			metadata[8] = new MetadataByte(0); // Potion Ambient
			metadata[15] = new MetadataByte(NoAi);
			metadata[16] = new MetadataByte(0); // Player flags
			//metadata[17] = new MetadataIntCoordinates(0, 0, 0);

			return metadata;
		}
Beispiel #4
0
        public PlayerInventory(Player player)
        {
            _player = player;
            Armor = new MetadataSlots();
            Slots = new MetadataSlots();
            ItemHotbar = new MetadataInts();
            ItemInHand = new MetadataSlot(new ItemStack());

            Armor[0] = new MetadataSlot(new ItemStack());
            Armor[1] = new MetadataSlot(new ItemStack());
            Armor[2] = new MetadataSlot(new ItemStack());
            Armor[3] = new MetadataSlot(new ItemStack());

            //Armor[0] = new MetadataSlot(new ItemStack(306));
            //Armor[1] = new MetadataSlot(new ItemStack(307));
            //Armor[2] = new MetadataSlot(new ItemStack(308));
            //Armor[3] = new MetadataSlot(new ItemStack(309));

            for (byte i = 0; i < 35; i++)
            {
                Slots[i] = new MetadataSlot(new ItemStack((short)-1, 0));
            }

            byte c = 0;
            //Slots[c++] = new MetadataSlot(new ItemStack(383, 1, 34));
            //Slots[c++] = new MetadataSlot(new ItemStack(355, 64));
            //Slots[c++] = new MetadataSlot(new ItemStack(261, 1)); // Bow
            //Slots[c++] = new MetadataSlot(new ItemStack(262, 64)); // Arrows
            //Slots[c++] = new MetadataSlot(new ItemStack(344, 64)); // Eggs
            //Slots[c++] = new MetadataSlot(new ItemStack(332, 64)); // Snowballs
            //Slots[c++] = new MetadataSlot(new ItemStack(46, 64));
            //Slots[c++] = new MetadataSlot(new ItemStack(259, 1));
            //Slots[c++] = new MetadataSlot(new ItemStack(268, 1));
            //Slots[c++] = new MetadataSlot(new ItemStack(280, 10));
            //Slots[c++] = new MetadataSlot(new ItemStack(290, 1));
            //Slots[c++] = new MetadataSlot(new ItemStack(259, 1)); // Flint/Steal
            //Slots[c++] = new MetadataSlot(new ItemStack(325, 64, 8)); // Water
            //Slots[c++] = new MetadataSlot(new ItemStack(325, 64, 10)); // Lava

            for (byte i = 0; i < 6; i++)
            {
                ItemHotbar[i] = new MetadataInt(i + 9);
            }
        }
Beispiel #5
0
        public MetadataInts GetHotbar()
        {
            MetadataInts metadata = new MetadataInts();
            for (byte i = 0; i < ItemHotbar.Length; i++)
            {
                metadata[i] = new MetadataInt(ItemHotbar[i] + HotbarSize);
            }

            return metadata;
        }
Beispiel #6
0
		public override MetadataDictionary GetMetadata()
		{
			MetadataDictionary metadata = new MetadataDictionary();
			metadata[0] = new MetadataByte(GetDataValue());
			metadata[1] = new MetadataShort(HealthManager.Air);
			metadata[2] = new MetadataString("\u2764 \u2665 " + (NameTag ?? Username));
			metadata[3] = new MetadataByte(!HideNameTag);
			metadata[4] = new MetadataByte(Silent);
			metadata[7] = new MetadataInt(0); // Potion Color
			metadata[8] = new MetadataByte(0); // Potion Ambient
			metadata[15] = new MetadataByte(NoAi);
			metadata[16] = new MetadataByte(0); // Player flags
			metadata[17] = new MetadataIntCoordinates(0, 0, 0);

			return metadata;
		}
Beispiel #7
0
        public override MetadataDictionary GetMetadata()
        {
            MetadataDictionary metadata = new MetadataDictionary();
            metadata[0] = new MetadataByte((byte) (HealthManager.IsOnFire ? 1 : 0));
            metadata[1] = new MetadataShort(HealthManager.Air);
            metadata[2] = new MetadataString(NameTag ?? Username);
            metadata[3] = new MetadataByte(1);
            metadata[4] = new MetadataByte(0);
            metadata[7] = new MetadataInt(0);
            metadata[8] = new MetadataByte(0);
            metadata[15] = new MetadataByte(0);
            metadata[16] = new MetadataByte(0);
            metadata[17] = new MetadataLong(0);

            return metadata;
        }
Beispiel #8
0
        public override MetadataDictionary GetMetadata()
        {
            //[0] byte 0 0,
            //[1] short 1 300,
            //[2] string 4 Client12,
            //[3] byte 0 1,
            //[4] byte 0 0,
            //[7] int 2 0,
            //[8] byte 0 0,
            //[15] byte 0 0,
            //[16] byte 0 0,
            //[17] long 6 0

            MetadataDictionary metadata = new MetadataDictionary();
            metadata[0] = new MetadataByte((byte) (HealthManager.IsOnFire ? 1 : 0));
            metadata[1] = new MetadataShort(HealthManager.Air);
            metadata[2] = new MetadataString(Username);
            metadata[3] = new MetadataByte(1);
            metadata[4] = new MetadataByte(0);
            metadata[7] = new MetadataInt(0);
            metadata[8] = new MetadataByte(0);
            metadata[15] = new MetadataByte(0);
            metadata[16] = new MetadataByte(0);
            metadata[17] = new MetadataLong(0);

            return metadata;
        }