- This works:
public boolean addtoPlayerList(Player player){
}String name=player.getName(); if (PlayerNumber>=MaximumPlayer) {return false;}//人数超过则返回错误 else { if(isInList(name)==false){ this.PlayerList[PlayerNumber]=name; getLogger().info("玩家:"+name+"已被添加至游戏列表。"); //Bukkit.getPlayer(name).sendMessage("玩家:"+name+"已被添加至游戏列表。"); PlayerNumber++; return true; }//不然就把名单上面下一位给加上传过来的玩家 else{ getLogger().info("玩家"+name+"已存在列表中"); Bukkit.getPlayer(name).sendMessage("玩家"+Bukkit.getPlayer(name)+"已存在列表中"); return false; } }
This don’t:public boolean addtoPlayerList(Player player){
}if (PlayerNumber>=MaximumPlayer) {return false;}//人数超过则返回错误 else { if(isInList(player)==false){ PlayerList[PlayerNumber]=(String)player.getName();//这个方法和下面那个是重载关系,都会出错,出错相同 getLogger().info("玩家:"+player.getName()+"已被添加至游戏列表。"); player.sendMessage("玩家:"+player.getName()+"已被添加至游戏列表。"); return true; }//不然就把名单上面下一位给加上传过来的玩家 else{ getLogger().info("玩家"+player.getName()+"已存在列表中"); player.sendMessage("玩家"+player.getName()+"已存在列表中"); return false; } }
Why?
2016/12/5: As I believed, this is the same problem with the one below. - ~~
Bukkit.getPlayer(name)
will report a NullPointerException when using. Why?
2016/12/15:
Let me simple this down to this:
Using Bukkit.getPlayer(args[0])
itself as a player instance will give a NullPointerException when using. But when I use
Player player=Bukkit.getPlayer(args[0]);
first and then use the player instance instead, everything works. Why?(I asked a few friends but still unsolved)~~
==Solved: When I was calling the method, the player was offline so it returns a null pointer. Also, I foget to check it so the error occurs. ==
- When I access a text file on my website generated by the pipeline or redirected output of a command or a program, all the
\n
have to be replaces with
to keep the form. How to make it more convenient?
==Possible solution: useview:sourcecode
when browsing==
2016/12/12
4.When using any types of audio players in my raspberry pi to play music, I found when I keep playing in a terminal, it will report a “audio device stuck” error and just stop. Even ^C don’t work on it. Why?
2016/12/19
5.I am trying to install Ubuntu on the second disk of my computer. But I think the boot priority is locked on my computer so I cannot boot from the second disk as long as I have a system on the first one. I have to go to recovery mode to manually make the computer boot from the second disk.
What should I do…
2016/12/20
Possible soluction from @Superboot:
==
2016/12/22
Looks like my computer locked my start up sequence. I tried to install a lower version bios as the custom service guy. But not working. Also, trying on installing grub on each disk and each partition is not working to. So I ask the service guy again and this time he told me that the booting partition is loaded on the second disk and need to be erased manually. Till now, I don’t feels like worth to do it so I guess I will just press F9 before actually start booting.
==Solved:== Install a software called easyuefi
. It couldn’t delete but do successfully disabled the windows loader. Now grub will be entered at first. 2017/2/13
6.The school will shutoff the Internet access after 10:30 pm. But if it’s connected beforehand with Ethernet, it won’t be shut as long as the device keeps connected. But if the device disconnected after 10:30 pm, it cannot connect again.
######why?
7.What’s the relationship between android build tool version, android sdk version, android api level, grandle version, grandle plugin version and those version of dependencies.
2017/3/14
#####If you have any solution, please comment below or contact me through d0048@china.com.cn#####