Skip to content

Commit

Permalink
Merge pull request #9 from NKID00/dev
Browse files Browse the repository at this point in the history
bump version 0.2.1
  • Loading branch information
NKID00 authored Sep 9, 2022
2 parents f28caa3 + a16c90e commit a185bf3
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 75 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Redstone Computer Utilities

> Lightweight and Modular Redstone Computer Debugging Tools.
> Lightweight and Modular Redstone Computer Debugging Tools.
[English README](./README.md) | [简体中文简介](./README.zh_cn.md)

Expand All @@ -19,12 +19,23 @@

## Installation

This mod supports Minecraft 1.19.2 and requires the latest Fabric Loader and Fabric API.
This mod supports Minecraft 1.16-1.19.2 and requires Java 17, the latest Fabric Loader and the latest Fabric API.

Only server-side installation is required for multiplayer and client-side installation is required for singleplayer.

Python 3.7.2 or newer (CPython or PyPy) is required to use the provided Python library.

```sh
$ pip install redstone-computer-utilities
```

or

```toml
# pyproject.toml
redstone-computer-utilities = "^0.2.0"
```

## Basic Usage

1. Execute `/rcu` to receive a wand item (or pick a pink dye by yourself).
Expand Down
13 changes: 12 additions & 1 deletion README.zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@

## 安装

支持 Minecraft 1.19.2,需要安装最新的 Fabric Loader Fabric API。
支持 Minecraft 1.16-1.19.2,需要安装 Java 17、最新的 Fabric Loader 和最新的 Fabric API。

多人游戏只需要安装在服务器侧,单人游戏需要安装在客户端侧。

需要安装 Python 3.7.2 或更新版本(CPython 或 PyPy)来使用提供的 Python 库。

```sh
$ pip install redstone-computer-utilities
```

或者

```toml
# pyproject.toml
redstone-computer-utilities = "^0.2.0"
```

## 基础用法

1. 执行 `/rcu` 来获取一个魔杖物品(也可以直接拿一个粉红色染料)。
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = "${project.mod_version}-mc1.19.2+${buildMetadata()}"
version = "${project.mod_version}-mc1.19+${buildMetadata()}"
group = project.maven_group

def buildMetadata() {
Expand Down
22 changes: 22 additions & 0 deletions docs/PyPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<img src="https://cdn.jsdelivr.net/gh/NKID00/redstone-computer-utilities@dev/src/main/resources/assets/rcutil/icon.png" alt="icon" align="right" height="175">

# Redstone Computer Utilities

> Lightweight and Modular Redstone Computer Debugging Tools.
## Installation

Python 3.7.2 or newer (CPython or PyPy) is required.

```sh
$ pip install redstone-computer-utilities
```

or

```toml
# pyproject.toml
redstone-computer-utilities = "^0.2.0"
```

### Check the GitHub repository [NKID00/redstone-computer-utilities](https://github.com/NKID00/redstone-computer-utilities) for details.
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.8
loader_version=0.14.9
# check these on https://fabricmc.net/develop
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.9

# Mod Properties
mod_version = 0.2.0
maven_group = name.nkid00
archives_base_name = redstone-computer-utilities
mod_version = 0.2.1
maven_group = name.nkid00
archives_base_name = redstone-computer-utilities

# Dependencies
fabric_version=0.60.0+1.19.2
fabric_version=0.58.0+1.19
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[tool.poetry]
name = "redstone-computer-utilities"
version = "0.2.0"
description = "Simple debug tools for redstone computers."
version = "0.2.0.post3"
description = "Lightweight and Modular Redstone Computer Debugging Tools."
authors = ["NKID00 <[email protected]>"]
readme = "docs/PyPI.md"
license = "MPL-2.0"
homepage = "https://github.com/NKID00/redstone-computer-utilities"

[tool.poetry.dependencies]
python = "^3.7.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static int execute(CommandContext<ServerCommandSource> c) throws CommandS

public static int executeDetail(CommandContext<ServerCommandSource> c) throws CommandSyntaxException {
var s = c.getSource();
var player = s.getPlayer();
var player = CommandHelper.playerOrNull(s);
var uuid = CommandHelper.uuidOrNull(s);
var args = ArgumentHelper.getMulti(c, "interface name...");
int result = 0;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/name/nkid00/rcutil/helper/CommandHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ public static UUID uuidOrNull(ServerCommandSource s) {
return player.getUuid();
}

public static ServerPlayerEntity playerOrNull(ServerCommandSource s) throws CommandSyntaxException {
return s.getPlayer();
}

public static ServerPlayerEntity requirePlayer(ServerCommandSource s) throws CommandSyntaxException {
var player = s.getPlayer();
var player = playerOrNull(s);
if (player == null) {
throw NOT_PLAYER_ENTITY_EXCEPTION.create();
}
Expand Down
62 changes: 31 additions & 31 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"schemaVersion": 1,
"id": "rcutil",
"version": "${version}",
"name": "Redstone Computer Utilities",
"description": "Simple debug tools for redstone computers.",
"authors": [
"NKID00"
],
"contact": {
"homepage": "https://github.com/NKID00/redstone-computer-utilities",
"sources": "https://github.com/NKID00/redstone-computer-utilities",
"issues": "https://github.com/NKID00/redstone-computer-utilities"
},
"license": "MIT",
"icon": "assets/rcutil/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"name.nkid00.rcutil.RCUtil"
]
},
"mixins": [
"rcutil.mixins.json"
],
"accessWidener" : "rcutil.accesswidener",
"depends": {
"fabricloader": ">=0.12",
"fabric": "*",
"minecraft": "1.19.2"
}
}
"schemaVersion": 1,
"id": "rcutil",
"version": "${version}",
"name": "Redstone Computer Utilities",
"description": "Simple debug tools for redstone computers.",
"authors": [
"NKID00"
],
"contact": {
"homepage": "https://github.com/NKID00/redstone-computer-utilities",
"sources": "https://github.com/NKID00/redstone-computer-utilities",
"issues": "https://github.com/NKID00/redstone-computer-utilities/issues"
},
"license": "MIT",
"icon": "assets/rcutil/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"name.nkid00.rcutil.RCUtil"
]
},
"mixins": [
"rcutil.mixins.json"
],
"accessWidener": "rcutil.accesswidener",
"depends": {
"fabricloader": ">=0.12",
"fabric": "*",
"minecraft": "~1.19"
}
}
14 changes: 1 addition & 13 deletions src/main/resources/rcutil.accesswidener
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
accessWidener v1 named
accessWidener v1 named
accessible field net/minecraft/server/command/ServerCommandSource output Lnet/minecraft/server/command/CommandOutput;
accessible field net/minecraft/server/command/ServerCommandSource position Lnet/minecraft/util/math/Vec3d;
accessible field net/minecraft/server/command/ServerCommandSource world Lnet/minecraft/server/world/ServerWorld;
accessible field net/minecraft/server/command/ServerCommandSource level I
accessible field net/minecraft/server/command/ServerCommandSource name Ljava/lang/String;
accessible field net/minecraft/server/command/ServerCommandSource displayName Lnet/minecraft/text/Text;
accessible field net/minecraft/server/command/ServerCommandSource server Lnet/minecraft/server/MinecraftServer;
accessible field net/minecraft/server/command/ServerCommandSource silent Z
accessible field net/minecraft/server/command/ServerCommandSource entity Lnet/minecraft/entity/Entity;
accessible field net/minecraft/server/command/ServerCommandSource resultConsumer Lcom/mojang/brigadier/ResultConsumer;
accessible field net/minecraft/server/command/ServerCommandSource entityAnchor Lnet/minecraft/command/argument/EntityAnchorArgumentType$EntityAnchor;
accessible field net/minecraft/server/command/ServerCommandSource rotation Lnet/minecraft/util/math/Vec2f;
accessible field net/minecraft/server/command/ServerCommandSource signedArguments Lnet/minecraft/network/message/SignedCommandArguments;
accessible field net/minecraft/server/command/ServerCommandSource messageChainTaskQueue Lnet/minecraft/util/thread/FutureQueue;
27 changes: 13 additions & 14 deletions src/main/resources/rcutil.mixins.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "name.nkid00.rcutil.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"MinecraftServerMixin",
"AbstractBlockMixin"
],
"client": [
],
"injectors": {
"defaultRequire": 1
}
}
"required": true,
"minVersion": "0.8",
"package": "name.nkid00.rcutil.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"MinecraftServerMixin",
"AbstractBlockMixin"
],
"client": [],
"injectors": {
"defaultRequire": 1
}
}

0 comments on commit a185bf3

Please sign in to comment.