Atmerek / CrossplayProject

The source of both the Minecraft and Roblox sides of the crossplay.
https://crossplayproject.xyz
GNU General Public License v3.0
9 stars 0 forks source link
crossplay minecraft roblox

The Crossplay Project Source

This repository contains the source code for both the Minecraft and Roblox sides of the Crossplay Project.

logo

Minecraft Side

Overview

The Minecraft side features the CrossplayPackage plugin; a package containing 5 of our smaller plugins.

The plugin hosts a Spark webserver on port 4567 (configurable).

Plugin Compilation from Source

To compile the plugin from source, follow these steps:

  1. Install IntelliJ IDEA: If you haven't already, download and install IntelliJ IDEA.

  2. Download the CrossplayPackage Directory: Obtain the source code directory for CrossplayPackage.

  3. Open as IntelliJ Project:

    • Launch IntelliJ IDEA.
    • Open the CrossplayPackage directory as an IntelliJ project.
  4. Build the Plugin:

    • Go to Build > Build Artifacts in the IntelliJ menu.
    • Select the action Build.
  5. Locate the Compiled JAR:

    • After the build process completes, the compiled .jar file will be located in the out/artifacts folder within your IntelliJ project directory.

Endpoints

/blocks

Example request for a single chunk:

curl http://<server-ip>:4567/blocks?chunkX=0&chunkZ=0

Example request for multiple chunks (3x3 grid with center at 0,0):

curl http://<server-ip>:4567/blocks?chunkX=-1,1&chunkZ=-1,1

Example request for an exact area:

curl http://<server-ip>:4567/blocks?cord1=15,0,15&cord2=-15,25,-15

Example Response:

[
    {"t":"OAK_LOG","x":7,"y":0,"z":2,"s":"axis\u003dy"},
    {"t":"GRASS_BLOCK","x":7,"y":-1,"z":3,"s":"snowy\u003dfalse","b":"PLAINS"},
    {"t":"STONE","x": 0,"y": 0,"z": 0}
]

/players

Example request:

curl http://<server-ip>:4567/players

Example Response:

[
    {"uuid":"<UUID>","mainItem":"AIR","offItem":"AIR","x":8,"y":0,"z":1,"yaw":79,"pitch":18,"crouch":false}
]

/mobs

Example Request:

curl http://<server-ip>:4567/mobs

Example Response:

[
    {"uuid":"<UUID>","x":6.5,"y":0.0,"z":1.5,"yaw":-90.0,"pitch":0.0,"mobType":"WANDERING_TRADER"}
]

/world

Example Request:

curl http://<server-ip>:4567/world

Example Response:

{"time":6000,"thundering":false,"raining":false}

/post

Example Request:

curl -X POST http://<server-ip>:4567/post -d 'action=BUILD&x=0&y=0&z=0&material=STONE&direction=NORTH'

Example Data:

/chat

Example payload:

{
    "player": "wwwdr666",
    "color": "#FFFFFF",
    "message": "Hewoo~"
}

/npc

Example payload:

{
    "x": 0,
    "y": 0,
    "z": 0,
    "yaw": 90,
    "pitch": 45,
    "disconnect": true (optional)
}

Roblox Side

Overview

The Roblox side provides a framework to help you start creating your own code. It includes several scripts and models to manage block data and interactions within Roblox.

Roblox files and scripts:

Workspace

ServerScriptService

ReplicatedStorage

StarterPlayer

StarterGui

Our API

We provide an API to resolve Minecraft player's usernames and skins by their UUIDs. The API supports both Java and Bedrock (floodgate) UUIDs.

Get Username by UUID

Endpoint: /api/uuid/:uuid

Example Request:

curl https://crossplayproject.xyz/api/uuid/92270a4f-f954-4087-a932-e8d0e5deb2bd

Example Response:

{
    "username":"The_Atmerek"
}

Get Skin by UUID

Endpoint: /api/uuid/:uuid/skin

Example Request:

curl https://crossplayproject.xyz/api/uuid/92270a4f-f954-4087-a932-e8d0e5deb2bd/skin

Response: Returns the skin image in PNG format.

Selfhosting

To selfhost the project, you will need a host that supports custom HTTP ports and plugins (if it can run Dynmap, it can probably run this), or a plain VPS server.

Minecraft Side

Hosting on a Linux VPS server:

  1. Install Java: Ensure Java 21 is installed by running java --version. If not installed, run sudo apt install openjdk-21-jdk.

  2. Prepare Directory:

    • Create a new directory for your Minecraft server:
      mkdir <folder-name>
      cd <folder-name>
  3. Download Server Software:

    • Download a Paper or Spigot server .jar file:
      wget <url>
  4. Run the Server:

    • Start the server with allocated memory:
      java -Xmx<max-ram>M -Xms<min-ram>M -jar <jar-name>.jar
  5. Agree to EULA:

    • Edit eula.txt to accept the EULA:
      nano eula.txt
    • Change false to true, save with CTRL+O, and exit with CTRL+X.
  6. Configure Server:

    • Modify server.properties:
      nano server.properties
    • Add {"layers":[{"block":"minecraft:air","height":63},{"block":"minecraft:grass_block","height":1}]} to the generator-settings field.
    • Set level-type to minecraft:flat.
  7. Install Plugins:

  8. Start Server:

    • Run the server again and allow it to generate necessary files.

Note: Additional hosting options may be provided in the future.

Roblox Side

  1. Upload Game:

    • Download the Roblox game or create your own from the source, then upload it to Roblox.
  2. Configure IP:

    • Set the IP of your Minecraft server's HTTP endpoint in ReplicatedStorage.
  3. Enable HTTP Requests:

    • Go to game settings on Roblox and enable HTTP requests.

For further details, contact support.

Demo

We provide a demo for you to test the source without needing to set up everything yourself.

To use the endpoints, append the endpoint name to the base URL. For example, to access the /players endpoint, use https://crossplayproject.xyz/demo/players.

Support

For support, reach us at our Discord.