//Sets Entity Id /// <summary> /// Do never, *never* create a Player. /// </summary> public Player(MinecraftClient client) : base() { this.Client = client; NextTransform = Transform; Inventory = new Inventory(this); GameMode = GameMode.Creative; SpawnPosition = new Vector3(0, 0, 0); Abilities = new PlayerAbilities(); OnGround = true; World.Entities.Remove(this); //Re-Add Later on }
public static void Process(ChatMessage msg, MinecraftClient client) { if (msg.Text.StartsWith('/')) { HandleCommand(msg.Text, client); } else { client.SendToAll(new ChatMessagePacketClient(client) { msg = msg, position = Types.Enums.ChatPosition.Chat }); } }
private static void HandleCommand(string text, MinecraftClient client) { if (!text.StartsWith('/')) { throw new ArgumentException(); } text = text.Remove(0, 1); try { root.Execute(new CommandContext(text, client.Player, client.Player.Transform.Position, client.Player)); } catch { client.Send(new ChatMessagePacketClient(client) { msg = new ChatMessage() { Text = "Error Executing Command", Color = "red" } }); } }
public MinecraftPacket(MinecraftClient client) { this.Client = client; }