update project metadata and license information
This commit is contained in:
parent
5a27787679
commit
09b389c206
|
@ -3,6 +3,13 @@ name = "shulkerscript-lang"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
authors = ["Moritz Hölting <moritz@hoelting.dev>"]
|
||||
categories = ["compilers"]
|
||||
description = "ShulkerScript language implementation with compiler"
|
||||
repository = "https://github.com/moritz-hoelting/shulkerscript-lang"
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
|
@ -23,7 +30,7 @@ getset = "0.1.2"
|
|||
mlua = { version = "0.9.7", features = ["lua54", "vendored"], optional = true }
|
||||
path-absolutize = "3.1.1"
|
||||
serde = { version = "1.0.197", features = ["derive", "rc"], optional = true }
|
||||
shulkerbox = { path = "../shulkerbox", optional = true}
|
||||
shulkerbox = { git = "https://github.com/moritz-hoelting/shulkerbox", default-features = false, optional = true, rev = "296502dcc5dd29b3d930ffec91ceec3d161e0e47" }
|
||||
strum = { version = "0.26.2", features = ["derive"] }
|
||||
strum_macros = "0.26.2"
|
||||
thiserror = "1.0.58"
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 Moritz Hölting <moritz@hoelting.dev>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,59 @@
|
|||
# ShulkerScript Language
|
||||
|
||||
ShulkerScript is a simple, easy-to-use scripting language for Minecraft datapacks. It is designed to be easy to learn and use, while still being powerful enough to create complex scripts, while not being hindered by Minecraft command limitations.
|
||||
|
||||
## Usage
|
||||
|
||||
Add the following to your dependencies in `Cargo.toml`:
|
||||
```toml
|
||||
[dependencies]
|
||||
shulkerscript-lang = { git = "https://github.com/moritz-hoelting/shulkerscript-lang" }
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Functions
|
||||
```shu
|
||||
#[load]
|
||||
fn load() {
|
||||
/say Loaded!
|
||||
hello();
|
||||
}
|
||||
|
||||
fn hello() {
|
||||
/say Hello, world!
|
||||
}
|
||||
```
|
||||
|
||||
### Execute blocks
|
||||
```shu
|
||||
as("@a") { // execute as all players
|
||||
/say Hello,
|
||||
/say world!
|
||||
}
|
||||
```
|
||||
Chained execute blocks are also supported:
|
||||
```shu
|
||||
as("@a"), at("@s") { // execute as all players at the executing entity
|
||||
/setblock ~ ~ ~ minecraft:diamond_block
|
||||
}
|
||||
```
|
||||
|
||||
### Conditionals
|
||||
```shu
|
||||
if("@s[tag=foo]" && "block ~ ~-1 ~ minecraft:stone") { // if the executing entity has the tag "foo" and is standing on stone
|
||||
/tag @s remove foo
|
||||
/say Hello, foo!
|
||||
} else {
|
||||
/say Hello, world!
|
||||
}
|
||||
```
|
||||
Unlike in `mcfunction` files, the actions in the conditional blocks are atomic, meaning that once the condition is fullfilled the actions are executed even after the condition is no longer fullfilled (in this case the "foo" tag has been removed).
|
||||
|
||||
### Lua scripting
|
||||
```shu
|
||||
run lua() {
|
||||
-- Lua code goes here
|
||||
return "Hello, Lua!";
|
||||
};
|
||||
```
|
Loading…
Reference in New Issue