Skip to content

Commit 548369f

Browse files
committed
initial commit
1 parent 726bb82 commit 548369f

File tree

20 files changed

+141
-455
lines changed

20 files changed

+141
-455
lines changed

.idea/BossBarAPI.iml

-9
This file was deleted.

.idea/compiler.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/discord.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BossBarAPI.iml

-12
This file was deleted.

README.md

+2-35
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,2 @@
1-
# BossBarAPI
2-
Adds the ability to display BossBars to eaglercraft with an API
3-
## How to use:
4-
There is one default command that BossBarAPI comes with and that is /bossbar which creates a bossbar with the text "Countdown" and the bar slowly goes down
5-
6-
Here is a guide to the API:
7-
To create a BossBar do
8-
9-
```BossBar bar = new BossBar(player)```
10-
11-
This will create a bossbar instance but wont spawn in the bossbar itself to the player
12-
13-
To set the Bars health do
14-
15-
```bar.setBarHealth(int)```
16-
17-
To set the bar's text do:
18-
19-
```bar.setText(String)```
20-
21-
If these values are not set before the bossbar is displayed, they will default to 200 which is the bar's full health and "A Bossbar!"
22-
23-
there are also getters for these 2 methods
24-
25-
To display a bossbar, use
26-
27-
```bar.display()```
28-
29-
To delete the bossbar, do
30-
31-
```bar.delete```
32-
33-
There is also a `bar.getLocation` which returns the location of the Enderdragon but you will most likely never use this method
34-
35-
ok thanx byeee
1+
# ClassicCore
2+
A plugin made for BnogoCarft's Classic Factions gamemode

pom.xml

+9-63
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>tech.nully</groupId>
8-
<artifactId>BossBarAPI</artifactId>
7+
<groupId>games.bnogocarft</groupId>
8+
<artifactId>ClassicCore</artifactId>
99
<version>0.0.1</version>
1010

1111
<properties>
@@ -22,77 +22,23 @@
2222
</repository>
2323
</repositories>
2424
<dependencies>
25-
<!-- PrimCore dependencies -->
2625
<dependency>
2726
<groupId>com.github.EaglerMaven</groupId>
28-
<artifactId>PacketWrapper</artifactId>
29-
<version>1.5.2</version>
30-
<scope>compile</scope>
27+
<artifactId>craftbukkit</artifactId>
28+
<version>1.5.2-R1.0</version>
29+
<scope>provided</scope>
3130
</dependency>
3231
<dependency>
3332
<groupId>com.github.EaglerMaven</groupId>
34-
<artifactId>ProtocolLib</artifactId>
35-
<version>3.6.4</version>
33+
<artifactId>Factions</artifactId>
34+
<version>2.0.1</version>
3635
<scope>provided</scope>
3736
</dependency>
3837
<dependency>
3938
<groupId>com.github.EaglerMaven</groupId>
40-
<artifactId>craftbukkit</artifactId>
41-
<version>1.5.2-R1.0</version>
39+
<artifactId>MassiveCore</artifactId>
40+
<version>6.4.1</version>
4241
<scope>provided</scope>
4342
</dependency>
4443
</dependencies>
45-
46-
<build>
47-
<plugins>
48-
<plugin>
49-
<groupId>org.apache.maven.plugins</groupId>
50-
<artifactId>maven-compiler-plugin</artifactId>
51-
<version>3.8.0</version>
52-
<configuration>
53-
<source>1.8</source>
54-
<target>1.8</target>
55-
</configuration>
56-
</plugin>
57-
<plugin>
58-
<groupId>org.apache.maven.plugins</groupId>
59-
<artifactId>maven-jar-plugin</artifactId>
60-
<configuration>
61-
<archive>
62-
<manifestEntries>
63-
<Built-By/>
64-
</manifestEntries>
65-
</archive>
66-
</configuration>
67-
</plugin>
68-
<plugin>
69-
<groupId>org.apache.maven.plugins</groupId>
70-
<artifactId>maven-shade-plugin</artifactId>
71-
<version>3.2.4</version>
72-
<executions>
73-
<execution>
74-
<phase>package</phase>
75-
<goals>
76-
<goal>shade</goal>
77-
</goals>
78-
</execution>
79-
</executions>
80-
<configuration>
81-
<generateUniqueDependencyReducedPom>false</generateUniqueDependencyReducedPom>
82-
<filters>
83-
<filter>
84-
<artifact>*:*</artifact>
85-
<excludes>
86-
<exclude>META-INF/*.SF</exclude>
87-
<exclude>META-INF/*.DSA</exclude>
88-
<exclude>META-INF/*.RSA</exclude>
89-
</excludes>
90-
</filter>
91-
</filters>
92-
<minimizeJar>true</minimizeJar>
93-
</configuration>
94-
</plugin>
95-
</plugins>
96-
</build>
97-
9844
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package games.bnogocarft.ClassicCore;
2+
3+
import com.massivecraft.factions.entity.UPlayer;
4+
import org.bukkit.Bukkit;
5+
import org.bukkit.ChatColor;
6+
import org.bukkit.entity.Player;
7+
import org.bukkit.event.EventHandler;
8+
import org.bukkit.event.Listener;
9+
import org.bukkit.event.player.AsyncPlayerChatEvent;
10+
11+
import java.util.Arrays;
12+
import java.util.List;
13+
14+
public class ChatListener implements Listener {
15+
@EventHandler
16+
public void onPlayerChat(AsyncPlayerChatEvent e) {
17+
if (Main.onChatCD.contains(e.getPlayer())) {
18+
e.setCancelled(true);
19+
e.getPlayer().sendMessage(ChatColor.RED + "ey man chill out 1 message every 1.5 seconds thanks");
20+
return;
21+
}
22+
List<String> arrayMessage = Arrays.asList(e.getMessage().split(" "));
23+
for (String word : arrayMessage) {
24+
if (word.contains("nigger") ||
25+
word.contains("faggot") ||
26+
word.contains("cum") ||
27+
word.contains("fag") ||
28+
word.contains("nazi") ||
29+
word.contains("nig") ||
30+
word.contains("beaner") ||
31+
word.contains("niggers") ||
32+
word.contains("faggots") ||
33+
word.contains("fags") ||
34+
word.contains("nigga") ||
35+
word.contains("niggas") ||
36+
word.contains("faggotass") ||
37+
word.contains("n1gger") ||
38+
word.contains("n1g") ||
39+
word.contains("n1gga") ||
40+
word.contains("beaners")
41+
) {
42+
arrayMessage.set(arrayMessage.indexOf(word), word.replaceAll("[A-Za-z]", "#"));
43+
}
44+
}
45+
e.setMessage(String.join(" ", arrayMessage));
46+
47+
Player player = e.getPlayer();
48+
if (player.hasPermission("bnogorpg.chat.admin")) {
49+
e.setFormat("" + ChatColor.DARK_GRAY + '[' + ChatColor.DARK_RED + "Admin" + ChatColor.DARK_GRAY + "] " + ChatColor.DARK_RED + player.getName() + ChatColor.DARK_GRAY + "» " + ChatColor.WHITE + e.getMessage());
50+
return;
51+
}
52+
53+
if (player.hasPermission("bnogorpg.chat.mod")) {
54+
e.setFormat("" + ChatColor.DARK_GRAY + '[' + ChatColor.DARK_BLUE + "Mod" + ChatColor.DARK_GRAY + "] " + ChatColor.DARK_BLUE + player.getName() + ChatColor.DARK_GRAY + "» " + ChatColor.WHITE + e.getMessage());
55+
return;
56+
}
57+
58+
if (player.hasPermission("bnogorpg.chat.helper")) {
59+
e.setFormat("" + ChatColor.DARK_GRAY + '[' + ChatColor.BLUE + "Helper" + ChatColor.DARK_GRAY + ']' + ChatColor.GRAY + ' ' + UPlayer.get(player).getFaction().getName() + ' ' + ChatColor.GRAY + player.getName() + ChatColor.DARK_GRAY + "» " + ChatColor.GRAY + e.getMessage());
60+
Main.onChatCD.add(e.getPlayer());
61+
Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), new Runnable() {
62+
@Override
63+
public void run() {
64+
Main.onChatCD.remove(e.getPlayer());
65+
}
66+
}, 30L);
67+
return;
68+
}
69+
70+
e.setFormat(ChatColor.GRAY + UPlayer.get(player).getFaction().getName() + ' ' + ChatColor.GRAY + player.getName() + ChatColor.DARK_GRAY + "» " + ChatColor.GRAY + e.getMessage());
71+
Main.onChatCD.add(e.getPlayer());
72+
Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), new Runnable() {
73+
@Override
74+
public void run() {
75+
Main.onChatCD.remove(e.getPlayer());
76+
}
77+
}, 30L);
78+
}
79+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package games.bnogocarft.ClassicCore;
2+
3+
import org.bukkit.entity.Player;
4+
import org.bukkit.plugin.Plugin;
5+
import org.bukkit.plugin.java.JavaPlugin;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
10+
public class Main extends JavaPlugin {
11+
12+
private static Plugin instance;
13+
14+
public static Plugin getInstance() {
15+
return instance;
16+
}
17+
public static List<Player> onChatCD = new ArrayList<>();
18+
@Override
19+
public void onEnable() {
20+
instance = this;
21+
getServer().getPluginManager().registerEvents(new ChatListener(), this);
22+
}
23+
24+
// Overrides onDisable
25+
@Override
26+
public void onDisable() {
27+
28+
}
29+
}

src/main/java/tech/nully/BossBarAPI/BossBar.java

-72
This file was deleted.

0 commit comments

Comments
 (0)