Skip to content

Commit a2eeb82

Browse files
author
foxdevtime
committed
Initial commit: Implemented the plugin core (v1.0.0)
1 parent 06ed723 commit a2eeb82

23 files changed

Lines changed: 1570 additions & 0 deletions

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# User-specific stuff
2+
.idea/
3+
4+
*.iml
5+
*.ipr
6+
*.iws
7+
8+
# IntelliJ
9+
out/
10+
# mpeltonen/sbt-idea plugin
11+
.idea_modules/
12+
13+
# JIRA plugin
14+
atlassian-ide-plugin.xml
15+
16+
# Compiled class file
17+
*.class
18+
19+
# Log file
20+
*.log
21+
22+
# BlueJ files
23+
*.ctxt
24+
25+
# Package Files #
26+
*.jar
27+
*.war
28+
*.nar
29+
*.ear
30+
*.zip
31+
*.tar.gz
32+
*.rar
33+
34+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
35+
hs_err_pid*
36+
37+
*~
38+
39+
# temporary files which can be created if a process still has a handle open of a deleted file
40+
.fuse_hidden*
41+
42+
# KDE directory preferences
43+
.directory
44+
45+
# Linux trash folder which might appear on any partition or disk
46+
.Trash-*
47+
48+
# .nfs files are created when an open file is removed but is still being accessed
49+
.nfs*
50+
51+
# General
52+
.DS_Store
53+
.AppleDouble
54+
.LSOverride
55+
56+
# Icon must end with two \r
57+
Icon
58+
59+
# Thumbnails
60+
._*
61+
62+
# Files that might appear in the root of a volume
63+
.DocumentRevisions-V100
64+
.fseventsd
65+
.Spotlight-V100
66+
.TemporaryItems
67+
.Trashes
68+
.VolumeIcon.icns
69+
.com.apple.timemachine.donotpresent
70+
71+
# Directories potentially created on remote AFP share
72+
.AppleDB
73+
.AppleDesktop
74+
Network Trash Folder
75+
Temporary Items
76+
.apdisk
77+
78+
# Windows thumbnail cache files
79+
Thumbs.db
80+
Thumbs.db:encryptable
81+
ehthumbs.db
82+
ehthumbs_vista.db
83+
84+
# Dump file
85+
*.stackdump
86+
87+
# Folder config file
88+
[Dd]esktop.ini
89+
90+
# Recycle Bin used on file shares
91+
$RECYCLE.BIN/
92+
93+
# Windows Installer files
94+
*.cab
95+
*.msi
96+
*.msix
97+
*.msm
98+
*.msp
99+
100+
# Windows shortcuts
101+
*.lnk
102+
103+
.gradle
104+
build/
105+
106+
# Ignore Gradle GUI config
107+
gradle-app.setting
108+
109+
# Cache of project
110+
.gradletasknamecache
111+
112+
**/build/
113+
114+
# Common working directory
115+
run/
116+
117+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
118+
!gradle-wrapper.jar

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# PotatoChat 🥔
2+
3+
![Java](https://img.shields.io/badge/Java-8%2B-orange) ![Platform](https://img.shields.io/badge/Platform-Spigot%201.8%2B-blue) ![License](https://img.shields.io/badge/License-MIT-green)
4+
[![English](https://img.shields.io/badge/Language-English-blue)](README.md) [![Русский](https://img.shields.io/badge/Язык-Русский-red)](README_ru.md)
5+
6+
**A lightweight, optimized, and customizable chat management solution.**
7+
Designed to replace bloated chat plugins. Features channel management, newbie protection, and full modern color support (RGB/HEX) while keeping resource usage at a minimum.
8+
9+
---
10+
11+
## ✨ Features
12+
13+
* **🚀 Highly Optimized:** Minimal resource usage, perfect for high-load servers (tested with spark!).
14+
* **📢 Dynamic Channels:** Create unlimited chat channels (Local, Global, Staff, etc.) distinguished by prefixes.
15+
* **🎨 Color Support:** Full support for Legacy colors (`&a`) and modern HEX colors (`&#RRGGBB`)
16+
* **🛡️ Newbie Protection:** Automatically blocks chat and PM commands for new players until they reach a specific playtime.
17+
* **⏱️ Anti-Spam:** Configurable cooldowns for each channel.
18+
* **🔗 Integration:** Seamless support for **Vault** (Prefixes/Suffixes) and **PlaceholderAPI**.
19+
* **🤖 Auto-Announcer:** Built-in broadcasting system with random or sequential messages.
20+
21+
---
22+
23+
## 📖 How to Use
24+
25+
### Step 1: Channels Setup
26+
Configure your channels in `config.yml`. The plugin uses **prefixes** to determine where to send the message.
27+
* **No Prefix:** Sends to the default channel (usually Local)
28+
* **`!` Prefix:** Sends to Global chat (configurable)
29+
* **`@` Prefix:** Sends to Staff chat (configurable)
30+
31+
### Step 2: Permissions
32+
Grant permissions to your groups.
33+
* `pchat.channel.global` -> To speak in global chat
34+
* `pchat.staff` -> To see and speak in staff chat
35+
* `pchat.rgb` -> To use HEX colors
36+
37+
### Step 3: Newbie Protection
38+
By default, players with less than **10 minutes** of playtime cannot use:
39+
* Chat (Global/Local)
40+
* Private message commands (`/msg`, `/tell`, etc.)
41+
42+
---
43+
44+
## 🛠 Commands & Permissions
45+
46+
| Command | Description | Permission |
47+
| :--- | :--- | :--- |
48+
| `/pchat reload` | Reloads the configuration file | `pchat.admin` (default: OP) |
49+
50+
| Permission Node | Description | Default |
51+
| :--- | :--- | :--- |
52+
| `pchat.bypass.cooldown` | Bypasses channel cooldowns | OP |
53+
| `pchat.bypass.newbie` | Bypasses newbie restrictions | OP |
54+
| `pchat.color` | Allows standard color codes (`&`) | OP |
55+
| `pchat.rgb` | Allows HEX color codes (`&#`) | OP |
56+
57+
---
58+
59+
## ⚙️ Configuration
60+
61+
The `config.yml` allows you to customize every aspect of the chat.
62+
63+
### Channel Configuration Example
64+
```yaml
65+
channels:
66+
local:
67+
format: "&7[L] {prefix}&r {player}&7: &f{message}"
68+
radius: 100 # Message visible within 100 blocks
69+
prefix: "" # Default chat
70+
cooldown: 3
71+
72+
global:
73+
format: "&a[G] {prefix}&r &c{player} {suffix}&7: &f{message}"
74+
radius: -1 # -1 = Global visibility
75+
prefix: "!" # Trigger: "!Hello world"
76+
permission: "pchat.channel.global"
77+
```
78+
79+
### Auto-Messages Example
80+
```yaml
81+
auto-messages:
82+
enabled: true
83+
interval: 300 # Seconds
84+
list:
85+
1: ["&aWelcome to the server!"]
86+
2: ["&bDon't forget to join our Discord."]
87+
```
88+
89+
---
90+
91+
## 📥 Installation
92+
93+
1. Ensure you are running **Spigot/Paper 1.8** or higher.
94+
2. Download the latest release `.jar`.
95+
3. Drop the file into your server's `/plugins` folder.
96+
4. (Optional) Install **Vault** and **PlaceholderAPI** for full functionality.
97+
5. Restart the server.
98+
99+
---
100+
101+
<p align="center">
102+
Made with ❤️ and 🥔 by foxdevtime
103+
</p>

README_ru.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# PotatoChat 🥔
2+
3+
![Java](https://img.shields.io/badge/Java-8%2B-orange) ![Platform](https://img.shields.io/badge/Platform-Spigot%201.8%2B-blue) ![License](https://img.shields.io/badge/License-MIT-green)
4+
[![English](https://img.shields.io/badge/Language-English-blue)](README.md) [![Русский](https://img.shields.io/badge/Язык-Русский-red)](README_ru.md)
5+
6+
**Лёгкое, оптимизированное и настраиваемое решение для управления чатом.**
7+
Создан для замены тяжеловесных плагинов чата. Включает управление каналами, защиту от спама новичков и полную поддержку современных цветов (RGB/HEX), сохраняя при этом минимальное потребление ресурсов.
8+
9+
---
10+
11+
## ✨ Возможности
12+
13+
* **🚀 Высокая оптимизация:** Минимальное использование ресурсов, идеально подходит для нагруженных серверов (проверено через spark!).
14+
* **📢 Динамические каналы:** Создавайте неограниченное количество каналов (Локальный, Глобальный, Персонал и т.д.), разделяемых префиксами.
15+
* **🎨 Поддержка цветов:** Полная поддержка классических цветов (`&a`) и современных HEX-цветов (`&#RRGGBB`).
16+
* **🛡️ Защита от новичков:** Автоматически блокирует чат и команды ЛС для новых игроков, пока они не наиграют определённое время.
17+
* **⏱️ Анти-спам:** Настраиваемая задержка (кулдаун) для каждого канала.
18+
* **🔗 Интеграция:** Бесшовная поддержка **Vault** (Префиксы/Суффиксы) и **PlaceholderAPI**.
19+
* **🤖 Авто-сообщения:** Встроенная система объявлений с возможностью случайного или последовательного выбора сообщений.
20+
21+
---
22+
23+
## 📖 Как использовать
24+
25+
### Шаг 1: Настройка каналов
26+
Настройте каналы в `config.yml`. Плагин использует **префиксы** (символы перед сообщением), чтобы определить, куда отправить текст.
27+
* **Без префикса:** Отправляет в канал по умолчанию (обычно Локальный).
28+
* **Префикс `!`:** Отправляет в Глобальный чат (настраивается).
29+
* **Префикс `@`:** Отправляет в чат Персонала (настраивается).
30+
31+
### Шаг 2: Права (Permissions)
32+
Выдайте права вашим группам игроков.
33+
* `pchat.channel.global` -> Чтобы писать в глобальный чат.
34+
* `pchat.staff` -> Чтобы видеть и писать в чат персонала.
35+
* `pchat.rgb` -> Чтобы использовать HEX-цвета.
36+
37+
### Шаг 3: Защита от новичков
38+
По умолчанию игроки, наигравшие менее **10 минут**, не могут использовать:
39+
* Чат (Глобальный/Локальный).
40+
* Команды личных сообщений (`/msg`, `/tell` и т.д.).
41+
42+
---
43+
44+
## 🛠 Команды и Права
45+
46+
| Команда | Описание | Право |
47+
| :--- | :--- | :--- |
48+
| `/pchat reload` | Перезагружает конфигурационный файл | `pchat.admin` (по умолч.: OP) |
49+
50+
| Узел прав (Permission Node) | Описание | По умолчанию |
51+
| :--- | :--- | :--- |
52+
| `pchat.bypass.cooldown` | Обход задержки (кулдауна) чата | OP |
53+
| `pchat.bypass.newbie` | Обход ограничений для новичков | OP |
54+
| `pchat.color` | Разрешает стандартные цветовые коды (`&`) | OP |
55+
| `pchat.rgb` | Разрешает HEX-цвета (`&#`) | OP |
56+
57+
---
58+
59+
## ⚙️ Конфигурация
60+
61+
Файл `config.yml` позволяет настроить каждый аспект чата.
62+
63+
### Пример настройки каналов
64+
```yaml
65+
channels:
66+
local:
67+
format: "&7[L] {prefix}&r {player}&7: &f{message}"
68+
radius: 100 # Сообщение видно в радиусе 100 блоков
69+
prefix: "" # Чат по умолчанию (без символа)
70+
cooldown: 3
71+
72+
global:
73+
format: "&a[G] {prefix}&r &c{player} {suffix}&7: &f{message}"
74+
radius: -1 # -1 = Видно на всём сервере
75+
prefix: "!" # Триггер: "!Привет мир"
76+
permission: "pchat.channel.global"
77+
```
78+
79+
### Пример авто-сообщений
80+
```yaml
81+
auto-messages:
82+
enabled: true
83+
interval: 300 # Секунды
84+
list:
85+
1: ["&aДобро пожаловать на сервер!"]
86+
2: ["&bНе забудьте зайти в наш Discord."]
87+
```
88+
89+
---
90+
91+
## 📥 Установка
92+
93+
1. Убедитесь, что ваш сервер работает на **Spigot/Paper 1.8** или выше.
94+
2. Скачайте `.jar` файл последнего релиза.
95+
3. Поместите файл в папку `/plugins` вашего сервера.
96+
4. (Опционально) Установите **Vault** и **PlaceholderAPI** для полного функционала.
97+
5. Перезапустите сервер.
98+
99+
---
100+
101+
<p align="center">
102+
Сделано с ❤️ и 🥔 от foxdevtime
103+
</p>

build.gradle

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
plugins {
2+
id 'java'
3+
id("xyz.jpenilla.run-paper") version "2.3.1"
4+
}
5+
6+
group = 'xyz.foxdevtime'
7+
version = '1.0.0'
8+
9+
def api_mc_ver = '1.13'
10+
11+
repositories {
12+
mavenCentral()
13+
maven {
14+
name = "spigotmc-repo"
15+
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
16+
}
17+
maven {
18+
name = "sonatype"
19+
url = "https://oss.sonatype.org/content/groups/public/"
20+
}
21+
maven {
22+
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
23+
}
24+
maven {
25+
url = 'https://jitpack.io'
26+
}
27+
}
28+
29+
dependencies {
30+
compileOnly "org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT"
31+
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
32+
compileOnly 'me.clip:placeholderapi:2.11.5'
33+
}
34+
35+
tasks {
36+
runServer {
37+
// Configure the Minecraft version for our task.
38+
// This is the only required configuration besides applying the plugin.
39+
// Your plugin's jar (or shadowJar if present) will be used automatically.
40+
minecraftVersion("1.16.5")
41+
}
42+
}
43+
44+
def targetJavaVersion = 8
45+
java {
46+
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
47+
sourceCompatibility = javaVersion
48+
targetCompatibility = javaVersion
49+
if (JavaVersion.current() < javaVersion) {
50+
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
51+
}
52+
}
53+
54+
tasks.withType(JavaCompile).configureEach {
55+
options.encoding = 'UTF-8'
56+
57+
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
58+
options.release.set(targetJavaVersion)
59+
}
60+
}
61+
62+
processResources {
63+
def props = [version: version, api_mc_ver: api_mc_ver]
64+
inputs.properties props
65+
filteringCharset 'UTF-8'
66+
filesMatching('plugin.yml') {
67+
expand props
68+
}
69+
}

gradle.properties

Whitespace-only changes.

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)