Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Aug 4, 2024
1 parent cd5191d commit 21db327
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# LegacyParticleAPI

**You shou install [LiteLoaderBDS-CUI](https://github.com/OEOTYAN/LiteLoaderBDS-CUI/releases) on your server firstly if you want to see the particle.**
English | [简体中文](README.zh.md)

**You shou install [LiteLoaderBDS-CUI](https://github.com/OEOTYAN/LiteLoaderBDS-CUI/releases) on your server firstly if you want to see the particle**
You can just decompress the resource pack to `./plugins/LegacyParticleAPI/ResourcePacks`

## Usage

ParticleAPI provides a rich and easy-to-use particle generation interface for plugin development, which intuitive design and efficient and stable performance support developers to write better plugins.

Including headfile `#include "LegacyParticleAPI/ParticleAPI.h"` is the first step to use ParticleAPI。
Including header `#include "LegacyParticleAPI/ParticleAPI.h"` is the first step to use ParticleAPI。
It provides the generation class `ParticleAPI` which is closer to the bottom layer and the further encapsulated CUI class `ParticleCUI`. The difference between the two is very small, and only the members of the CUI class are introduced here.

### CUI

| Type | Name | Illustration |
| ---- | ------------------- | ------------------------- |
| Var | displayRadius: uint | maximum visible distance |
Expand Down
27 changes: 27 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# LegacyParticleAPI

[English](README.md) | 简体中文

**如果您想看到粒子,请先在服务器上安装 [LiteLoaderBDS-CUI](https://github.com/OEOTYAN/LiteLoaderBDS-CUI/releases)**
您只需将资源包解压缩到 `./plugins/LegacyParticleAPI/ResourcePacks` 中即可

## 使用方法

ParticleAPI 为插件开发提供了丰富易用的粒子生成接口,直观的设计和高效稳定的性能支持开发者编写更好的插件。

包含头文件 `#include "LegacyParticleAPI/ParticleAPI.h"` 是使用 ParticleAPI 的第一步。
它提供了更接近底层的生成类 `ParticleAPI` 和进一步封装的 CUI 类 `ParticleCUI`。两者之间的区别很小,这里只介绍 CUI 类的成员。

### CUI

| 类型 | 名称 | 说明 |
| ---- | ------------------- | ---------------- |
| Var | displayRadius: uint | 最大可见距离 |
| Var | highDetial:bool | 绘制类型高清选项 |
| Var | doubleSide: bool | 绘制类型双面选项 |
| Func | spawnParticle | 生成粒子 |
| Func | spawnPoint | 生成点 |
| Func | spawnNumber | 生成数字 |
| Func | drawOrientedLine | 绘制定向线 |
| Func | drawCuboid | 绘制 3D 矩形 |
| Func | drawCircle | 绘制二维圆 |
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"type": "native",
"description": "ParticleAPI ported from LiteLoaderBDS",
"author": "LiteLDev",
"version": "0.8.2"
"version": "0.8.3"
}
5 changes: 4 additions & 1 deletion src/LegacyParticleAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ LL_AUTO_TYPE_INSTANCE_HOOK(
&ResourcePackRepository::_initialize,
void
) {
this->addCustomResourcePackPath("./plugins/LegacyParticleAPI/ResourcePacks", PackType::Resources);
this->addCustomResourcePackPath(
legacy_particleapi::LegacyParticleAPI::getInstance().getSelf().getModDir() / "ResourcePacks",
PackType::Resources
);
origin();
}

Expand Down
2 changes: 2 additions & 0 deletions src/ParticleAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
//
#include "ParticleAPI.h"
#include "ll/api/service/Bedrock.h"
#include "mc/deps/core/mce/Color.h"
#include "mc/network/packet/SpawnParticleEffectPacket.h"
#include "mc/world/actor/player/Player.h"
#include "mc/world/level/Level.h"
#include "mc/world/level/dimension/Dimension.h"
#include "mc/world/phys/AABB.h"


namespace {
template <typename T>
std::string fto_string(const T a_value) {
Expand Down
1 change: 0 additions & 1 deletion src/ParticleAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*
*/
#pragma once
#include "mc/deps/core/mce/Color.h"
#include "mc/math/Vec3.h"
#include "mc/world/level/BlockPos.h"
#include "mc/world/level/levelgen/structure/BoundingBox.h"
Expand Down
4 changes: 2 additions & 2 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 2,
"tooth": "github.com/LiteLDev/LegacyParticleAPI",
"version": "0.8.2",
"version": "0.8.3",
"info": {
"name": "LegacyParticleAPI",
"description": "ParticleAPI ported from LiteLoaderBDS",
Expand All @@ -12,7 +12,7 @@
"library"
]
},
"asset_url": "https://github.com/LiteLDev/LegacyParticleAPI/releases/download/v0.8.2/LegacyParticleAPI-windows-x64.zip",
"asset_url": "https://github.com/LiteLDev/LegacyParticleAPI/releases/download/v0.8.3/LegacyParticleAPI-windows-x64.zip",
"prerequisites": {
"github.com/LiteLDev/LeviLamina": ">=0.13.4 <0.14.0"
},
Expand Down

0 comments on commit 21db327

Please sign in to comment.