@@ -97,13 +97,13 @@ public class CraftBossBar implements BossBar {
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return CraftChatMessage.fromComponent(handle.title);
|
||||
return CraftChatMessage.fromComponent(handle.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(String title) {
|
||||
handle.title = CraftChatMessage.fromString(title, true)[0];
|
||||
handle.sendUpdate(PacketPlayOutBoss.Action.UPDATE_NAME);
|
||||
handle.name = CraftChatMessage.fromString(title, true)[0];
|
||||
handle.sendUpdate(PacketPlayOutBoss::createUpdateNamePacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,18 +114,18 @@ public class CraftBossBar implements BossBar {
|
||||
@Override
|
||||
public void setColor(BarColor color) {
|
||||
handle.color = convertColor(color);
|
||||
handle.sendUpdate(PacketPlayOutBoss.Action.UPDATE_STYLE);
|
||||
handle.sendUpdate(PacketPlayOutBoss::createUpdatePropertiesPacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarStyle getStyle() {
|
||||
return convertStyle(handle.style);
|
||||
return convertStyle(handle.overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStyle(BarStyle style) {
|
||||
handle.style = convertStyle(style);
|
||||
handle.sendUpdate(PacketPlayOutBoss.Action.UPDATE_STYLE);
|
||||
handle.overlay = convertStyle(style);
|
||||
handle.sendUpdate(PacketPlayOutBoss::createUpdatePropertiesPacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,7 +167,7 @@ public class CraftBossBar implements BossBar {
|
||||
@Override
|
||||
public void addPlayer(Player player) {
|
||||
Preconditions.checkArgument(player != null, "player == null");
|
||||
Preconditions.checkArgument(((CraftPlayer) player).getHandle().playerConnection != null, "player is not fully connected (wait for PlayerJoinEvent)");
|
||||
Preconditions.checkArgument(((CraftPlayer) player).getHandle().connection != null, "player is not fully connected (wait for PlayerJoinEvent)");
|
||||
|
||||
handle.addPlayer(((CraftPlayer) player).getHandle());
|
||||
}
|
||||
|
||||
@@ -20,27 +20,27 @@ public class CraftDragonBattle implements DragonBattle {
|
||||
|
||||
@Override
|
||||
public EnderDragon getEnderDragon() {
|
||||
Entity entity = handle.world.getEntity(handle.dragonUUID);
|
||||
Entity entity = handle.level.getEntity(handle.dragonUUID);
|
||||
return (entity != null) ? (EnderDragon) entity.getBukkitEntity() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BossBar getBossBar() {
|
||||
return new CraftBossBar(handle.bossBattle);
|
||||
return new CraftBossBar(handle.dragonEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getEndPortalLocation() {
|
||||
if (handle.exitPortalLocation == null) {
|
||||
if (handle.portalLocation == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Location(handle.world.getWorld(), handle.exitPortalLocation.getX(), handle.exitPortalLocation.getY(), handle.exitPortalLocation.getZ());
|
||||
return new Location(handle.level.getWorld(), handle.portalLocation.getX(), handle.portalLocation.getY(), handle.portalLocation.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateEndPortal(boolean withPortals) {
|
||||
if (handle.exitPortalLocation != null || handle.getExitPortalShape() != null) {
|
||||
if (handle.portalLocation != null || handle.getExitPortalShape() != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,14 +60,14 @@ public class CraftDragonBattle implements DragonBattle {
|
||||
|
||||
@Override
|
||||
public RespawnPhase getRespawnPhase() {
|
||||
return toBukkitRespawnPhase(handle.respawnPhase);
|
||||
return toBukkitRespawnPhase(handle.respawnStage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setRespawnPhase(RespawnPhase phase) {
|
||||
Preconditions.checkArgument(phase != null && phase != RespawnPhase.NONE, "Invalid respawn phase provided: %s", phase);
|
||||
|
||||
if (handle.respawnPhase == null) {
|
||||
if (handle.respawnStage == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user