mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Fix to getFormLevel() in ScriptDBCPlayer
This commit is contained in:
1 parent
32792e7d6f
commit
c3541df1dc
1 file changed
+14
-1
@@ -475,7 +475,20 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T>{
|
||||
player.getEntityData().getCompoundTag("PlayerPersisted").setString("jrmcSSltX","TR"+level);
|
||||
}
|
||||
public int getFormLevel(){
|
||||
return Integer.parseInt(player.getEntityData().getCompoundTag("PlayerPersisted").getString("jrmcSSltX").replace("TR","").replace("pty",""));
|
||||
String formString = player.getEntityData().getCompoundTag("PlayerPersisted").getString("jrmcSSltX");
|
||||
if(formString.length() < 1)
|
||||
return 0;
|
||||
|
||||
StringBuilder digitString = new StringBuilder();
|
||||
for(char c : formString.toCharArray()){
|
||||
if(Character.isDigit(c))
|
||||
digitString.append(c);
|
||||
}
|
||||
|
||||
if(digitString.length() < 1)
|
||||
return 0;
|
||||
|
||||
return Integer.parseInt(digitString.toString());
|
||||
}
|
||||
|
||||
public void setSkills(String skills){
|
||||
|
||||
Reference in new issue
Block a user