Crates.io | rustfire |
lib.rs | rustfire |
version | 0.2.0 |
source | src |
created_at | 2023-02-26 15:40:46.220457 |
updated_at | 2023-02-26 20:20:23.804604 |
description | A crate that allows you to use Rust to generate DiamondFire templates. |
homepage | https://crates.io/crates/rustfire |
repository | https://github.com/akarahdev/rustfire |
max_upload_size | |
id | 795233 |
size | 22,555 |
Note: This project is not ready for full usage. Please refrain from main usage until 1.0.0. This is because syntax is constantly changing and new systems are being added/removed.
RustFire is a project coded in Rust. It allows users to create DiamondFire templates through the use of the Rust programming language.
You can either type the following into your command prompt:
cargo add rustfire
or add the following to your cargo.toml:
[dependencies]
rustfire = "0.2.0"
Dependencies of this will be installed automatically.
After this, you will want to install Python 3 (if you don't have it already) and add the following to the root directory of your project. This file should be called send.py
:
import socket
import sys
import json
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to server and send data
sock.connect(("localhost", 31372))
sock.sendall(bytes(sys.argv[1],encoding="utf-8"))
finally:
sock.close()
This code opens a socket on 31372 for RustFire to send templates through. This will later be implemented as base into RustFire.
Here is a basic program written in RustFire.
use rustfire::*;
// Code to be ran. This is usually split into multiple functions.
fn main() {
build_set!("Player Join Event"); // Template name. System will soon be reworked.
player_event!(join); // Player Join Event.
select!(all_players); // Select all players. By default, all codeblocks have the Selection target. This system will be reworked soon.
player_action!(send_message "text::&a&lJOINED! &e%default &7has joined!"); // Send the player a message
build!(); // Send code to Recode.
}
Check the examples directory for more examples.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project falls under the MIT license. Read it at LICENSE.txt
coming soonTM