🆙 From Integer.valueOf to Integer.parseInt
This commit is contained in:
parent
35b740c8e8
commit
760a56745f
@ -34,10 +34,10 @@ public class TalentTrackLevel {
|
|||||||
if (achievements[i].isEmpty() || achievementLevels[i].isEmpty())
|
if (achievements[i].isEmpty() || achievementLevels[i].isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.valueOf(achievements[i]));
|
Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.parseInt(achievements[i]));
|
||||||
|
|
||||||
if (achievement != null) {
|
if (achievement != null) {
|
||||||
this.achievements.put(achievement, Integer.valueOf(achievementLevels[i]));
|
this.achievements.put(achievement, Integer.parseInt(achievementLevels[i]));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Could not find achievement with ID " + achievements[i] + " for talenttrack level " + this.level + " of type " + this.type);
|
LOGGER.error("Could not find achievement with ID " + achievements[i] + " for talenttrack level " + this.level + " of type " + this.type);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class TalentTrackLevel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (String s : set.getString("reward_furni").split(",")) {
|
for (String s : set.getString("reward_furni").split(",")) {
|
||||||
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(s));
|
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(s));
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
|
@ -270,7 +270,7 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(this.itemId));
|
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(this.itemId));
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
this.allowGift = item.allowGift();
|
this.allowGift = item.allowGift();
|
||||||
|
@ -71,7 +71,7 @@ public abstract class CatalogPage implements Comparable<CatalogPage>, ISerialize
|
|||||||
if (!set.getString("includes").isEmpty()) {
|
if (!set.getString("includes").isEmpty()) {
|
||||||
for (String id : set.getString("includes").split(";")) {
|
for (String id : set.getString("includes").split(";")) {
|
||||||
try {
|
try {
|
||||||
this.included.add(Integer.valueOf(id));
|
this.included.add(Integer.parseInt(id));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
LOGGER.error("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")");
|
LOGGER.error("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")");
|
||||||
|
@ -20,7 +20,7 @@ public class ClothItem {
|
|||||||
|
|
||||||
this.setId = new int[parts.length];
|
this.setId = new int[parts.length];
|
||||||
for (int i = 0; i < this.setId.length; i++) {
|
for (int i = 0; i < this.setId.length; i++) {
|
||||||
this.setId[i] = Integer.valueOf(parts[i]);
|
this.setId[i] = Integer.parseInt(parts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!item[0].getExtradata().isEmpty()) {
|
if (!item[0].getExtradata().isEmpty()) {
|
||||||
items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(item[0].getExtradata())), 1);
|
items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(item[0].getExtradata())), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder data = new StringBuilder();
|
StringBuilder data = new StringBuilder();
|
||||||
|
@ -36,8 +36,8 @@ public class MarketPlaceOffer implements Runnable {
|
|||||||
this.itemId = set.getInt("item_id");
|
this.itemId = set.getInt("item_id");
|
||||||
|
|
||||||
if (!set.getString("ltd_data").split(":")[1].equals("0")) {
|
if (!set.getString("ltd_data").split(":")[1].equals("0")) {
|
||||||
this.limitedStack = Integer.valueOf(set.getString("ltd_data").split(":")[0]);
|
this.limitedStack = Integer.parseInt(set.getString("ltd_data").split(":")[0]);
|
||||||
this.limitedNumber = Integer.valueOf(set.getString("ltd_data").split(":")[1]);
|
this.limitedNumber = Integer.parseInt(set.getString("ltd_data").split(":")[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!privateOffer) {
|
if (!privateOffer) {
|
||||||
|
@ -28,7 +28,7 @@ public class BanCommand extends Command {
|
|||||||
|
|
||||||
int banTime;
|
int banTime;
|
||||||
try {
|
try {
|
||||||
banTime = Integer.valueOf(params[2]);
|
banTime = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.invalid_time"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.invalid_time"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -17,7 +17,7 @@ public class ChatTypeCommand extends Command {
|
|||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
int chatColor;
|
int chatColor;
|
||||||
try {
|
try {
|
||||||
chatColor = Integer.valueOf(params[1]);
|
chatColor = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.numbers"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.numbers"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -34,7 +34,7 @@ public class ChatTypeCommand extends Command {
|
|||||||
|
|
||||||
if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
||||||
if (Integer.valueOf(s) == chatColor) {
|
if (Integer.parseInt(s) == chatColor) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class GiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[2]);
|
itemId = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,7 +28,7 @@ public class GiveRankCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
if (StringUtils.isNumeric(params[2])) {
|
if (StringUtils.isNumeric(params[2])) {
|
||||||
int rankId = Integer.valueOf(params[2]);
|
int rankId = Integer.parseInt(params[2]);
|
||||||
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
|
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
|
||||||
rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId);
|
rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@ public class MassCreditsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -25,7 +25,7 @@ public class MassGiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class MassPixelsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,7 +19,7 @@ public class MassPointsCommand extends Command {
|
|||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
amountString = params[1];
|
amountString = params[1];
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(params[2]);
|
type = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -48,7 +48,7 @@ public class MassPointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(amountString);
|
amount = Integer.parseInt(amountString);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -33,7 +33,7 @@ public class MuteCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
try {
|
try {
|
||||||
duration = Integer.valueOf(params[2]);
|
duration = Integer.parseInt(params[2]);
|
||||||
|
|
||||||
if (duration <= 0)
|
if (duration <= 0)
|
||||||
throw new Exception("");
|
throw new Exception("");
|
||||||
|
@ -20,11 +20,11 @@ public class PixelCommand extends Command {
|
|||||||
if (Integer.parseInt(params[2]) != 0) {
|
if (Integer.parseInt(params[2]) != 0) {
|
||||||
habbo.givePixels(Integer.parseInt(params[2]));
|
habbo.givePixels(Integer.parseInt(params[2]));
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
||||||
habbo.whisper(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.valueOf(params[2]) + ""), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.parseInt(params[2]) + ""), RoomChatMessageBubbles.ALERT);
|
||||||
else
|
else
|
||||||
habbo.alert(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.valueOf(params[2]) + ""));
|
habbo.alert(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.parseInt(params[2]) + ""));
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_duckets.send").replace("%amount%", Integer.valueOf(params[2]) + "").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_duckets.send").replace("%amount%", Integer.parseInt(params[2]) + "").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_duckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_duckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -21,7 +21,7 @@ public class PointsCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 4) {
|
if (params.length == 4) {
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(params[3]);
|
type = Integer.parseInt(params[3]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -31,7 +31,7 @@ public class PointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[2]);
|
amount = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -47,7 +47,7 @@ public class PromoteTargetOfferCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
int offerId = 0;
|
int offerId = 0;
|
||||||
try {
|
try {
|
||||||
offerId = Integer.valueOf(offerKey);
|
offerId = Integer.parseInt(offerKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,21 +35,21 @@ public class RedeemCommand extends Command {
|
|||||||
items.add(item);
|
items.add(item);
|
||||||
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
||||||
try {
|
try {
|
||||||
credits += Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
credits += Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (item.getBaseItem().getName().startsWith("PF_")) {
|
} else if (item.getBaseItem().getName().startsWith("PF_")) {
|
||||||
try {
|
try {
|
||||||
pixels += Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pixels += Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
} else if (item.getBaseItem().getName().startsWith("DF_")) {
|
} else if (item.getBaseItem().getName().startsWith("DF_")) {
|
||||||
int pointsType;
|
int pointsType;
|
||||||
int pointsAmount;
|
int pointsAmount;
|
||||||
|
|
||||||
pointsType = Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
|
|
||||||
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class RedeemCommand extends Command {
|
|||||||
int pointsAmount;
|
int pointsAmount;
|
||||||
|
|
||||||
pointsType = 5;
|
pointsType = 5;
|
||||||
pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
|
|
||||||
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ public class RoomBundleCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
parentId = Integer.valueOf(params[1]);
|
parentId = Integer.parseInt(params[1]);
|
||||||
credits = Integer.valueOf(params[2]);
|
credits = Integer.parseInt(params[2]);
|
||||||
points = Integer.valueOf(params[3]);
|
points = Integer.parseInt(params[3]);
|
||||||
pointsType = Integer.valueOf(params[4]);
|
pointsType = Integer.parseInt(params[4]);
|
||||||
|
|
||||||
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId);
|
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class RoomCreditsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class RoomDanceCommand extends Command {
|
|||||||
int danceId;
|
int danceId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
danceId = Integer.valueOf(params[1]);
|
danceId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_danceall.invalid_dance"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_danceall.invalid_dance"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,7 +19,7 @@ public class RoomEffectCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int effectId = Integer.valueOf(params[1]);
|
int effectId = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (effectId >= 0) {
|
if (effectId >= 0) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
||||||
|
@ -20,7 +20,7 @@ public class RoomGiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -17,7 +17,7 @@ public class RoomItemCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (itemId < 0) {
|
if (itemId < 0) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomitem.positive"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomitem.positive"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -16,7 +16,7 @@ public class RoomPixelsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class RoomPointsCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
amountString = params[1];
|
amountString = params[1];
|
||||||
|
|
||||||
type = Integer.valueOf(params[2]);
|
type = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -46,7 +46,7 @@ public class RoomPointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(amountString);
|
amount = Integer.parseInt(amountString);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,7 +14,7 @@ public class SetMaxCommand extends Command {
|
|||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
int max;
|
int max;
|
||||||
try {
|
try {
|
||||||
max = Integer.valueOf(params[1]);
|
max = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class SetPollCommand extends Command {
|
|||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
||||||
int pollId = -1;
|
int pollId = -1;
|
||||||
try {
|
try {
|
||||||
pollId = Integer.valueOf(params[1]);
|
pollId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SetSpeedCommand extends Command {
|
|||||||
int newSpeed;
|
int newSpeed;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
newSpeed = Integer.valueOf(params[1]);
|
newSpeed = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_setspeed.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_setspeed.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -25,7 +25,7 @@ public class ShutdownCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
try {
|
try {
|
||||||
minutes = Integer.valueOf(params[1]);
|
minutes = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
reason = new StringBuilder(params[1]);
|
reason = new StringBuilder(params[1]);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class StaffOnlineCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
try {
|
try {
|
||||||
int i = Integer.valueOf(params[1]);
|
int i = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_staffonline.positive_only"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_staffonline.positive_only"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -15,7 +15,7 @@ public class TestCommand extends Command {
|
|||||||
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
|
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int header = Integer.valueOf(params[1]);
|
int header = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
ServerMessage message = new ServerMessage(header);
|
ServerMessage message = new ServerMessage(header);
|
||||||
|
|
||||||
@ -31,11 +31,11 @@ public class TestCommand extends Command {
|
|||||||
message.appendString("");
|
message.appendString("");
|
||||||
}
|
}
|
||||||
} else if (data[0].equals("i")) {
|
} else if (data[0].equals("i")) {
|
||||||
message.appendInt(Integer.valueOf(data[1]));
|
message.appendInt(Integer.parseInt(data[1]));
|
||||||
} else if (data[0].equalsIgnoreCase("by")) {
|
} else if (data[0].equalsIgnoreCase("by")) {
|
||||||
message.appendByte(Integer.valueOf(data[1]));
|
message.appendByte(Integer.parseInt(data[1]));
|
||||||
} else if (data[0].equalsIgnoreCase("sh")) {
|
} else if (data[0].equalsIgnoreCase("sh")) {
|
||||||
message.appendShort(Integer.valueOf(data[1]));
|
message.appendShort(Integer.parseInt(data[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class TransformCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 3) {
|
if (params.length >= 3) {
|
||||||
try {
|
try {
|
||||||
race = Integer.valueOf(params[2]);
|
race = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
scoreboard.setExtradata("0");
|
scoreboard.setExtradata("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
int oldScore = Integer.valueOf(scoreboard.getExtradata());
|
int oldScore = Integer.parseInt(scoreboard.getExtradata());
|
||||||
|
|
||||||
if (oldScore == totalScore)
|
if (oldScore == totalScore)
|
||||||
continue;
|
continue;
|
||||||
|
@ -255,7 +255,7 @@ public class FreezeGame extends Game {
|
|||||||
scoreboard.setExtradata("0");
|
scoreboard.setExtradata("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
int oldScore = Integer.valueOf(scoreboard.getExtradata());
|
int oldScore = Integer.parseInt(scoreboard.getExtradata());
|
||||||
|
|
||||||
if (oldScore == totalScore)
|
if (oldScore == totalScore)
|
||||||
continue;
|
continue;
|
||||||
|
@ -45,12 +45,12 @@ public class CrackableReward {
|
|||||||
int chance = 100;
|
int chance = 100;
|
||||||
|
|
||||||
if (prize.contains(":") && prize.split(":").length == 2) {
|
if (prize.contains(":") && prize.split(":").length == 2) {
|
||||||
itemId = Integer.valueOf(prize.split(":")[0]);
|
itemId = Integer.parseInt(prize.split(":")[0]);
|
||||||
chance = Integer.valueOf(prize.split(":")[1]);
|
chance = Integer.parseInt(prize.split(":")[1]);
|
||||||
} else if (prize.contains(":")) {
|
} else if (prize.contains(":")) {
|
||||||
LOGGER.error("Invalid configuration of crackable prizes (item id: " + this.itemId + "). '" + prize + "' format should be itemId:chance.");
|
LOGGER.error("Invalid configuration of crackable prizes (item id: " + this.itemId + "). '" + prize + "' format should be itemId:chance.");
|
||||||
} else {
|
} else {
|
||||||
itemId = Integer.valueOf(prize.replace(":", ""));
|
itemId = Integer.parseInt(prize.replace(":", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prizes.put(itemId, new AbstractMap.SimpleEntry<>(this.totalChance, this.totalChance + chance));
|
this.prizes.put(itemId, new AbstractMap.SimpleEntry<>(this.totalChance, this.totalChance + chance));
|
||||||
|
@ -55,7 +55,7 @@ public class Item implements ISerialize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int index = Integer.valueOf(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length);
|
int index = Integer.parseInt(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length);
|
||||||
return item.getBaseItem().getMultiHeights()[(item.getExtradata().isEmpty() ? 0 : index)];
|
return item.getBaseItem().getMultiHeights()[(item.getExtradata().isEmpty() ? 0 : index)];
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public class Item implements ISerialize {
|
|||||||
this.vendingItems = new TIntArrayList();
|
this.vendingItems = new TIntArrayList();
|
||||||
String[] vendingIds = set.getString("vending_ids").replace(";", ",").split(",");
|
String[] vendingIds = set.getString("vending_ids").replace(";", ",").split(",");
|
||||||
for (String s : vendingIds) {
|
for (String s : vendingIds) {
|
||||||
this.vendingItems.add(Integer.valueOf(s.replace(" ", "")));
|
this.vendingItems.add(Integer.parseInt(s.replace(" ", "")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ public class ItemManager {
|
|||||||
try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO items_presents VALUES (?, ?)")) {
|
try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO items_presents VALUES (?, ?)")) {
|
||||||
while (set.next() && item == null) {
|
while (set.next() && item == null) {
|
||||||
preparedStatement.setInt(1, set.getInt(1));
|
preparedStatement.setInt(1, set.getInt(1));
|
||||||
preparedStatement.setInt(2, Integer.valueOf(itemId));
|
preparedStatement.setInt(2, Integer.parseInt(itemId));
|
||||||
preparedStatement.addBatch();
|
preparedStatement.addBatch();
|
||||||
item = new InteractionDefault(set.getInt(1), habbo.getHabboInfo().getId(), Emulator.getGameEnvironment().getCatalogManager().ecotronItem, extradata, 0, 0);
|
item = new InteractionDefault(set.getInt(1), habbo.getHabboInfo().getId(), Emulator.getGameEnvironment().getCatalogManager().ecotronItem, extradata, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,10 @@ public class InteractionBackgroundToner extends HabboItem {
|
|||||||
serverMessage.appendInt(4);
|
serverMessage.appendInt(4);
|
||||||
if (this.getExtradata().split(":").length == 4) {
|
if (this.getExtradata().split(":").length == 4) {
|
||||||
String[] colorData = this.getExtradata().split(":");
|
String[] colorData = this.getExtradata().split(":");
|
||||||
serverMessage.appendInt(Integer.valueOf(colorData[0]));
|
serverMessage.appendInt(Integer.parseInt(colorData[0]));
|
||||||
serverMessage.appendInt(Integer.valueOf(colorData[1]));
|
serverMessage.appendInt(Integer.parseInt(colorData[1]));
|
||||||
serverMessage.appendInt(Integer.valueOf(colorData[2]));
|
serverMessage.appendInt(Integer.parseInt(colorData[2]));
|
||||||
serverMessage.appendInt(Integer.valueOf(colorData[3]));
|
serverMessage.appendInt(Integer.parseInt(colorData[3]));
|
||||||
} else {
|
} else {
|
||||||
serverMessage.appendInt(0);
|
serverMessage.appendInt(0);
|
||||||
serverMessage.appendInt(126);
|
serverMessage.appendInt(126);
|
||||||
|
@ -42,7 +42,7 @@ public class InteractionColorPlate extends InteractionDefault {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
state = Integer.valueOf(this.getExtradata());
|
state = Integer.parseInt(this.getExtradata());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ public class InteractionCrackable extends HabboItem {
|
|||||||
|
|
||||||
serverMessage.appendInt(7 + (this.isLimited() ? 256 : 0));
|
serverMessage.appendInt(7 + (this.isLimited() ? 256 : 0));
|
||||||
|
|
||||||
serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.valueOf(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + "");
|
serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.parseInt(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + "");
|
||||||
serverMessage.appendInt(Integer.valueOf(this.getExtradata()));
|
serverMessage.appendInt(Integer.parseInt(this.getExtradata()));
|
||||||
serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()));
|
serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()));
|
||||||
|
|
||||||
super.serializeExtradata(serverMessage);
|
super.serializeExtradata(serverMessage);
|
||||||
|
@ -77,7 +77,7 @@ public class InteractionDefault extends HabboItem {
|
|||||||
int currentState = 0;
|
int currentState = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
currentState = Integer.valueOf(this.getExtradata());
|
currentState = Integer.parseInt(this.getExtradata());
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
LOGGER.error("Incorrect extradata (" + this.getExtradata() + ") for item ID (" + this.getId() + ") of type (" + this.getBaseItem().getName() + ")");
|
LOGGER.error("Incorrect extradata (" + this.getExtradata() + ") for item ID (" + this.getId() + ") of type (" + this.getBaseItem().getName() + ")");
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class InteractionEffectToggle extends InteractionDefault {
|
|||||||
|
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
if (room.hasRights(client.getHabbo())) {
|
if (room.hasRights(client.getHabbo())) {
|
||||||
if (Integer.valueOf(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) {
|
if (Integer.parseInt(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) {
|
||||||
if ((client.getHabbo().getHabboInfo().getGender() == HabboGender.M && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectM()) ||
|
if ((client.getHabbo().getHabboInfo().getGender() == HabboGender.M && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectM()) ||
|
||||||
(client.getHabbo().getHabboInfo().getGender() == HabboGender.F && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectF())) {
|
(client.getHabbo().getHabboInfo().getGender() == HabboGender.F && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectF())) {
|
||||||
super.onClick(client, room, objects);
|
super.onClick(client, room, objects);
|
||||||
|
@ -94,16 +94,16 @@ public class InteractionGift extends HabboItem {
|
|||||||
data = this.getExtradata().split("\t");
|
data = this.getExtradata().split("\t");
|
||||||
|
|
||||||
if (data != null && data.length >= 5) {
|
if (data != null && data.length >= 5) {
|
||||||
int count = Integer.valueOf(data[0]);
|
int count = Integer.parseInt(data[0]);
|
||||||
|
|
||||||
this.itemId = new int[count];
|
this.itemId = new int[count];
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.itemId[i] = Integer.valueOf(data[i + 1]);
|
this.itemId[i] = Integer.parseInt(data[i + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.colorId = Integer.valueOf(data[count + 1]);
|
this.colorId = Integer.parseInt(data[count + 1]);
|
||||||
this.ribbonId = Integer.valueOf(data[count + 2]);
|
this.ribbonId = Integer.parseInt(data[count + 2]);
|
||||||
this.showSender = data[count + 3].equalsIgnoreCase("1");
|
this.showSender = data[count + 3].equalsIgnoreCase("1");
|
||||||
this.message = data[count + 4];
|
this.message = data[count + 4];
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class InteractionMusicDisc extends HabboItem {
|
|||||||
|
|
||||||
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
||||||
try {
|
try {
|
||||||
this.songId = Integer.valueOf(stuff[6]);
|
this.songId = Integer.parseInt(stuff[6]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ public class InteractionMusicDisc extends HabboItem {
|
|||||||
|
|
||||||
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
||||||
try {
|
try {
|
||||||
this.songId = Integer.valueOf(stuff[6]);
|
this.songId = Integer.parseInt(stuff[6]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class InteractionPyramid extends InteractionGate {
|
|||||||
|
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) {
|
if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
state = Math.abs(state - 1);
|
state = Math.abs(state - 1);
|
||||||
|
|
||||||
this.setExtradata(state + "");
|
this.setExtradata(state + "");
|
||||||
|
@ -36,8 +36,8 @@ public class InteractionRentableSpace extends HabboItem {
|
|||||||
this.renterName = "Unknown";
|
this.renterName = "Unknown";
|
||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
this.renterId = Integer.valueOf(data[0]);
|
this.renterId = Integer.parseInt(data[0]);
|
||||||
this.endTimestamp = Integer.valueOf(data[1]);
|
this.endTimestamp = Integer.parseInt(data[1]);
|
||||||
|
|
||||||
if (this.renterId > 0) {
|
if (this.renterId > 0) {
|
||||||
if (this.isRented()) {
|
if (this.isRented()) {
|
||||||
@ -233,8 +233,8 @@ public class InteractionRentableSpace extends HabboItem {
|
|||||||
String[] data = this.getBaseItem().getName().replace("hblooza_spacerent", "").split("x");
|
String[] data = this.getBaseItem().getName().replace("hblooza_spacerent", "").split("x");
|
||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
int x = Integer.valueOf(data[0]);
|
int x = Integer.parseInt(data[0]);
|
||||||
int y = Integer.valueOf(data[1]);
|
int y = Integer.parseInt(data[1]);
|
||||||
|
|
||||||
return 10 * (x * y);
|
return 10 * (x * y);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class InteractionTileEffectProvider extends InteractionCustomValues {
|
|||||||
public void onWalkOn(RoomUnit roomUnit, final Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, final Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOn(roomUnit, room, objects);
|
super.onWalkOn(roomUnit, room, objects);
|
||||||
|
|
||||||
int effectId = Integer.valueOf(this.values.get("effectId"));
|
int effectId = Integer.parseInt(this.values.get("effectId"));
|
||||||
|
|
||||||
if (roomUnit.getEffectId() == effectId) {
|
if (roomUnit.getEffectId() == effectId) {
|
||||||
effectId = 0;
|
effectId = 0;
|
||||||
|
@ -26,7 +26,7 @@ public class InteractionVikingCotie extends InteractionDefault {
|
|||||||
|
|
||||||
if (client != null && client.getHabbo().getHabboInfo().getId() == this.getUserId()) {
|
if (client != null && client.getHabbo().getHabboInfo().getId() == this.getUserId()) {
|
||||||
if (client.getHabbo().getRoomUnit().getEffectId() == 172 || client.getHabbo().getRoomUnit().getEffectId() == 173) {
|
if (client.getHabbo().getRoomUnit().getEffectId() == 172 || client.getHabbo().getRoomUnit().getEffectId() == 173) {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
|
|
||||||
if (state < 5) {
|
if (state < 5) {
|
||||||
state++;
|
state++;
|
||||||
|
@ -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) {
|
||||||
@ -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) {
|
||||||
|
@ -57,7 +57,7 @@ public class InteractionBattleBanzaiTile extends HabboItem {
|
|||||||
if (this.getExtradata().isEmpty())
|
if (this.getExtradata().isEmpty())
|
||||||
this.setExtradata("0");
|
this.setExtradata("0");
|
||||||
|
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
|
|
||||||
if (state % 3 == 2)
|
if (state % 3 == 2)
|
||||||
return;
|
return;
|
||||||
@ -88,7 +88,7 @@ public class InteractionBattleBanzaiTile extends HabboItem {
|
|||||||
if (this.getExtradata().isEmpty())
|
if (this.getExtradata().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Integer.valueOf(this.getExtradata()) % 3 == 2;
|
return Integer.parseInt(this.getExtradata()) % 3 == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -103,7 +103,7 @@ public class InteractionFreezeBlock extends HabboItem {
|
|||||||
|
|
||||||
int powerUp;
|
int powerUp;
|
||||||
try {
|
try {
|
||||||
powerUp = Integer.valueOf(this.getExtradata()) / 1000;
|
powerUp = Integer.parseInt(this.getExtradata()) / 1000;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
powerUp = 0;
|
powerUp = 0;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class WiredEffectBotClothes extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length >= 3) {
|
if (data.length >= 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.botName = data[1];
|
this.botName = data[1];
|
||||||
this.botLook = data[2];
|
this.botLook = data[2];
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public class WiredEffectBotFollowHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = (data[1].equalsIgnoreCase("1") ? 1 : 0);
|
this.mode = (data[1].equalsIgnoreCase("1") ? 1 : 0);
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
}
|
}
|
||||||
|
@ -152,8 +152,8 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.itemId = Integer.valueOf(data[1]);
|
this.itemId = Integer.parseInt(data[1]);
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class WiredEffectBotTalk extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
this.message = data[3];
|
this.message = data[3];
|
||||||
|
@ -166,7 +166,7 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
this.message = data[3];
|
this.message = data[3];
|
||||||
|
@ -220,14 +220,14 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (wiredDataSplit.length >= 2) {
|
if (wiredDataSplit.length >= 2) {
|
||||||
this.setDelay(Integer.valueOf(wiredDataSplit[0]));
|
this.setDelay(Integer.parseInt(wiredDataSplit[0]));
|
||||||
String[] data = wiredDataSplit[1].split(";");
|
String[] data = wiredDataSplit[1].split(";");
|
||||||
|
|
||||||
if (data.length > 1) {
|
if (data.length > 1) {
|
||||||
this.botName = data[0];
|
this.botName = data[0];
|
||||||
|
|
||||||
for (int i = 1; i < data.length; i++) {
|
for (int i = 1; i < data.length; i++) {
|
||||||
HabboItem item = room.getHabboItem(Integer.valueOf(data[i]));
|
HabboItem item = room.getHabboItem(Integer.parseInt(data[i]));
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
|
@ -171,14 +171,14 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
|
|||||||
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (wiredDataSplit.length >= 2) {
|
if (wiredDataSplit.length >= 2) {
|
||||||
this.setDelay(Integer.valueOf(wiredDataSplit[0]));
|
this.setDelay(Integer.parseInt(wiredDataSplit[0]));
|
||||||
String[] data = wiredDataSplit[1].split(";");
|
String[] data = wiredDataSplit[1].split(";");
|
||||||
|
|
||||||
if (data.length > 1) {
|
if (data.length > 1) {
|
||||||
this.botName = data[0];
|
this.botName = data[0];
|
||||||
|
|
||||||
for (int i = 1; i < data.length; i++) {
|
for (int i = 1; i < data.length; i++) {
|
||||||
HabboItem item = room.getHabboItem(Integer.valueOf(data[i]));
|
HabboItem item = room.getHabboItem(Integer.parseInt(data[i]));
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
|
@ -21,7 +21,7 @@ public class WiredEffectGiveEffect extends WiredEffectWhisper {
|
|||||||
int effectId;
|
int effectId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
effectId = Integer.valueOf(this.message);
|
effectId = Integer.parseInt(this.message);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class WiredEffectGiveHandItem extends WiredEffectWhisper {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
try {
|
try {
|
||||||
int itemId = Integer.valueOf(this.message);
|
int itemId = Integer.parseInt(this.message);
|
||||||
|
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
|
@ -117,10 +117,10 @@ public class WiredEffectGiveHotelviewHofPoints extends InteractionWiredEffect {
|
|||||||
this.amount = 0;
|
this.amount = 0;
|
||||||
|
|
||||||
if (wiredData.split("\t").length >= 2) {
|
if (wiredData.split("\t").length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(wiredData.split("\t")[0]));
|
super.setDelay(Integer.parseInt(wiredData.split("\t")[0]));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.amount = Integer.valueOf(this.getWiredData().split("\t")[1]);
|
this.amount = Integer.parseInt(this.getWiredData().split("\t")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,10 +117,10 @@ public class WiredEffectGiveRespect extends InteractionWiredEffect {
|
|||||||
this.respects = 0;
|
this.respects = 0;
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(data[0]));
|
super.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.respects = Integer.valueOf(data[1]);
|
this.respects = Integer.parseInt(data[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,12 +81,12 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
|
|||||||
else {
|
else {
|
||||||
String[] data = wiredData.split(":");
|
String[] data = wiredData.split(":");
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
this.limit = Integer.valueOf(data[0]);
|
this.limit = Integer.parseInt(data[0]);
|
||||||
this.given = Integer.valueOf(data[1]);
|
this.given = Integer.parseInt(data[1]);
|
||||||
this.rewardTime = Integer.valueOf(data[2]);
|
this.rewardTime = Integer.parseInt(data[2]);
|
||||||
this.uniqueRewards = data[3].equals("1");
|
this.uniqueRewards = data[3].equals("1");
|
||||||
this.limitationInterval = Integer.valueOf(data[4]);
|
this.limitationInterval = Integer.parseInt(data[4]);
|
||||||
this.setDelay(Integer.valueOf(data[5]));
|
this.setDelay(Integer.parseInt(data[5]));
|
||||||
|
|
||||||
if (data.length > 6) {
|
if (data.length > 6) {
|
||||||
if (!data[6].equalsIgnoreCase("\t")) {
|
if (!data[6].equalsIgnoreCase("\t")) {
|
||||||
@ -197,7 +197,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (d.length == 3) {
|
if (d.length == 3) {
|
||||||
if (!(d[1].contains(":") || d[1].contains(";"))) {
|
if (!(d[1].contains(":") || d[1].contains(";"))) {
|
||||||
this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.valueOf(d[2])));
|
this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.parseInt(d[2])));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,9 +116,9 @@ public class WiredEffectGiveScore extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(";");
|
String[] data = wiredData.split(";");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.score = Integer.valueOf(data[0]);
|
this.score = Integer.parseInt(data[0]);
|
||||||
this.count = Integer.valueOf(data[1]);
|
this.count = Integer.parseInt(data[1]);
|
||||||
this.setDelay(Integer.valueOf(data[2]));
|
this.setDelay(Integer.parseInt(data[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.needsUpdate(true);
|
this.needsUpdate(true);
|
||||||
|
@ -79,10 +79,10 @@ public class WiredEffectGiveScoreToTeam extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split(";");
|
String[] data = set.getString("wired_data").split(";");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.points = Integer.valueOf(data[0]);
|
this.points = Integer.parseInt(data[0]);
|
||||||
this.count = Integer.valueOf(data[1]);
|
this.count = Integer.parseInt(data[1]);
|
||||||
this.teamColor = GameTeamColors.values()[Integer.valueOf(data[2])];
|
this.teamColor = GameTeamColors.values()[Integer.parseInt(data[2])];
|
||||||
this.setDelay(Integer.valueOf(data[3]));
|
this.setDelay(Integer.parseInt(data[3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.needsUpdate(true);
|
this.needsUpdate(true);
|
||||||
|
@ -78,10 +78,10 @@ public class WiredEffectJoinTeam extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split("\t");
|
String[] data = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (data.length >= 1) {
|
if (data.length >= 1) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
this.teamColor = GameTeamColors.values()[Integer.valueOf(data[1])];
|
this.teamColor = GameTeamColors.values()[Integer.parseInt(data[1])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class WiredEffectKickHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split("\t");
|
String[] data = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (data.length >= 1) {
|
if (data.length >= 1) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
this.message = data[1];
|
this.message = data[1];
|
||||||
|
@ -69,7 +69,7 @@ public class WiredEffectLeaveTeam extends InteractionWiredEffect {
|
|||||||
this.setDelay(data.delay);
|
this.setDelay(data.delay);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.setDelay(Integer.valueOf(wiredData));
|
this.setDelay(Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +104,8 @@ public class WiredEffectMuteHabbo extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (data.length >= 3) {
|
if (data.length >= 3) {
|
||||||
try {
|
try {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.length = Integer.valueOf(data[1]);
|
this.length = Integer.parseInt(data[1]);
|
||||||
this.message = data[2];
|
this.message = data[2];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class WiredEffectWhisper extends InteractionWiredEffect {
|
|||||||
this.message = "";
|
this.message = "";
|
||||||
|
|
||||||
if (wiredData.split("\t").length >= 2) {
|
if (wiredData.split("\t").length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(wiredData.split("\t")[0]));
|
super.setDelay(Integer.parseInt(wiredData.split("\t")[0]));
|
||||||
this.message = wiredData.split("\t")[1];
|
this.message = wiredData.split("\t")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class WiredTriggerRepeater extends InteractionWiredTrigger implements ICy
|
|||||||
this.repeatTime = data.repeatTime;
|
this.repeatTime = data.repeatTime;
|
||||||
} else {
|
} else {
|
||||||
if (wiredData.length() >= 1) {
|
if (wiredData.length() >= 1) {
|
||||||
this.repeatTime = (Integer.valueOf(wiredData));
|
this.repeatTime = (Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class WiredTriggerRepeaterLong extends InteractionWiredTrigger implements
|
|||||||
this.repeatTime = data.repeatTime;
|
this.repeatTime = data.repeatTime;
|
||||||
} else {
|
} else {
|
||||||
if (wiredData.length() >= 1) {
|
if (wiredData.length() >= 1) {
|
||||||
this.repeatTime = (Integer.valueOf(wiredData));
|
this.repeatTime = (Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class EventCategory {
|
|||||||
|
|
||||||
if (parts.length != 3) throw new Exception("A serialized event category should contain 3 fields");
|
if (parts.length != 3) throw new Exception("A serialized event category should contain 3 fields");
|
||||||
|
|
||||||
this.id = Integer.valueOf(parts[0]);
|
this.id = Integer.parseInt(parts[0]);
|
||||||
this.caption = parts[1];
|
this.caption = parts[1];
|
||||||
this.visible = parts[2].equalsIgnoreCase("true");
|
this.visible = parts[2].equalsIgnoreCase("true");
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int petId = Integer.valueOf(petName.split("t")[1]);
|
int petId = Integer.parseInt(petName.split("t")[1]);
|
||||||
return this.petRaces.get(petId);
|
return this.petRaces.get(petId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
@ -392,17 +392,17 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Pet createPet(Item item, String name, String race, String color, GameClient client) {
|
public Pet createPet(Item item, String name, String race, String color, GameClient client) {
|
||||||
int type = Integer.valueOf(item.getName().toLowerCase().replace("a0 pet", ""));
|
int type = Integer.parseInt(item.getName().toLowerCase().replace("a0 pet", ""));
|
||||||
|
|
||||||
if (this.petData.containsKey(type)) {
|
if (this.petData.containsKey(type)) {
|
||||||
Pet pet;
|
Pet pet;
|
||||||
if (type == 15)
|
if (type == 15)
|
||||||
pet = new HorsePet(type, Integer.valueOf(race), color, name, client.getHabbo().getHabboInfo().getId());
|
pet = new HorsePet(type, Integer.parseInt(race), color, name, client.getHabbo().getHabboInfo().getId());
|
||||||
else if (type == 16)
|
else if (type == 16)
|
||||||
pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0);
|
pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0);
|
||||||
else
|
else
|
||||||
pet = new Pet(type,
|
pet = new Pet(type,
|
||||||
Integer.valueOf(race),
|
Integer.parseInt(race),
|
||||||
color,
|
color,
|
||||||
name,
|
name,
|
||||||
client.getHabbo().getHabboInfo().getId()
|
client.getHabbo().getHabboInfo().getId()
|
||||||
|
@ -19,7 +19,7 @@ public class RoomMoodlightData {
|
|||||||
String[] data = s.split(",");
|
String[] data = s.split(",");
|
||||||
|
|
||||||
if (data.length == 5) {
|
if (data.length == 5) {
|
||||||
return new RoomMoodlightData(Integer.valueOf(data[1]), data[0].equalsIgnoreCase("2"), data[2].equalsIgnoreCase("2"), data[3], Integer.valueOf(data[4]));
|
return new RoomMoodlightData(Integer.parseInt(data[1]), data[0].equalsIgnoreCase("2"), data[2].equalsIgnoreCase("2"), data[3], Integer.parseInt(data[4]));
|
||||||
} else {
|
} else {
|
||||||
return new RoomMoodlightData(1, true, true, "#000000", 255);
|
return new RoomMoodlightData(1, true, true, "#000000", 255);
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ public class RoomTrade {
|
|||||||
if (!item.getBaseItem().getName().startsWith("CF_") && !item.getBaseItem().getName().startsWith("CFC_")) return 0;
|
if (!item.getBaseItem().getName().startsWith("CF_") && !item.getBaseItem().getName().startsWith("CFC_")) return 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
return Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,10 @@ public class WiredGiveRewardItem {
|
|||||||
public WiredGiveRewardItem(String dataString) {
|
public WiredGiveRewardItem(String dataString) {
|
||||||
String[] data = dataString.split(",");
|
String[] data = dataString.split(",");
|
||||||
|
|
||||||
this.id = Integer.valueOf(data[0]);
|
this.id = Integer.parseInt(data[0]);
|
||||||
this.badge = data[1].equalsIgnoreCase("0");
|
this.badge = data[1].equalsIgnoreCase("0");
|
||||||
this.data = data[2];
|
this.data = data[2];
|
||||||
this.probability = Integer.valueOf(data[3]);
|
this.probability = Integer.parseInt(data[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -327,23 +327,23 @@ public class WiredHandler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (rewardReceived.type.equalsIgnoreCase("credits")) {
|
if (rewardReceived.type.equalsIgnoreCase("credits")) {
|
||||||
int credits = Integer.valueOf(rewardReceived.value);
|
int credits = Integer.parseInt(rewardReceived.value);
|
||||||
habbo.giveCredits(credits);
|
habbo.giveCredits(credits);
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
|
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
|
||||||
int pixels = Integer.valueOf(rewardReceived.value);
|
int pixels = Integer.parseInt(rewardReceived.value);
|
||||||
habbo.givePixels(pixels);
|
habbo.givePixels(pixels);
|
||||||
} else if (rewardReceived.type.startsWith("points")) {
|
} else if (rewardReceived.type.startsWith("points")) {
|
||||||
int points = Integer.valueOf(rewardReceived.value);
|
int points = Integer.parseInt(rewardReceived.value);
|
||||||
int type = 5;
|
int type = 5;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(rewardReceived.type.replace("points", ""));
|
type = Integer.parseInt(rewardReceived.type.replace("points", ""));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.givePoints(type, points);
|
habbo.givePoints(type, points);
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("furni")) {
|
} else if (rewardReceived.type.equalsIgnoreCase("furni")) {
|
||||||
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(rewardReceived.value));
|
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.value));
|
||||||
if (baseItem != null) {
|
if (baseItem != null) {
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, "");
|
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, "");
|
||||||
|
|
||||||
@ -356,9 +356,9 @@ public class WiredHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("respect")) {
|
} else if (rewardReceived.type.equalsIgnoreCase("respect")) {
|
||||||
habbo.getHabboStats().respectPointsReceived += Integer.valueOf(rewardReceived.value);
|
habbo.getHabboStats().respectPointsReceived += Integer.parseInt(rewardReceived.value);
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("cata")) {
|
} else if (rewardReceived.type.equalsIgnoreCase("cata")) {
|
||||||
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.valueOf(rewardReceived.value));
|
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.value));
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);
|
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);
|
||||||
|
@ -130,7 +130,7 @@ public class PacketManager {
|
|||||||
|
|
||||||
for (String s : Emulator.getConfig().getValue("debug.show.headers").split(";")) {
|
for (String s : Emulator.getConfig().getValue("debug.show.headers").split(";")) {
|
||||||
try {
|
try {
|
||||||
logList.add(Integer.valueOf(s));
|
logList.add(Integer.parseInt(s));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class BotSaveSettingsEvent extends MessageHandler {
|
|||||||
int chatSpeed = 7;
|
int chatSpeed = 7;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
chatSpeed = Integer.valueOf(data[data.length - 2]);
|
chatSpeed = Integer.parseInt(data[data.length - 2]);
|
||||||
if (chatSpeed < BotManager.MINIMUM_CHAT_SPEED) {
|
if (chatSpeed < BotManager.MINIMUM_CHAT_SPEED) {
|
||||||
chatSpeed = BotManager.MINIMUM_CHAT_SPEED;
|
chatSpeed = BotManager.MINIMUM_CHAT_SPEED;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class RedeemItemEvent extends MessageHandler {
|
|||||||
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
||||||
int credits;
|
int credits;
|
||||||
try {
|
try {
|
||||||
credits = Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
credits = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Failed to parse redeemable furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_<amount>");
|
LOGGER.error("Failed to parse redeemable furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_<amount>");
|
||||||
return;
|
return;
|
||||||
@ -45,7 +45,7 @@ public class RedeemItemEvent extends MessageHandler {
|
|||||||
int pixels;
|
int pixels;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pixels = Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pixels = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Failed to parse redeemable pixel furniture: " + item.getBaseItem().getName() + ". Must be in format of PF_<amount>");
|
LOGGER.error("Failed to parse redeemable pixel furniture: " + item.getBaseItem().getName() + ". Must be in format of PF_<amount>");
|
||||||
return;
|
return;
|
||||||
@ -57,14 +57,14 @@ public class RedeemItemEvent extends MessageHandler {
|
|||||||
int points;
|
int points;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pointsType = Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
points = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
||||||
return;
|
return;
|
||||||
@ -75,7 +75,7 @@ public class RedeemItemEvent extends MessageHandler {
|
|||||||
int points;
|
int points;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
points = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Failed to parse redeemable diamonds furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_diamond_<amount>");
|
LOGGER.error("Failed to parse redeemable diamonds furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_diamond_<amount>");
|
||||||
return;
|
return;
|
||||||
|
@ -97,12 +97,12 @@ public class ToggleFloorItemEvent extends MessageHandler {
|
|||||||
|
|
||||||
boolean isRare = item.getBaseItem().getName().contains("rare");
|
boolean isRare = item.getBaseItem().getName().contains("rare");
|
||||||
|
|
||||||
if ((!item.getExtradata().isEmpty() && Integer.valueOf(item.getExtradata()) - 1 < 0) || item.getExtradata().isEmpty()) {
|
if ((!item.getExtradata().isEmpty() && Integer.parseInt(item.getExtradata()) - 1 < 0) || item.getExtradata().isEmpty()) {
|
||||||
rarity = isRare ? InteractionMonsterPlantSeed.randomGoldenRarityLevel() : InteractionMonsterPlantSeed.randomRarityLevel();
|
rarity = isRare ? InteractionMonsterPlantSeed.randomGoldenRarityLevel() : InteractionMonsterPlantSeed.randomRarityLevel();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
rarity = Integer.valueOf(item.getExtradata()) - 1;
|
rarity = Integer.parseInt(item.getExtradata()) - 1;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class PetUseItemEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (pet instanceof HorsePet) {
|
if (pet instanceof HorsePet) {
|
||||||
if (item.getBaseItem().getName().toLowerCase().startsWith("horse_dye")) {
|
if (item.getBaseItem().getName().toLowerCase().startsWith("horse_dye")) {
|
||||||
int race = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
int race = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
int raceType = (race * 4) - 2;
|
int raceType = (race * 4) - 2;
|
||||||
|
|
||||||
if (race >= 13 && race <= 17)
|
if (race >= 13 && race <= 17)
|
||||||
@ -46,7 +46,7 @@ public class PetUseItemEvent extends MessageHandler {
|
|||||||
pet.setRace(raceType);
|
pet.setRace(raceType);
|
||||||
((HorsePet) pet).needsUpdate = true;
|
((HorsePet) pet).needsUpdate = true;
|
||||||
} else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairdye")) {
|
} else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairdye")) {
|
||||||
int splittedHairdye = Integer.valueOf(item.getBaseItem().getName().toLowerCase().split("_")[2]);
|
int splittedHairdye = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]);
|
||||||
int newHairdye = 48;
|
int newHairdye = 48;
|
||||||
|
|
||||||
if (splittedHairdye == 0) {
|
if (splittedHairdye == 0) {
|
||||||
@ -62,7 +62,7 @@ public class PetUseItemEvent extends MessageHandler {
|
|||||||
((HorsePet) pet).setHairColor(newHairdye);
|
((HorsePet) pet).setHairColor(newHairdye);
|
||||||
((HorsePet) pet).needsUpdate = true;
|
((HorsePet) pet).needsUpdate = true;
|
||||||
} else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairstyle")) {
|
} else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairstyle")) {
|
||||||
int splittedHairstyle = Integer.valueOf(item.getBaseItem().getName().toLowerCase().split("_")[2]);
|
int splittedHairstyle = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]);
|
||||||
int newHairstyle = 100;
|
int newHairstyle = 100;
|
||||||
|
|
||||||
if (splittedHairstyle == 0) {
|
if (splittedHairstyle == 0) {
|
||||||
|
@ -12,7 +12,7 @@ public class ChangeChatBubbleEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (!this.client.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
if (!this.client.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
||||||
if (Integer.valueOf(s) == chatBubble) {
|
if (Integer.parseInt(s) == chatBubble) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class RecyclerLogicComposer extends MessageComposer {
|
|||||||
this.response.appendInt(Emulator.getGameEnvironment().getCatalogManager().prizes.size());
|
this.response.appendInt(Emulator.getGameEnvironment().getCatalogManager().prizes.size());
|
||||||
for (Map.Entry<Integer, THashSet<Item>> map : Emulator.getGameEnvironment().getCatalogManager().prizes.entrySet()) {
|
for (Map.Entry<Integer, THashSet<Item>> map : Emulator.getGameEnvironment().getCatalogManager().prizes.entrySet()) {
|
||||||
this.response.appendInt(map.getKey());
|
this.response.appendInt(map.getKey());
|
||||||
this.response.appendInt(Integer.valueOf(Emulator.getConfig().getValue("hotel.ecotron.rarity.chance." + map.getKey())));
|
this.response.appendInt(Integer.parseInt(Emulator.getConfig().getValue("hotel.ecotron.rarity.chance." + map.getKey())));
|
||||||
this.response.appendInt(map.getValue().size());
|
this.response.appendInt(map.getValue().size());
|
||||||
for (Item item : map.getValue()) {
|
for (Item item : map.getValue()) {
|
||||||
this.response.appendString(item.getName());
|
this.response.appendString(item.getName());
|
||||||
|
@ -91,7 +91,7 @@ public class InventoryItemsComposer extends MessageComposer implements TIntObjec
|
|||||||
this.response.appendString("");
|
this.response.appendString("");
|
||||||
if(habboItem.getBaseItem().getName().equals("song_disk")) {
|
if(habboItem.getBaseItem().getName().equals("song_disk")) {
|
||||||
List<String> extraDataAsList = Arrays.asList(habboItem.getExtradata().split("\n"));
|
List<String> extraDataAsList = Arrays.asList(habboItem.getExtradata().split("\n"));
|
||||||
this.response.appendInt(Integer.valueOf(extraDataAsList.get(extraDataAsList.size() - 1)));
|
this.response.appendInt(Integer.parseInt(extraDataAsList.get(extraDataAsList.size() - 1)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
this.response.appendInt(habboItem instanceof InteractionGift ? ((((InteractionGift) habboItem).getColorId() * 1000) + ((InteractionGift) habboItem).getRibbonId()) : 1);
|
this.response.appendInt(habboItem instanceof InteractionGift ? ((((InteractionGift) habboItem).getColorId() * 1000) + ((InteractionGift) habboItem).getRibbonId()) : 1);
|
||||||
|
@ -17,7 +17,7 @@ public class ItemStateComposer extends MessageComposer {
|
|||||||
this.response.init(Outgoing.ItemStateComposer);
|
this.response.init(Outgoing.ItemStateComposer);
|
||||||
this.response.appendInt(this.item.getId());
|
this.response.appendInt(this.item.getId());
|
||||||
try {
|
try {
|
||||||
int state = Integer.valueOf(this.item.getExtradata());
|
int state = Integer.parseInt(this.item.getExtradata());
|
||||||
this.response.appendInt(state);
|
this.response.appendInt(state);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.response.appendInt(0);
|
this.response.appendInt(0);
|
||||||
|
@ -25,7 +25,7 @@ public class UserCurrencyComposer extends MessageComposer {
|
|||||||
for (String s : pointsTypes) {
|
for (String s : pointsTypes) {
|
||||||
int type;
|
int type;
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(s);
|
type = Integer.parseInt(s);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
return null;
|
return null;
|
||||||
|
@ -127,7 +127,7 @@ public class PluginManager {
|
|||||||
RoomChatMessage.BANNED_BUBBLES = new int[bannedBubbles.length];
|
RoomChatMessage.BANNED_BUBBLES = new int[bannedBubbles.length];
|
||||||
for (int i = 0; i < RoomChatMessage.BANNED_BUBBLES.length; i++) {
|
for (int i = 0; i < RoomChatMessage.BANNED_BUBBLES.length; i++) {
|
||||||
try {
|
try {
|
||||||
RoomChatMessage.BANNED_BUBBLES[i] = Integer.valueOf(bannedBubbles[i]);
|
RoomChatMessage.BANNED_BUBBLES[i] = Integer.parseInt(bannedBubbles[i]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,12 @@ public class PetEatAction implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (this.pet.getRoomUnit() != null && this.pet.getRoom() != null) {
|
if (this.pet.getRoomUnit() != null && this.pet.getRoom() != null) {
|
||||||
if (this.pet.levelHunger >= 20 && this.food != null && Integer.valueOf(this.food.getExtradata()) < this.food.getBaseItem().getStateCount()) {
|
if (this.pet.levelHunger >= 20 && this.food != null && Integer.parseInt(this.food.getExtradata()) < this.food.getBaseItem().getStateCount()) {
|
||||||
this.pet.addHunger(-20);
|
this.pet.addHunger(-20);
|
||||||
this.pet.setTask(PetTasks.EAT);
|
this.pet.setTask(PetTasks.EAT);
|
||||||
this.pet.getRoomUnit().setCanWalk(false);
|
this.pet.getRoomUnit().setCanWalk(false);
|
||||||
|
|
||||||
this.food.setExtradata(Integer.valueOf(this.food.getExtradata()) + 1 + "");
|
this.food.setExtradata(Integer.parseInt(this.food.getExtradata()) + 1 + "");
|
||||||
this.pet.getRoom().updateItem(this.food);
|
this.pet.getRoom().updateItem(this.food);
|
||||||
|
|
||||||
if (this.pet instanceof GnomePet) {
|
if (this.pet instanceof GnomePet) {
|
||||||
@ -42,7 +42,7 @@ public class PetEatAction implements Runnable {
|
|||||||
|
|
||||||
Emulator.getThreading().run(this, 1000);
|
Emulator.getThreading().run(this, 1000);
|
||||||
} else {
|
} else {
|
||||||
if (this.food != null && Integer.valueOf(this.food.getExtradata()) == this.food.getBaseItem().getStateCount()) {
|
if (this.food != null && Integer.parseInt(this.food.getExtradata()) == this.food.getBaseItem().getStateCount()) {
|
||||||
Emulator.getThreading().run(new QueryDeleteHabboItem(this.food.getId()), 500);
|
Emulator.getThreading().run(new QueryDeleteHabboItem(this.food.getId()), 500);
|
||||||
if (this.pet.getRoom() != null) {
|
if (this.pet.getRoom() != null) {
|
||||||
this.pet.getRoom().removeHabboItem(this.food);
|
this.pet.getRoom().removeHabboItem(this.food);
|
||||||
|
@ -33,7 +33,7 @@ public class FigureUtil {
|
|||||||
String[] pieces = set.split("-");
|
String[] pieces = set.split("-");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (pieces.length >= 2 && blacklist.contains(Integer.valueOf(pieces[1]))) {
|
if (pieces.length >= 2 && blacklist.contains(Integer.parseInt(pieces[1]))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException ignored) {
|
} catch (NumberFormatException ignored) {
|
||||||
|
@ -191,9 +191,9 @@ public class BadgeImager {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
String type = s.charAt(0) + "";
|
String type = s.charAt(0) + "";
|
||||||
int id = Integer.valueOf(s.substring(1, 4));
|
int id = Integer.parseInt(s.substring(1, 4));
|
||||||
int c = Integer.valueOf(s.substring(4, 6));
|
int c = Integer.parseInt(s.substring(4, 6));
|
||||||
int position = Integer.valueOf(s.substring(6));
|
int position = Integer.parseInt(s.substring(6));
|
||||||
|
|
||||||
GuildPart part;
|
GuildPart part;
|
||||||
GuildPart color = Emulator.getGameEnvironment().getGuildManager().getPart(GuildPartType.BASE_COLOR, c);
|
GuildPart color = Emulator.getGameEnvironment().getGuildManager().getPart(GuildPartType.BASE_COLOR, c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user