mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
room nullable..
This commit is contained in:
parent
607c29af07
commit
176cf2c218
@ -36,7 +36,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
||||||
int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1;
|
int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1;
|
||||||
this.scoreType = WiredHighscoreScoreType.valueOf(name);
|
this.scoreType = WiredHighscoreScoreType.valueOf(name);
|
||||||
this.clearType = WiredHighscoreClearType.values()[ctype];
|
this.clearType = WiredHighscoreClearType.values()[ctype];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -54,7 +54,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
||||||
int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1;
|
int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1;
|
||||||
this.scoreType = WiredHighscoreScoreType.valueOf(name);
|
this.scoreType = WiredHighscoreScoreType.valueOf(name);
|
||||||
this.clearType = WiredHighscoreClearType.values()[ctype];
|
this.clearType = WiredHighscoreClearType.values()[ctype];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -81,7 +81,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
||||||
if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
|
if (room == null || !((client != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
|
if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
|
||||||
@ -89,7 +89,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
this.setExtradata(Math.abs(state - 1) + "");
|
this.setExtradata(Math.abs(state - 1) + "");
|
||||||
room.updateItem(this);
|
room.updateItem(this);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user