2013-06-15 11:08:58 +00:00
package biomesoplenty.handlers ;
2013-06-14 13:17:48 +00:00
import java.util.EnumSet ;
import net.minecraft.entity.player.EntityPlayer ;
2013-09-26 02:16:33 +00:00
import biomesoplenty.handlers.versionhandlers.BOPModVersionHandler ;
2013-06-14 13:17:48 +00:00
import cpw.mods.fml.common.ITickHandler ;
import cpw.mods.fml.common.Loader ;
import cpw.mods.fml.common.TickType ;
public class TickHandlerClient implements ITickHandler
{
private boolean nagged ;
@Override
public void tickStart ( EnumSet < TickType > type , Object . . . tickData )
{
}
@Override
public void tickEnd ( EnumSet < TickType > type , Object . . . tickData )
{
if ( nagged )
return ;
EntityPlayer player = ( EntityPlayer ) tickData [ 0 ] ;
2013-09-26 02:16:33 +00:00
if ( BOPModVersionHandler . needsBOPWorldtypeAndMarkAsSeen ( player . worldObj ) )
2013-06-14 23:16:58 +00:00
{
2013-07-02 03:57:49 +00:00
player . addChatMessage ( String . format ( " \ u00A7cThe Biomes O Plenty world type must be used in order for the new biomes to generate. This message will only display once. " ) ) ;
2013-06-14 23:16:58 +00:00
}
2013-09-26 02:16:33 +00:00
if ( BOPModVersionHandler . needsUpdateNoticeAndMarkAsSeen ( ) )
2013-06-14 13:17:48 +00:00
{
2013-09-26 02:16:33 +00:00
player . addChatMessage ( String . format ( " \ u00A7cA new version of Biomes O Plenty is available: v%s for Minecraft %s " , BOPModVersionHandler . getRecommendedVersion ( ) , Loader . instance ( ) . getMinecraftModContainer ( ) . getVersion ( ) ) ) ;
2013-06-14 13:17:48 +00:00
}
nagged = true ;
}
@Override
public EnumSet < TickType > ticks ( )
{
return EnumSet . of ( TickType . PLAYER ) ;
}
@Override
public String getLabel ( )
{
return " BiomesOPlenty - Player update tick " ;
}
}