Snazzy diagram
This commit is contained in:
parent
68a15236ef
commit
34b13b3257
@ -1,6 +1,6 @@
|
||||
# `api` Mod
|
||||
|
||||
This mod implements all of the RaspberryJuice extensions to the MCPI API, for the modding API, see [../misc/api.cpp]().
|
||||
This mod implements all of the RaspberryJuice extensions to the MCPI API, for the modding API, see [misc/api.cpp](../misc/api.cpp).
|
||||
|
||||
This includes:
|
||||
- [x] `world.getBlocks(x0: int, y0: int, z0: int, x1: int, y1: int, z1: int) -> int[]`
|
||||
@ -65,11 +65,11 @@ This includes:
|
||||
- - Sets a block of `id:data` at the specified point, if the block is a sign, it will attempt to set lines 1 through 4 of the sign to the given text
|
||||
- - For the API, the lines must be below 100 characters, however when loading signs MCPI will cap it at 16 characters (this can be disabled by patching out the call at `0xd1e2c`).
|
||||
- - The lines are optional
|
||||
- - The wiki has a list of blocks: [https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Block_List], sign is 63 and wall sign is 68
|
||||
- - The wiki has a list of blocks: https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Block_List, sign is 63 and wall sign is 68
|
||||
- [x] `world.spawnEntity(x: int, y: int, z: int, type: int) -> int`
|
||||
- - Spawns an entity of `type` at the given position
|
||||
- - Entities with a type of 0 cannot be spawned
|
||||
- - The list of entity types can be found by running the command below, or on the wiki: [https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Entity_List]
|
||||
- - The list of entity types can be found by running the command below, or on the wiki: https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Entity_List
|
||||
- [x] `world.getEntityTypes() -> {type: int, name: str}`
|
||||
- - Returns a list of known entity types, if there are modded entities this list may be incorrect
|
||||
|
||||
@ -86,3 +86,7 @@ Egdecases:
|
||||
- `entity.getName` will not get the name of non-player entities with a type id of 0 due to ambiguity.
|
||||
- All Raspberry Juice commands/responses involving the player name are designed around the MCJE username restrictions, not the much looser MCPI restrictions. They may cause problems.
|
||||
|
||||
|
||||
## How does it work?
|
||||
|
||||
![Reborn-API.png](Reborn-API.png)
|
||||
|
82
mods/src/api/Reborn-API.drawio
Normal file
82
mods/src/api/Reborn-API.drawio
Normal file
@ -0,0 +1,82 @@
|
||||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" version="24.7.16">
|
||||
<diagram name="Page-1" id="jwWo0YrG7pLoplSde7jo">
|
||||
<mxGraphModel dx="1173" dy="609" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" background="#000000" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-1" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#66FF66;strokeColor=#FFFFFF;strokeWidth=2;" vertex="1" parent="1">
|
||||
<mxGeometry x="10" y="170" width="470" height="330" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-3" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="410" y="296" as="sourcePoint" />
|
||||
<mxPoint x="410" y="256" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-6" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#66FF66;strokeColor=#FFFFFF;strokeWidth=2;" vertex="1" parent="1">
|
||||
<mxGeometry x="30" y="190" width="430" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-8" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FF9933;strokeColor=#FFFFFF;strokeWidth=2;" vertex="1" parent="1">
|
||||
<mxGeometry x="30" y="302" width="430" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-12" value="CommandServer_parse_injection" style="text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="312" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-15" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#66FF66;strokeColor=#FFFFFF;strokeWidth=2;" vertex="1" parent="1">
|
||||
<mxGeometry x="30" y="414" width="430" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-16" value="CommandServer::tick" style="text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="200" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-17" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="410" y="407" as="sourcePoint" />
|
||||
<mxPoint x="410" y="367" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-19" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="85" y="256" as="sourcePoint" />
|
||||
<mxPoint x="85" y="296" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-20" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="86" y="370" as="sourcePoint" />
|
||||
<mxPoint x="86" y="410" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-25" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#007FFF;strokeColor=#FFFFFF;strokeWidth=2;" vertex="1" parent="1">
|
||||
<mxGeometry x="10" y="10" width="470" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-26" value="<blockquote style="line-height: 10%; font-size: 11px;"><font style="font-size: 11px;">Reborn's injection hands it off to the&nbsp;original</font></blockquote><div style="line-height: 10%; font-size: 11px;"><font style="font-size: 11px;">CommandServer::parse for the normal commands.</font></div>" style="text;strokeColor=none;fillColor=none;html=1;fontSize=11;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="220" y="340" width="60" height="90" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-27" value="<blockquote style="line-height: 10%; font-size: 11px;">Reborn inject into CommandServer::parse</blockquote><blockquote style="line-height: 10%; font-size: 11px;">and checks if the command is non-standard,</blockquote><blockquote style="line-height: 10%; font-size: 11px;">if it is, Reborn runs it and returns the result.</blockquote>" style="text;strokeColor=none;fillColor=none;html=1;fontSize=11;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="220" y="230" width="60" height="90" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-11" value="CommandServer::parse" style="text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="420" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-31" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="410" y="160" as="sourcePoint" />
|
||||
<mxPoint x="409" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-32" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;strokeColor=none;fillColor=#FFFFFF;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="85" y="80" as="sourcePoint" />
|
||||
<mxPoint x="85" y="160" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-33" value="<blockquote style="line-height: 10%; font-size: 11px;">All commands are sent over a</blockquote><blockquote style="line-height: 10%; font-size: 11px;">TCP socket from the&nbsp;<span style="background-color: initial;">user to&nbsp;</span><span style="background-color: initial;">MCPI</span></blockquote><blockquote style="line-height: 10%; font-size: 11px;">This is often on port&nbsp;4711.</blockquote><blockquote style="line-height: 10%; font-size: 11px;">This means many languages&nbsp;</blockquote><blockquote style="line-height: 10%; font-size: 11px;">can use the API, not just</blockquote><blockquote style="line-height: 10%; font-size: 11px;">Python and Java.</blockquote>" style="text;strokeColor=none;fillColor=none;html=1;fontSize=11;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="210" y="77" width="60" height="90" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="uj48QsM38hnUiDGvlzeM-35" value="Whatever MCPI API you want!" style="text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="20" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
BIN
mods/src/api/Reborn-API.png
Normal file
BIN
mods/src/api/Reborn-API.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
Loading…
Reference in New Issue
Block a user