public void Track(EntityMetadata em) { if (em.EID != TrackEID) return; Debug.WriteLine(em.Metadata); if (em.Metadata.Fields.ContainsKey(10) == false) #if DEBUG throw new Exception("Protocol changed: Metadata: " + em.Metadata); #else return; #endif if (em.Metadata.Fields [10].Type != MetaType.Item) { #if DEBUG if (em.Metadata.Fields [10].Type == MetaType.Byte) return; throw new Exception("Protocol changed: Metadata: " + em.Metadata); #else return; #endif } var si = em.Metadata.Fields [10].Item; switch (si.ItemID) { case BlockID.Diamond: case BlockID.DiamondOre: case BlockID.Emerald: case BlockID.EmeraldOre: if (DateTime.Now - DiamondsTime > DiamondsTimeout) Diamonds = 0; Diamonds += 1; DiamondsTime = DateTime.Now; #if DEBUG client.TellSystem(Chat.Pink, "Spawned: " + si); Debug.WriteLine("Spawned: " + si); #endif if (Diamonds > DiamondsLimit) { string msg = "found " + Diamonds + " " + si.ItemID + " last " + minuteLimit + " minutes"; Log.WritePlayer(client, msg); Chatting.Parser.TellAdmin(client.MinecraftUsername + " " + msg); } break; } TrackEID = 0; }
public void UpdateEntity(EntityMetadata meta) { lock (entities) { if (entities.ContainsKey(meta.EID) == false) return; entities[meta.EID].Update(meta); } }
public void Update(EntityMetadata meta) { UpdateMeta(meta.Metadata); }