Skip to content

Commit

Permalink
Revert "camelCase all component SerialNames"
Browse files Browse the repository at this point in the history
This reverts commit 4bf8b4e.
  • Loading branch information
0ffz committed Dec 26, 2023
1 parent 3cc2730 commit 2796d04
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.bukkit.entity.LivingEntity
* Deals the given damage in a square of the specified size
*/
@Serializable
@SerialName("geary:areaDamage")
@SerialName("geary:area_damage")
class AreaDamage(
val damage: Double,
val size: Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlinx.serialization.Serializable
* @param damage The damage amount.
*/
@Serializable
@SerialName("geary:dealDamage")
@SerialName("geary:deal_damage")
data class DealDamage(
val damage: @Serializable(with = DoubleRangeSerializer::class) DoubleRange,
val minHealth: Double = 0.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable
import org.bukkit.potion.PotionEffect

@Serializable
@SerialName("geary:potionEffects")
@SerialName("geary:potion_effects")
class PotionEffects(
val effects: List<@Serializable(with = PotionEffectSerializer::class) PotionEffect>
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import kotlinx.serialization.Serializable


/**
* `geary:cancel_bukkit_event`
* Cancels any bukkit event added to an event entity when added to that same entity.
*
* TODO implement
*/
@Serializable
@SerialName("geary:cancelBukkitEvent")
@SerialName("geary:cancel_bukkit_event")
sealed class CancelBukkitEvent
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
@SerialName("geary:event.leftClicked")
@SerialName("geary:event.left_clicked")
sealed class LeftClicked

@Serializable
@SerialName("geary:event.rightClicked")
@SerialName("geary:event.right_clicked")
sealed class RightClicked

@Serializable
@SerialName("geary:event.itemInteracted")
@SerialName("geary:event.item_interacted")
sealed class Interacted

sealed class ItemBroke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
import org.bukkit.Material

@Serializable
@SerialName("geary:check.blockType")
@SerialName("geary:check.block_type")
class BlockConditions(
val allow: Set<Material> = setOf(),
val deny: Set<Material> = setOf()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mineinabyss.geary.papermc.bridge.systems.apply

import com.mineinabyss.geary.papermc.bridge.actions.components.ApplicableAttribute
import com.mineinabyss.geary.papermc.configlang.components.Apply
import com.mineinabyss.geary.papermc.commons.events.configurable.components.Apply
import com.mineinabyss.geary.systems.GearyListener
import com.mineinabyss.geary.systems.accessors.Pointers
import com.mineinabyss.idofront.typealiases.BukkitEntity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mineinabyss.geary.papermc.bridge.systems.apply

import com.mineinabyss.geary.papermc.bridge.actions.components.DealDamage
import com.mineinabyss.geary.papermc.configlang.components.Apply
import com.mineinabyss.geary.papermc.commons.events.configurable.components.Apply
import com.mineinabyss.geary.systems.GearyListener
import com.mineinabyss.geary.systems.accessors.Pointers
import com.mineinabyss.idofront.typealiases.BukkitEntity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mineinabyss.geary.papermc.bridge.systems.apply

import com.mineinabyss.geary.papermc.bridge.actions.components.PotionEffects
import com.mineinabyss.geary.papermc.configlang.components.Apply
import com.mineinabyss.geary.papermc.commons.events.configurable.components.Apply
import com.mineinabyss.geary.systems.GearyListener
import com.mineinabyss.geary.systems.accessors.Pointers
import com.mineinabyss.idofront.typealiases.BukkitEntity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.mineinabyss.geary.papermc.configlang.components
package com.mineinabyss.geary.papermc.commons.events.configurable.components

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
@SerialName("geary:applyRelation")
@SerialName("geary:apply_relation")
sealed class Apply

@JvmInline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import kotlinx.serialization.Serializable
value class EventRunBuilder(val expression: String)

@Serializable
@SerialName("geary:event.runRelation")
@SerialName("geary:event.run_relation")
sealed class EventRun
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mineinabyss.geary.papermc.configlang.systems

import com.mineinabyss.geary.annotations.optin.UnsafeAccessors
import com.mineinabyss.geary.papermc.configlang.components.Apply
import com.mineinabyss.geary.papermc.configlang.components.ApplyBuilder
import com.mineinabyss.geary.papermc.commons.events.configurable.components.Apply
import com.mineinabyss.geary.papermc.commons.events.configurable.components.ApplyBuilder
import com.mineinabyss.geary.papermc.configlang.helpers.parseEntity
import com.mineinabyss.geary.systems.GearyListener
import com.mineinabyss.geary.systems.accessors.Pointers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ package com.mineinabyss.geary.papermc.tracking.entities.components
import com.mineinabyss.idofront.nms.aliases.NMSEntityType
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import net.minecraft.world.entity.EntityType

@JvmInline
@Serializable
@SerialName("geary:set.entityType")
value class SetEntityType(
val key: String,
@SerialName("geary:set.entity_type")
class SetEntityType(
private val key: String,
// TODO support this via custom entity types in the future
// val mobCategory: MobCategory? = null,
) {
val entityTypeFromRegistry: EntityType<*> get() = NMSEntityType
@Transient
val entityTypeFromRegistry: EntityType<*> = NMSEntityType
.byString(key)
.orElseGet { error("An entity type with key $key was not found.") }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.mineinabyss.geary.papermc.tracking.entities.components

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import net.minecraft.world.entity.EntityType

@JvmInline
@Serializable
@SerialName("geary:set.mythicMob")
@SerialName("geary:set.mythic_mob")
value class SetMythicMob(val id: String)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable
import java.util.*

@Serializable
@SerialName("geary:set.item.ignoredProperties")
@SerialName("geary:set.item.ignored_properties")
data class SetItemIgnoredProperties(val ignore: Set<SerializableItemStack.Properties>) {
fun ignoreAsEnumSet(): EnumSet<SerializableItemStack.Properties> =
if (ignore.isEmpty()) EnumSet.noneOf(SerializableItemStack.Properties::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import com.mineinabyss.geary.modules.TestEngineModule
import com.mineinabyss.geary.modules.geary
import com.mineinabyss.geary.papermc.bridge.actions.components.PotionEffects
import com.mineinabyss.geary.papermc.bridge.components.Touched
import com.mineinabyss.geary.papermc.commons.events.configurable.components.ApplyBuilder
import com.mineinabyss.geary.papermc.commons.events.configurable.components.EventTriggers
import com.mineinabyss.geary.papermc.configlang.ConfigLang
import com.mineinabyss.geary.papermc.configlang.components.ApplyBuilder
import com.mineinabyss.geary.papermc.helpers.MockedServerTest
import com.mineinabyss.geary.papermc.helpers.SomeData
import com.mineinabyss.geary.papermc.helpers.TestEntityTracking
Expand Down Expand Up @@ -57,7 +57,7 @@ class EventTriggersTests : MockedServerTest() {
mapOf(
"poison" to listOf(
SomeData("testing"),
ApplyBuilder("geary:potionEffects")
ApplyBuilder("geary:potion_effects")
)
)
)
Expand All @@ -80,7 +80,7 @@ class EventTriggersTests : MockedServerTest() {
mapOf(
"poison" to listOf(
PotionEffects(listOf(PotionEffect(PotionEffectType.POISON, 10, 1, true))),
ApplyBuilder("geary:potionEffects")
ApplyBuilder("geary:potion_effects")
)
)
)
Expand Down

0 comments on commit 2796d04

Please sign in to comment.