9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-27 19:09:17 +00:00

Continued development

This commit is contained in:
Auxilor
2020-12-08 19:50:38 +00:00
parent 733cd22c29
commit 4baae80598
40 changed files with 430 additions and 1102 deletions

View File

@@ -6,5 +6,5 @@ import org.bukkit.Location;
* NMS Interface for managing illusioner bosses
*/
public interface IllusionerWrapper {
EntityIllusionerWrapper spawn(Location location, double maxHealth, double attackDamage);
EntityIllusionerWrapper spawn(Location location, double maxHealth, double attackDamage, String name);
}

View File

@@ -15,8 +15,11 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
public class EntityIllusioner extends EntityIllagerIllusioner implements EntityIllusionerWrapper {
public EntityIllusioner(Location location, double maxHealth, double attackDamage) {
private final String displayName;
public EntityIllusioner(Location location, double maxHealth, double attackDamage, String name) {
super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle());
this.displayName = name;
this.setPosition(location.getX(), location.getY(), location.getZ());
@@ -43,7 +46,7 @@ public class EntityIllusioner extends EntityIllagerIllusioner implements EntityI
@Override
public void createBossbar(Plugin plugin, BarColor color, BarStyle style) {
String name = this.getName();
String name = this.getDisplayName().getText();
BossBar bossBar = Bukkit.getServer().createBossBar(name, color, style, (BarFlag) null);
Bukkit.getServer().getOnlinePlayers().forEach(bossBar::addPlayer);
LivingEntity entity = (LivingEntity) this.getBukkitEntity();

View File

@@ -7,8 +7,8 @@ import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
public class Illusioner implements IllusionerWrapper {
@Override
public EntityIllusionerWrapper spawn(Location location, double maxHealth, double attackDamage) {
EntityIllusioner illusioner = new EntityIllusioner(location, maxHealth, attackDamage);
public EntityIllusionerWrapper spawn(Location location, double maxHealth, double attackDamage, String name) {
EntityIllusioner illusioner = new EntityIllusioner(location, maxHealth, attackDamage, name);
((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner);
return illusioner;
}