diff --git a/README.md b/README.md index 564a72a..a729445 100644 --- a/README.md +++ b/README.md @@ -17,74 +17,4 @@ An IPC[^1] system for MCBE Script API projects **TypeScript** 1. Download `ipc.ts` from the latest [release](https://github.com/OmniacDev/MCBE-IPC/releases/latest) -2. Copy file into your project - -## Usage - -### Sending & Receiving - -`IPC.send()` and `IPC.on()` can be used to send messages or data between packs. - -_Pack 1_ -```js -import IPC from 'ipc.js' - -IPC.on('message_channel', (args) => { - console.log(`Message: ${args}`) -}) - -IPC.on('data_channel', (args) => { - console.log(`Data: ${args.example_bool}, ${args.example_number}`) -}) -``` -_Pack 2_ -```js -import IPC from 'ipc.js' - -IPC.send('message_channel', 'Example Message') - -IPC.send('data_channel', { example_number: 100, example_bool: true }) -``` -_Console Output_ -``` -Message: Example Message -Data: true, 100 -``` - -### Requesting & Serving - -`IPC.invoke()` and `IPC.handle()` can be used to request and serve data between packs. - -_Pack 1_ -```js -import IPC from 'ipc.js' - -IPC.handle('request_channel', (args) => { - switch (args) { - case 'status': - return 'inactive' - case 'size': - return 100 - } -}) -``` -_Pack 2_ -```js -import IPC from 'ipc.js' - -IPC.invoke('request_channel', 'status').then(result => { - console.log(`Status: ${result}`) -}) - -IPC.invoke('request_channel', 'size').then(result => { - console.log(`Size: ${result}`) -}) -``` -_Console Output_ -``` -Status: inactive -Size: 100 -``` - - - +2. Copy file into your project \ No newline at end of file diff --git a/TYPES.md b/TYPES.md deleted file mode 100644 index 90ff0c3..0000000 --- a/TYPES.md +++ /dev/null @@ -1,18 +0,0 @@ -- Int8 -- Int16 -- Int32 -- UInt8 -- UInt16 -- UInt32 -- Float32 -- Float64 -- VarInt -- String -- Boolean -- Date -- Object -- Array -- Tuple -- Optional -- Map -- Set \ No newline at end of file diff --git a/package.json b/package.json index 88ee3c5..87632e1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "author": "OmniacDev", "description": "IPC system for MCBE Script API projects", "license": "MIT", - "version": "2.0.1", + "version": "3.0.0", "repository": { "type": "git", "url": "https://github.com/OmniacDev/mcbe-ipc.git"