diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2021-09-30 22:56:33 -0400 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2021-09-30 22:56:40 -0400 |
commit | 32a6e05d26a89dd96afd85adb15dfffb5a74b7eb (patch) | |
tree | 959321308a0cd8b9a2f8371804adc9abaf258997 /src/main | |
parent | 22636caabf97b647a9d3c7a38af7a5301f924e36 (diff) | |
download | SkytilsMod-32a6e05d26a89dd96afd85adb15dfffb5a74b7eb.tar.gz SkytilsMod-32a6e05d26a89dd96afd85adb15dfffb5a74b7eb.tar.bz2 SkytilsMod-32a6e05d26a89dd96afd85adb15dfffb5a74b7eb.zip |
aaaaaaa why is it null
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt | 21 | ||||
-rw-r--r-- | src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/solvers/TeleportMazeSolver.kt | 3 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt b/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt index 9cd20419..616cc8a9 100644 --- a/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt +++ b/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt @@ -17,6 +17,7 @@ */ package skytils.skytilsmod.core +import com.google.gson.JsonObject import net.minecraft.util.BlockPos import skytils.skytilsmod.Skytils import skytils.skytilsmod.features.impl.dungeons.solvers.ThreeWeirdosSolver @@ -109,17 +110,15 @@ object DataFetcher { for ((key, value) in slayerHealthData.entrySet()) { SlayerFeatures.BossHealths[key] = value.asJsonObject } - for (value in APIUtil.getArrayResponse("${Skytils.config.dataURL}SpamFilters.json")) { - val json = value.asJsonObject - SpamHider.repoFilters.add( - SpamHider.Filter( - json["name"].asString, 0, true, json["pattern"].asString, when (json["type"].asString) { - "STARTSWITH" -> SpamHider.FilterType.STARTSWITH - "CONTAINS" -> SpamHider.FilterType.CONTAINS - "REGEX" -> SpamHider.FilterType.REGEX - else -> SpamHider.FilterType.CONTAINS - }, json["formatted"].asBoolean - ) + APIUtil.getArrayResponse("${Skytils.config.dataURL}SpamFilters.json").mapNotNullTo(SpamHider.repoFilters) { + it as JsonObject + SpamHider.Filter( + it["name"].asString, 0, true, it["pattern"].asString, when (it["type"].asString) { + "STARTSWITH" -> SpamHider.FilterType.STARTSWITH + "CONTAINS" -> SpamHider.FilterType.CONTAINS + "REGEX" -> SpamHider.FilterType.REGEX + else -> SpamHider.FilterType.CONTAINS + }, it["formatted"].asBoolean ) } APIUtil.getJSONResponse("${dataUrl}constants/summons.json").entrySet().forEach { diff --git a/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/solvers/TeleportMazeSolver.kt b/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/solvers/TeleportMazeSolver.kt index f87ae47b..9ab6d7db 100644 --- a/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/solvers/TeleportMazeSolver.kt +++ b/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/solvers/TeleportMazeSolver.kt @@ -44,6 +44,7 @@ class TeleportMazeSolver { companion object { private val steppedPads = HashSet<BlockPos>() val poss = HashSet<BlockPos>() + val valid = HashSet<BlockPos>() } @SubscribeEvent @@ -84,7 +85,7 @@ class TeleportMazeSolver { val yawZ = MathHelper.cos(magicYaw) val pitchVal = -MathHelper.cos(-pitch * 0.017453292f) val vec = Vec3((yawX * pitchVal).toDouble(), 69.0, (yawZ * pitchVal).toDouble()) - val valid = HashSet<BlockPos>() + valid.clear(); for (i in 4..23) { val bp = BlockPos( x + vec.xCoord * i, |