HudManager.java
package com.hypixel.hytale.server.core.entity.entities.player.hud;
import com.hypixel.hytale.protocol.packets.interface_.CustomHud;
import com.hypixel.hytale.protocol.packets.interface_.CustomUICommand;
import com.hypixel.hytale.protocol.packets.interface_.HudComponent;
import com.hypixel.hytale.protocol.packets.interface_.ResetUserInterfaceState;
import com.hypixel.hytale.protocol.packets.interface_.UpdateVisibleHudComponents;
import com.hypixel.hytale.server.core.io.PacketHandler;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class HudManager {
private static final Set<HudComponent> DEFAULT_HUD_COMPONENTS;
private final Set<HudComponent> visibleHudComponents = ConcurrentHashMap.newKeySet();
private final Set<HudComponent> unmodifiableVisibleHudComponents;
@Nullable
private CustomUIHud customHud;
public HudManager() {
this.unmodifiableVisibleHudComponents = Collections.unmodifiableSet(this.visibleHudComponents);
this.visibleHudComponents.addAll(DEFAULT_HUD_COMPONENTS);
}
{
.unmodifiableVisibleHudComponents = Collections.unmodifiableSet(.visibleHudComponents);
.customHud = other.customHud;
}
CustomUIHud {
.customHud;
}
Set<HudComponent> {
.unmodifiableVisibleHudComponents;
}
{
.visibleHudComponents.clear();
Collections.addAll(.visibleHudComponents, hudComponents);
.sendVisibleHudComponents(ref.getPacketHandler());
}
{
.visibleHudComponents.clear();
.visibleHudComponents.addAll(hudComponents);
.sendVisibleHudComponents(ref.getPacketHandler());
}
{
Collections.addAll(.visibleHudComponents, hudComponents);
.sendVisibleHudComponents(ref.getPacketHandler());
}
{
.visibleHudComponents.addAll(hudComponents);
.sendVisibleHudComponents(ref.getPacketHandler());
}
{
(HudComponent hudComponent : hudComponents) {
.visibleHudComponents.remove(hudComponent);
}
.sendVisibleHudComponents(ref.getPacketHandler());
}
{
.getCustomHud();
(oldHud != hud) {
.customHud = hud;
(hud == ) {
ref.getPacketHandler().writeNoCache( (, (CustomUICommand[])));
} {
hud.show();
}
}
}
{
.setVisibleHudComponents(ref, DEFAULT_HUD_COMPONENTS);
.setCustomHud(ref, (CustomUIHud));
}
{
ref.getPacketHandler().writeNoCache( ());
}
{
packetHandler.writeNoCache( ((HudComponent[]).visibleHudComponents.toArray((x$) -> [x$])));
}
String {
String.valueOf(.visibleHudComponents);
+ var10000 + + String.valueOf(.unmodifiableVisibleHudComponents) + + String.valueOf(.customHud) + ;
}
{
DEFAULT_HUD_COMPONENTS = Set.of(HudComponent.UtilitySlotSelector, HudComponent.BlockVariantSelector, HudComponent.StatusIcons, HudComponent.Hotbar, HudComponent.Chat, HudComponent.Notifications, HudComponent.KillFeed, HudComponent.InputBindings, HudComponent.Reticle, HudComponent.Compass, HudComponent.Speedometer, HudComponent.ObjectivePanel, HudComponent.PortalPanel, HudComponent.EventTitle, HudComponent.Stamina, HudComponent.AmmoIndicator, HudComponent.Health, HudComponent.Mana, HudComponent.Oxygen, HudComponent.BuilderToolsLegend, HudComponent.Sleep);
}
}