當前位置: 首頁>>代碼示例>>Java>>正文


Java PlayerLoggedInEvent類代碼示例

本文整理匯總了Java中cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent的典型用法代碼示例。如果您正苦於以下問題:Java PlayerLoggedInEvent類的具體用法?Java PlayerLoggedInEvent怎麽用?Java PlayerLoggedInEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PlayerLoggedInEvent類屬於cpw.mods.fml.common.gameevent.PlayerEvent包,在下文中一共展示了PlayerLoggedInEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: login

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@Hack
@SubscribeEvent
public void login(PlayerLoggedInEvent e)
{
	if (e.player.worldObj.isRemote)
       {
           // do nothing on client
           return;
       }


	Collection<BloodStain> outStains = getStains(e.player.dimension);
	System.out.println("SENDING STAIONS: " + outStains.size());
	for (BloodStain stain : outStains)
	{
		PacketManager.sendToPlayer(new PacketCreateStain(stain), e.player);
       }
   }
 
開發者ID:Ubiquitous-Spice,項目名稱:ModJam-4,代碼行數:19,代碼來源:StainManager.java

示例2: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event)
{
    ChunkLoadingCallback.onPlayerLogin(event.player);

    if (event.player instanceof EntityPlayerMP)
    {
    	EntityPlayerMP thePlayer = (EntityPlayerMP) event.player;
    	GCPlayerStats stats = GCPlayerStats.get(thePlayer);
    	SpaceStationWorldData.checkAllStations(thePlayer, stats);
        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_SPACESTATION_CLIENT_ID, new Object[] { WorldUtil.spaceStationDataToString(stats.spaceStationDimensionData) }), thePlayer);
        SpaceRace raceForPlayer = SpaceRaceManager.getSpaceRaceFromPlayer(thePlayer.getGameProfile().getName());
        if (raceForPlayer != null) SpaceRaceManager.sendSpaceRaceData(thePlayer, raceForPlayer);
    }

    if (event.player.worldObj.provider instanceof WorldProviderOrbit && event.player instanceof EntityPlayerMP)
    {
        ((WorldProviderOrbit) event.player.worldObj.provider).sendPacketsToClient((EntityPlayerMP) event.player);
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:21,代碼來源:ConnectionEvents.java

示例3: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {

	event.player.addChatComponentMessage(new ChatComponentText("�b�lHello" + " " + "�e�l" + event.player.getDisplayName() + "�b�l!"));
	event.player.addChatComponentMessage(new ChatComponentText(/*/event.player.getDisplayName() + /*/"�a�l" + EpicProportionsMod.MODNAME + " " + "�2�lMade By:jtrent238"));
	event.player.addChatComponentMessage(new ChatComponentText(/*/event.player.getDisplayName() + /*/"�6�lYou are running" + "�b�l" + " " + EpicProportionsMod.MODVERSION + " " + "�6�lof" + "�6�l" + " " + EpicProportionsMod.MODNAME + "!"));
	//event.player.addChatComponentMessage(new ChatComponentText("�e�lLearn more at: �b�lhttp://bit.ly/FoodModWiki"));
	event.player.triggerAchievement(Achievements.achievementinstall);
	//event.player.addEntityCrashInfo(EpicProportionsMod.CRASHINFO);
	//event.player.clonePlayer(playerclone, true);
	event.player.extinguish();
	event.player.getDisplayName();
	//event.player.writeToNBT(EpicProportionsMod.NBTJOIN);
	event.player.getBedLocation();
	event.player.shouldHeal();
	event.getListenerList();
	event.hashCode();
	Minecraft.getSystemTime();
	Minecraft.isAmbientOcclusionEnabled();
	Minecraft.isGuiEnabled();
	Minecraft.getMinecraft();
	Minecraft.getGLMaximumTextureSize();
	Minecraft.isFancyGraphicsEnabled();
	//Log.getLog(arg0, arg1, arg2);
	//event.notifyAll();

	
}
 
開發者ID:jtrent238,項目名稱:PopularMMOS-EpicProportions-Mod,代碼行數:29,代碼來源:OnJoinEvent.java

示例4: enterWorldHandler

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void enterWorldHandler(PlayerLoggedInEvent e)
{
	if(!alerted)
	{
		 EntityPlayer player=e.player;
		 String[] pars;
		 for(String modid:this.latestVersion.keySet())
		 {
			 pars=this.modPool.get(modid);
			 //modname,latestestversion
			 player.addChatMessage(new ChatComponentTranslation("chat.newversion",pars[0],this.latestVersion.get(modid)));
		 }
		alerted=true;
	}
}
 
開發者ID:LambdaInnovation,項目名稱:LambdaLib,代碼行數:17,代碼來源:CheckManger.java

示例5: playerConnected

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void playerConnected(PlayerLoggedInEvent event)
{
	String name = event.player.getDisplayName();
	boolean found = false;
	for (int i = 0; i < chats.size(); i++) {
		if (chats.get(i).getUsername().equals(name)) {
			chats.get(i).connect();
		}
	}
	if (!found) {
		XMPPConnectionHandler chat = new XMPPConnectionHandler(name, name, resource, service, host, chatRoomName, chatRoomPrefix);
		chat.connect();
		chats.add(chat);
	}
}
 
開發者ID:fatcat32594,項目名稱:MineXMPP,代碼行數:17,代碼來源:MineXMPP.java

示例6: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin( PlayerLoggedInEvent pLoginEvent )
{
  if( pLoginEvent.player instanceof EntityPlayerMP )
  {
    EntityPlayerMP tEP = (EntityPlayerMP) pLoginEvent.player;
    // Is player op/admin
    if( MinecraftServer.getServer().getConfigurationManager().func_152596_g( tEP.getGameProfile() ) )
    {
      for( String tMsg : _mErrorBuffer )
      {
        // If this ever crashing cause of an invalid cast, your next
        // beer is on me
        PlayerChatHelper.SendError( tEP, tMsg );
      }
    }
  }
}
 
開發者ID:GTNewHorizons,項目名稱:Yamcl,代碼行數:19,代碼來源:IngameErrorLog.java

示例7: onPlayerLoggedIn

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLoggedIn(PlayerLoggedInEvent event) {
	if (mod.getConfig().isUseVersionChecker() && mod.getVersionChecker().isNewVersionAvaible()) {
		if (mod.getVersionChecker().getNewestVersion() != null) {
			event.player.addChatComponentMessage(mod.getVersionChecker().getNewestVersion().getFormattedChatText());
		}
	}

}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:10,代碼來源:FMLEventHandler.java

示例8: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event)
{
    if (event.player instanceof EntityPlayerMP)
    {
        this.onPlayerLogin((EntityPlayerMP) event.player);
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:9,代碼來源:AsteroidsPlayerHandler.java

示例9: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event)
{
	PacketDispatcher.packetsys.sendTo(new InspectPacket(), (EntityPlayerMP) event.player);
	if (!roundstarted) return;
	if (!rrplayerlist.contains(event.player.getCommandSenderName()))
	{
		event.player.inventory.clearInventory(null, -1);
		event.player.setLocationAndAngles(cSpawnx, 200, cSpawnz,0,0);
		//rrplayerlist.add(new RivalRebelsPlayer(event.player.getCommandSenderName(), RivalRebelsTeam.NONE, RivalRebelsClass.NONE, RivalRebelsRank.REGULAR, RivalRebels.resetMax));
	}
	PacketDispatcher.packetsys.sendTo(rrplayerlist, (EntityPlayerMP) event.player);
	if (isInSpawn(event.player)) PacketDispatcher.packetsys.sendTo(new GuiSpawnPacket(), (EntityPlayerMP) event.player);
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:15,代碼來源:RivalRebelsRound.java

示例10: JoinWorld

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
 public void JoinWorld(PlayerLoggedInEvent event) {
    EntityPlayer player = event.player;
    NBTTagCompound entityData = player.getEntityData();
    String joinedBefore = "HasPlayerJoinedWorldBefore"/*player.PERSISTED_NBT_TAG*/;
    Calendar calendar = Calendar.getInstance();

    //String PlayerName = null;
    //entityData.setString(PlayerName, player.getDisplayName());
    
    entityData.getBoolean(joinedBefore);
    
    if(entityData.getBoolean(joinedBefore) == false) {
  	  
       entityData.setBoolean(joinedBefore, true);
       
       if(EpicProportionsMod.PRESENT_ON_JOIN == true){ 
      	 		player.inventory.addItemStackToInventory(new ItemStack(ItemLoader.itemBirthdayPresent));
       		}
       
       
if (calendar.get(2) + 1 == 4 && calendar.get(5) == 4){
	
			event.player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GOLD + "Happy Birthday, " + EnumChatFormatting.GREEN + "jtrent238" + EnumChatFormatting.GOLD + "."));
	
	if(EpicProportionsMod.PRESENT_ON_DEVBIRTHDAY == true){
			player.inventory.addItemStackToInventory(new ItemStack(ItemLoader.itemBirthdayPresent));
			event.player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.LIGHT_PURPLE + "Have a Free Birthday Present to Celebrate."));
		}
}
    }
 }
 
開發者ID:jtrent238,項目名稱:PopularMMOS-EpicProportions-Mod,代碼行數:33,代碼來源:OnJoinEvent.java

示例11: playerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void playerLogin(final PlayerLoggedInEvent event) {

	if (event.player instanceof EntityPlayer) {
		if (status == UpdateStatus.OUTDATED) {
			final String msg = StatCollector.translateToLocalFormatted("msg.NewVersionAvailable.pathways",
					Pathways.MOD_NAME, currentVersion, CURSE_PROJECT_NAME);
			IChatComponent component = IChatComponent.Serializer.func_150699_a(msg);
			event.player.addChatMessage(component);
		}
	}
}
 
開發者ID:OreCruncher,項目名稱:Pathways,代碼行數:13,代碼來源:VersionCheck.java

示例12: playerJoinEvent

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent()
public void playerJoinEvent(final PlayerLoggedInEvent event) {
	if (isFirstJoin(event.player) || !ONLY_NEW_PLAYERS) {
		if (!StringUtils.isEmpty(PLAYER_JOIN_TARGET))
			TargetManager.execute((EntityPlayerMP) event.player, PLAYER_JOIN_TARGET, true);
	}
}
 
開發者ID:OreCruncher,項目名稱:Pathways,代碼行數:8,代碼來源:PlayerSpawnEventHandler.java

示例13: onPlayerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event) {

	Preconditions.checkNotNull(event);
	Preconditions.checkNotNull(event.player);

	PlayerContext ctx = new PlayerContext(event.player);

	if (!ctx.senderIsFakePlayer()) {
		PlayerEntityHelper.sendChatMessage(ctx,
				getLoginMessage(ctx.getLanguagePack()));
	}
}
 
開發者ID:OreCruncher,項目名稱:ModpackInfo,代碼行數:14,代碼來源:PlayerLoginEventHandler.java

示例14: playerLogin

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void playerLogin(final PlayerLoggedInEvent event) {

	if (event.player instanceof EntityPlayer) {
		if (status == UpdateStatus.OUTDATED) {
			final String msg = StatCollector.translateToLocalFormatted("msg.NewVersionAvailable.mpinfo",
					ModpackInfo.MOD_NAME, currentVersion, CURSE_PROJECT_NAME);
			IChatComponent component = IChatComponent.Serializer
					.func_150699_a(msg);
			event.player.addChatMessage(component);
		}
	}
}
 
開發者ID:OreCruncher,項目名稱:ModpackInfo,代碼行數:14,代碼來源:VersionCheck.java

示例15: onPlayerLoggedIn

import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLoggedIn(PlayerLoggedInEvent event) {
    if (!addPlayerLoggedIn.isEmpty()) {
        hPlayerLoggedIn.addAll(addPlayerLoggedIn);
        addPlayerLoggedIn.clear();
    }
    for (Iterator<LIHandler> it = hPlayerLoggedIn.iterator(); it.hasNext(); ) {
        LIHandler handler = it.next();
        if (handler.isDead())
            it.remove();
        else
            handler.trigger(event);
    }
}
 
開發者ID:LambdaInnovation,項目名稱:LambdaLib,代碼行數:15,代碼來源:LIFMLGameEventDispatcher.java


注:本文中的cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。