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