Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 47 additions & 94 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,117 +1,70 @@

# User-specific stuff

*.iml
*.ipr
*.iws


# IntelliJ
out/
.idea/

# Compiled class file
# ================================
# Java 通用
# ================================
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
*.log
hs_err_pid*
*.ctxt

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*
# ================================
# Maven 构建
# ================================
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.flattened-pom.xml

# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# ================================
# Gradle 构建(新增,干净不冲突)
# ================================
.gradle/
build/
gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties

# ================================
# IDE 配置(全部忽略,不污染仓库)
# ================================
.idea/
out/
.vscode/
*.iml
*.ipr
*.iws

# General
# ================================
# 系统垃圾文件
# ================================
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

target/

pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next

release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml

# Common working directory
# ================================
# 运行时文件
# ================================
run/
.vscode
.vscode/settings.json
*.stackdump
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ CDKer 是一个运行在Spigot1.18+的Minecraft服务器插件,用于管理和
# CDK配置
cdk:
# CDK字符集
charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
# CDK长度
length: 12
# 默认兑换次数
default-uses: 1
# 语言配置 (支持: zh_CN, en_US)
# 语言配置 (支持: zh_CN[中文], en_US[英文], ja_JP[日文])
language: "zh_CN"
# 消息前缀
prefix: "&bCDKer &7> &f"
Expand All @@ -77,7 +77,7 @@ cdk:
settings:
# 插件消息前缀
prefix: "§6[CDK] §f"
# 插件语言 (zh_CNen_US)
# 插件语言 (zh_CN[中文], en_US[英文], ja_JP[日文])
language: "zh_CN"
# 是否启用调试模式
debug: false
Expand Down Expand Up @@ -228,8 +228,8 @@ cdk:

要从源代码构建插件,您需要:

1. JDK 17
2. Apache Maven 3.6
1. Java JDK 17 +
2. Apache Maven 3.6 + 或者 Gradle 7.4 8+

构建步骤:
```bash
Expand All @@ -238,14 +238,14 @@ cd CDKer
mvn clean package
```

构建后的JAR文件将位于 `target/` 目录中。
默认构建为Maven项目,构建后的JAR文件将位于 `target/` 目录中。,如果您使用Gradle构建,构建后的JAR文件将位于 `build/libs/` 目录中。

## 贡献

欢迎任何形式的贡献!如果您发现了bug或有改进建议,请提交[Issue](https://github.com/baicaizhale/CDKer/issues)或[Pull Request](https://github.com/baicaizhale/CDKer/pulls)。

## 第三方工具
- [MC-CDKer-Generator](https://github.com/EndlessPixel/MC-CDKer-Generator):一个简单的 CDK 批量生成脚本,支持自定义物品池和权重,采用20位随机字符串作为cdk代码,目前仅支持give
- [MC-CDKer-Generator](https://github.com/EndlessPixel/MC-CDKer-Generator):一个简单的 CDK 批量生成脚本,支持自定义物品池和权重,采用自定义长度的随机字符串作为cdk代码,目前仅支持give命令

## 许可证

Expand Down
32 changes: 32 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id 'java'
id 'maven-publish'
}

group = 'studio.winds'
version = project.hasProperty('version') ? project.getProperty('version') : 'dev-SNAPSHOT'

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
maven { url "https://repo.papermc.io/repository/maven-public/" }
}

dependencies {
// 这里我按常规 MC 插件写
// 如果你需要,我可以按你的 pom.xml 精确生成
compileOnly 'io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT'
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

jar {
archiveBaseName.set('CDKer')
destinationDirectory.set(file('build/libs')) // 与 maven 的 target 完全不冲突
}
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading