本文整理匯總了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++;
}
}
示例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);
}
}
示例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);
}
}
示例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"));
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
}
示例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));
}
}
示例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();
}
示例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());
}
}
}
示例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);
}
示例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);
//}
}
示例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();
}
}