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


Java PlayerLoggedInEvent類代碼示例

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


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

示例1: loadPlayer

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void loadPlayer(PlayerLoggedInEvent event) {
	// System.out.println("LoggedIn");
	if (TF2weapons.server.isDedicatedServer() || Minecraft.getMinecraft().getIntegratedServer().getPublic()) {
		TF2weapons.network.sendTo(new TF2Message.WeaponDataMessage(TF2weapons.itemDataCompressed), (EntityPlayerMP) event.player);
	}
	int i=0;
	for (Contract contract:event.player.getCapability(TF2weapons.PLAYER_CAP, null).contracts) {
		TF2weapons.network.sendTo(new TF2Message.ContractMessage(i, contract), (EntityPlayerMP) event.player);
		i++;
	}
	if (TF2weapons.udpServer != null) {
		event.player.getCapability(TF2weapons.PLAYER_CAP, null).udpServerId=TF2UdpServer.nextPlayerId;
		TF2weapons.udpServer.playerList.put(TF2UdpServer.nextPlayerId, (EntityPlayerMP) event.player);
		TF2weapons.network.sendTo(new TF2Message.InitMessage(TF2weapons.udpServer.port, TF2UdpServer.nextPlayerId), (EntityPlayerMP) event.player);
		TF2UdpServer.nextPlayerId++;
	}

}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:20,代碼來源:TF2EventsCommon.java

示例2: playerLogsIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
/**
 * When player logs in, sent him his server counter partner's values.
 */
@SubscribeEvent
public void playerLogsIn(PlayerLoggedInEvent event)
{
    EntityPlayer player = event.player;
    IMorphing cap = Morphing.get(player);

    if (cap != null)
    {
        this.sendAcquiredMorphs(cap, player);

        /* Ensure that player was morphed */
        if (cap.isMorphed())
        {
            cap.getCurrentMorph().morph(player);
        }

        /* Send data */
        Dispatcher.sendTo(new PacketBlacklist(MorphManager.INSTANCE.activeBlacklist), (EntityPlayerMP) player);
        Dispatcher.sendTo(new PacketSettings(MorphManager.INSTANCE.activeSettings), (EntityPlayerMP) player);
    }
}
 
開發者ID:mchorse,項目名稱:metamorph,代碼行數:25,代碼來源:CapabilityHandler.java

示例3: onPlayerLogsIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
/**
 * When player is logs in, send him all available models and skins. I think
 * this should go to a separate server handler
 */
@SubscribeEvent
public void onPlayerLogsIn(PlayerLoggedInEvent event)
{
    EntityPlayerMP player = (EntityPlayerMP) event.player;

    if (Blockbuster.proxy.config.load_models_on_login)
    {
        ServerHandlerRequestModels.sendModels(this, player);
    }

    if (!Metamorph.VERSION.equals(Blockbuster.METAMORPH))
    {
        L10n.info(player, "metamorph", Metamorph.VERSION, Blockbuster.METAMORPH);
    }
}
 
開發者ID:mchorse,項目名稱:blockbuster,代碼行數:20,代碼來源:ModelHandler.java

示例4: onPlayerLoggedIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLoggedIn(PlayerLoggedInEvent event)
{
	EntityPlayer player = event.player;
	if (player != null) {
		if (ARKCraft.instance().isDebugger()) {
			player.sendMessage(new TextComponentString(ChatFormatting.RED + "You are running a decompiled version of ARKCraft!"));
		}
		else if (ARKCraft.versionCheckResult != null && ARKCraft.versionCheckResult.status == Status.OUTDATED || ARKCraft.versionCheckResult.status == Status.BETA_OUTDATED) {
			player.sendMessage(new TextComponentString(ChatFormatting.RED + I18n.translate("chat.notification.outdated")));
			player.sendMessage(new TextComponentString(ChatFormatting.RED + I18n.format("chat.notification.outdatedversion", ARKCraft.instance().version())));
		}
		else if (ARKCraft.versionCheckResult == null) {
			player.sendMessage(new TextComponentString(ChatFormatting.RED + "No Internet access"));
		}
	}

}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:19,代碼來源:VersionDetectionHandler.java

示例5: onPlayerLoggedIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public static void onPlayerLoggedIn(PlayerLoggedInEvent event)
{
	if (!event.player.world.isRemote)
	{
		VillagerInventoryMod.NETWORK.sendTo(new ConfigSyncMessage(), (EntityPlayerMP)event.player);
	}
}
 
開發者ID:crazysnailboy,項目名稱:VillagerInventory,代碼行數:9,代碼來源:ModConfiguration.java

示例6: onPlayerLogin

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SideOnly(Side.SERVER)
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent e) {
	//Map<String, Object> configs = new HashMap<String, Object>();
	//ModNetworking.INSTANCE.sendTo(new PacketConfigSync(configs), (EntityPlayerMP) e.player);
	EntityPFakePlayer.getFakePlayerForParent(e.player);
}
 
開發者ID:p455w0rd,項目名稱:DankNull,代碼行數:8,代碼來源:ModEvents.java

示例7: onPlayerLogin

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SideOnly(Side.SERVER)
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent e) {
	Map<String, Object> configs = new HashMap<String, Object>();
	configs.put("TempRegulatorBlockRadius", Options.TEMP_REGULATOR_RADIUS);
	configs.put("TempRegulatorBlockRFCap", Options.TEMP_REGULATOR_RF_CAPACITY);
	configs.put("ThirstHealthFix", Options.THIRST_HEALTH_REGEN_FIX);
	configs.put("ThirstQuencherRFCap", Options.THIRST_QUENCHER_RF_CAPACITY);
	configs.put("PortableTempRegulatorCap", Options.PORTABLE_TEMP_REGULATOR_CAPACITY);
	ModNetworking.INSTANCE.sendTo(new PacketConfigSync(configs), (EntityPlayerMP) e.player);
}
 
開發者ID:p455w0rd,項目名稱:ToughExpansion,代碼行數:12,代碼來源:ModEvents.java

示例8: onPlayerJoinedServer

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerJoinedServer(PlayerLoggedInEvent ev)
{
	this.stateEpisodeLock.readLock().lock();
	if (this.stateEpisode != null && this.stateEpisode.isLive())
	{
		this.stateEpisode.onPlayerJoinedServer(ev);
	}
	this.stateEpisodeLock.readLock().unlock();
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:11,代碼來源:EpisodeEventWrapper.java

示例9: onPlayerLoggedIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public static void onPlayerLoggedIn(PlayerLoggedInEvent event)
{
	if (!event.player.world.isRemote)
	{
		NBTTagCompound compound = ModConfiguration.writeToNBT(new NBTTagCompound());
		HalloweenMod.NETWORK.sendTo(new ConfigSyncMessage(compound), (EntityPlayerMP)event.player);
	}
}
 
開發者ID:crazysnailboy,項目名稱:Halloween,代碼行數:10,代碼來源:ModConfiguration.java

示例10: onPlayerLogsIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogsIn(PlayerLoggedInEvent e)
{
	EntityPlayer player = e.player;
	World world = player.world;
	
	if(world.isRemote == false) 
	{
		WorldTurn turn = WorldTurn.get(world);
	
		int currentTurn = turn.getTurn();
		String message = String.format("Hello there, the World Turn is currently %s", currentTurn);
		player.sendMessage(new TextComponentString(message));
	}
}
 
開發者ID:stuebz88,項目名稱:modName,代碼行數:16,代碼來源:EventHandlerCommon.java

示例11: onPlayerLogin

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event) {
	final EntityPlayer player = event.player;
	
	new Thread(new Runnable() {

		@Override
		public void run() {
			setupDailiesData(player);
		}
	}).start();
}
 
開發者ID:ToroCraft,項目名稱:Dailies,代碼行數:13,代碼來源:Events.java

示例12: onEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onEvent(PlayerLoggedInEvent event) {
  if (context.shouldShowAboutMessage()) {
    if (notifiedPlayers.add(event.player.getUniqueID())) {
      event.player.sendMessage(getTextComponent());
    }
  }
}
 
開發者ID:wizards-of-lua,項目名稱:wizards-of-lua,代碼行數:9,代碼來源:AboutMessage.java

示例13: onPlayerLoggedIn

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLoggedIn(PlayerLoggedInEvent evt) {
  if (FMLCommonHandler.instance().getEffectiveSide() != Side.SERVER) {
    return;
  }
  EntityPlayerMP player = (EntityPlayerMP) evt.player;
  addWolPacketHandler(player);
  replacePlayerInstance(player);
}
 
開發者ID:wizards-of-lua,項目名稱:wizards-of-lua,代碼行數:10,代碼來源:WolEventHandler.java

示例14: onEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onEvent(PlayerLoggedInEvent evt) {
  //if (WolTestEnvironment.instance.getTestPlayer() == null) {
    EntityPlayerMP player = (EntityPlayerMP) evt.player;
    WolTestEnvironment.instance.setTestPlayer(player);
    makeOperator(player);
    ConfigMessage message = new ConfigMessage(WolTestEnvironment.VERSION);
    WolTestEnvironment.instance.getPacketDispatcher().sendTo(message, player);
  //}
}
 
開發者ID:wizards-of-lua,項目名稱:wizards-of-lua,代碼行數:11,代碼來源:ServerProxy.java

示例15: onPlayerLogin

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; //導入依賴的package包/類
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event)
{
	EntityPlayer player = event.player;
	PlayerAether playerAether = PlayerAether.get(player);

	if (playerAether != null)
	{
		playerAether.accessories.markDirty();
	}
}
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:12,代碼來源:PlayerAetherEvents.java


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