mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Merge branch 'dev' of https://git.krews.org/morningstar/Arcturus-Community into dev
This commit is contained in:
commit
8b873edd14
@ -34,8 +34,12 @@ public class InteractionVendingMachine extends HabboItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public THashSet<RoomTile> getActivatorTiles(Room room) {
|
public THashSet<RoomTile> getActivatorTiles(Room room) {
|
||||||
THashSet<RoomTile> tiles = new THashSet<RoomTile>();
|
THashSet<RoomTile> tiles = new THashSet<>();
|
||||||
tiles.add(getSquareInFront(room.getLayout(), this));
|
RoomTile tileInFront = getSquareInFront(room.getLayout(), this);
|
||||||
|
|
||||||
|
if (tileInFront != null)
|
||||||
|
tiles.add(tileInFront);
|
||||||
|
|
||||||
tiles.add(room.getLayout().getTile(this.getX(), this.getY()));
|
tiles.add(room.getLayout().getTile(this.getX(), this.getY()));
|
||||||
return tiles;
|
return tiles;
|
||||||
}
|
}
|
||||||
|
@ -138,29 +138,14 @@ public class WordFilter {
|
|||||||
filteredMessage = this.normalise(filteredMessage);
|
filteredMessage = this.normalise(filteredMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
TObjectHashIterator iterator = this.words.iterator();
|
for (WordFilterWord word : this.words) {
|
||||||
|
if (!StringUtils.containsIgnoreCase(filteredMessage, word.key)) continue;
|
||||||
boolean foundShit = false;
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
WordFilterWord word = (WordFilterWord) iterator.next();
|
|
||||||
|
|
||||||
if (StringUtils.containsIgnoreCase(filteredMessage, word.key)) {
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
|
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
filteredMessage = filteredMessage.replace("(?i)" + word.key, word.replacement);
|
|
||||||
foundShit = true;
|
|
||||||
|
|
||||||
if (habbo != null && word.muteTime > 0) {
|
filteredMessage = filteredMessage.replaceAll("(?i)" + Pattern.quote(word.key), word.replacement);
|
||||||
habbo.mute(word.muteTime, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!foundShit) {
|
|
||||||
return message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredMessage;
|
return filteredMessage;
|
||||||
|
Loading…
Reference in New Issue
Block a user