Merge pull request #1 from darverdevs/dev

Dev
This commit is contained in:
BongoCat 2022-07-16 16:54:17 -07:00 committed by GitHub
commit 683a57af8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 122 additions and 86 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -73,9 +73,9 @@
</dependency>
</dependencies>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

View File

@ -1,6 +1,7 @@
package tech.nully.BossBarAPI;
import com.comphenix.protocol.ProtocolLibrary;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -20,6 +21,8 @@ public class BossBar {
return bossHealth;
}
private TeleportScheduler t;
public void setHealth(int bossHealth) {
this.bossHealth = bossHealth;
if (dragon != null) {
@ -48,17 +51,20 @@ public class BossBar {
dragon.destroy();
}
}
dragon = new SpawnFakeWither.FakeWither(
new Location(p.getWorld(), p.getLocation().getX(), -15, p.getLocation().getZ()), ProtocolLibrary.getProtocolManager());
dragon = new SpawnFakeWither.FakeWither(p, ProtocolLibrary.getProtocolManager());
dragon.setCustomName(text);
dragon.setVisible(false);
dragon.create();
t = new TeleportScheduler(this);
Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), t, 100);
}
public void delete() {
if (dragon != null) {
if (dragon.created) {
dragon.destroy();
t.cancel();
}
}
}

View File

@ -0,0 +1,16 @@
package tech.nully.BossBarAPI;
import org.bukkit.scheduler.BukkitRunnable;
public class TeleportScheduler extends BukkitRunnable {
private BossBar b;
public TeleportScheduler(BossBar b) {
this.b = b;
}
@Override
public void run() {
b.display();
}
}

Binary file not shown.

BIN
target/BossBarAPI-0.0.1.jar Normal file

Binary file not shown.

View File

@ -1,3 +1,7 @@
tech\nully\BossBarAPI\FakeWitherCommand$1.class
tech\nully\BossBarAPI\BossBar.class
tech\nully\BossBarAPI\FakeWitherCommand.class
tech/nully/BossBarAPI/BossBar.class
tech/nully/BossBarAPI/Main.class
tech/nully/BossBarAPI/FakeWitherCommand$1.class
tech/nully/BossBarAPI/SpawnFakeWither.class
tech/nully/BossBarAPI/TeleportScheduler.class
tech/nully/BossBarAPI/FakeWitherCommand.class
tech/nully/BossBarAPI/SpawnFakeWither$FakeWither.class

Binary file not shown.