From 1c73aa27a84a6cc8d41275d42f6044397e030785 Mon Sep 17 00:00:00 2001 From: Beny Date: Mon, 20 May 2019 16:34:44 +0100 Subject: [PATCH] Removed stripBlacklistedClothing --- .../interactions/InteractionMannequin.java | 2 +- .../football/InteractionFootballGate.java | 4 ++-- .../eu/habbo/habbohotel/users/HabboInfo.java | 10 ---------- .../incoming/users/UserSaveLookEvent.java | 5 ----- .../com/eu/habbo/messages/rcon/UpdateUser.java | 2 +- .../com/eu/habbo/util/figure/FigureUtil.java | 18 ------------------ 6 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java index 29d4d6b4..65fed46a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java @@ -94,7 +94,7 @@ public class InteractionMannequin extends HabboItem } } - client.getHabbo().getHabboInfo().setLook(look.substring(0, look.length() - 1), true); + client.getHabbo().getHabboInfo().setLook(look.substring(0, look.length() - 1)); room.sendComposer(new RoomUserDataComposer(client.getHabbo()).compose()); client.sendResponse(new UserDataComposer(client.getHabbo())); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java index eb968519..7f24355a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java @@ -102,7 +102,7 @@ public class InteractionFootballGate extends HabboItem Emulator.getPluginManager().fireEvent(lookEvent); if(!lookEvent.isCancelled()) { - habbo.getHabboInfo().setLook(lookEvent.newLook, true); + habbo.getHabboInfo().setLook(lookEvent.newLook); Emulator.getThreading().run(habbo.getHabboInfo()); habbo.getClient().sendResponse(new UpdateUserLookComposer(habbo)); room.sendComposer(new RoomUserDataComposer(habbo).compose()); @@ -119,7 +119,7 @@ public class InteractionFootballGate extends HabboItem if(!lookEvent.isCancelled()) { habbo.getHabboStats().cache.put(CACHE_KEY, habbo.getHabboInfo().getLook()); - habbo.getHabboInfo().setLook(lookEvent.newLook, true); + habbo.getHabboInfo().setLook(lookEvent.newLook); Emulator.getThreading().run(habbo.getHabboInfo()); habbo.getClient().sendResponse(new UpdateUserLookComposer(habbo)); room.sendComposer(new RoomUserDataComposer(habbo).compose()); diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java index bed421ad..4c5cfef1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java @@ -217,16 +217,6 @@ public class HabboInfo implements Runnable } public void setLook(String look) { - this.setLook(look, false); - } - - public void setLook(String look, boolean stripForbidden) { - if (stripForbidden && Emulator.getConfig().getBoolean("clothing.strip_unowned", false)) { - Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.id); - - if (habbo != null) look = FigureUtil.stripBlacklistedClothing(look, habbo.getForbiddenClothing()); - } - this.look = look; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/UserSaveLookEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/UserSaveLookEvent.java index 53fffdb3..503a666d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/UserSaveLookEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/UserSaveLookEvent.java @@ -32,11 +32,6 @@ public class UserSaveLookEvent extends MessageHandler String look = this.packet.readString(); - if (FigureUtil.hasBlacklistedClothing(look, this.client.getHabbo().getForbiddenClothing())) { - ScripterManager.scripterDetected(this.client, "The user tried to wear clothing that they have not bought yet."); - return; - } - UserSavedLookEvent lookEvent = new UserSavedLookEvent(this.client.getHabbo(), gender, look); Emulator.getPluginManager().fireEvent(lookEvent); if(lookEvent.isCancelled()) diff --git a/src/main/java/com/eu/habbo/messages/rcon/UpdateUser.java b/src/main/java/com/eu/habbo/messages/rcon/UpdateUser.java index d661af1b..e96e9fc4 100644 --- a/src/main/java/com/eu/habbo/messages/rcon/UpdateUser.java +++ b/src/main/java/com/eu/habbo/messages/rcon/UpdateUser.java @@ -58,7 +58,7 @@ public class UpdateUser extends RCONMessage if (!json.look.isEmpty()) { - habbo.getHabboInfo().setLook(json.look, json.strip_unredeemed_clothing); + habbo.getHabboInfo().setLook(json.look); if(habbo.getClient() != null) { habbo.getClient().sendResponse(new UpdateUserLookComposer(habbo).compose()); } diff --git a/src/main/java/com/eu/habbo/util/figure/FigureUtil.java b/src/main/java/com/eu/habbo/util/figure/FigureUtil.java index 9c20ac00..c30361d6 100644 --- a/src/main/java/com/eu/habbo/util/figure/FigureUtil.java +++ b/src/main/java/com/eu/habbo/util/figure/FigureUtil.java @@ -50,24 +50,6 @@ public class FigureUtil return false; } - public static String stripBlacklistedClothing(String figure, Set blacklist) { - StringJoiner joiner = new StringJoiner("."); - - for (String set : figure.split("\\.")) { - String[] pieces = set.split("-"); - - try { - if (pieces.length < 2 || !blacklist.contains(Integer.valueOf(pieces[1]))) { - joiner.add(set); - } - } catch (NumberFormatException ignored) { - joiner.add(set); - } - } - - return joiner.toString(); - } - public static String mergeFigures(String figure1, String figure2, String[] limitFigure1, String[] limitFigure2) { THashMap figureBits1 = getFigureBits(figure1);