diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt index 6de251af5..e4db8ee3b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.chat.playerchat import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.MultiFilter +import at.hannibal2.skyhanni.utils.jsonobjects.PlayerChatFilterJson import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PlayerChatFilter { @@ -29,18 +30,16 @@ class PlayerChatFilter { var countCategories = 0 var countFilters = 0 - val data = event.getConstant("PlayerChatFilter") - for (category in data["filters"].asJsonArray) { - val jsonObject = category.asJsonObject - val description = jsonObject["description"].asString + val data = event.getConstant<PlayerChatFilterJson>("PlayerChatFilter") + for (category in data.filters) { + val description = category.description val filter = MultiFilter() - filter.load(jsonObject) + filter.load(category) filters[description] = filter countCategories++ countFilters += filter.count() } - LorenzUtils.debug("Loaded $countFilters filters in $countCategories categories from repo") } } |