More encapsulation

This commit is contained in:
Dominic Bridge 2023-01-10 14:29:21 +00:00 committed by John
parent 9ee1997c50
commit 57b13cac48
106 changed files with 442 additions and 409 deletions

View File

@ -12,8 +12,8 @@ import com.eu.habbo.plugin.events.users.UserSavedMottoEvent;
public class Easter {
@EventHandler
public static void onUserChangeMotto(UserSavedMottoEvent event) {
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.newMotto.equalsIgnoreCase("crickey!")) {
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.newMotto, event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.getNewMotto().equalsIgnoreCase("crickey!")) {
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getNewMotto(), event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
Room room = event.habbo.getHabboInfo().getCurrentRoom();

View File

@ -215,7 +215,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
if (message.equals("o/") || message.equals("_o/")) {
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
@ -230,7 +230,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
if (message.equals("o/") || message.equals("_o/")) {
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
@ -245,7 +245,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
event.target.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
event.getTarget().getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
}
}

View File

@ -85,19 +85,19 @@ public class ButlerBot extends Bot {
final Bot bot = this;
// Step 1: Look at Habbo
bot.lookAt(serveEvent.habbo);
bot.lookAt(serveEvent.getHabbo());
// Step 2: Prepare tasks for when the Bot (carrying the handitem) reaches the Habbo
final List<Runnable> tasks = new ArrayList<>();
tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0));
tasks.add(new RoomUnitGiveHanditem(serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), 0));
tasks.add(() -> {
if (this.getRoom() != null) {
String botMessage = Emulator.getTexts()
.getValue("bots.butler.given")
.replace("%key%", key)
.replace("%username%", serveEvent.habbo.getHabboInfo().getUsername());
.replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{botMessage})) {
bot.talk(botMessage);
@ -115,18 +115,18 @@ public class ButlerBot extends Bot {
});
// Give bot the handitem that it's going to give the Habbo
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
if (distanceBetweenBotAndHabbo > Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)) {
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
} else {
Emulator.getThreading().run(failedReached.get(0), 1000);
}
} else {
if (this.getRoom() != null) {
this.getRoom().giveHandItem(serveEvent.habbo, serveEvent.itemId);
this.getRoom().giveHandItem(serveEvent.getHabbo(), serveEvent.getItemId());
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.habbo.getHabboInfo().getUsername());
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{msg})) {
this.talk(msg);
}

View File

@ -1054,16 +1054,16 @@ public class CatalogManager {
Emulator.getPluginManager().fireEvent(purchasedEvent);
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) {
if (purchasedEvent.totalCredits > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.totalCredits);
if (purchasedEvent.getTotalCredits() > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits());
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo()));
}
}
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) {
if (purchasedEvent.totalPoints > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.totalPoints);
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.totalPoints, item.getPointsType()));
if (purchasedEvent.getTotalPoints() > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.getTotalPoints());
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.getTotalPoints(), item.getPointsType()));
}
}
@ -1080,11 +1080,11 @@ public class CatalogManager {
}
}
if (!purchasedEvent.badges.isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) {
if (!purchasedEvent.getBadges().isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) {
unseenItems.put(UnseenItemsComposer.AddHabboItemCategory.BADGE, new ArrayList<>());
}
for (String b : purchasedEvent.badges) {
for (String b : purchasedEvent.getBadges()) {
HabboBadge badge = new HabboBadge(0, b, 0, habbo);
Emulator.getThreading().run(badge);
habbo.getInventory().getBadgesComponent().addBadge(badge);
@ -1096,11 +1096,11 @@ public class CatalogManager {
habbo.getClient().sendResponse(new NotificationDialogMessageComposer(BubbleAlertKeys.RECEIVED_BADGE.getKey(), keys));
unseenItems.get(UnseenItemsComposer.AddHabboItemCategory.BADGE).add(badge.getId());
}
habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.catalogItem);
habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.getCatalogItem());
habbo.getClient().sendResponse(new UnseenItemsComposer(unseenItems));
habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.catalogItem));
habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.getCatalogItem()));
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
THashSet<String> itemIds = new THashSet<>();
@ -1113,11 +1113,11 @@ public class CatalogManager {
Emulator.getThreading().run(new CatalogPurchaseLogEntry(
Emulator.getIntUnixTimestamp(),
purchasedEvent.habbo.getHabboInfo().getId(),
purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getId() : 0,
purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getId() : 0,
String.join(";", itemIds),
purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getName() : "",
purchasedEvent.totalCredits,
purchasedEvent.totalPoints,
purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getName() : "",
purchasedEvent.getTotalCredits(),
purchasedEvent.getTotalPoints(),
item.getPointsType(),
amount
));

View File

@ -346,14 +346,14 @@ public class MarketPlace {
GetMarketplaceOffersEvent.cachedResults.clear();
client.sendResponse(new FurniListRemoveComposer(event.item.getGiftAdjustedId()));
client.sendResponse(new FurniListRemoveComposer(event.getItem().getGiftAdjustedId()));
client.sendResponse(new FurniListInvalidateComposer());
event.item.setFromGift(false);
event.getItem().setFromGift(false);
MarketPlaceOffer offer = new MarketPlaceOffer(event.item, event.price, client.getHabbo());
MarketPlaceOffer offer = new MarketPlaceOffer(event.getItem(), event.getPrice(), client.getHabbo());
client.getHabbo().getInventory().addMarketplaceOffer(offer);
client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.item);
client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.getItem());
item.setUserId(-1);
item.needsUpdate(true);
Emulator.getThreading().run(item);

View File

@ -13,7 +13,7 @@ public class AboutCommand extends Command {
public AboutCommand() {
super(null, new String[]{"about", "info", "online", "server"});
}
public static String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" +
public static final String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" +
"The Following people have all contributed to this emulator:\n" +
" TheGeneral\n Beny\n Alejandro\n Capheus\n Skeletor\n Harmonic\n Mike\n Remco\n zGrav \n Quadral \n Harmony\n Swirny\n ArpyAge\n Mikkel\n Rodolfo\n Rasmus\n Kitt Mustang\n Snaiker\n nttzx\n necmi\n Dome\n Jose Flores\n Cam\n Oliver\n Narzo\n Tenshie\n MartenM\n Ridge\n SenpaiDipper\n Snaiker\n Thijmen";
@Override

View File

@ -3,25 +3,17 @@ package com.eu.habbo.habbohotel.games;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.wired.WiredHandler;
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class GamePlayer {
private final Habbo habbo;
private GameTeamColors teamColor;
private final GameTeamColors teamColor;
private int score;
private int wiredScore;
public GamePlayer(Habbo habbo, GameTeamColors teamColor) {
this.habbo = habbo;
this.teamColor = teamColor;
}
public void reset() {
this.score = 0;
this.wiredScore = 0;

View File

@ -24,7 +24,7 @@ import gnu.trove.set.hash.THashSet;
import java.util.Map;
public abstract class TagGame extends Game {
public THashMap<Habbo, InteractionTagPole> taggers = new THashMap<>();
protected final THashMap<Habbo, InteractionTagPole> taggers = new THashMap<>();
public TagGame(Class<? extends GameTeam> gameTeamClazz, Class<? extends GamePlayer> gamePlayerClazz, Room room) {
super(gameTeamClazz, gamePlayerClazz, room, false);

View File

@ -57,8 +57,8 @@ public class InteractionDice extends HabboItem {
room.updateItemState(this);
Emulator.getThreading().run(this);
if (event.result > 0) {
Emulator.getThreading().run(new RandomDiceNumber(room, this, event.result), 1500);
if (event.getResult() > 0) {
Emulator.getThreading().run(new RandomDiceNumber(room, this, event.getResult()), 1500);
} else {
Emulator.getThreading().run(new RandomDiceNumber(this, room, this.getBaseItem().getStateCount()), 1500);
}

View File

@ -21,7 +21,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
public class InteractionMuteArea extends InteractionCustomValues {
public static THashMap<String, String> defaultValues = new THashMap<>() {
public static final THashMap<String, String> defaultValues = new THashMap<>() {
{
this.put("tilesLeft", "0");
}

View File

@ -16,7 +16,7 @@ import java.util.List;
public class InteractionRoller extends HabboItem {
public static boolean NO_RULES = false;
public static int DELAY = 400;
public static final int DELAY = 400;
public InteractionRoller(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);

View File

@ -10,7 +10,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
public class InteractionTileEffectProvider extends InteractionCustomValues {
public static THashMap<String, String> defaultValues = new THashMap<>() {
public static final THashMap<String, String> defaultValues = new THashMap<>() {
{
this.put("effectId", "0");
}

View File

@ -121,7 +121,7 @@ public class InteractionFootballGate extends HabboItem {
UserSavedLookEvent lookEvent = new UserSavedLookEvent(habbo, habbo.getHabboInfo().getGender(), oldlook);
Emulator.getPluginManager().fireEvent(lookEvent);
if (!lookEvent.isCancelled()) {
habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook);
habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook());
Emulator.getThreading().run(habbo.getHabboInfo());
habbo.getClient().sendResponse(new FigureUpdateComposer(habbo));
room.sendComposer(new UserChangeMessageComposer(habbo).compose());
@ -135,7 +135,7 @@ public class InteractionFootballGate extends HabboItem {
Emulator.getPluginManager().fireEvent(lookEvent);
if (!lookEvent.isCancelled()) {
habbo.getHabboStats().getCache().put(CACHE_KEY, habbo.getHabboInfo().getLook());
habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook);
habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook());
Emulator.getThreading().run(habbo.getHabboInfo());
habbo.getClient().sendResponse(new FigureUpdateComposer(habbo));
room.sendComposer(new UserChangeMessageComposer(habbo).compose());

View File

@ -17,26 +17,28 @@ import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.incoming.wired.WiredSaveException;
import com.eu.habbo.messages.outgoing.generic.alerts.WiredValidationErrorComposer;
import gnu.trove.set.hash.THashSet;
import lombok.Getter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@Getter
public class WiredEffectGiveReward extends InteractionWiredEffect {
public final static int LIMIT_ONCE = 0;
public final static int LIMIT_N_DAY = 1;
public final static int LIMIT_N_HOURS = 2;
public final static int LIMIT_N_MINUTES = 3;
public final static WiredEffectType type = WiredEffectType.GIVE_REWARD;
public int limit;
public int limitationInterval;
public int given;
public int rewardTime;
public boolean uniqueRewards;
private final static WiredEffectType type = WiredEffectType.GIVE_REWARD;
private int limit;
private int limitationInterval;
private int given;
private int rewardTime;
private boolean uniqueRewards;
public THashSet<WiredGiveRewardItem> rewardItems = new THashSet<>();
private final THashSet<WiredGiveRewardItem> rewardItems = new THashSet<>();
public WiredEffectGiveReward(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);
@ -64,7 +66,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
public void loadWiredData(ResultSet set, Room room) throws SQLException {
String wiredData = set.getString("wired_data");
if(wiredData.startsWith("{")) {
if (wiredData.startsWith("{")) {
JsonData data = WiredHandler.getGsonBuilder().create().fromJson(wiredData, JsonData.class);
this.setDelay(data.delay);
this.limit = data.limit;
@ -74,8 +76,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
this.limitationInterval = data.limit_interval;
this.rewardItems.clear();
this.rewardItems.addAll(data.rewards);
}
else {
} else {
String[] data = wiredData.split(":");
if (data.length > 0) {
this.limit = Integer.parseInt(data[0]);
@ -172,7 +173,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
@Override
public boolean saveData(WiredSettings settings, GameClient gameClient) throws WiredSaveException {
if (gameClient.getHabbo().hasPermission(Permission.ACC_SUPERWIRED)) {
if(settings.getIntParams().length < 4) throw new WiredSaveException("Invalid data");
if (settings.getIntParams().length < 4) throw new WiredSaveException("Invalid data");
this.rewardTime = settings.getIntParams()[0];
this.uniqueRewards = settings.getIntParams()[1] == 1;
this.limit = settings.getIntParams()[2];
@ -220,6 +221,10 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
return 0;
}
public void incrementGiven() {
given++;
}
static class JsonData {
int limit;
int given;
@ -239,4 +244,6 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
this.delay = delay;
}
}
}

View File

@ -27,7 +27,7 @@ public class WiredEffectGiveScoreToTeam extends InteractionWiredEffect {
private int count;
private GameTeamColors teamColor = GameTeamColors.RED;
private TIntIntHashMap startTimes = new TIntIntHashMap();
private final TIntIntHashMap startTimes = new TIntIntHashMap();
public WiredEffectGiveScoreToTeam(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
super(id, userId, item, extradata, limitedStack, limitedSells);

View File

@ -27,7 +27,7 @@ import java.util.regex.Pattern;
public class WiredEffectMatchFurni extends InteractionWiredEffect implements InteractionWiredMatchFurniSettings {
private static final WiredEffectType type = WiredEffectType.MATCH_SSHOT;
public boolean checkForWiredResetPermission = true;
private final boolean checkForWiredResetPermission = true;
private final THashSet<WiredMatchFurniSetting> settings;
private boolean state = false;
private boolean direction = false;

View File

@ -29,7 +29,7 @@ public class WiredEffectMoveFurniTo extends InteractionWiredEffect {
private final List<HabboItem> items = new ArrayList<>();
private int direction;
private int spacing = 1;
private Map<Integer, Integer> indexOffset = new LinkedHashMap<>();
private final Map<Integer, Integer> indexOffset = new LinkedHashMap<>();
public WiredEffectMoveFurniTo(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);

View File

@ -7,14 +7,16 @@ import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.messages.ServerMessage;
import lombok.Getter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@Getter
public class WiredExtraUnseen extends InteractionWiredExtra {
public List<Integer> seenList = new ArrayList<>();
private final List<Integer> seenList = new ArrayList<>();
public WiredExtraUnseen(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);

View File

@ -14,18 +14,18 @@ import java.text.SimpleDateFormat;
@Getter
public class ModToolBan implements Runnable {
public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private int userId;
private String ip;
private String machineId;
private int staffId;
private int expireDate;
private int timestamp;
private String reason;
private ModToolBanType type;
private int cfhTopic;
public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private final int userId;
private final String ip;
private final String machineId;
private final int staffId;
private final int expireDate;
private final int timestamp;
private final String reason;
private final ModToolBanType type;
private final int cfhTopic;
private boolean needsInsert;
private final boolean needsInsert;
public ModToolBan(ResultSet set) throws SQLException {
this.userId = set.getInt("user_id");

View File

@ -9,10 +9,10 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class ModToolChatLog implements Comparable<ModToolChatLog> {
private final int timestamp;
private final int habboId;
private final String username;
private final String message;
private boolean highlighted = false;
private final int habboId;
private final String username;
private final String message;
private boolean highlighted = false;
@Override

View File

@ -397,7 +397,7 @@ public class ModToolManager {
return;
if (target != null)
alertedEvent.target.getClient().sendResponse(new IssueCloseNotificationMessageComposer(alertedEvent.message));
alertedEvent.getTarget().getClient().sendResponse(new IssueCloseNotificationMessageComposer(alertedEvent.getMessage()));
}
public void kick(Habbo moderator, Habbo target, String message) {
@ -471,17 +471,17 @@ public class ModToolManager {
SupportRoomActionEvent roomActionEvent = new SupportRoomActionEvent(moderator, room, kickUsers, lockDoor, changeTitle);
Emulator.getPluginManager().fireEvent(roomActionEvent);
if (roomActionEvent.changeTitle) {
if (roomActionEvent.isChangeTitle()) {
room.setName(Emulator.getTexts().getValue("hotel.room.inappropriate.title"));
room.setNeedsUpdate(true);
}
if (roomActionEvent.lockDoor) {
if (roomActionEvent.isLockDoor()) {
room.setState(RoomState.LOCKED);
room.setNeedsUpdate(true);
}
if (roomActionEvent.kickUsers) {
if (roomActionEvent.isKickUsers()) {
for (Habbo habbo : room.getHabbos()) {
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
room.kickHabbo(habbo, false);

View File

@ -13,8 +13,7 @@ public class ModToolRoomVisit implements Comparable<ModToolRoomVisit> {
private final String roomName;
private final int timestamp;
private int exitTimestamp;
private THashSet<ModToolChatLog> chat = new THashSet<>();
;
private final THashSet<ModToolChatLog> chat = new THashSet<>();
public ModToolRoomVisit(ResultSet set) throws SQLException {
this.roomId = set.getInt("room_id");

View File

@ -1,28 +1,17 @@
package com.eu.habbo.habbohotel.modtool;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public class ModToolSanctionItem {
private int id;
private int habboId;
private int sanctionLevel;
private int probationTimestamp;
private boolean isMuted;
private int muteDuration;
private int tradeLockedUntil;
private String reason;
public ModToolSanctionItem(int id, int habboId, int sanctionLevel, int probationTimestamp, boolean isMuted, int muteDuration, int tradeLockedUntil, String reason) {
this.id = id;
this.habboId = habboId;
this.sanctionLevel = sanctionLevel;
this.probationTimestamp = probationTimestamp;
this.isMuted = isMuted;
this.muteDuration = muteDuration;
this.tradeLockedUntil = tradeLockedUntil;
this.reason = reason;
}
private final int id;
private final int habboId;
private final int sanctionLevel;
private final int probationTimestamp;
private final boolean isMuted;
private final int muteDuration;
private final int tradeLockedUntil;
private final String reason;
}

View File

@ -1,18 +1,14 @@
package com.eu.habbo.habbohotel.modtool;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public class ModToolSanctionLevelItem {
private int sanctionLevel;
private String sanctionType;
private int sanctionHourLength;
private int sanctionProbationDays;
private final int sanctionLevel;
private final String sanctionType;
private final int sanctionHourLength;
private final int sanctionProbationDays;
public ModToolSanctionLevelItem(int sanctionLevel, String sanctionType, int sanctionHourLength, int sanctionProbationDays) {
this.sanctionLevel = sanctionLevel;
this.sanctionType = sanctionType;
this.sanctionHourLength = sanctionHourLength;
this.sanctionProbationDays = sanctionProbationDays;
}
}

View File

@ -25,9 +25,9 @@ public class WordFilter {
//Configuration. Loaded from database & updated accordingly.
public static boolean ENABLED_FRIENDCHAT = true;
public static String DEFAULT_REPLACEMENT = "bobba";
protected THashSet<WordFilterWord> autoReportWords = new THashSet<>();
protected THashSet<WordFilterWord> hideMessageWords = new THashSet<>();
protected THashSet<WordFilterWord> words = new THashSet<>();
protected final THashSet<WordFilterWord> autoReportWords = new THashSet<>();
protected final THashSet<WordFilterWord> hideMessageWords = new THashSet<>();
protected final THashSet<WordFilterWord> words = new THashSet<>();
public WordFilter() {
long start = System.currentTimeMillis();

View File

@ -6,48 +6,48 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public class Permission {
public static String ACC_ANYCHATCOLOR = "acc_anychatcolor"; // allows them to pick and choose any color from the chat bubbles.
public static String ACC_ANYROOMOWNER = "acc_anyroomowner";
public static String ACC_EMPTY_OTHERS = "acc_empty_others";
public static String ACC_ENABLE_OTHERS = "acc_enable_others";
public static String ACC_SEE_WHISPERS = "acc_see_whispers";
public static String ACC_SEE_TENTCHAT = "acc_see_tentchat";
public static String ACC_SUPERWIRED = "acc_superwired";
public static String ACC_SUPPORTTOOL = "acc_supporttool";
public static String ACC_UNKICKABLE = "acc_unkickable";
public static String ACC_GUILDGATE = "acc_guildgate";
public static String ACC_MOVEROTATE = "acc_moverotate";
public static String ACC_PLACEFURNI = "acc_placefurni";
public static String ACC_UNLIMITED_BOTS = "acc_unlimited_bots";
public static String ACC_UNLIMITED_PETS = "acc_unlimited_pets";
public static String ACC_HIDE_IP = "acc_hide_ip";
public static String ACC_HIDE_MAIL = "acc_hide_mail";
public static String ACC_NOT_MIMICED = "acc_not_mimiced";
public static String ACC_CHAT_NO_FLOOD = "acc_chat_no_flood";
public static String ACC_STAFF_PICK = "acc_staff_pick";
public static String ACC_ENTERANYROOM = "acc_enteranyroom"; //
public static String ACC_FULLROOMS = "acc_fullrooms";
public static String ACC_INFINITE_CREDITS = "acc_infinite_credits";
public static String ACC_INFINITE_PIXELS = "acc_infinite_pixels";
public static String ACC_INFINITE_POINTS = "acc_infinite_points";
public static String ACC_AMBASSADOR = "acc_ambassador";
public static String ACC_CHAT_NO_LIMIT = "acc_chat_no_limit";
public static String ACC_CHAT_NO_FILTER = "acc_chat_no_filter";
public static String ACC_NOMUTE = "acc_nomute";
public static String ACC_GUILD_ADMIN = "acc_guild_admin";
public static String ACC_CATALOG_IDS = "acc_catalog_ids";
public static String ACC_MODTOOL_TICKET_Q = "acc_modtool_ticket_q";
public static String ACC_MODTOOL_USER_LOGS = "acc_modtool_user_logs";
public static String ACC_MODTOOL_USER_ALERT = "acc_modtool_user_alert";
public static String ACC_MODTOOL_USER_KICK = "acc_modtool_user_kick";
public static String ACC_MODTOOL_USER_BAN = "acc_modtool_user_ban";
public static String ACC_MODTOOL_ROOM_INFO = "acc_modtool_room_info";
public static String ACC_MODTOOL_ROOM_LOGS = "acc_modtool_room_logs";
public static String ACC_TRADE_ANYWHERE = "acc_trade_anywhere";
public static String ACC_HELPER_USE_GUIDE_TOOL = "acc_helper_use_guide_tool";
public static String ACC_HELPER_GIVE_GUIDE_TOURS = "acc_helper_give_guide_tours";
public static String ACC_HELPER_JUDGE_CHAT_REVIEWS = "acc_helper_judge_chat_reviews";
public static String ACC_FLOORPLAN_EDITOR = "acc_floorplan_editor";
public static final String ACC_ANYCHATCOLOR = "acc_anychatcolor"; // allows them to pick and choose any color from the chat bubbles.
public static final String ACC_ANYROOMOWNER = "acc_anyroomowner";
public static final String ACC_EMPTY_OTHERS = "acc_empty_others";
public static final String ACC_ENABLE_OTHERS = "acc_enable_others";
public static final String ACC_SEE_WHISPERS = "acc_see_whispers";
public static final String ACC_SEE_TENTCHAT = "acc_see_tentchat";
public static final String ACC_SUPERWIRED = "acc_superwired";
public static final String ACC_SUPPORTTOOL = "acc_supporttool";
public static final String ACC_UNKICKABLE = "acc_unkickable";
public static final String ACC_GUILDGATE = "acc_guildgate";
public static final String ACC_MOVEROTATE = "acc_moverotate";
public static final String ACC_PLACEFURNI = "acc_placefurni";
public static final String ACC_UNLIMITED_BOTS = "acc_unlimited_bots";
public static final String ACC_UNLIMITED_PETS = "acc_unlimited_pets";
public static final String ACC_HIDE_IP = "acc_hide_ip";
public static final String ACC_HIDE_MAIL = "acc_hide_mail";
public static final String ACC_NOT_MIMICED = "acc_not_mimiced";
public static final String ACC_CHAT_NO_FLOOD = "acc_chat_no_flood";
public static final String ACC_STAFF_PICK = "acc_staff_pick";
public static final String ACC_ENTERANYROOM = "acc_enteranyroom"; //
public static final String ACC_FULLROOMS = "acc_fullrooms";
public static final String ACC_INFINITE_CREDITS = "acc_infinite_credits";
public static final String ACC_INFINITE_PIXELS = "acc_infinite_pixels";
public static final String ACC_INFINITE_POINTS = "acc_infinite_points";
public static final String ACC_AMBASSADOR = "acc_ambassador";
public static final String ACC_CHAT_NO_LIMIT = "acc_chat_no_limit";
public static final String ACC_CHAT_NO_FILTER = "acc_chat_no_filter";
public static final String ACC_NOMUTE = "acc_nomute";
public static final String ACC_GUILD_ADMIN = "acc_guild_admin";
public static final String ACC_CATALOG_IDS = "acc_catalog_ids";
public static final String ACC_MODTOOL_TICKET_Q = "acc_modtool_ticket_q";
public static final String ACC_MODTOOL_USER_LOGS = "acc_modtool_user_logs";
public static final String ACC_MODTOOL_USER_ALERT = "acc_modtool_user_alert";
public static final String ACC_MODTOOL_USER_KICK = "acc_modtool_user_kick";
public static final String ACC_MODTOOL_USER_BAN = "acc_modtool_user_ban";
public static final String ACC_MODTOOL_ROOM_INFO = "acc_modtool_room_info";
public static final String ACC_MODTOOL_ROOM_LOGS = "acc_modtool_room_logs";
public static final String ACC_TRADE_ANYWHERE = "acc_trade_anywhere";
public static final String ACC_HELPER_USE_GUIDE_TOOL = "acc_helper_use_guide_tool";
public static final String ACC_HELPER_GIVE_GUIDE_TOURS = "acc_helper_give_guide_tours";
public static final String ACC_HELPER_JUDGE_CHAT_REVIEWS = "acc_helper_judge_chat_reviews";
public static final String ACC_FLOORPLAN_EDITOR = "acc_floorplan_editor";
private final String key;
private final PermissionSetting setting;

View File

@ -59,8 +59,8 @@ public class MonsterplantPet extends Pet implements IPetLook {
};
public static final ArrayList<Pair<String, Integer>> indexedBody = new ArrayList<>(MonsterplantPet.bodyRarity.values());
public static final ArrayList<Pair<String, Integer>> indexedColors = new ArrayList<>(MonsterplantPet.colorRarity.values());
public static int growTime = (30 * 60);
public static int timeToLive = (3 * 24 * 60 * 60); //3 days
public static final int growTime = (30 * 60);
public static final int timeToLive = (3 * 24 * 60 * 60); //3 days
private final int nose;
private final int noseColor;
private final int eyes;
@ -68,8 +68,8 @@ public class MonsterplantPet extends Pet implements IPetLook {
private final int mouth;
private final int mouthColor;
public String look;
private int type;
private int hue;
private final int type;
private final int hue;
private int deathTimestamp = Emulator.getIntUnixTimestamp() + timeToLive;
private boolean canBreed = true;
private boolean publiclyBreedable = false;
@ -170,6 +170,7 @@ public class MonsterplantPet extends Pet implements IPetLook {
for (RoomUnitStatus s : this.roomUnit.getStatusMap().keySet()) {
if (s.equals(RoomUnitStatus.GROW)) {
clear = true;
break;
}
}

View File

@ -27,7 +27,7 @@ import java.util.Map;
public class PetManager {
public static int MAXIMUM_PET_INVENTORY_SIZE = 25;
public static final int[] experiences = new int[]{100, 200, 400, 600, 900, 1300, 1800, 2400, 3200, 4300, 5700, 7600, 10100, 13300, 17500, 23000, 30200, 39600, 51900};
static int[] skins = new int[]{0, 1, 6, 7};
static final int[] skins = new int[]{0, 1, 6, 7};
public final THashMap<Integer, PetAction> petActions = new THashMap<>() {
{
this.put(0, new ActionFree());

View File

@ -100,7 +100,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
public static String PREFIX_FORMAT = "[<font color=\"%color%\">%prefix%</font>] ";
public static int ROLLERS_MAXIMUM_ROLL_AVATARS = 1;
public static boolean MUTEAREA_CAN_WHISPER = false;
public static double MAXIMUM_FURNI_HEIGHT = 40d;
public static final double MAXIMUM_FURNI_HEIGHT = 40d;
static {
for (int i = 1; i <= 3; i++) {
@ -141,7 +141,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
//Use appropriately. Could potentially cause memory leaks when used incorrectly.
public volatile boolean preventUnloading = false;
public volatile boolean preventUncaching = false;
public ConcurrentSet<ServerMessage> scheduledComposers = new ConcurrentSet<>();
public final ConcurrentSet<ServerMessage> scheduledComposers = new ConcurrentSet<>();
public ConcurrentSet<Runnable> scheduledTasks = new ConcurrentSet<>();
public String wordQuiz = "";
public int noVotes = 0;
@ -2872,7 +2872,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
this.unIdle(habbo);
}
}

View File

@ -723,8 +723,8 @@ public class RoomManager {
if (Emulator.getPluginManager().isRegistered(HabboAddedToRoomEvent.class, false)) {
HabboAddedToRoomEvent event = Emulator.getPluginManager().fireEvent(new HabboAddedToRoomEvent(habbo, room, habbosToSendEnter, visibleHabbos));
habbosToSendEnter = event.habbosToSendEnter;
visibleHabbos = event.visibleHabbos;
habbosToSendEnter = event.getHabbosToSendEnter();
visibleHabbos = event.getVisibleHabbos();
}
for (Habbo habboToSendEnter : habbosToSendEnter) {

View File

@ -225,7 +225,7 @@ public class RoomUnit {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
room.unIdle(habbo);
this.idleTimer = 0;
}

View File

@ -206,7 +206,7 @@ public class Habbo implements Runnable {
if (Emulator.getPluginManager().fireEvent(event).isCancelled())
return;
this.getHabboInfo().addCredits(event.credits);
this.getHabboInfo().addCredits(event.getCredits());
if (this.client != null) this.client.sendResponse(new CreditBalanceComposer(this.client.getHabbo()));
}
@ -221,7 +221,7 @@ public class Habbo implements Runnable {
if (Emulator.getPluginManager().fireEvent(event).isCancelled())
return;
this.getHabboInfo().addPixels(event.points);
this.getHabboInfo().addPixels(event.getPoints());
if (this.client != null) this.client.sendResponse(new ActivityPointsMessageComposer(this.client.getHabbo()));
}
@ -239,9 +239,9 @@ public class Habbo implements Runnable {
if (Emulator.getPluginManager().fireEvent(event).isCancelled())
return;
this.getHabboInfo().addCurrencyAmount(event.type, event.points);
this.getHabboInfo().addCurrencyAmount(event.getType(), event.getPoints());
if (this.client != null)
this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.points, event.type));
this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.getPoints(), event.getType()));
}

View File

@ -113,7 +113,6 @@ public class HabboManager {
userId = s.getInt("id");
}
}
statement.close();
} catch (SQLException e) {
log.error("Caught SQL exception", e);
}

View File

@ -90,7 +90,7 @@ public class ClothingValidationManager {
* @return Cleaned figure string
*/
public static String validateLook(String look, String gender, boolean isHC, TIntCollection ownedClothing) {
if(FIGUREDATA.palettes.size() == 0 || FIGUREDATA.settypes.size() == 0)
if(FIGUREDATA.getPalettes().size() == 0 || FIGUREDATA.getSettypes().size() == 0)
return look;
String[] newLookParts = look.split(Pattern.quote("."));
@ -102,14 +102,14 @@ public class ClothingValidationManager {
for(String lookpart : newLookParts) {
if (lookpart.contains("-")) {
String[] data = lookpart.split(Pattern.quote("-"));
FiguredataSettype settype = FIGUREDATA.settypes.get(data[0]);
FiguredataSettype settype = FIGUREDATA.getSettypes().get(data[0]);
if(settype != null) {
parts.put(data[0], data);
}
}
}
FIGUREDATA.settypes.entrySet().stream().filter(x -> !parts.containsKey(x.getKey())).forEach(x ->
FIGUREDATA.getSettypes().entrySet().stream().filter(x -> !parts.containsKey(x.getKey())).forEach(x ->
{
FiguredataSettype settype = x.getValue();
@ -132,13 +132,13 @@ public class ClothingValidationManager {
parts.forEach((key, data) -> {
try {
if (data.length >= 1) {
FiguredataSettype settype = FIGUREDATA.settypes.get(data[0]);
FiguredataSettype settype = FIGUREDATA.getSettypes().get(data[0]);
if (settype == null) {
//throw new Exception("Set type " + data[0] + " does not exist");
return;
}
FiguredataPalette palette = FIGUREDATA.palettes.get(settype.getPaletteId());
FiguredataPalette palette = FIGUREDATA.getPalettes().get(settype.getPaletteId());
if (palette == null) {
throw new Exception("Palette " + settype.getPaletteId() + " does not exist");
}

View File

@ -1,5 +1,6 @@
package com.eu.habbo.habbohotel.users.clothingvalidation;
import lombok.Getter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@ -18,9 +19,10 @@ import java.io.StringWriter;
import java.util.Map;
import java.util.TreeMap;
@Getter
public class Figuredata {
public Map<Integer, FiguredataPalette> palettes;
public Map<String, FiguredataSettype> settypes;
private final Map<Integer, FiguredataPalette> palettes;
private final Map<String, FiguredataSettype> settypes;
public Figuredata() {
palettes = new TreeMap<>();

View File

@ -75,7 +75,7 @@ public class ItemsComponent {
}
synchronized (this.items) {
this.items.put(event.item.getId(), event.item);
this.items.put(event.getItem().getId(), event.getItem());
}
}
@ -127,7 +127,7 @@ public class ItemsComponent {
}
synchronized (this.items) {
this.items.remove(event.item.getId());
this.items.remove(event.getItem().getId());
}
}

View File

@ -36,7 +36,7 @@ public class SubscriptionHabboClub extends Subscription {
public static int HC_PAYDAY_NEXT_DATE = Integer.MAX_VALUE; // yyyy-MM-dd HH:mm:ss
public static String HC_PAYDAY_INTERVAL = "";
public static String HC_PAYDAY_QUERY = "";
public static TreeMap<Integer, Integer> HC_PAYDAY_STREAK = new TreeMap<>();
public static final TreeMap<Integer, Integer> HC_PAYDAY_STREAK = new TreeMap<>();
public static String HC_PAYDAY_CURRENCY = "";
public static Double HC_PAYDAY_KICKBACK_PERCENTAGE = 0.1;
public static String ACHIEVEMENT_NAME = "";

View File

@ -20,7 +20,7 @@ import java.sql.SQLException;
@Getter
public class SubscriptionManager {
private THashMap<String, Class<? extends Subscription>> types;
private final THashMap<String, Class<? extends Subscription>> types;
public SubscriptionManager() {
this.types = new THashMap<>();

View File

@ -26,7 +26,7 @@ import com.eu.habbo.messages.outgoing.wired.WiredRewardResultMessageComposer;
import com.eu.habbo.plugin.events.furniture.wired.WiredConditionFailedEvent;
import com.eu.habbo.plugin.events.furniture.wired.WiredStackExecutedEvent;
import com.eu.habbo.plugin.events.furniture.wired.WiredStackTriggeredEvent;
import com.eu.habbo.plugin.events.users.UserWiredRewardReceived;
import com.eu.habbo.plugin.events.users.UserWiredRewardReceivedEvent;
import com.google.gson.GsonBuilder;
import gnu.trove.set.hash.THashSet;
import lombok.extern.slf4j.Slf4j;
@ -285,8 +285,8 @@ public class WiredHandler {
}
private static void giveReward(Habbo habbo, WiredEffectGiveReward wiredBox, WiredGiveRewardItem reward) {
if (wiredBox.limit > 0)
wiredBox.given++;
if (wiredBox.getLimit() > 0)
wiredBox.incrementGiven();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO wired_rewards_given (wired_item, user_id, reward_id, timestamp) VALUES ( ?, ?, ?, ?)")) {
statement.setInt(1, wiredBox.getId());
@ -299,17 +299,17 @@ public class WiredHandler {
}
if (reward.isBadge()) {
UserWiredRewardReceived rewardReceived = new UserWiredRewardReceived(habbo, wiredBox, "badge", reward.getData());
UserWiredRewardReceivedEvent rewardReceived = new UserWiredRewardReceivedEvent(habbo, wiredBox, "badge", reward.getData());
if (Emulator.getPluginManager().fireEvent(rewardReceived).isCancelled())
return;
if (rewardReceived.value.isEmpty())
if (rewardReceived.getValue().isEmpty())
return;
if (habbo.getInventory().getBadgesComponent().hasBadge(rewardReceived.value))
if (habbo.getInventory().getBadgesComponent().hasBadge(rewardReceived.getValue()))
return;
HabboBadge badge = new HabboBadge(0, rewardReceived.value, 0, habbo);
HabboBadge badge = new HabboBadge(0, rewardReceived.getValue(), 0, habbo);
Emulator.getThreading().run(badge);
habbo.getInventory().getBadgesComponent().addBadge(badge);
habbo.getClient().sendResponse(new BadgeReceivedComposer(badge));
@ -318,31 +318,31 @@ public class WiredHandler {
String[] data = reward.getData().split("#");
if (data.length == 2) {
UserWiredRewardReceived rewardReceived = new UserWiredRewardReceived(habbo, wiredBox, data[0], data[1]);
UserWiredRewardReceivedEvent rewardReceived = new UserWiredRewardReceivedEvent(habbo, wiredBox, data[0], data[1]);
if (Emulator.getPluginManager().fireEvent(rewardReceived).isCancelled())
return;
if (rewardReceived.value.isEmpty())
if (rewardReceived.getValue().isEmpty())
return;
if (rewardReceived.type.equalsIgnoreCase("credits")) {
int credits = Integer.parseInt(rewardReceived.value);
if (rewardReceived.getType().equalsIgnoreCase("credits")) {
int credits = Integer.parseInt(rewardReceived.getValue());
habbo.giveCredits(credits);
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
int pixels = Integer.parseInt(rewardReceived.value);
} else if (rewardReceived.getType().equalsIgnoreCase("pixels")) {
int pixels = Integer.parseInt(rewardReceived.getValue());
habbo.givePixels(pixels);
} else if (rewardReceived.type.startsWith("points")) {
int points = Integer.parseInt(rewardReceived.value);
} else if (rewardReceived.getType().startsWith("points")) {
int points = Integer.parseInt(rewardReceived.getValue());
int type = 5;
try {
type = Integer.parseInt(rewardReceived.type.replace("points", ""));
type = Integer.parseInt(rewardReceived.getType().replace("points", ""));
} catch (Exception ignored) {
}
habbo.givePoints(type, points);
} else if (rewardReceived.type.equalsIgnoreCase("furni")) {
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.value));
} else if (rewardReceived.getType().equalsIgnoreCase("furni")) {
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.getValue()));
if (baseItem != null) {
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, "");
@ -354,10 +354,10 @@ public class WiredHandler {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_RECEIVED_ITEM));
}
}
} else if (rewardReceived.type.equalsIgnoreCase("respect")) {
habbo.getHabboStats().increaseRespectPointsReceived(Integer.parseInt(rewardReceived.value));
} else if (rewardReceived.type.equalsIgnoreCase("cata")) {
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.value));
} else if (rewardReceived.getType().equalsIgnoreCase("respect")) {
habbo.getHabboStats().increaseRespectPointsReceived(Integer.parseInt(rewardReceived.getValue()));
} else if (rewardReceived.getType().equalsIgnoreCase("cata")) {
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.getValue()));
if (item != null) {
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);
@ -369,8 +369,8 @@ public class WiredHandler {
}
public static boolean getReward(Habbo habbo, WiredEffectGiveReward wiredBox) {
if (wiredBox.limit > 0) {
if (wiredBox.limit - wiredBox.given == 0) {
if (wiredBox.getLimit() > 0) {
if (wiredBox.getLimit() - wiredBox.getGiven() == 0) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.LIMITED_NO_MORE_AVAILABLE));
return false;
}
@ -379,12 +379,12 @@ public class WiredHandler {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) as row_count, wired_rewards_given.* FROM wired_rewards_given WHERE user_id = ? AND wired_item = ? ORDER BY timestamp DESC LIMIT ?", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) {
statement.setInt(1, habbo.getHabboInfo().getId());
statement.setInt(2, wiredBox.getId());
statement.setInt(3, wiredBox.rewardItems.size());
statement.setInt(3, wiredBox.getRewardItems().size());
try (ResultSet set = statement.executeQuery()) {
if (set.first()) {
if (set.getInt("row_count") >= 1) {
if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_ONCE) {
if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_ONCE) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED));
return false;
}
@ -392,37 +392,37 @@ public class WiredHandler {
set.beforeFirst();
if (set.next()) {
if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_MINUTES) {
if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_MINUTES) {
if (Emulator.getIntUnixTimestamp() - set.getInt("timestamp") <= 60) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_MINUTE));
return false;
}
}
if (wiredBox.uniqueRewards) {
if (set.getInt("row_count") == wiredBox.rewardItems.size()) {
if (wiredBox.isUniqueRewards()) {
if (set.getInt("row_count") == wiredBox.getRewardItems().size()) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALL_COLLECTED));
return false;
}
}
if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_HOURS) {
if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (3600 * wiredBox.limitationInterval))) {
if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_HOURS) {
if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (3600 * wiredBox.getLimitationInterval()))) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_HOUR));
return false;
}
}
if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_DAY) {
if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (86400 * wiredBox.limitationInterval))) {
if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_DAY) {
if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (86400 * wiredBox.getLimitationInterval()))) {
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_TODAY));
return false;
}
}
}
if (wiredBox.uniqueRewards) {
for (WiredGiveRewardItem item : wiredBox.rewardItems) {
if (wiredBox.isUniqueRewards()) {
for (WiredGiveRewardItem item : wiredBox.getRewardItems()) {
set.beforeFirst();
boolean found = false;
@ -440,7 +440,7 @@ public class WiredHandler {
int randomNumber = Emulator.getRandom().nextInt(101);
int count = 0;
for (WiredGiveRewardItem item : wiredBox.rewardItems) {
for (WiredGiveRewardItem item : wiredBox.getRewardItems()) {
if (randomNumber >= count && randomNumber <= (count + item.getProbability())) {
giveReward(habbo, wiredBox, item);
return true;

View File

@ -6,6 +6,8 @@ import com.eu.habbo.messages.ClientMessage;
public abstract class MessageHandler {
public GameClient client;
public ClientMessage packet;
@SuppressWarnings("CanBeFinal")
public boolean isCancelled = false;
public abstract void handle() throws Exception;

View File

@ -43,9 +43,9 @@ public class PublishPhotoEvent extends MessageHandler {
if (!Emulator.getPluginManager().fireEvent(publishPictureEvent).isCancelled()) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO camera_web (user_id, room_id, timestamp, url) VALUES (?, ?, ?, ?)")) {
statement.setInt(1, this.client.getHabbo().getHabboInfo().getId());
statement.setInt(2, publishPictureEvent.roomId);
statement.setInt(3, publishPictureEvent.timestamp);
statement.setString(4, publishPictureEvent.URL);
statement.setInt(2, publishPictureEvent.getRoomId());
statement.setInt(3, publishPictureEvent.getTimestamp());
statement.setString(4, publishPictureEvent.getURL());
statement.execute();
this.client.getHabbo().getHabboInfo().setWebPublishTimestamp(timestamp);

View File

@ -9,7 +9,7 @@ import gnu.trove.set.hash.THashSet;
import java.util.concurrent.ConcurrentHashMap;
public class HabboSearchEvent extends MessageHandler {
public static ConcurrentHashMap<String, THashSet<MessengerBuddy>> cachedResults = new ConcurrentHashMap<>();
public static final ConcurrentHashMap<String, THashSet<MessengerBuddy>> cachedResults = new ConcurrentHashMap<>();
@Override
public void handle() throws Exception {

View File

@ -15,7 +15,7 @@ public class SetRelationshipStatusEvent extends MessageHandler {
if (buddy != null && relationId >= 0 && relationId <= 3) {
UserRelationShipEvent event = new UserRelationShipEvent(this.client.getHabbo(), buddy, relationId);
if (!event.isCancelled()) {
buddy.setRelation(event.relationShip);
buddy.setRelation(event.getRelationShip());
this.client.sendResponse(new UpdateFriendComposer(this.client.getHabbo(), buddy, 0));
}
}

View File

@ -51,7 +51,7 @@ public class UpdateGuildBadgeEvent extends MessageHandler {
if (badgeEvent.isCancelled())
return;
guild.setBadge(badgeEvent.badge);
guild.setBadge(badgeEvent.getBadge());
guild.needsUpdate = true;
if (Emulator.getConfig().getBoolean("imager.internal.enabled")) {

View File

@ -22,9 +22,9 @@ public class UpdateGuildColorsEvent extends MessageHandler {
if (colorsEvent.isCancelled())
return;
if (guild.getColorOne() != colorsEvent.colorOne || guild.getColorTwo() != colorsEvent.colorTwo) {
guild.setColorOne(colorsEvent.colorOne);
guild.setColorTwo(colorsEvent.colorTwo);
if (guild.getColorOne() != colorsEvent.getColorOne() || guild.getColorTwo() != colorsEvent.getColorTwo()) {
guild.setColorOne(colorsEvent.getColorOne());
guild.setColorTwo(colorsEvent.getColorTwo());
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());

View File

@ -22,14 +22,14 @@ public class UpdateGuildIdentityEvent extends MessageHandler {
if (nameEvent.isCancelled())
return;
if (guild.getName().equals(nameEvent.name) && guild.getDescription().equals(nameEvent.description))
if (guild.getName().equals(nameEvent.getName()) && guild.getDescription().equals(nameEvent.getDescription()))
return;
if(nameEvent.name.length() > 29 || nameEvent.description.length() > 254)
if(nameEvent.getName().length() > 29 || nameEvent.getDescription().length() > 254)
return;
guild.setName(nameEvent.name);
guild.setDescription(nameEvent.description);
guild.setName(nameEvent.getName());
guild.setDescription(nameEvent.getDescription());
guild.needsUpdate = true;
guild.run();

View File

@ -23,8 +23,8 @@ public class UpdateGuildSettingsEvent extends MessageHandler {
if (settingsEvent.isCancelled())
return;
guild.setState(GuildState.valueOf(settingsEvent.state));
guild.setRights(settingsEvent.rights);
guild.setState(GuildState.valueOf(settingsEvent.getState()));
guild.setRights(settingsEvent.isRights());
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());
if(room != null) {

View File

@ -31,9 +31,9 @@ public class SetRoomBackgroundColorDataEvent extends MessageHandler {
if (event.isCancelled())
return;
hue = event.hue % 256;
saturation = event.saturation % 256;
brightness = event.brightness % 256;
hue = event.getHue() % 256;
saturation = event.getSaturation() % 256;
brightness = event.getBrightness() % 256;
item.setExtradata(item.getExtradata().split(":")[0] + ":" + hue + ":" + saturation + ":" + brightness);
item.needsUpdate(true);

View File

@ -45,9 +45,9 @@ public class CommandBotEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(lookEvent);
if (lookEvent.isCancelled())
break;
bot.setFigure(lookEvent.newLook);
bot.setGender(lookEvent.gender);
bot.setEffect(lookEvent.effect, -1);
bot.setFigure(lookEvent.getNewLook());
bot.setGender(lookEvent.getGender());
bot.setEffect(lookEvent.getEffect(), -1);
bot.needsUpdate(true);
}
case 2 -> {
@ -97,9 +97,9 @@ public class CommandBotEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(chatEvent);
if (chatEvent.isCancelled())
break;
bot.setChatAuto(chatEvent.autoChat);
bot.setChatRandom(chatEvent.randomChat);
bot.setChatDelay((short) chatEvent.chatDelay);
bot.setChatAuto(chatEvent.isAutoChat());
bot.setChatRandom(chatEvent.isRandomChat());
bot.setChatDelay((short) chatEvent.getChatDelay());
bot.clearChat();
bot.addChatLines(chat);
bot.needsUpdate(true);
@ -127,9 +127,9 @@ public class CommandBotEvent extends MessageHandler {
if (nameEvent.isCancelled())
break;
bot.setName(nameEvent.name);
bot.setName(nameEvent.getName());
bot.needsUpdate(true);
room.sendComposer(new UserNameChangedMessageComposer(bot.getRoomUnit().getId(), bot.getRoomUnit().getId(), nameEvent.name).compose());
room.sendComposer(new UserNameChangedMessageComposer(bot.getRoomUnit().getId(), bot.getRoomUnit().getId(), nameEvent.getName()).compose());
}
}
if (invalidName) {

View File

@ -14,8 +14,8 @@ import java.util.Arrays;
import java.util.List;
public class RoomDimmerSavePresetEvent extends MessageHandler {
public static List<String> MOODLIGHT_AVAILABLE_COLORS = Arrays.asList("#74F5F5,#0053F7,#E759DE,#EA4532,#F2F851,#82F349,#000000".split(","));
public static int MIN_BRIGHTNESS = (int) Math.floor(0.3 * 0xFF);
private static final List<String> MOODLIGHT_AVAILABLE_COLORS = Arrays.asList("#74F5F5,#0053F7,#E759DE,#EA4532,#F2F851,#82F349,#000000".split(","));
private static final int MIN_BRIGHTNESS = (int) Math.floor(0.3 * 0xFF);
@Override
public void handle() throws Exception {

View File

@ -32,7 +32,7 @@ public class AvatarExpressionEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (event.idle) {
if (event.isIdle()) {
room.idle(habbo);
} else {
room.unIdle(habbo);
@ -43,7 +43,7 @@ public class AvatarExpressionEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
room.unIdle(habbo);
}
}

View File

@ -17,7 +17,7 @@ public class ChangePostureEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo());
}
}

View File

@ -35,7 +35,7 @@ public class DanceEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(habbo);
}
}

View File

@ -82,7 +82,7 @@ public class MoveAvatarEvent extends MessageHandler {
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
if (!event.idle) {
if (!event.isIdle()) {
if (roomUnit.getRoom() != null) roomUnit.getRoom().unIdle(habbo);
roomUnit.resetIdleTimer();
}

View File

@ -20,7 +20,7 @@ public class SignEvent extends MessageHandler {
UserSignEvent event = new UserSignEvent(this.client.getHabbo(), signId);
if (!Emulator.getPluginManager().fireEvent(event).isCancelled()) {
this.client.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.SIGN, event.sign + "");
this.client.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.SIGN, event.getSign() + "");
this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo());
if(signId <= 10) {

View File

@ -12,7 +12,7 @@ public class ChangeMottoEvent extends MessageHandler {
String motto = this.packet.readString();
UserSavedMottoEvent event = new UserSavedMottoEvent(this.client.getHabbo(), this.client.getHabbo().getHabboInfo().getMotto(), motto);
Emulator.getPluginManager().fireEvent(event);
motto = event.newMotto;
motto = event.getNewMotto();
if(motto.length() <= Emulator.getConfig().getInt("motto.max_length", 38)) {
this.client.getHabbo().getHabboInfo().setMotto(motto);

View File

@ -7,12 +7,14 @@ import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.unknown.IgnoredUsersMessageComposer;
import gnu.trove.list.array.TIntArrayList;
import lombok.Getter;
import java.util.ArrayList;
@Getter
public class GetIgnoredUsersEvent extends MessageHandler {
ArrayList<String> ignoredUsernames = new ArrayList<>();
private final ArrayList<String> ignoredUsernames = new ArrayList<>();
@Override
public void handle() throws Exception {
Habbo habbo = this.client.getHabbo();

View File

@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.Map;
public class NewUserExperienceScriptProceedEvent extends MessageHandler {
public static Map<Integer, String> keys = new HashMap<>() {
public static final Map<Integer, String> keys = new HashMap<>() {
{
this.put(1, "BOTTOM_BAR_RECEPTION");
this.put(2, "BOTTOM_BAR_NAVIGATOR");

View File

@ -35,8 +35,8 @@ public class UpdateFigureDataEvent extends MessageHandler {
if (lookEvent.isCancelled())
return;
this.client.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_CHANGE_LOOKS ? ClothingValidationManager.validateLook(this.client.getHabbo(), lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook);
this.client.getHabbo().getHabboInfo().setGender(lookEvent.gender);
this.client.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_CHANGE_LOOKS ? ClothingValidationManager.validateLook(this.client.getHabbo(), lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook());
this.client.getHabbo().getHabboInfo().setGender(lookEvent.getGender());
Emulator.getThreading().run(this.client.getHabbo().getHabboInfo());
this.client.sendResponse(new FigureUpdateComposer(this.client.getHabbo()));
if (this.client.getHabbo().getHabboInfo().getCurrentRoom() != null) {

View File

@ -9,7 +9,7 @@ import java.util.ArrayList;
import java.util.List;
public class UserEventCatsComposer extends MessageComposer {
public static List<EventCategory> CATEGORIES = new ArrayList<>();
public static final List<EventCategory> CATEGORIES = new ArrayList<>();
@Override
protected ServerMessage composeInternal() {

View File

@ -10,8 +10,9 @@ import com.eu.habbo.messages.outgoing.Outgoing;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor
public class RentableSpaceStatusMessageComposer extends MessageComposer {
public static final int SPACE_ALREADY_RENTED = 100;
public static final int SPACE_EXTEND_NOT_RENTED = 101;

View File

@ -3,16 +3,16 @@ package com.eu.habbo.messages.outgoing.unknown;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.ArrayList;
@Getter
@AllArgsConstructor
public class IgnoredUsersMessageComposer extends MessageComposer {
ArrayList<String> ignoredUsers;
public IgnoredUsersMessageComposer(ArrayList<String> ignoredUsers) {
this.ignoredUsers = ignoredUsers;
}
private final ArrayList<String> ignoredUsers;
@Override
protected ServerMessage composeInternal() {

View File

@ -15,11 +15,11 @@ public class ScrSendUserInfoComposer extends MessageComposer {
private final String subscriptionType;
private final int responseType;
public static int RESPONSE_TYPE_NORMAL = 0;
public static int RESPONSE_TYPE_LOGIN = 1;
public static int RESPONSE_TYPE_PURCHASE = 2; // closes the catalog after buying
public static int RESPONSE_TYPE_DISCOUNT_AVAILABLE = 3;
public static int RESPONSE_TYPE_CITIZENSHIP_DISCOUNT = 4;
public static final int RESPONSE_TYPE_NORMAL = 0;
public static final int RESPONSE_TYPE_LOGIN = 1;
public static final int RESPONSE_TYPE_PURCHASE = 2; // closes the catalog after buying
public static final int RESPONSE_TYPE_DISCOUNT_AVAILABLE = 3;
public static final int RESPONSE_TYPE_CITIZENSHIP_DISCOUNT = 4;
public ScrSendUserInfoComposer(Habbo habbo) {
this.habbo = habbo;

View File

@ -31,7 +31,7 @@ public class CreateModToolTicket extends RCONMessage<CreateModToolTicket.JSON> {
public String reported_username;
public int reported_room_id = 0;
public final int reported_room_id = 0;
public String message;

View File

@ -35,7 +35,7 @@ public class DisconnectUser extends RCONMessage<DisconnectUser.DisconnectUserJSO
static class DisconnectUserJSON {
public int user_id = -1;
public final int user_id = -1;
public String username;

View File

@ -88,7 +88,7 @@ public class GiveBadge extends RCONMessage<GiveBadge.GiveBadgeJSON> {
static class GiveBadgeJSON {
public int user_id = -1;
public final int user_id = -1;
public String badge;

View File

@ -9,6 +9,7 @@ import gnu.trove.map.hash.THashMap;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
@ -20,7 +21,8 @@ public class RCONServer extends Server {
private final THashMap<String, Class<? extends RCONMessage>> messages;
private final GsonBuilder gsonBuilder;
List<String> allowedAdresses = new ArrayList<>();
@Getter
private final List<String> allowedAdresses = new ArrayList<>();
public RCONServer(String host, int port) throws Exception {
super("RCON Server", host, port, 1, 2);

View File

@ -18,7 +18,7 @@ public class RCONServerHandler extends ChannelInboundHandlerAdapter {
public void channelRegistered(ChannelHandlerContext ctx) {
String adress = ctx.channel().remoteAddress().toString().split(":")[0].replace("/", "");
for (String s : Emulator.getRconServer().allowedAdresses) {
for (String s : Emulator.getRconServer().getAllowedAdresses()) {
if (s.equalsIgnoreCase(adress)) {
return;
}

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import lombok.Getter;
@Getter
public abstract class BotChatEvent extends BotEvent {
public String message;
private final String message;
public BotChatEvent(Bot bot, String message) {

View File

@ -1,21 +1,23 @@
package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import lombok.Getter;
import java.util.ArrayList;
@Getter
public class BotSavedChatEvent extends BotEvent {
public boolean autoChat;
private final boolean autoChat;
public boolean randomChat;
private final boolean randomChat;
public int chatDelay;
private final int chatDelay;
public ArrayList<String> chat;
private final ArrayList<String> chat;
public BotSavedChatEvent(Bot bot, boolean autoChat, boolean randomChat, int chatDelay, ArrayList<String> chat) {

View File

@ -2,16 +2,18 @@ package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.users.HabboGender;
import lombok.Getter;
@Getter
public class BotSavedLookEvent extends BotEvent {
public HabboGender gender;
private final HabboGender gender;
public String newLook;
private final String newLook;
public int effect;
private final int effect;
public BotSavedLookEvent(Bot bot, HabboGender gender, String newLook, int effect) {

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import lombok.Getter;
@Getter
public class BotSavedNameEvent extends BotEvent {
public String name;
private final String name;
public BotSavedNameEvent(Bot bot, String name) {

View File

@ -2,12 +2,14 @@ package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class BotServerItemEvent extends BotEvent {
public Habbo habbo;
private final Habbo habbo;
public int itemId;
private final int itemId;
public BotServerItemEvent(Bot bot, Habbo habbo, int itemId) {

View File

@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.bots;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class BotWhisperEvent extends BotChatEvent {
public Habbo target;
private final Habbo target;
public BotWhisperEvent(Bot bot, String message, Habbo target) {

View File

@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.furniture;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import lombok.Getter;
@Getter
public class FurnitureDiceRolledEvent extends FurnitureUserEvent {
public int result;
private final int result;
public FurnitureDiceRolledEvent(HabboItem furniture, Habbo habbo, int result) {

View File

@ -2,11 +2,14 @@ package com.eu.habbo.plugin.events.furniture;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import lombok.Getter;
@Getter
public class FurnitureRoomTonerEvent extends FurnitureUserEvent {
public int hue;
public int saturation;
public int brightness;
private final int hue;
private final int saturation;
private final int brightness;
public FurnitureRoomTonerEvent(HabboItem furniture, Habbo habbo, int hue, int saturation, int brightness) {

View File

@ -2,9 +2,11 @@ package com.eu.habbo.plugin.events.furniture;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import lombok.Getter;
@Getter
public class FurnitureToggleEvent extends FurnitureUserEvent {
public int state;
private final int state;
public FurnitureToggleEvent(HabboItem furniture, Habbo habbo, int state) {
super(furniture, habbo);

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.guilds;
import com.eu.habbo.habbohotel.guilds.Guild;
import lombok.Getter;
@Getter
public class GuildChangedBadgeEvent extends GuildEvent {
public String badge;
private final String badge;
public GuildChangedBadgeEvent(Guild guild, String badge) {

View File

@ -1,13 +1,15 @@
package com.eu.habbo.plugin.events.guilds;
import com.eu.habbo.habbohotel.guilds.Guild;
import lombok.Getter;
@Getter
public class GuildChangedColorsEvent extends GuildEvent {
public int colorOne;
private final int colorOne;
public int colorTwo;
private final int colorTwo;
public GuildChangedColorsEvent(Guild guild, int colorOne, int colorTwo) {

View File

@ -1,13 +1,15 @@
package com.eu.habbo.plugin.events.guilds;
import com.eu.habbo.habbohotel.guilds.Guild;
import lombok.Getter;
@Getter
public class GuildChangedNameEvent extends GuildEvent {
public String name;
private final String name;
public String description;
private final String description;
public GuildChangedNameEvent(Guild guild, String name, String description) {

View File

@ -1,12 +1,14 @@
package com.eu.habbo.plugin.events.guilds;
import com.eu.habbo.habbohotel.guilds.Guild;
import lombok.Getter;
@Getter
public class GuildChangedSettingsEvent extends GuildEvent {
public int state;
private final int state;
public boolean rights;
private final boolean rights;
public GuildChangedSettingsEvent(Guild guild, int state, boolean rights) {
super(guild);

View File

@ -2,9 +2,13 @@ package com.eu.habbo.plugin.events.inventory;
import com.eu.habbo.habbohotel.users.HabboInventory;
import com.eu.habbo.habbohotel.users.HabboItem;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
@Getter
public class InventoryItemEvent extends InventoryEvent {
public HabboItem item;
private final HabboItem item;
public InventoryItemEvent(HabboInventory inventory, HabboItem item) {
super(inventory);

View File

@ -2,11 +2,13 @@ package com.eu.habbo.plugin.events.marketplace;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import lombok.Getter;
@Getter
public class MarketPlaceItemOfferedEvent extends MarketPlaceEvent {
public final Habbo habbo;
public final HabboItem item;
public int price;
private final Habbo habbo;
private final HabboItem item;
private final int price;
public MarketPlaceItemOfferedEvent(Habbo habbo, HabboItem item, int price) {
this.habbo = habbo;

View File

@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.pets;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import lombok.Getter;
@Getter
public class PetTalkEvent extends PetEvent {
public RoomChatMessage message;
private final RoomChatMessage message;
public PetTalkEvent(Pet pet, RoomChatMessage message) {
super(pet);

View File

@ -2,11 +2,13 @@ package com.eu.habbo.plugin.events.sanctions;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.plugin.events.support.SupportEvent;
import lombok.Getter;
@Getter
public class SanctionEvent extends SupportEvent {
public Habbo target;
private final Habbo target;
public int sanctionLevel;
private final int sanctionLevel;
public SanctionEvent(Habbo moderator, Habbo target, int sanctionLevel) {
super(moderator);

View File

@ -2,13 +2,11 @@ package com.eu.habbo.plugin.events.support;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.plugin.Event;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public abstract class SupportEvent extends Event {
public Habbo moderator;
public SupportEvent(Habbo moderator) {
this.moderator = moderator;
}
protected final Habbo moderator;
}

View File

@ -2,19 +2,15 @@ package com.eu.habbo.plugin.events.support;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class SupportRoomActionEvent extends SupportEvent {
public final Room room;
public boolean kickUsers;
public boolean lockDoor;
public boolean changeTitle;
private final Room room;
private final boolean kickUsers;
private final boolean lockDoor;
private final boolean changeTitle;
public SupportRoomActionEvent(Habbo moderator, Room room, boolean kickUsers, boolean lockDoor, boolean changeTitle) {

View File

@ -1,14 +1,16 @@
package com.eu.habbo.plugin.events.support;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class SupportUserAlertedEvent extends SupportEvent {
public Habbo target;
private final Habbo target;
public String message;
private final String message;
public SupportUserAlertedReason reason;
private final SupportUserAlertedReason reason;
public SupportUserAlertedEvent(Habbo moderator, Habbo target, String message, SupportUserAlertedReason reason) {
super(moderator);

View File

@ -1,13 +1,13 @@
package com.eu.habbo.plugin.events.support;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class SupportUserKickEvent extends SupportEvent {
public Habbo target;
public String message;
private final Habbo target;
private final String message;
public SupportUserKickEvent(Habbo moderator, Habbo target, String message) {

View File

@ -2,14 +2,16 @@ package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
import java.util.Collection;
@Getter
public class HabboAddedToRoomEvent extends UserEvent {
public final Room room;
public Collection<Habbo> habbosToSendEnter;
public Collection<Habbo> visibleHabbos;
private final Room room;
private final Collection<Habbo> habbosToSendEnter;
private final Collection<Habbo> visibleHabbos;
public HabboAddedToRoomEvent(Habbo habbo, Room room, Collection<Habbo> habbosToSendEnter, Collection<Habbo> visibleHabbos) {
super(habbo);

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserCreditsEvent extends UserEvent {
public int credits;
private final int credits;
public UserCreditsEvent(Habbo habbo, int credits) {

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserIdleEvent extends UserEvent {
public final IdleReason reason;
public boolean idle;
private final IdleReason reason;
private final boolean idle;
public UserIdleEvent(Habbo habbo, IdleReason reason, boolean idle) {
super(habbo);

View File

@ -1,13 +1,12 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserPointsEvent extends UserEvent {
public int points;
public int type;
private final int points;
private final int type;
public UserPointsEvent(Habbo habbo, int points, int type) {

View File

@ -1,16 +1,15 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserPublishPictureEvent extends UserEvent {
private final String URL;
public String URL;
private final int timestamp;
public int timestamp;
public int roomId;
private final int roomId;
public UserPublishPictureEvent(Habbo habbo, String url, int timestamp, int roomId) {

View File

@ -1,16 +1,13 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserPurchasePictureEvent extends UserEvent {
public String url;
public int roomId;
public int timestamp;
private final String url;
private final int roomId;
private final int timestamp;
public UserPurchasePictureEvent(Habbo habbo, String url, int roomId, int timestamp) {

View File

@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import lombok.Getter;
@Getter
public class UserSavedLookEvent extends UserEvent {
public HabboGender gender;
public String newLook;
private final HabboGender gender;
private final String newLook;
public UserSavedLookEvent(Habbo habbo, HabboGender gender, String newLook) {

View File

@ -1,10 +1,12 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserSavedMottoEvent extends UserEvent {
public final String oldMotto;
public String newMotto;
private final String oldMotto;
private final String newMotto;
public UserSavedMottoEvent(Habbo habbo, String oldMotto, String newMotto) {

View File

@ -1,11 +1,11 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserSignEvent extends UserEvent {
public int sign;
private final int sign;
public UserSignEvent(Habbo habbo, int sign) {
super(habbo);

View File

@ -1,24 +0,0 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward;
import com.eu.habbo.habbohotel.users.Habbo;
public class UserWiredRewardReceived extends UserEvent {
public final WiredEffectGiveReward wiredEffectGiveReward;
public final String type;
public String value;
public UserWiredRewardReceived(Habbo habbo, WiredEffectGiveReward wiredEffectGiveReward, String type, String value) {
super(habbo);
this.wiredEffectGiveReward = wiredEffectGiveReward;
this.type = type;
this.value = value;
}
}

View File

@ -0,0 +1,21 @@
package com.eu.habbo.plugin.events.users;
import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.Getter;
@Getter
public class UserWiredRewardReceivedEvent extends UserEvent {
private final WiredEffectGiveReward wiredEffectGiveReward;
private final String type;
private final String value;
public UserWiredRewardReceivedEvent(Habbo habbo, WiredEffectGiveReward wiredEffectGiveReward, String type, String value) {
super(habbo);
this.wiredEffectGiveReward = wiredEffectGiveReward;
this.type = type;
this.value = value;
}
}

Some files were not shown because too many files have changed in this diff Show More