Archived
0

public variable to enum in TitlePacket

This commit is contained in:
2018-08-12 19:42:56 +03:00
parent b811653795
commit 7b61aa7707
2 changed files with 26 additions and 18 deletions

View File

@@ -41,26 +41,26 @@ public class WrapperNetChannel implements NetChannel {
@Override
public void sendTitle(Title title) {
Text text = title.getTitle();
if (text != null) write(new TitlePacket(TitlePacket.SET_TITLE, text));
if (text != null) write(new TitlePacket(TitlePacket.Action.SET_TITLE, text));
text = title.getSubtitle();
if (text != null) write(new TitlePacket(TitlePacket.SET_SUBTITLE, text));
if (text != null) write(new TitlePacket(TitlePacket.Action.SET_SUBTITLE, text));
text = title.getTextActionBar();
if (text != null) write(new TitlePacket(TitlePacket.SET_ACTION_BAR, text));
if (text != null) write(new TitlePacket(TitlePacket.Action.SET_ACTION_BAR, text));
Integer fadeIn = title.getFadeInTime();
Integer stay = title.getStayTime();
Integer fadeOut = title.getFadeOutTime();
if (fadeIn != null && stay != null && fadeOut != null) {
write(new TitlePacket(TitlePacket.SET_DISPLAY_TIME, fadeIn, stay, fadeOut));
write(new TitlePacket(TitlePacket.Action.SET_DISPLAY_TIME, fadeIn, stay, fadeOut));
}
Boolean bool = title.getHide();
if (bool != null && bool) write(new TitlePacket(TitlePacket.HIDE));
if (bool != null && bool) write(new TitlePacket(TitlePacket.Action.HIDE));
bool = title.getReset();
if (bool != null && bool) write(new TitlePacket(TitlePacket.RESET));
if (bool != null && bool) write(new TitlePacket(TitlePacket.Action.RESET));
flush();
}