Skip to content

Commit b30788f

Browse files
added whisper on click, vanish hook and bStats
1 parent 7740cca commit b30788f

File tree

13 files changed

+627
-744
lines changed

13 files changed

+627
-744
lines changed

README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
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/)
55
[![release](https://github.com/zeroBzeroT/ChatCoPlus/actions/workflows/release.yml/badge.svg)](https://github.com/zeroBzeroT/ChatCoPlus/actions/workflows/release.yml)
6+
![repo size](https://img.shields.io/github/languages/code-size/zeroBzeroT/ChatCoPlus.svg?label=repo%20size)
7+
[![downloads](https://img.shields.io/github/downloads/zeroBzeroT/ChatCoPlus/total)](https://github.com/zeroBzeroT/ChatCoPlus/releases)
68

79
---
810

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.
11+
ChatCoPlus is a rebuild of the famous chat plugin ChatCo created by [jj20051](https://github.com/WiredTombstone), who is
12+
the founder and current owner of 9b9t.
1013

11-
**ChatCoPlus has the following features:**
14+
### Features
1215

1316
- Players can customize their chat message using various prefixes. As an example putting an '>' before a chat message
1417
will turn the text green (green-text). (Note: Does not change the color of player names).
@@ -18,74 +21,69 @@ ChatCoPlus is a fork of the famous chat plugin ChatCo created by [jj20051](https
1821
- Allows for a customizable spoiler text system (who wants to ruin the walking dead for everyone?).
1922
- Players can toggle chat on/off.
2023
- Full permission support so that you can limit who has access to what colors / features.
21-
- Allows the administrator to log whispers between players. (Could be against local law.)
24+
- Allows the administrator to log whispers between players. (This might be against local law.)
2225

23-
**Popular servers known or thought to be running this plugin:**
26+
### Popular servers running this plugin
2427

28+
- 0b0t.org
29+
- 2b2t.net
2530
- 9b9t.com
2631
- Anarchy.pw
27-
- 2b2t.net
28-
- 0b0t.org
2932

30-
**ADMINISTRATIVE COMMANDS (only console input is accepted):**
33+
### Administrative commands
3134

32-
Every single admin command goes by the format "/chatco {component} {e|d}" where 'e' enables and 'd' disables, e.g. typing "/chatco
33-
whisperlog e" in the console will enable whisper logging. You will have to reload the plugin in order to make most of the
35+
Every single admin command goes by the format "/chatco {component} {e|d}" where 'e' enables and 'd' disables, e.g.
36+
typing "/chatco
37+
whisperlog e" in the console will enable whisper logging. You will have to reload the plugin in order to make most of
38+
the
3439
changes take effect.
3540

36-
**Components:**
41+
### Components
3742

3843
- **spoilers** - enables or disables spoilers, is **disabled** by default.
3944
- **whispers** - enables or disables whisper changes, is **enabled** by default.
4045
- **newcommands** - enables or disables new whisper commands, is **enabled** by default.
41-
- **whisperlog** - enables or disables whisper logging (whisper logs are saved in /ChatCo/whisperlog.txt), is **disabled**
46+
- **whisperlog** - enables or disables whisper logging (whisper logs are saved in /ChatCo/whisperlog.txt), is **
47+
disabled**
4248
by default.)
4349

44-
**Player Commands:**
50+
### Player Commands
4551

4652
- **/ignore {player}** - ignores or un-ignores the player.
4753
- **/ignorelist** - prints all ignored players.
4854
- **/unignoreall** - clears ignore list
4955
- **/togglechat** - disables regular chatting for the player - NOT PERSISTENT.
5056
- **/toggletells** - disables tells for the player - NOT PERSISTENT,
5157

52-
**Whisper Related Player Commands:**
58+
### Whisper Related Player Commands
5359

5460
- **/r** and **/reply** - replies to the last person who sent you a whisper this session.
5561
- **/l** and **/last** - replies to the last person you sent a whisper to
5662

57-
**Config**\
58-
Color codes and prefixes can be disabled by replacing the contents of "" with "!#" e.g. Green: "!#".\
59-
Usage of color codes and prefixes can be restricted by using permissions.\
63+
### Config
64+
65+
Color codes and prefixes can be disabled by replacing the contents with NULL e.g. GREEN: NULL.
66+
Usage of color codes and prefixes can be restricted by using permissions.
6067
You can customize the appearance of whispers.
6168

62-
**Examples:**
69+
### Examples
6370

6471
- Turn chat off/on with /togglechat.
6572
- Write > at the start of a message for green-text.
6673
- Write [SPOILER]text[/SPOILER] to make a spoiler.
6774
- Write /show spoiler [1-5] to view spoilers.
6875

69-
**Planned Features:**
76+
### Planned Features
7077

71-
- Use UUIDs for ignore lists (and convert old ones)
72-
- Remove redundant code
7378
- Fully Async Chat
74-
- Groups
75-
- Customizable Death Messages
76-
- Last time a player was seen online
7779

78-
**Minecraft Versions (Confirmed Working):**
80+
### Tested Minecraft Versions
7981

8082
- 1.12.2
81-
- 1.11.2
82-
- 1.11.0
83-
- 1.10
84-
- 1.9
85-
- 1.8
86-
87-
**Git Release Creation**
88-
```sh
83+
84+
### Git Release Creation
85+
86+
```bash
8987
git tag <tag_name>
9088
git push origin <tag_name>
9189
```

pom.xml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
<groupId>org.zeroBzeroT.chatCo</groupId>
77
<artifactId>ChatCoPlus</artifactId>
8-
<version>0.27.1</version>
8+
<version>0.27.2</version>
99
<packaging>jar</packaging>
1010
<name>${project.artifactId}</name>
11-
<description>An efficient chat system with green-text, ignore, whispers and chat logging.</description>
11+
12+
<description>An efficient chat system with colored text, ignore list, whispering and chat logging.</description>
1213

1314
<properties>
1415
<java.version>1.8</java.version>
@@ -18,6 +19,7 @@
1819
</properties>
1920

2021
<build>
22+
<defaultGoal>clean package</defaultGoal>
2123
<plugins>
2224
<plugin>
2325
<groupId>org.apache.maven.plugins</groupId>
@@ -46,7 +48,19 @@
4648
<artifactId>maven-shade-plugin</artifactId>
4749
<version>3.3.0</version>
4850
<configuration>
51+
<relocations>
52+
<relocation>
53+
<pattern>org.bstats</pattern>
54+
<shadedPattern>org.zeroBzeroT.bstats</shadedPattern>
55+
</relocation>
56+
</relocations>
4957
<filters>
58+
<filter>
59+
<artifact>org.bstats:*</artifact>
60+
<excludes>
61+
<exclude>META-INF/*.MF</exclude>
62+
</excludes>
63+
</filter>
5064
<filter>
5165
<excludes>
5266
<exclude>META-INF/**</exclude>
@@ -81,6 +95,11 @@
8195
<id>spigot-repo</id>
8296
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
8397
</repository>
98+
<repository>
99+
<id>codemc-repo</id>
100+
<url>https://repo.codemc.org/repository/maven-public/</url>
101+
<layout>default</layout>
102+
</repository>
84103
</repositories>
85104

86105
<dependencies>
@@ -103,5 +122,11 @@
103122
<version>2.0.9</version>
104123
<scope>test</scope>
105124
</dependency>
125+
<dependency>
126+
<groupId>org.bstats</groupId>
127+
<artifactId>bstats-bukkit</artifactId>
128+
<version>3.0.0</version>
129+
<scope>compile</scope>
130+
</dependency>
106131
</dependencies>
107132
</project>

src/main/java/org/zeroBzeroT/chatCo/ChatPlayer.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.zeroBzeroT.chatCo;
22

33
import org.bukkit.Bukkit;
4+
import org.bukkit.entity.Player;
45

56
import java.io.*;
67
import java.util.ArrayList;
78
import java.util.List;
89
import java.util.UUID;
910

1011
public class ChatPlayer {
11-
public final org.bukkit.entity.Player player;
12-
public final String playerName;
12+
public final Player player;
1313
public final UUID playerUUID;
1414
public boolean chatDisabled;
1515
public boolean tellsDisabled;
@@ -18,20 +18,21 @@ public class ChatPlayer {
1818
private File IgnoreList;
1919
private List<String> ignores;
2020

21-
public ChatPlayer(final org.bukkit.entity.Player p) throws IOException {
21+
public ChatPlayer(final Player p) throws IOException {
2222
player = p;
23-
playerName = p.getName();
2423
playerUUID = p.getUniqueId();
2524
chatDisabled = false;
2625
tellsDisabled = false;
2726
LastMessenger = null;
2827
LastReceiver = null;
29-
saveIgnoreList(""); // "" means only create the file
28+
29+
// create the ignore-list
30+
saveIgnoreList("");
3031
}
3132

3233
@SuppressWarnings("ResultOfMethodCallIgnored")
3334
public void saveIgnoreList(final String p) throws IOException {
34-
File oldIgnores = new File(Main.dataFolder, "/ignorelists/" + this.playerName + ".txt");
35+
File oldIgnores = new File(Main.dataFolder, "/ignorelists/" + this.player.getName() + ".txt");
3536
this.IgnoreList = new File(Main.dataFolder, "/ignorelists/" + this.playerUUID + ".txt");
3637

3738
if (oldIgnores.exists()) {
@@ -79,27 +80,27 @@ public void unIgnoreAll() throws IOException {
7980
this.updateIgnoreList();
8081
}
8182

82-
public org.bukkit.entity.Player getLastMessenger() {
83+
public Player getLastMessenger() {
8384
if (this.LastMessenger != null) {
8485
return Bukkit.getPlayerExact(this.LastMessenger);
8586
}
8687

8788
return null;
8889
}
8990

90-
public void setLastMessenger(final org.bukkit.entity.Player sender) {
91+
public void setLastMessenger(final Player sender) {
9192
this.LastMessenger = sender.getName();
9293
}
9394

94-
public org.bukkit.entity.Player getLastReceiver() {
95+
public Player getLastReceiver() {
9596
if (this.LastReceiver != null) {
9697
return Bukkit.getPlayerExact(this.LastReceiver);
9798
}
9899

99100
return null;
100101
}
101102

102-
public void setLastReceiver(final org.bukkit.entity.Player sender) {
103+
public void setLastReceiver(final Player sender) {
103104
this.LastReceiver = sender.getName();
104105
}
105106

0 commit comments

Comments
 (0)