♻️ cleanup

This commit is contained in:
duckietm 2024-07-03 10:40:59 +02:00
parent b2ffaf5a7c
commit d6ce42e996
5 changed files with 55 additions and 54 deletions

View File

@ -8,5 +8,5 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-21" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK" />
</project>

View File

@ -9,7 +9,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.plugin.EventHandler;
import com.eu.habbo.plugin.events.users.UserSavedMottoEvent;
public class Easter {
public final class Easter {
@EventHandler
public static void onUserChangeMotto(UserSavedMottoEvent event) {
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.newMotto.equalsIgnoreCase("crickey!")) {

View File

@ -470,16 +470,15 @@ public class CatalogManager {
this.giftWrappers.clear();
this.giftFurnis.clear();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM gift_wrappers ORDER BY sprite_id DESC")) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
Statement statement = connection.createStatement();
ResultSet set =
statement.executeQuery("SELECT * FROM gift_wrappers ORDER BY sprite_id DESC")) {
while (set.next()) {
switch (set.getString("type")) {
case "wrapper":
if ("wrapper".equals(set.getString("type"))) {
this.giftWrappers.put(set.getInt("sprite_id"), set.getInt("item_id"));
break;
case "gift":
} else if ("gift".equals(set.getString("type"))) {
this.giftFurnis.put(set.getInt("sprite_id"), set.getInt("item_id"));
break;
}
}
} catch (SQLException e) {
@ -489,6 +488,7 @@ public class CatalogManager {
}
}
private void loadClothing() {
synchronized (this.clothing) {
this.clothing.clear();

View File

@ -27,7 +27,7 @@ import java.util.ArrayList;
import java.util.List;
public class MarketPlace {
public final class MarketPlace {
private static final Logger LOGGER = LoggerFactory.getLogger(MarketPlace.class);
//Configuration. Loaded from database & updated accordingly.
@ -143,10 +143,9 @@ public class MarketPlace {
case 2:
query += " ORDER BY minPrice ASC";
break;
default:
case 1:
default:
query += " ORDER BY minPrice DESC";
break;
}
query += ")";

View File

@ -21,7 +21,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.habbohotel.wired.WiredEffectType;
import com.eu.habbo.habbohotel.wired.WiredHandler;
import com.eu.habbo.messages.ClientMessage;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.incoming.wired.WiredSaveException;
import gnu.trove.procedure.TObjectProcedure;
@ -32,6 +31,7 @@ import org.slf4j.LoggerFactory;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -42,45 +42,47 @@ public class WiredEffectToggleRandom extends InteractionWiredEffect {
private final THashSet<HabboItem> items = new THashSet<>();
private static final List<Class<? extends HabboItem>> FORBIDDEN_TYPES = new ArrayList<Class<? extends HabboItem>>() {
{
this.add(InteractionWired.class);
this.add(InteractionTeleport.class);
this.add(InteractionPushable.class);
this.add(InteractionTagPole.class);
this.add(InteractionTagField.class);
this.add(InteractionCrackable.class);
this.add(InteractionGameScoreboard.class);
this.add(InteractionGameGate.class);
this.add(InteractionFreezeTile.class);
this.add(InteractionFreezeBlock.class);
this.add(InteractionFreezeExitTile.class);
this.add(InteractionBattleBanzaiTeleporter.class);
this.add(InteractionBattleBanzaiTile.class);
this.add(InteractionMonsterPlantSeed.class);
this.add(InteractionPetBreedingNest.class);
this.add(InteractionPetDrink.class);
this.add(InteractionPetFood.class);
this.add(InteractionPetToy.class);
this.add(InteractionBadgeDisplay.class);
this.add(InteractionClothing.class);
this.add(InteractionVendingMachine.class);
this.add(InteractionGift.class);
this.add(InteractionPressurePlate.class);
this.add(InteractionMannequin.class);
this.add(InteractionGymEquipment.class);
this.add(InteractionHopper.class);
this.add(InteractionObstacle.class);
this.add(InteractionOneWayGate.class);
this.add(InteractionPuzzleBox.class);
this.add(InteractionRoller.class);
this.add(InteractionSwitch.class);
this.add(InteractionTent.class);
this.add(InteractionTrap.class);
this.add(InteractionTrophy.class);
this.add(InteractionWater.class);
private static final List<Class<? extends HabboItem>> FORBIDDEN_TYPES;
static {
FORBIDDEN_TYPES = new ArrayList<>(Arrays.asList(
InteractionWired.class,
InteractionTeleport.class,
InteractionPushable.class,
InteractionTagPole.class,
InteractionTagField.class,
InteractionCrackable.class,
InteractionGameScoreboard.class,
InteractionGameGate.class,
InteractionFreezeTile.class,
InteractionFreezeBlock.class,
InteractionFreezeExitTile.class,
InteractionBattleBanzaiTeleporter.class,
InteractionBattleBanzaiTile.class,
InteractionMonsterPlantSeed.class,
InteractionPetBreedingNest.class,
InteractionPetDrink.class,
InteractionPetFood.class,
InteractionPetToy.class,
InteractionBadgeDisplay.class,
InteractionClothing.class,
InteractionVendingMachine.class,
InteractionGift.class,
InteractionPressurePlate.class,
InteractionMannequin.class,
InteractionGymEquipment.class,
InteractionHopper.class,
InteractionObstacle.class,
InteractionOneWayGate.class,
InteractionPuzzleBox.class,
InteractionRoller.class,
InteractionSwitch.class,
InteractionTent.class,
InteractionTrap.class,
InteractionTrophy.class,
InteractionWater.class
));
}
};
public WiredEffectToggleRandom(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);