-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Show yaml decoding error when running test command
- Loading branch information
Showing
4 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...in/com/mineinabyss/geary/papermc/features/common/conditions/location/GapAboveCondition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.mineinabyss.geary.papermc.features.common.conditions.location | ||
|
||
import com.mineinabyss.geary.actions.ActionGroupContext | ||
import com.mineinabyss.geary.actions.Condition | ||
import com.mineinabyss.geary.papermc.features.common.conditions.location.GapCondition.Companion.checkGap | ||
import com.mineinabyss.geary.papermc.location | ||
import com.mineinabyss.geary.serialization.serializers.InnerSerializer | ||
import com.mineinabyss.idofront.serialization.IntRangeSerializer | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable(with = GapAboveCondition.Serializer::class) | ||
class GapAboveCondition( | ||
val gap: @Serializable(with = IntRangeSerializer::class) IntRange, | ||
) : Condition { | ||
override fun ActionGroupContext.execute(): Boolean { | ||
val location = location?.clone() ?: return true | ||
return checkGap(location, gap, checkBelow = false) { it.block.isEmpty } | ||
} | ||
|
||
object Serializer : InnerSerializer<IntRange, GapAboveCondition>( | ||
"geary:gap_above", | ||
IntRangeSerializer, | ||
{ GapAboveCondition(it) }, | ||
{ it.gap }, | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
...in/com/mineinabyss/geary/papermc/features/common/conditions/location/GapBelowCondition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.mineinabyss.geary.papermc.features.common.conditions.location | ||
|
||
import com.mineinabyss.geary.actions.ActionGroupContext | ||
import com.mineinabyss.geary.actions.Condition | ||
import com.mineinabyss.geary.papermc.features.common.conditions.location.GapCondition.Companion.checkGap | ||
import com.mineinabyss.geary.papermc.location | ||
import com.mineinabyss.geary.serialization.serializers.InnerSerializer | ||
import com.mineinabyss.idofront.serialization.IntRangeSerializer | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable(with = GapBelowCondition.Serializer::class) | ||
class GapBelowCondition( | ||
val gap: @Serializable(with = IntRangeSerializer::class) IntRange, | ||
) : Condition { | ||
override fun ActionGroupContext.execute(): Boolean { | ||
val location = location?.clone() ?: return true | ||
return checkGap(location, gap, checkAbove = false) { it.block.isEmpty } | ||
} | ||
|
||
object Serializer : InnerSerializer<IntRange, GapBelowCondition>( | ||
"geary:gap_below", | ||
IntRangeSerializer, | ||
{ GapBelowCondition(it) }, | ||
{ it.gap }, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters