Final Patch to totems, resolves the NumberFormatException for all Totems. Added correct SQL for totems.

This commit is contained in:
KrewsOrg 2020-01-17 20:10:19 +00:00
parent 353bde440c
commit 6f0fcafb7b
5 changed files with 20 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.eu.habbo</groupId> <groupId>com.eu.habbo</groupId>
<artifactId>Habbo</artifactId> <artifactId>Habbo</artifactId>
<version>2.2.0</version> <version>2.2.2</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -0,0 +1,6 @@
UPDATE items_base SET interaction_type = 'totem_leg' WHERE item_name = 'totem_leg';
UPDATE items_base SET interaction_type = 'totem_head' WHERE item_name = 'totem_head';
UPDATE items_base SET interaction_type = 'totem_planet' WHERE item_name = 'totem_planet';
UPDATE items_base SET interaction_modes_count = '3' WHERE item_name = 'totem_planet';
UPDATE items_base SET interaction_modes_count = '12' WHERE item_name = 'totem_leg';
UPDATE items_base SET interaction_modes_count = '9' WHERE item_name = 'totem_head';

View File

@ -34,7 +34,7 @@ public final class Emulator {
public final static int MINOR = 2; public final static int MINOR = 2;
public final static int BUILD = 1; public final static int BUILD = 2;
public final static String PREVIEW = "Stable"; public final static String PREVIEW = "Stable";

View File

@ -21,7 +21,12 @@ public class InteractionTotemLegs extends InteractionDefault {
} }
public TotemType getTotemType() { public TotemType getTotemType() {
int extraData = Integer.parseInt(this.getExtradata()); int extraData;
try {
extraData = Integer.parseInt(this.getExtradata());
} catch(NumberFormatException ex) {
extraData = 0;
}
return TotemType.fromInt((int)Math.ceil((extraData + 1) / 4.0f)); return TotemType.fromInt((int)Math.ceil((extraData + 1) / 4.0f));
} }

View File

@ -22,7 +22,12 @@ public class InteractionTotemPlanet extends InteractionDefault {
} }
public TotemPlanetType getPlanetType() { public TotemPlanetType getPlanetType() {
int extraData = Integer.parseInt(this.getExtradata()); int extraData;
try {
extraData = Integer.parseInt(this.getExtradata());
} catch(NumberFormatException ex) {
extraData = 0;
}
return TotemPlanetType.fromInt(extraData); return TotemPlanetType.fromInt(extraData);
} }