mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-27 19:09:17 +00:00
Continued development
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user