public static Action <Task, string> DoSendCommand(MiNetClient client) { Action <Task, string> doUseItem = (t, command) => { McpeCommandStep commandStep = McpeCommandStep.CreateObject(); commandStep.commandName = "help"; commandStep.commandOverload = "byPage"; commandStep.unknown1 = 0; commandStep.currentStep = 0; commandStep.isOutput = false; commandStep.clientId = -1; //commandStep.commandJson = @"{}"; //commandStep.unkown6 = @"{}"; commandStep.commandInputJson = "null\n"; commandStep.commandOutputJson = "null\n"; commandStep.unknown7 = 0; commandStep.unknown8 = 0; commandStep.entityIdSelf = client.NetworkEntityId; Log.Error($"Entity ID used={client.EntityId}\n{Package.HexDump(commandStep.Encode())}"); client.SendPackage(commandStep); }; return(doUseItem); }
public static Action <Task, string> DoSendCommand(MiNetClient client) { Action <Task, string> doUseItem = (t, command) => { McpeCommandStep commandStep = McpeCommandStep.CreateObject(); commandStep.commandName = "fill"; commandStep.commandOverload = "replace"; commandStep.unknown1 = 0; commandStep.currentStep = 0; commandStep.isOutput = false; commandStep.clientId = client.ClientId; //commandStep.commandInputJson = "{\n \"tileName\" : \"dirt\",\n \"from\" : {\n \"x\" : 0,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 0,\n \"zrelative\" : false\n },\n \"to\" : {\n \"x\" : 10,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 10,\n \"zrelative\" : false\n }\n}\n"; commandStep.commandInputJson = "{\n \"from\" : {\n \"x\" : 0,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 0,\n \"zrelative\" : false\n },\n \"tileName\" : \"dirt\",\n \"to\" : {\n \"x\" : 10,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 10,\n \"zrelative\" : false\n }\n}\n"; // "commandInputJson": "{\n \"from\" : {\n \"x\" : 0,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 0,\n \"zrelative\" : false\n },\n \"tileName\" : \"dirt\",\n \"to\" : {\n \"x\" : 10,\n \"xrelative\" : false,\n \"y\" : 10,\n \"yrelative\" : false,\n \"z\" : 10,\n \"zrelative\" : false\n }\n}\n", //commandStep.commandInputJson = "null\n"; commandStep.commandOutputJson = "null\n"; commandStep.unknown7 = 0; commandStep.unknown8 = 0; commandStep.entityIdSelf = client.NetworkEntityId; //Log.Error($"Entity ID used={commandStep.entityIdSelf}\n{Package.HexDump(commandStep.Encode())}"); client.SendPackage(commandStep); }; return(doUseItem); }