Skip to content

Commit b16c1d4

Browse files
uuids for ignorelists (names still inside for speedup)
1 parent 4acbba9 commit b16c1d4

File tree

12 files changed

+191
-130
lines changed

12 files changed

+191
-130
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
version: 2
22
updates:
3+
34
- package-ecosystem: "maven"
45
directory: "/"
56
schedule:
@@ -13,3 +14,17 @@ updates:
1314
commit-message:
1415
prefix: "maven"
1516
include: "scope"
17+
18+
- package-ecosystem: "github-actions"
19+
directory: "/"
20+
schedule:
21+
interval: "daily"
22+
time: "12:00"
23+
timezone: "Europe/Berlin"
24+
assignees:
25+
- "bierdosenhalter"
26+
reviewers:
27+
- "bierdosenhalter"
28+
commit-message:
29+
prefix: "github-actions"
30+
include: "scope"

.github/workflows/release.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,40 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212

13-
- name: Checkout changes
14-
uses: actions/checkout@v2
13+
- name: Git
14+
uses: actions/checkout@v3
1515

16-
- name: Get commit info
17-
run: echo "SHA=$GITHUB_SHA" >> $GITHUB_ENV
16+
- name: Java
17+
uses: actions/[email protected]
18+
with:
19+
distribution: 'adopt'
20+
java-version: '8'
1821

19-
- name: Prepare release
22+
- name: Cache
23+
uses: actions/[email protected]
24+
with:
25+
path: ~/.m2
26+
key: '${{ runner.os }}-m2-${{ hashFiles(''**/pom.xml'') }}'
27+
restore-keys: '${{ runner.os }}-m2'
28+
29+
- name: Package
30+
run: mvn --batch-mode --show-version --errors package --file pom.xml
31+
32+
- name: Draft
2033
id: create_release
2134
uses: actions/create-release@v1
2235
env:
2336
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2437
with:
2538
tag_name: ${{ github.ref }}
2639
release_name: ${{ github.ref }}
27-
body: |
28-
Minecraft 1.12.2
29-
Automated release at commit ${{ env.SHA }}
40+
body: 'automated release at commit ${{ github.sha }}'
3041
draft: false
3142
prerelease: false
3243

33-
- name: Prepare Java 1.8
34-
uses: actions/setup-java@v1
35-
with:
36-
java-version: 1.8
37-
38-
- name: Prepare dependency cache
39-
uses: actions/cache@v2
40-
with:
41-
path: ~/.m2
42-
key: '${{ runner.os }}-m2-${{ hashFiles(''**/pom.xml'') }}'
43-
restore-keys: '${{ runner.os }}-m2'
44-
45-
- name: Maven package
46-
run: mvn --batch-mode --show-version --errors package --file pom.xml
47-
48-
- name: upload release asset
44+
- name: Release
4945
uses: csexton/release-asset-action@v2
5046
with:
51-
pattern: "target/*.jar"
47+
pattern: "target/ChatCoPlus-*.jar"
5248
github-token: ${{ secrets.GITHUB_TOKEN }}
53-
release-url: ${{ steps.create_release.outputs.upload_url }}
49+
release-url: ${{ steps.create_release.outputs.upload_url }}

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# ChatCo
1+
# ChatCoPlus
22

33
[![discord](https://img.shields.io/discord/843551077759844362?logo=discord)](https://discord.gg/7tW8ZAtGr5)
44
[![reddit](https://img.shields.io/reddit/subreddit-subscribers/0b0t)](https://old.reddit.com/r/0b0t/)
5-
[![release](https://github.com/zeroBzeroT/ChatCo/actions/workflows/release.yml/badge.svg)](https://github.com/zeroBzeroT/ChatCo/actions/workflows/release.yml)
5+
[![release](https://github.com/zeroBzeroT/ChatCoPlus/actions/workflows/release.yml/badge.svg)](https://github.com/zeroBzeroT/ChatCoPlus/actions/workflows/release.yml)
66

77
---
88

9-
**ChatCo is a simple chat plugin which has the following features:**
9+
ChatCoPlus is a fork of the famous chat plugin ChatCo created by [jj20051](https://github.com/WiredTombstone), who is the founder and current owner of 9b9t.
10+
11+
**ChatCoPlus has the following features:**
1012

1113
- Players can customize their chat message using various prefixes. As an example putting an '>' before a chat message
1214
will turn the text green (green-text). (Note: Does not change the color of player names).
@@ -16,7 +18,7 @@
1618
- Allows for a customizable spoiler text system (who wants to ruin the walking dead for everyone?).
1719
- Players can toggle chat on/off.
1820
- Full permission support so that you can limit who has access to what colors / features.
19-
- Allows the administrator to log whispers between players. (Could be against EU law.)
21+
- Allows the administrator to log whispers between players. (Could be against local law.)
2022

2123
**Popular servers known or thought to be running this plugin:**
2224

@@ -69,9 +71,9 @@ You can customize the appearance of whispers.
6971
- Use UUIDs for ignore lists (and convert old ones)
7072
- Remove redundant code
7173
- Fully Async Chat
72-
- Groups?
74+
- Groups
7375
- Customizable Death Messages
74-
- Last time a player was seen online?
76+
- Last time a player was seen online
7577

7678
**Minecraft Versions (Confirmed Working):**
7779

pom.xml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54
<modelVersion>4.0.0</modelVersion>
65

7-
<groupId>com.gmail.fyrvelm.chatco</groupId>
8-
<artifactId>ChatCo</artifactId>
9-
<version>0.26</version>
6+
<groupId>org.zeroBzeroT.chatCo</groupId>
7+
<artifactId>ChatCoPlus</artifactId>
8+
<version>0.27.0</version>
109
<packaging>jar</packaging>
11-
12-
<name>ChatCo</name>
10+
<name>${project.artifactId}</name>
11+
<description>An efficient chat system with green-text, ignore, whispers and chat logging.</description>
1312

1413
<properties>
1514
<java.version>1.8</java.version>
15+
<maven.compiler.source>${java.version}</maven.compiler.source>
16+
<maven.compiler.target>${java.version}</maven.compiler.target>
1617
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1718
</properties>
1819

19-
<description>An efficient chat system with green-text, ignore, whispers and chat logging.</description>
20-
2120
<build>
2221
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-jar-plugin</artifactId>
25+
<version>3.2.2</version>
26+
<configuration>
27+
<archive>
28+
<addMavenDescriptor>false</addMavenDescriptor>
29+
<manifestEntries>
30+
<Built-By>bierdosenhalter</Built-By>
31+
</manifestEntries>
32+
</archive>
33+
</configuration>
34+
</plugin>
2335
<plugin>
2436
<groupId>org.apache.maven.plugins</groupId>
2537
<artifactId>maven-compiler-plugin</artifactId>
@@ -33,6 +45,15 @@
3345
<groupId>org.apache.maven.plugins</groupId>
3446
<artifactId>maven-shade-plugin</artifactId>
3547
<version>3.3.0</version>
48+
<configuration>
49+
<filters>
50+
<filter>
51+
<excludes>
52+
<exclude>META-INF/**</exclude>
53+
</excludes>
54+
</filter>
55+
</filters>
56+
</configuration>
3657
<executions>
3758
<execution>
3859
<phase>package</phase>
@@ -70,5 +91,17 @@
7091
<version>1.12.2-R0.1-SNAPSHOT</version>
7192
<scope>provided</scope>
7293
</dependency>
94+
<dependency>
95+
<groupId>org.powermock</groupId>
96+
<artifactId>powermock-module-junit4</artifactId>
97+
<version>2.0.9</version>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.powermock</groupId>
102+
<artifactId>powermock-api-mockito2</artifactId>
103+
<version>2.0.9</version>
104+
<scope>test</scope>
105+
</dependency>
73106
</dependencies>
74107
</project>

src/main/java/com/gmail/fyrvelm/chatco/CCPlayer.java renamed to src/main/java/org/zeroBzeroT/chatCo/ChatPlayer.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
package com.gmail.fyrvelm.chatco;
1+
package org.zeroBzeroT.chatCo;
22

33
import org.bukkit.Bukkit;
4-
import org.bukkit.entity.Player;
54

65
import java.io.*;
76
import java.util.ArrayList;
87
import java.util.List;
8+
import java.util.UUID;
99

10-
public class CCPlayer {
11-
public final Player player;
10+
public class ChatPlayer {
11+
public final org.bukkit.entity.Player player;
1212
public final String playerName;
13+
public final UUID playerUUID;
1314
public boolean chatDisabled;
1415
public boolean tellsDisabled;
1516
public String LastMessenger;
1617
public String LastReceiver;
1718
private File IgnoreList;
1819
private List<String> ignores;
1920

20-
public CCPlayer(final Player p, final String pN) throws IOException {
21+
public ChatPlayer(final org.bukkit.entity.Player p) throws IOException {
2122
player = p;
22-
playerName = pN;
23+
playerName = p.getName();
24+
playerUUID = p.getUniqueId();
2325
chatDisabled = false;
2426
tellsDisabled = false;
2527
LastMessenger = null;
@@ -29,7 +31,12 @@ public CCPlayer(final Player p, final String pN) throws IOException {
2931

3032
@SuppressWarnings("ResultOfMethodCallIgnored")
3133
public void saveIgnoreList(final String p) throws IOException {
32-
this.IgnoreList = new File(ChatCo.dataFolder, "/ignorelists/" + this.playerName + ".txt");
34+
File oldIgnores = new File(Main.dataFolder, "/ignorelists/" + this.playerName + ".txt");
35+
this.IgnoreList = new File(Main.dataFolder, "/ignorelists/" + this.playerUUID + ".txt");
36+
37+
if (oldIgnores.exists()) {
38+
oldIgnores.renameTo(this.IgnoreList);
39+
}
3340

3441
if (!this.IgnoreList.exists()) {
3542
this.IgnoreList.getParentFile().mkdir();
@@ -72,31 +79,30 @@ public void unIgnoreAll() throws IOException {
7279
this.updateIgnoreList();
7380
}
7481

75-
public Player getLastMessenger() {
82+
public org.bukkit.entity.Player getLastMessenger() {
7683
if (this.LastMessenger != null) {
7784
return Bukkit.getPlayerExact(this.LastMessenger);
7885
}
7986

8087
return null;
8188
}
8289

83-
public void setLastMessenger(final Player sender) {
90+
public void setLastMessenger(final org.bukkit.entity.Player sender) {
8491
this.LastMessenger = sender.getName();
8592
}
8693

87-
public Player getLastReceiver() {
94+
public org.bukkit.entity.Player getLastReceiver() {
8895
if (this.LastReceiver != null) {
8996
return Bukkit.getPlayerExact(this.LastReceiver);
9097
}
9198

9299
return null;
93100
}
94101

95-
public void setLastReceiver(final Player sender) {
102+
public void setLastReceiver(final org.bukkit.entity.Player sender) {
96103
this.LastReceiver = sender.getName();
97104
}
98105

99-
100106
private void updateIgnoreList() throws IOException {
101107
final FileInputStream file = new FileInputStream(this.IgnoreList);
102108
final InputStreamReader fileReader = new InputStreamReader(file);

0 commit comments

Comments
 (0)