style: use Quaedam#resource for resource locations

This commit is contained in:
xtex 2023-07-26 21:07:52 +08:00
parent bbfb3f9b9a
commit bc64a13d9c
Signed by: xtex
GPG Key ID: B918086ED8045B91
5 changed files with 9 additions and 9 deletions

View File

@ -9,6 +9,7 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerLevel import net.minecraft.server.level.ServerLevel
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import quaedam.Quaedam
abstract class ProjectionEffect : Cloneable { abstract class ProjectionEffect : Cloneable {
@ -37,11 +38,11 @@ data class ProjectionEffectType<T : ProjectionEffect>(val constructor: () -> T)
companion object { companion object {
val registryKey: ResourceKey<Registry<ProjectionEffectType<*>>> = val registryKey: ResourceKey<Registry<ProjectionEffectType<*>>> =
ResourceKey.createRegistryKey(ResourceLocation("quaedam", "projection_effect")) ResourceKey.createRegistryKey(Quaedam.resource("projection_effect"))
val registry: Registry<ProjectionEffectType<*>> = BuiltInRegistries.registerSimple(registryKey) { null } val registry: Registry<ProjectionEffectType<*>> = BuiltInRegistries.registerSimple(registryKey) { null }
val nopEffect: ProjectionEffectType<NopEffect> = val nopEffect: ProjectionEffectType<NopEffect> =
Registry.register(registry, ResourceLocation("quaedam", "nop"), ProjectionEffectType { NopEffect }) Registry.register(registry, Quaedam.resource("nop"), ProjectionEffectType { NopEffect })
} }

View File

@ -7,14 +7,13 @@ import net.minecraft.core.BlockPos
import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.CompoundTag
import net.minecraft.network.FriendlyByteBuf import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer import net.minecraft.server.level.ServerPlayer
import quaedam.Quaedam import quaedam.Quaedam
import quaedam.utils.sendBlockUpdated import quaedam.utils.sendBlockUpdated
object SimpleProjectionUpdate { object SimpleProjectionUpdate {
val id = ResourceLocation("quaedam", "simple_projection_update") val id = Quaedam.resource("simple_projection_update")
init { init {
NetworkManager.registerReceiver(NetworkManager.Side.C2S, id, ::handle) NetworkManager.registerReceiver(NetworkManager.Side.C2S, id, ::handle)

View File

@ -72,7 +72,7 @@ data class ProjectedPersonShape(
object Names { object Names {
val id = ResourceLocation("quaedam", "projected-person-names") val id = Quaedam.resource("projected-person-names")
var names = emptySet<String>() var names = emptySet<String>()
@ -109,7 +109,7 @@ data class ProjectedPersonShape(
object Skins { object Skins {
val id = ResourceLocation("quaedam", "skins") val id = Quaedam.resource("skins")
var skins = emptyList<ResourceLocation>() var skins = emptyList<ResourceLocation>()

View File

@ -24,8 +24,8 @@ import kotlin.jvm.optionals.getOrNull
object ProjectedPersonAI { object ProjectedPersonAI {
val tagEnemy = TagKey.create(Registries.ENTITY_TYPE, ResourceLocation("quaedam", "projected_person/enemy")) val tagEnemy = TagKey.create(Registries.ENTITY_TYPE, Quaedam.resource("projected_person/enemy"))
val tagNoAttack = TagKey.create(Registries.ENTITY_TYPE, ResourceLocation("quaedam", "projected_person/no_attack")) val tagNoAttack = TagKey.create(Registries.ENTITY_TYPE, Quaedam.resource("projected_person/no_attack"))
val defaultSchedule = Quaedam.schedules.register("projected_person_default") { val defaultSchedule = Quaedam.schedules.register("projected_person_default") {
ScheduleBuilder(Schedule()).changeActivityAt(10, Activity.IDLE) ScheduleBuilder(Schedule()).changeActivityAt(10, Activity.IDLE)

View File

@ -14,7 +14,7 @@ object ProjectionShell {
val item = Quaedam.items.register(ID) { ProjectionShellItem }!! val item = Quaedam.items.register(ID) { ProjectionShellItem }!!
val channel = NetworkChannel.create(ResourceLocation("quaedam", ID)) val channel = NetworkChannel.create(Quaedam.resource(ID))
init { init {
ServerboundPSHLockAcquirePacket ServerboundPSHLockAcquirePacket