From 32a788476c19b44c9ed449dc5c07c4a6fde3da0b Mon Sep 17 00:00:00 2001 From: Snaiker Date: Sun, 20 Dec 2020 14:07:31 +0000 Subject: [PATCH] Setting to enable/disable Easter Eggs --- sqlupdates/2_4_0 to 2_5_0-RC-1.sql | 2 ++ src/main/java/com/eu/habbo/core/Easter.java | 3 ++- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sqlupdates/2_4_0 to 2_5_0-RC-1.sql b/sqlupdates/2_4_0 to 2_5_0-RC-1.sql index 04476df3..cbd02a7b 100644 --- a/sqlupdates/2_4_0 to 2_5_0-RC-1.sql +++ b/sqlupdates/2_4_0 to 2_5_0-RC-1.sql @@ -104,6 +104,8 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('subscriptions.hc.payday.m -- OPTIONAL HC MIGRATION -- INSERT INTO users_subscriptions SELECT NULL, user_id, 'HABBO_CLUB' as `subscription_type`, UNIX_TIMESTAMP() AS `timestamp_start`, (club_expire_timestamp - UNIX_TIMESTAMP()) AS `duration`, 1 AS `active` FROM users_settings WHERE club_expire_timestamp > UNIX_TIMESTAMP(); +INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('easter_eggs.enabled', '1'); + ALTER TABLE `bots` ADD COLUMN `bubble_id` int(3) NULL DEFAULT 31 AFTER `effect`; diff --git a/src/main/java/com/eu/habbo/core/Easter.java b/src/main/java/com/eu/habbo/core/Easter.java index ea643841..f358dbc8 100644 --- a/src/main/java/com/eu/habbo/core/Easter.java +++ b/src/main/java/com/eu/habbo/core/Easter.java @@ -1,5 +1,6 @@ package com.eu.habbo.core; +import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomChatMessage; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; @@ -11,7 +12,7 @@ import com.eu.habbo.plugin.events.users.UserSavedMottoEvent; public class Easter { @EventHandler public static void onUserChangeMotto(UserSavedMottoEvent event) { - if (event.newMotto.equalsIgnoreCase("crickey!")) { + if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.newMotto.equalsIgnoreCase("crickey!")) { event.habbo.getClient().sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(event.newMotto, event.habbo, event.habbo, RoomChatMessageBubbles.ALERT))); Room room = event.habbo.getHabboInfo().getCurrentRoom(); diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 842142c8..11b9d206 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3095,7 +3095,7 @@ public class Room implements Comparable, ISerialize, Runnable { } } habbo.getHabboStats().lastChat = millis; - if (roomChatMessage != null && roomChatMessage.getMessage().equalsIgnoreCase("i am a pirate")) { + if (roomChatMessage != null && Emulator.getConfig().getBoolean("easter_eggs.enabled") && roomChatMessage.getMessage().equalsIgnoreCase("i am a pirate")) { habbo.getHabboStats().chatCounter.addAndGet(1); Emulator.getThreading().run(new YouAreAPirate(habbo, this)); return;