Skip to content

Commit b8b4d08

Browse files
authored
Merge pull request #12 from NKID00/dev
bump python library version 0.2.1 & port mod to mc1.19.3
2 parents a185bf3 + 361ff5a commit b8b4d08

21 files changed

+81
-33
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.0-SNAPSHOT'
2+
id 'fabric-loom' version '1.1-SNAPSHOT'
33
id 'maven-publish'
44
id 'org.ajoberstar.grgit' version '5.0.0'
55
}
@@ -12,7 +12,7 @@ sourceCompatibility = JavaVersion.VERSION_17
1212
targetCompatibility = JavaVersion.VERSION_17
1313

1414
archivesBaseName = project.archives_base_name
15-
version = "${project.mod_version}-mc1.19+${buildMetadata()}"
15+
version = "${project.mod_version}-mc1.19.3+${buildMetadata()}"
1616
group = project.maven_group
1717

1818
def buildMetadata() {
@@ -49,8 +49,8 @@ dependencies {
4949
include(modImplementation(fabricApi.module(it, "${project.fabric_version}")))
5050
}
5151

52-
implementation 'com.google.code.gson:gson:2.9.1'
53-
implementation 'io.netty:netty-all:4.1.79.Final'
52+
implementation 'com.google.code.gson:gson:2.10.1'
53+
implementation 'io.netty:netty-all:4.1.89.Final'
5454
implementation 'com.google.guava:guava:31.1-jre'
5555
}
5656

docs/api-openrpc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@
831831
"permissionLevel": {
832832
"name": "permissionLevel",
833833
"summary": "Permission level required to run the script.",
834-
"description": "MUST be a integer >= 2 and <= 4.",
834+
"description": "MUST be an integer >= 2 and <= 4.",
835835
"required": true,
836836
"schema": {
837837
"type": "integer",

docs/callback-openrpc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
"permissionLevel": {
416416
"name": "permissionLevel",
417417
"summary": "Permission level required to run the script.",
418-
"description": "MUST be a integer >= 2 and <= 4.",
418+
"description": "MUST be an integer >= 2 and <= 4.",
419419
"required": true,
420420
"schema": {
421421
"type": "integer",

example/filerom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ def main() -> None:
1313
addr_size: int = 0
1414
file: Optional[BinaryIO] = None
1515

16+
# called when addr interface is updated
1617
async def callback() -> None:
1718
addr = await addr_interface.read()
1819
if file is not None:
1920
file.seek(addr, io.SEEK_SET)
2021
if file.readable():
2122
await data_interface.write(file.read(math.ceil(data_size / 8)))
2223

24+
# /rcu run filerom <filename> <data interface> <addr interface>
2325
@script.main
2426
async def _(filename: str, data: rcu.Interface,
2527
addr: rcu.Interface) -> None:
@@ -38,7 +40,7 @@ async def _(filename: str, data: rcu.Interface,
3840
await script.on_interface_update_immediate(addr_interface)(callback)
3941

4042
rcu.run()
41-
# script is stopped
43+
# after script is stopped
4244
if file is not None:
4345
file.close()
4446

example/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
@script.main
11-
# one argument
11+
# one argument, without optional the uuid argument
1212
async def _(interface: rcu.Interface) -> int:
1313
print(f'{interface} @ without uuid')
1414
return 0 # return value may be int or None
@@ -27,7 +27,7 @@ async def _(uuid: Optional[UUID], interface: rcu.Interface) -> Optional[int]:
2727

2828

2929
@script.main
30-
# zero arguments
30+
# zero arguments (obviously without the optional uuid argument)
3131
async def _() -> None:
3232
print('called with no arguments')
3333
# returns None (which is treated as 0)

example/more_highlevel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WIP, not a operational example
1+
# WIP, not an operational example
22

33
import redstone_computer_utilities as rcu
44

example/runtime_deregister.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ async def callback():
1111
@script.main
1212
async def _(command: str):
1313
if command == 'register':
14+
# await is required to register event callbacks at runtime
1415
await script.on_gametick_start(callback)
1516
print('event callback added')
1617
elif command == 'deregister':

example/timer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ async def _():
3333
print('[on_gametick_end_delay] 1s later')
3434

3535

36+
# called at the start of the gametick for every 2 rt
3637
@script.on_gametick_start_clock(rcu.redstonetick(2))
3738
async def _():
3839
print(f'[on_gametick_start_clock] {await script.gametime()}')
3940

4041

42+
# called at the end of the gametick for every 2 rt
4143
@script.on_gametick_end_clock(rcu.redstonetick(2))
4244
async def _():
4345
print(f'[on_gametick_end_clock] {await script.gametime()}')

gradle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Done to increase the memory available to gradle.
22
org.gradle.jvmargs=-Xmx1G
3+
org.gradle.parallel=true
34

45
# Fabric Properties
56
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.19
7-
yarn_mappings=1.19+build.4
8-
loader_version=0.14.9
7+
minecraft_version=1.19.3
8+
yarn_mappings=1.19.3+build.5
9+
loader_version=0.14.14
910

1011
# Mod Properties
1112
mod_version = 0.2.1
1213
maven_group = name.nkid00
1314
archives_base_name = redstone-computer-utilities
1415

1516
# Dependencies
16-
fabric_version=0.58.0+1.19
17+
fabric_version=0.74.0+1.19.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)