This commit is contained in:
Ilany 2020-09-24 09:41:14 +02:00
commit 8b873edd14
2 changed files with 12 additions and 23 deletions

View File

@ -34,8 +34,12 @@ public class InteractionVendingMachine extends HabboItem {
}
public THashSet<RoomTile> getActivatorTiles(Room room) {
THashSet<RoomTile> tiles = new THashSet<RoomTile>();
tiles.add(getSquareInFront(room.getLayout(), this));
THashSet<RoomTile> tiles = new THashSet<>();
RoomTile tileInFront = getSquareInFront(room.getLayout(), this);
if (tileInFront != null)
tiles.add(tileInFront);
tiles.add(room.getLayout().getTile(this.getX(), this.getY()));
return tiles;
}

View File

@ -138,29 +138,14 @@ public class WordFilter {
filteredMessage = this.normalise(filteredMessage);
}
TObjectHashIterator iterator = this.words.iterator();
boolean foundShit = false;
while (iterator.hasNext()) {
WordFilterWord word = (WordFilterWord) iterator.next();
if (StringUtils.containsIgnoreCase(filteredMessage, word.key)) {
if (habbo != null) {
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
continue;
}
filteredMessage = filteredMessage.replace("(?i)" + word.key, word.replacement);
foundShit = true;
if (habbo != null && word.muteTime > 0) {
habbo.mute(word.muteTime, false);
}
for (WordFilterWord word : this.words) {
if (!StringUtils.containsIgnoreCase(filteredMessage, word.key)) continue;
if (habbo != null) {
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
continue;
}
}
if (!foundShit) {
return message;
filteredMessage = filteredMessage.replaceAll("(?i)" + Pattern.quote(word.key), word.replacement);
}
return filteredMessage;