mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 02:57:39 +01:00
Merge branch 'master' of github.com:CitizensDev/Citizens2
This commit is contained in:
commit
35fe1c5c93
@ -41,6 +41,9 @@ public class BossBarTrait extends Trait {
|
||||
if (!npc.isSpawned() || !isBoss(npc.getEntity()))
|
||||
return;
|
||||
BossBar bar = NMSImpl.getBossBar(npc.getEntity());
|
||||
if (bar == null) {
|
||||
return;
|
||||
}
|
||||
bar.setVisible(visible);
|
||||
if (color != null) {
|
||||
bar.setColor(color);
|
||||
|
@ -1460,7 +1460,11 @@ public class NMSImpl implements NMSBridge {
|
||||
if (entity.getType() == EntityType.WITHER) {
|
||||
bserver = ((EntityWither) NMSImpl.getHandle(entity)).bossBattle;
|
||||
} else if (entity.getType() == EntityType.ENDER_DRAGON) {
|
||||
bserver = ((EnderDragonBattle) ENDERDRAGON_BATTLE_FIELD.invoke(NMSImpl.getHandle(entity))).bossBattle;
|
||||
Object battleObject = ENDERDRAGON_BATTLE_FIELD.invoke(NMSImpl.getHandle(entity));
|
||||
if (battleObject == null) {
|
||||
return null;
|
||||
}
|
||||
bserver = ((EnderDragonBattle) battleObject).bossBattle;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user