lp数据存储入门 & inv称号案例 & 补充和排版基岩版客户端下载 & 开始 -> 通用 (#162)
* 补充和排版基岩版客户端下载 * 开始 -> 通用 * lp数据存储入门 & inv称号案例 * 修复构建 * 修复构建 --------- Co-authored-by: “postyizhan” <“185839426@qq.com”>
@ -12,30 +12,30 @@ sidebar_position: 4
|
||||
|
||||
资料来自 https://www.runoob.com/java/java-basic-datatypes.html
|
||||
|
||||
## int
|
||||
### int
|
||||
|
||||
最小值是 -2,147,483,648(-2^31);
|
||||
|
||||
最大值是 2,147,483,647(2^31 - 1);
|
||||
|
||||
## long
|
||||
### long
|
||||
|
||||
最小值是 -9,223,372,036,854,775,808(-2^63);
|
||||
|
||||
最大值是 9,223,372,036,854,775,807(2^63 -1);
|
||||
|
||||
## float
|
||||
### float
|
||||
|
||||
float 数据类型是单精度、32位、符合IEEE 754标准的浮点数;
|
||||
|
||||
float 在储存大型浮点数组的时候可节省内存空间;
|
||||
|
||||
## double
|
||||
### double
|
||||
|
||||
double 数据类型是双精度、64 位、符合 IEEE 754 标准的浮点数;
|
||||
浮点数的默认类型为 double 类型;
|
||||
|
||||
## boolean
|
||||
### boolean
|
||||
|
||||
boolean数据类型表示一位的信息;
|
||||
|
||||
@ -45,10 +45,16 @@ boolean数据类型表示一位的信息;
|
||||
|
||||
</details>
|
||||
|
||||
## 类型转换(Type)
|
||||
### 类型转换(Type)
|
||||
|
||||
> https://kether.tabooproject.org/list.html#Type
|
||||
|
||||
## 变量(Variable)
|
||||
|
||||
以后再写awa
|
||||
|
||||
## 案例
|
||||
|
||||
### 每日刷新
|
||||
|
||||
TODO
|
||||
|
@ -7,7 +7,7 @@ sidebar_position: 3
|
||||
|
||||
## 一 手机运行Java
|
||||
|
||||
### Android
|
||||
### Android
|
||||
|
||||
[Pojav_Android](Pojav_Android.md)
|
||||
|
||||
@ -19,8 +19,12 @@ sidebar_position: 3
|
||||
|
||||
使基岩版客户端进入Java版服务器
|
||||
|
||||
#### 基岩版客户端下载
|
||||
## 基岩版客户端下载
|
||||
|
||||
https://mc.minebbs.com/
|
||||
MineBBS:https://mc.minebbs.com
|
||||
|
||||
https://res.nullatom.com/Minecraft/
|
||||
原子云:https://res.nullatom.com/Minecraft
|
||||
|
||||
Minecraft for Windows 版本库:https://www.mcappx.com
|
||||
|
||||
我的世界国际版下载:https://mcapks.com
|
||||
|
@ -8,7 +8,7 @@ sidebar_position: 1
|
||||
|
||||
:::tip[注意]
|
||||
|
||||
我们只推荐 Luckperms 作为高版本插件服作为权限插件,如果是老版本服请自行学习 GroupManager 等老插件。
|
||||
我们只推荐 Luckperms 作为服武器的权限插件
|
||||
|
||||
:::
|
||||
|
||||
@ -26,6 +26,8 @@ sidebar_position: 1
|
||||
|
||||
`插件百科` https://mineplugin.org/LuckPerms
|
||||
|
||||
`papi变量` https://snowcutieowo.github.io/LuckPerms/#/project-info.placeholders?id=%e5%8f%98%e9%87%8f-1
|
||||
|
||||
:::
|
||||
|
||||
**不建议使用**Luckperms 以外的权限插件如:
|
||||
@ -44,3 +46,15 @@ sidebar_position: 1
|
||||
下载 jar 文件放入 plugins 文件夹即可
|
||||
|
||||
[点击此处查看教程](https://snowcutieowo.github.io/LuckPerms/#/install-on-a-single-server)
|
||||
|
||||
:::tip[注意]
|
||||
|
||||
1.7.10 要用 Bukkit Legacy 版本
|
||||
|
||||
:::
|
||||
|
||||
## 存储方式
|
||||
|
||||
LuckPerms 可以使用 yml 文件存储数据,易于编辑,但我推荐使用 h2(默认) 或者连接数据库使用
|
||||
|
||||
如果你想更改存储方式,可见:https://snowcutieowo.github.io/LuckPerms/#/configuration?id=storage-method
|
||||
|
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 12 KiB |
BIN
docs-java/process/plugin/ManageTool/Permission/_images/正经笑+手.jpg
Normal file
After Width: | Height: | Size: 1.3 KiB |
208
docs-java/process/plugin/ManageTool/Permission/meta.md
Normal file
@ -0,0 +1,208 @@
|
||||
---
|
||||
title: 数据存储
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
# 数据存储
|
||||
|
||||
这里简单介绍下 LuckPerms 一些可以用在储存数据方面的功能,以及一些简单的案例
|
||||
|
||||
## 权限
|
||||
|
||||
实际上,你可以给予用户和组 *不存在的*(没有被其他插件使用)的权限节点
|
||||
|
||||
这些权限有着和其他权限一样的性质
|
||||
|
||||
**设置权限**
|
||||
|
||||
![](_images/memory_1.png)
|
||||
|
||||
![](_images/memory_2.png)
|
||||
|
||||
### 只能按一次的按钮
|
||||
|
||||
子图标的 material 改成 air 就可以做点击后消失了
|
||||
|
||||
案例(TrMenu):
|
||||
```yaml
|
||||
'A':
|
||||
display:
|
||||
material: stone
|
||||
icons:
|
||||
- condition: 'perm *nitwikit.demo'
|
||||
actions:
|
||||
- 'tell: "你已经按过了!"'
|
||||
actions:
|
||||
- 'command inline "lp user {{player name}} permission set nitwikit.demo true" as console'
|
||||
- 'refresh: A'
|
||||
```
|
||||
|
||||
用权限的好处是适用性广,不过对op不太方便,因为op所有权限都是true嘛
|
||||
|
||||
## 限时权限
|
||||
|
||||
过时间后权限自动消失
|
||||
|
||||
:::tip
|
||||
|
||||
这里是 **settemp** 而不是 **set**
|
||||
|
||||
:::
|
||||
|
||||
![](_images/memory_3.png)
|
||||
|
||||
### 按钮冷却
|
||||
|
||||
案例(TrMenu):
|
||||
|
||||
![](_images/memory_4.png)
|
||||
|
||||
```yaml
|
||||
'A':
|
||||
update: 20
|
||||
display:
|
||||
material: stone
|
||||
icons:
|
||||
- condition: 'perm *nitwikit.demo'
|
||||
actions:
|
||||
- 'tell: "正在冷却!还有%luckperms_expiry_time_nitwikit.demo%"'
|
||||
actions:
|
||||
- 'command inline "lp user {{player name}} permission settemp nitwikit.demo true 60s" as console'
|
||||
- 'refresh'
|
||||
```
|
||||
|
||||
:::warning
|
||||
|
||||
安装 LuckPerms 变量扩展才能正确显示变量
|
||||
|
||||
`/papi ecloud download LuckPerms`
|
||||
|
||||
`/papi reload`
|
||||
|
||||
:::
|
||||
|
||||
### 限时vip
|
||||
|
||||
除了限时权限,还有限时权限组可以使用
|
||||
|
||||
图中执行了三次相同的命令
|
||||
|
||||
![](_images/memory_4.png)
|
||||
|
||||
:::tip
|
||||
|
||||
值得一提的是,如果命令中最后没有加 **accumulate** ,他会把权限时间重置到你给的数字而不是累加时间
|
||||
|
||||
下表来自:[此处](https://snowcutieowo.github.io/LuckPerms/#/command-usage.permission?id=lp-usergroup-lt%e7%8e%a9%e5%ae%b6%e6%9d%83%e9%99%90%e7%bb%84gt-permission-settemp-lt%e6%9d%83%e9%99%90gt-lttruefalsegt-lt%e6%97%b6%e9%97%b4gt-%e6%96%bd%e5%8a%a0%e6%a8%a1%e5%bc%8f-%e4%b8%8a%e4%b8%8b%e6%96%87)
|
||||
|
||||
| 模式关键词 | 描述 |
|
||||
| ---------- | -------------------------------------------- |
|
||||
| accumulate | 新加入的权限时长会叠加在已有的时长之上 |
|
||||
| replace | 保留持续时间最长的权限节点 |
|
||||
| deny | 不接受重复的限时权限节点,若有则拒绝执行命令 |
|
||||
|
||||
:::
|
||||
|
||||
### 每日刷新
|
||||
|
||||
原理:假如现在是13点,那么距离今天结束就是 24h - 13h = 11h
|
||||
|
||||
我给玩家 11h 的限时权限,今日24点一过就是无权限状态,那些判断此权限的东西就变成每日刷新了
|
||||
|
||||
实现(kether):
|
||||
|
||||
搓命令:
|
||||
```yaml
|
||||
inline "lp user {{sender}} permission settemp nitwikit.demo true {{math 24 - time as HH}}h{{math 60 - time as mm}}m{{math 60 - time as ss}}s"
|
||||
```
|
||||
|
||||
tell搓出来的看看
|
||||
|
||||
![](_images/memory_6.png)
|
||||
|
||||
执行命令:
|
||||
```yaml
|
||||
command inline "lp user {{sender}} permission settemp nitwikit.demo true {{math 24 - time as HH}}h{{math 60 - time as mm}}m{{math 60 - time as ss}}s" as console
|
||||
```
|
||||
|
||||
你也可以用 papi 的 server 和 math 两个扩展来做
|
||||
|
||||
- `%math_0_24-{server_time_HH}%` // 时
|
||||
- `%math_0_60-{server_time_mm}%` // 分
|
||||
- `%math_0_60-{server_time_ss}%` // 秒
|
||||
|
||||
不过我不太喜欢这种做法,另一种: [案例 | 变量|每日刷新](../../../../advance/kether/variable.md#每日刷新)
|
||||
|
||||
### 倒计时
|
||||
|
||||
和上面每日刷新一个思路
|
||||
|
||||
## meta
|
||||
|
||||
你只需要知道 `键` 和 `值` 是一一对应的就好了
|
||||
|
||||
然后框框设♂就行
|
||||
|
||||
![](_images/memory_7.png)
|
||||
|
||||
![](_images/memory_8.png)
|
||||
|
||||
![](_images/memory_9.png)
|
||||
|
||||
```
|
||||
\%luckperms_meta_键名%
|
||||
```
|
||||
|
||||
![](_images/memory_10.png)
|
||||
|
||||
此方法op不受影响,但适用性没权限广,因为一些插件只支持判断权限
|
||||
|
||||
:::warning
|
||||
|
||||
安装 LuckPerms 变量扩展才能正确显示变量
|
||||
|
||||
`/papi ecloud download LuckPerms`
|
||||
|
||||
`/papi reload`
|
||||
|
||||
:::
|
||||
|
||||
但是使用lp的命令设置meta要写一大串不说,还会输出log
|
||||
|
||||
好在 [Vulpecula](https://github.com/Lanscarlos/Vulpecula) 的 [memory](https://www.yuque.com/lanscarlos/vulpecula-wiki-v2/og93eqlegc0geyfi) 动作可以用来设置meta
|
||||
|
||||
```
|
||||
memory 键名 to 值 using lp
|
||||
```
|
||||
|
||||
存meta
|
||||
|
||||
![](_images/memory_11.png)
|
||||
|
||||
```
|
||||
memory 键名 using lp
|
||||
```
|
||||
|
||||
取meta
|
||||
|
||||
![](_images/memory_12.png)
|
||||
|
||||
![](_images/正经笑+手.jpg)
|
||||
|
||||
### 案例
|
||||
|
||||
上面权限能做的meta基本都能做
|
||||
|
||||
### 称号系统
|
||||
|
||||
见 [案例 | Invero|称号系统](../../other/Menu/TrMenu.md#称号系统)
|
||||
|
||||
## 限时meta
|
||||
|
||||
```
|
||||
/lp user postyizhan meta settemp 键 值 时间
|
||||
```
|
||||
|
||||
### 案例
|
||||
|
||||
没啥要写的
|
@ -111,3 +111,7 @@ https://github.com/Dreeam-qwq/TrMenu/blob/stable/v3/plugin/src/main/resources/se
|
||||
### tpa选人菜单
|
||||
|
||||
[查看配置](https://github.com/postyizhan/NitWikit/blob/main/docs-java/process/plugin/other/Menu/demo/inv-tpa选人菜单.yml)
|
||||
|
||||
### 称号系统
|
||||
|
||||
[查看配置](https://github.com/postyizhan/NitWikit/blob/main/docs-java/process/plugin/other/Menu/demo/inv-称号系统.yml)
|
||||
|
165
docs-java/process/plugin/other/Menu/demo/inv-称号系统.yml
Normal file
@ -0,0 +1,165 @@
|
||||
##############################
|
||||
# 是驿站写滴 Q:185839426
|
||||
# 禁止商用和抹除作者信息
|
||||
##############################
|
||||
|
||||
|
||||
|
||||
title: '称号菜单'
|
||||
|
||||
layout:
|
||||
- '#|#######'
|
||||
- '#?# #'
|
||||
- '#|# #'
|
||||
- '#|# #'
|
||||
- '#|#######'
|
||||
- '#|#<#@#>#'
|
||||
|
||||
# bindings:
|
||||
# command:
|
||||
# name: 'prefix'
|
||||
|
||||
common: &common
|
||||
name: '{{element name}}'
|
||||
lore: |-
|
||||
{{element lore}}
|
||||
{{v-script run prefix by player name with [ element id ] }}
|
||||
page_act: &page_act
|
||||
node Sound
|
||||
icons refresh
|
||||
menu title update
|
||||
icons refresh
|
||||
|
||||
nodes:
|
||||
Sound:
|
||||
type: kether
|
||||
value:
|
||||
sound UI_BUTTON_CLICK by 1 1
|
||||
|
||||
generator:
|
||||
# filter:
|
||||
# any [
|
||||
# check &filter == 无
|
||||
# ]
|
||||
output:
|
||||
enhancedLore: true
|
||||
material: bedrock
|
||||
name: '&c&l判断错误,请联系管理'
|
||||
sub:
|
||||
- if: check element source == mc
|
||||
material: '{{element mat}}'
|
||||
<<: *common
|
||||
- if: check element source == ni
|
||||
texture:
|
||||
source: ni
|
||||
value: '{{element mat}}'
|
||||
<<: *common
|
||||
action:
|
||||
- if: not perm join [ "prefix." element id ]
|
||||
# 称号获得
|
||||
then:
|
||||
context set id to element id
|
||||
menu open_ctx element id
|
||||
# 佩戴称号
|
||||
else:
|
||||
if* element id != papi %luckperms_meta_prefix% then {
|
||||
v-memory prefix to element id by &player using lp
|
||||
v-memory prefix_name to &element_name by &player using lp
|
||||
tell "&a&l! &7佩戴成功!%luckperms_meta_prefix_name%"
|
||||
}
|
||||
- icons refresh
|
||||
|
||||
|
||||
|
||||
elements:
|
||||
- id: citizen
|
||||
source: mc
|
||||
mat: name_tag
|
||||
name: '&7公民'
|
||||
lore: |-
|
||||
|
||||
\n服务器玩家的默认称号!
|
||||
\n
|
||||
- id: ben_dan
|
||||
source: mc
|
||||
mat: redstone
|
||||
name: '&c&l笨蛋'
|
||||
lore: |-
|
||||
|
||||
\n服务器管理员称号
|
||||
\n
|
||||
- id: hei_nu
|
||||
source: mc
|
||||
mat: coal
|
||||
name: '&0&l黑奴'
|
||||
lore: |-
|
||||
|
||||
\n挖煤导致的
|
||||
\n
|
||||
- id: yuan_shi
|
||||
source: mc
|
||||
mat: cobblestone
|
||||
name: '&d圆石&7粉碎机'
|
||||
lore: |-
|
||||
|
||||
\n关于我上辈子是个刷石机这件事
|
||||
\n
|
||||
|
||||
|
||||
|
||||
icons:
|
||||
'#':
|
||||
material: air
|
||||
'|':
|
||||
material: light_blue_stained_glass_pane
|
||||
name: ' '
|
||||
'@':
|
||||
material: barrier
|
||||
name: '&c&l返回'
|
||||
lore:
|
||||
- ''
|
||||
- '&8| &7点击返回主菜单.'
|
||||
- ''
|
||||
action: node Sound
|
||||
'?':
|
||||
material: sign
|
||||
name: '&c&l搜索'
|
||||
lore:
|
||||
- ''
|
||||
- '&8| &6左键&7点击搜索内容'
|
||||
- '&8| &7搜素内容: &6{{&filter}}'
|
||||
- '&8| &6右键&7点击清除搜索'
|
||||
- ''
|
||||
action:
|
||||
def: node Sound regenerate icons update
|
||||
# number_key_1: context set filter to 1
|
||||
# number_key_2: context set filter to 2
|
||||
# number_key_3: context set filter to 3
|
||||
left:
|
||||
catch: filter
|
||||
cancel: [ 'exit' ]
|
||||
beforeInput: tell '&7请输入 &a搜素内容 &7输入 &cexit &7取消'
|
||||
onCancel: tell '&a! &7已经取消'
|
||||
right: context set filter to 无 regenerate
|
||||
'>':
|
||||
material: air
|
||||
name: ' '
|
||||
lore: '{{math page current + 1}} / {{math page max + 1}}'
|
||||
sub:
|
||||
if: not page isLast
|
||||
material: arrow
|
||||
name: '<green>下一页 →'
|
||||
action:
|
||||
- page next
|
||||
- *page_act
|
||||
'<':
|
||||
material: air
|
||||
name: ' '
|
||||
lore: '{{math page current + 1}} / {{math page max + 1}}'
|
||||
sub:
|
||||
if: not page isFirst
|
||||
material: arrow
|
||||
name: '<aqua>← 上一页'
|
||||
action:
|
||||
- page previous
|
||||
- *page_act
|
@ -127,7 +127,7 @@ const config = {
|
||||
type: 'doc',
|
||||
docId: 'intro',
|
||||
position: 'left',
|
||||
label: '开始',
|
||||
label: '通用',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
|