Skip to content

Commit e2d756d

Browse files
committed
Revert "initial commit"
This reverts commit 548369f.
1 parent 548369f commit e2d756d

File tree

19 files changed

+470
-141
lines changed

19 files changed

+470
-141
lines changed

.idea/BossBarAPI.iml

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

.idea/ClassicCore.iml

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

.idea/compiler.xml

+2-2
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.

.idea/modules.xml

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

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
# ClassicCore
2-
A plugin made for BnogoCarft's Classic Factions gamemode
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

pom.xml

+63-9
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>games.bnogocarft</groupId>
8-
<artifactId>ClassicCore</artifactId>
7+
<groupId>tech.nully</groupId>
8+
<artifactId>BossBarAPI</artifactId>
99
<version>0.0.1</version>
1010

1111
<properties>
@@ -22,23 +22,77 @@
2222
</repository>
2323
</repositories>
2424
<dependencies>
25+
<!-- PrimCore dependencies -->
2526
<dependency>
2627
<groupId>com.github.EaglerMaven</groupId>
27-
<artifactId>craftbukkit</artifactId>
28-
<version>1.5.2-R1.0</version>
29-
<scope>provided</scope>
28+
<artifactId>PacketWrapper</artifactId>
29+
<version>1.5.2</version>
30+
<scope>compile</scope>
3031
</dependency>
3132
<dependency>
3233
<groupId>com.github.EaglerMaven</groupId>
33-
<artifactId>Factions</artifactId>
34-
<version>2.0.1</version>
34+
<artifactId>ProtocolLib</artifactId>
35+
<version>3.6.4</version>
3536
<scope>provided</scope>
3637
</dependency>
3738
<dependency>
3839
<groupId>com.github.EaglerMaven</groupId>
39-
<artifactId>MassiveCore</artifactId>
40-
<version>6.4.1</version>
40+
<artifactId>craftbukkit</artifactId>
41+
<version>1.5.2-R1.0</version>
4142
<scope>provided</scope>
4243
</dependency>
4344
</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+
4498
</project>

src/main/java/games/bnogocarft/ClassicCore/ChatListener.java

-79
This file was deleted.

src/main/java/games/bnogocarft/ClassicCore/Main.java

-29
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package tech.nully.BossBarAPI;
2+
3+
import com.comphenix.protocol.ProtocolLibrary;
4+
import org.bukkit.Bukkit;
5+
import org.bukkit.Location;
6+
import org.bukkit.entity.Player;
7+
8+
public class BossBar {
9+
private int bossHealth = 200;
10+
private String text = "A BossBar!";
11+
12+
private SpawnFakeWither.FakeWither dragon;
13+
14+
private Player p;
15+
16+
public BossBar(Player p) {
17+
this.p = p;
18+
}
19+
20+
public int getHealth() {
21+
return bossHealth;
22+
}
23+
24+
private TeleportScheduler t;
25+
26+
public void setHealth(int bossHealth) {
27+
this.bossHealth = bossHealth;
28+
if (dragon != null) {
29+
if (dragon.created) {
30+
dragon.setHealth(bossHealth);
31+
}
32+
}
33+
}
34+
35+
public String getText() {
36+
return text;
37+
}
38+
39+
public void setText(String text) {
40+
this.text = text;
41+
if (dragon != null) {
42+
if (dragon.created) {
43+
dragon.setCustomName(text);
44+
}
45+
}
46+
}
47+
48+
public void display() {
49+
if (dragon != null) {
50+
if (dragon.created) {
51+
dragon.destroy();
52+
}
53+
}
54+
dragon = new SpawnFakeWither.FakeWither(p, ProtocolLibrary.getProtocolManager());
55+
dragon.setCustomName(text);
56+
dragon.create();
57+
58+
t = new TeleportScheduler(this);
59+
Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), t, 100);
60+
}
61+
62+
public void delete() {
63+
if (dragon != null) {
64+
if (dragon.created) {
65+
if (t != null) {
66+
t.cancel();
67+
}
68+
dragon.destroy();
69+
}
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)