@EventHandler
public void playerChangedWorldEvent(PlayerChangedWorldEvent event)
{
Player player = event.getPlayer();
PlayerGUIPage playerGUIContainer = PlayerData.getPlayerData(player).getPlayerGUIPage();
if(playerGUIContainer != null)
{
playerGUIContainer.destroy();
PlayerData.getPlayerData(player).setPlayerGUIPage(null);
PlayerData.getPlayerData(player).setPlayerPreviousGUIPage(null);
}
for(StationaryGUIDisplayContainer stationaryDisplay : holoGUI.getStationaryDisplays())
{
if(stationaryDisplay.playerInRange(player))
{
if(!stationaryDisplay.isDisplayingToPlayer(player))//player in range of display but not currently viewing the stationary gui, make gui visible
{
stationaryDisplay.display(player);
}
}
else if(stationaryDisplay.isDisplayingToPlayer(player))//player was viewing the stationary gui, but moved out of range. Remove the gui for that player
{
stationaryDisplay.destroy(player);
}
}
}
PlayerChangedWorldEventListener.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:HoloGUIApi
作者:
评论列表
文章目录