mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-26 18:30:52 +01:00
Fix HEntity's HGender parser
* Exceptions like: No enum constant gearth.extensions.parsers.HGender.m appeared when trying to parse an HEntity, adding a proper HGender parser seems to solve the problem
This commit is contained in:
parent
459f07e126
commit
7f4f73603d
@ -29,7 +29,7 @@ public class HEntity {
|
|||||||
|
|
||||||
switch (entityTypeId) {
|
switch (entityTypeId) {
|
||||||
case 1:
|
case 1:
|
||||||
gender = HGender.valueOf(packet.readString());
|
gender = HGender.fromString(packet.readString());
|
||||||
packet.readInteger();
|
packet.readInteger();
|
||||||
packet.readInteger();
|
packet.readInteger();
|
||||||
favoriteGroup = packet.readString();
|
favoriteGroup = packet.readString();
|
||||||
|
@ -14,4 +14,12 @@ public enum HGender {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HGender fromString(String text) {
|
||||||
|
for (HGender g : HGender.values()) {
|
||||||
|
if (g.toString().toLowerCase().equals(text.toLowerCase()))
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user