-
Notifications
You must be signed in to change notification settings - Fork 95
/
BossEventPacket.java
65 lines (60 loc) · 1.89 KB
/
BossEventPacket.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.nukkitx.protocol.bedrock.packet;
import com.nukkitx.protocol.bedrock.BedrockPacket;
import com.nukkitx.protocol.bedrock.BedrockPacketType;
import com.nukkitx.protocol.bedrock.handler.BedrockPacketHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(doNotUseGetters = true, callSuper = false)
public class BossEventPacket extends BedrockPacket {
private long bossUniqueEntityId;
private Action action;
private long playerUniqueEntityId;
private String title;
private float healthPercentage;
private int darkenSky;
private int color;
private int overlay;
@Override
public final boolean handle(BedrockPacketHandler handler) {
return handler.handle(this);
}
public BedrockPacketType getPacketType() {
return BedrockPacketType.BOSS_EVENT;
}
public enum Action {
/**
* Creates the bossbar to the player.
*/
CREATE,
/**
* Registers a player to a boss fight.
*/
REGISTER_PLAYER,
/**
* Removes the bossbar from the client.
*/
REMOVE,
/**
* Unregisters a player from a boss fight.
*/
UNREGISTER_PLAYER,
/**
* Appears not to be implemented. Currently bar percentage only appears to change in response to the target entity's health.
*/
UPDATE_PERCENTAGE,
/**
* Also appears to not be implemented. Title clientside sticks as the target entity's nametag, or their entity transactionType name if not set.
*/
UPDATE_NAME,
/**
* Darken the sky when the boss bar is shown.
*/
UPDATE_PROPERTIES,
/**
* Not implemented :( Intended to alter bar appearance, but these currently produce no effect on clientside whatsoever.
*/
UPDATE_STYLE,
QUERY
}
}