Removed stripBlacklistedClothing

This commit is contained in:
Beny 2019-05-20 16:34:44 +01:00
parent dda8963c1e
commit 1c73aa27a8
6 changed files with 4 additions and 37 deletions

View File

@ -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()));
}

View File

@ -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());

View File

@ -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;
}

View File

@ -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())

View File

@ -58,7 +58,7 @@ public class UpdateUser extends RCONMessage<UpdateUser.JSON>
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());
}

View File

@ -50,24 +50,6 @@ public class FigureUtil
return false;
}
public static String stripBlacklistedClothing(String figure, Set<Integer> 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<String, String> figureBits1 = getFigureBits(figure1);