diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 1cbcde636..ff449b005 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -9,6 +9,7 @@ diff --git a/.idea/modules.xml b/.idea/modules.xml index a006eaf0a..35d9b6241 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,6 +2,8 @@ + + diff --git a/.idea/runConfigurations/MainKt.xml b/.idea/runConfigurations/MainKt.xml deleted file mode 100644 index 60dbe4dde..000000000 --- a/.idea/runConfigurations/MainKt.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 44287ca7e..965593603 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { `java-library` } -val minecraftVersion = "1.21.8" +val minecraftVersion = "1.21.9" val dockyardVersion = properties["dockyard.version"]!! val gitBranch = "git rev-parse --abbrev-ref HEAD".runCommand() val gitCommit = "git rev-parse --short=8 HEAD".runCommand() diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts new file mode 100644 index 000000000..053687ef7 --- /dev/null +++ b/demo/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + kotlin("jvm") +} + +group = "io.github.dockyardmc.demo" +version = parent!!.version + +repositories { + mavenCentral() + maven("https://mvn.devos.one/releases") + maven("https://mvn.devos.one/snapshots") + maven("https://jitpack.io") + maven("https://repo.spongepowered.org/repository/maven-public/") + maven("https://repo.viaversion.com") + maven("https://maven.noxcrew.com/public") +} + +dependencies { + testImplementation(kotlin("test")) + implementation(project(":")) +} + +tasks.test { + useJUnitPlatform() +} +kotlin { + jvmToolchain(21) +} \ No newline at end of file diff --git a/demo/src/main/kotlin/io/github/dockyardmc/demo/Clanker.kt b/demo/src/main/kotlin/io/github/dockyardmc/demo/Clanker.kt new file mode 100644 index 000000000..b2302cb5a --- /dev/null +++ b/demo/src/main/kotlin/io/github/dockyardmc/demo/Clanker.kt @@ -0,0 +1,24 @@ +package io.github.dockyardmc.demo + +import io.github.dockyardmc.entity.ai.EntityBehaviourCoordinator +import io.github.dockyardmc.entity.entities.CopperGolem +import io.github.dockyardmc.location.Location + +class Clanker(location: Location) : CopperGolem(location) { + + val brain = ClankerBehaviourCoordinator(this) + + override fun tick() { + super.tick() + brain.tick() + } + +} + +class ClankerBehaviourCoordinator(entity: Clanker) : EntityBehaviourCoordinator(entity) { + + init { + this.behaviours.add(EntityWalkAroundBehaviour(this)) + } + +} \ No newline at end of file diff --git a/demo/src/main/kotlin/io/github/dockyardmc/demo/WalkAroundBehaviourNode.kt b/demo/src/main/kotlin/io/github/dockyardmc/demo/WalkAroundBehaviourNode.kt new file mode 100644 index 000000000..c67b9cb7a --- /dev/null +++ b/demo/src/main/kotlin/io/github/dockyardmc/demo/WalkAroundBehaviourNode.kt @@ -0,0 +1,72 @@ +package io.github.dockyardmc.demo + +import io.github.dockyardmc.entity.Entity +import io.github.dockyardmc.entity.ai.EntityBehaviourCoordinator +import io.github.dockyardmc.entity.ai.EntityBehaviourNode +import io.github.dockyardmc.entity.ai.EntityBehaviourResult +import io.github.dockyardmc.pathfinding.PatheticPlatformDockyard.toPathPosition +import io.github.dockyardmc.pathfinding.PathfindingHelper +import io.github.dockyardmc.registry.Sounds +import io.github.dockyardmc.scheduler.runnables.ticks +import io.github.dockyardmc.sounds.Sound +import io.github.dockyardmc.utils.debug +import kotlin.random.Random + +class EntityWalkAroundBehaviour(val coordinator: EntityBehaviourCoordinator) : EntityBehaviourNode() { + + override val interruptible: Boolean = true + var failedTimes: Int = 0 + + override fun getScorer(entity: Entity): Float { + return 0.05f + } + + override fun onStart(entity: Entity) { + var foundPath = false + this.cooldown = Random.nextInt(40, 80).ticks + + coordinator.navigator.navigationCompleteDispatcher.subscribe { + getBehaviourFuture().complete(EntityBehaviourResult.SUCCESS) + } + coordinator.navigator.navigationNodeStepDispatcher.subscribe { + entity.playSoundToViewers(Sound(Sounds.ENTITY_COPPER_GOLEM_STEP)) + } + + entity.location.getBlocksInRadius(10).shuffled().forEach blockLoop@{ location -> + if (foundPath) { + return@blockLoop + } + + if (!PathfindingHelper.isTraversable(location.block, location)) return@blockLoop + val start = entity.location.getBlockLocation().subtract(0, 1, 0).toPathPosition() + val end = location.toPathPosition() + + coordinator.navigator.pathfinder.findPath(start, end, coordinator.navigator.filters).thenAccept { result -> + if (!result.successful()) { + return@thenAccept + } + if (foundPath) return@thenAccept + + foundPath = true + coordinator.navigator.cancelNavigating() + coordinator.navigator.updatePathfindingPath(location) + } + } + } + + override fun onBackstageTick(tick: Int) { + } + + override fun onFrontstageTick(tick: Int) { + } + + override fun onGeneralTick(tick: Int) { + } + + override fun onStop(entity: Entity, interrupted: Boolean) { + coordinator.navigator.cancelNavigating() + coordinator.navigator.navigationNodeStepDispatcher.dispose() + coordinator.navigator.navigationCompleteDispatcher.dispose() + coordinator.navigator.pathfindResultDispatcher.dispose() + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 43f18b792..a5c8d59b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ kotlin.daemon.jvmargs=-Xmx3000m -dockyard.version=0.10.7 +dockyard.version=0.10.8 kotlin.code.style=official diff --git a/settings.gradle.kts b/settings.gradle.kts index be11e6de3..6eba3277c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1,4 @@ rootProject.name = "Dockyard" + +include("demo") \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/DockyardServer.kt b/src/main/kotlin/io/github/dockyardmc/DockyardServer.kt index 04c6e61ad..7619139bf 100644 --- a/src/main/kotlin/io/github/dockyardmc/DockyardServer.kt +++ b/src/main/kotlin/io/github/dockyardmc/DockyardServer.kt @@ -14,7 +14,7 @@ import io.github.dockyardmc.player.Player import io.github.dockyardmc.player.PlayerManager import io.github.dockyardmc.profiler.profiler import io.github.dockyardmc.protocol.NetworkCompression -import io.github.dockyardmc.protocol.packets.configurations.Tag +import io.github.dockyardmc.protocol.packets.configurations.clientbound.Tag import io.github.dockyardmc.protocol.packets.registry.ClientPacketRegistry import io.github.dockyardmc.protocol.packets.registry.ServerPacketRegistry import io.github.dockyardmc.provider.PlayerMessageProvider @@ -45,6 +45,7 @@ class DockyardServer(configBuilder: Config.() -> Unit) { profiler("Server Load") { instance = this + versionInfo = Resources.getDockyardVersion() configBuilder.invoke(config) profiler("Register packets") { @@ -123,7 +124,6 @@ class DockyardServer(configBuilder: Config.() -> Unit) { val port get() = config.port fun start() { - versionInfo = Resources.getDockyardVersion() log("Starting DockyardMC Version ${versionInfo.dockyardVersion} (${versionInfo.gitCommit}@${versionInfo.gitBranch} for MC ${minecraftVersion.versionName})", LogType.RUNTIME) log("DockyardMC is still under heavy development. Things will break (I warned you)", LogType.WARNING) @@ -139,7 +139,7 @@ class DockyardServer(configBuilder: Config.() -> Unit) { companion object : PlayerMessageProvider, PlayerPacketProvider { lateinit var versionInfo: Resources.DockyardVersionInfo lateinit var instance: DockyardServer - val minecraftVersion = MinecraftVersions.v1_21_8 + val minecraftVersion = MinecraftVersions.v1_21_9 var allowAnyVersion: Boolean = false val scheduler = GlobalScheduler("main_scheduler") diff --git a/src/main/kotlin/io/github/dockyardmc/apis/Hologram.kt b/src/main/kotlin/io/github/dockyardmc/apis/Hologram.kt index d1cc701a8..8c20a1d37 100644 --- a/src/main/kotlin/io/github/dockyardmc/apis/Hologram.kt +++ b/src/main/kotlin/io/github/dockyardmc/apis/Hologram.kt @@ -6,12 +6,9 @@ import io.github.dockyardmc.entity.Entity import io.github.dockyardmc.entity.EntityManager.despawnEntity import io.github.dockyardmc.entity.EntityManager.spawnEntity import io.github.dockyardmc.entity.TextDisplay -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.location.Location import io.github.dockyardmc.player.Player -import io.github.dockyardmc.player.toPersistent import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType import io.github.dockyardmc.scroll.extensions.toComponent @@ -141,7 +138,7 @@ class Hologram(spawnLocation: Location, builder: HologramBuilder) : Entity(spawn entity.lineWidth.value = Int.MAX_VALUE lineEntities.add(entity) } - if (line !is PlayerContentLine && entity.metadataLayers.values.isNotEmpty()) entity.metadataLayers.clear() + if (line !is PlayerContentLine && entity.metadata.getMetadataLayers().values.isNotEmpty()) entity.metadata.clearMetadataLayers() when (line) { is StaticContentLine -> setGlobalLineContent(index, line.line) @@ -156,10 +153,7 @@ class Hologram(spawnLocation: Location, builder: HologramBuilder) : Entity(spawn private fun setPlayerLineContent(player: Player, lineIndex: Int, message: String) { val display = lineEntities.getOrNull(lineIndex) ?: return - - if (display.metadataLayers[player.toPersistent()] == null) display.metadataLayers[player.toPersistent()] = mutableMapOf() - val layer = display.metadataLayers[player.toPersistent()]!! - layer[EntityMetadataType.TEXT_DISPLAY_TEXT] = EntityMetadata(EntityMetadataType.TEXT_DISPLAY_TEXT, EntityMetaValue.TEXT_COMPONENT, message.toComponent()) + display.metadata.setForPlayer(player, Metadata.TextDisplay.TEXT, message.toComponent()) display.sendMetadataPacket(player) onLinesUpdated.dispatch(Unit) } diff --git a/src/main/kotlin/io/github/dockyardmc/codec/ExtendedCodecs.kt b/src/main/kotlin/io/github/dockyardmc/codec/ExtendedCodecs.kt new file mode 100644 index 000000000..5e606880f --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/codec/ExtendedCodecs.kt @@ -0,0 +1,12 @@ +package io.github.dockyardmc.codec + +import io.github.dockyardmc.tide.codec.Codec +import io.github.dockyardmc.tide.stream.StreamCodec + +fun StreamCodec.mutableList(): MutableListStreamCodec { + return MutableListStreamCodec(this) +} + +fun Codec.mutableList(): MutableListCodec { + return MutableListCodec(this) +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/codec/ExtraCodecs.kt b/src/main/kotlin/io/github/dockyardmc/codec/ExtraCodecs.kt new file mode 100644 index 000000000..245353d10 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/codec/ExtraCodecs.kt @@ -0,0 +1,35 @@ +package io.github.dockyardmc.codec + +import io.github.dockyardmc.extentions.read +import io.github.dockyardmc.extentions.writeColor +import io.github.dockyardmc.scroll.CustomColor +import io.github.dockyardmc.tide.stream.StreamCodec +import io.netty.buffer.ByteBuf + +object ExtraCodecs { + fun fieldWriter(innerCodec: StreamCodec): StreamCodec { + return object : StreamCodec { + + override fun write(buffer: ByteBuf, value: T) { + innerCodec.write(buffer, value) + } + + override fun read(buffer: ByteBuf): T { + return innerCodec.read(buffer) + } + + } + } + + val CUSTOM_COLOR_STREAM = object : StreamCodec { + + override fun write(buffer: ByteBuf, value: CustomColor) { + buffer.writeColor(value) + } + + override fun read(buffer: ByteBuf): CustomColor { + return CustomColor.read(buffer) + } + + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/codec/MutableListCodec.kt b/src/main/kotlin/io/github/dockyardmc/codec/MutableListCodec.kt new file mode 100644 index 000000000..9ee6da4dc --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/codec/MutableListCodec.kt @@ -0,0 +1,24 @@ +package io.github.dockyardmc.codec + +import io.github.dockyardmc.tide.codec.Codec +import io.github.dockyardmc.tide.transcoder.Transcoder + +class MutableListCodec(val inner: Codec) : Codec> { + + override fun encode(transcoder: Transcoder, value: MutableList): D { + val encodedList = transcoder.encodeList(value.size) + value.forEach { item -> + encodedList.add(inner.encode(transcoder, item)) + } + return encodedList.build() + } + + override fun decode(transcoder: Transcoder, value: D): MutableList { + val listResult = transcoder.decodeList(value) + val decodedList = mutableListOf() + listResult.forEach { item -> + decodedList.add(inner.decode(transcoder, item)) + } + return decodedList + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/codec/MutableListStreamCodec.kt b/src/main/kotlin/io/github/dockyardmc/codec/MutableListStreamCodec.kt new file mode 100644 index 000000000..8ef4fabaf --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/codec/MutableListStreamCodec.kt @@ -0,0 +1,23 @@ +package io.github.dockyardmc.codec + +import io.github.dockyardmc.tide.stream.StreamCodec +import io.netty.buffer.ByteBuf + +class MutableListStreamCodec(val inner: StreamCodec) : StreamCodec> { + + override fun write(buffer: ByteBuf, value: MutableList) { + StreamCodec.VAR_INT.write(buffer, value.size) + value.forEach { item -> + inner.write(buffer, item) + } + } + + override fun read(buffer: ByteBuf): MutableList { + val size = StreamCodec.VAR_INT.read(buffer) + val list = mutableListOf() + for (i in 0 until size) { + list.add(inner.read(buffer)) + } + return list + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/data/components/ParrotVariantComponent.kt b/src/main/kotlin/io/github/dockyardmc/data/components/ParrotVariantComponent.kt index 17cce024a..911c601de 100644 --- a/src/main/kotlin/io/github/dockyardmc/data/components/ParrotVariantComponent.kt +++ b/src/main/kotlin/io/github/dockyardmc/data/components/ParrotVariantComponent.kt @@ -1,13 +1,13 @@ package io.github.dockyardmc.data.components import io.github.dockyardmc.data.DataComponent -import io.github.dockyardmc.entity.ParrotVariant +import io.github.dockyardmc.entity.Parrot import io.github.dockyardmc.extentions.readEnum import io.github.dockyardmc.extentions.writeEnum import io.github.dockyardmc.protocol.NetworkReadable import io.netty.buffer.ByteBuf -data class ParrotVariantComponent(val parrotColor: ParrotVariant) : DataComponent() { +data class ParrotVariantComponent(val parrotColor: Parrot.Variant) : DataComponent() { override fun write(buffer: ByteBuf) { buffer.writeEnum(parrotColor) diff --git a/src/main/kotlin/io/github/dockyardmc/entity/BlockDisplay.kt b/src/main/kotlin/io/github/dockyardmc/entity/BlockDisplay.kt index 33c7920f3..af067cb9d 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/BlockDisplay.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/BlockDisplay.kt @@ -1,23 +1,21 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.location.Location import io.github.dockyardmc.registry.Blocks import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType +import io.github.dockyardmc.world.block.Block -class BlockDisplay(location: Location): DisplayEntity(location) { +class BlockDisplay(location: Location) : DisplayEntity(location) { override var type: EntityType = EntityTypes.BLOCK_DISPLAY - val block: Bindable = Bindable(Blocks.STONE.toBlock()) + val block: Bindable = bindablePool.provideBindable(Blocks.STONE.toBlock()) init { - block.valueChanged { - val type = EntityMetadataType.BLOCK_DISPLAY_BLOCK - metadata[type] = EntityMetadata(type, EntityMetaValue.BLOCK_STATE, it.newValue) + block.valueChanged { event -> + metadata[Metadata.BlockDisplay.DISPLAYED_BLOCK_STATE] = event.newValue } } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/DisplayEntity.kt b/src/main/kotlin/io/github/dockyardmc/entity/DisplayEntity.kt index 631800fa7..da30fb60e 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/DisplayEntity.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/DisplayEntity.kt @@ -1,104 +1,95 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.extentions.getPackedInt import io.github.dockyardmc.location.Location +import io.github.dockyardmc.maths.Quaternion +import io.github.dockyardmc.maths.vectors.Vector3f import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType import io.github.dockyardmc.scroll.CustomColor -import io.github.dockyardmc.maths.Quaternion -import io.github.dockyardmc.maths.vectors.Vector3f import kotlin.math.PI import kotlin.math.cos import kotlin.math.sin open class DisplayEntity(location: Location) : Entity(location) { override var type: EntityType = EntityTypes.TEXT_DISPLAY - override val health: Bindable = Bindable(0f) + override val health: Bindable = bindablePool.provideBindable(0f) override var inventorySize: Int = 0 - val interpolationDelay: Bindable = Bindable(0) - val transformInterpolation: Bindable = Bindable(0) - val translationInterpolation: Bindable = Bindable(0) - - val translation: Bindable = Bindable(Vector3f()) - val scale: Bindable = Bindable(Vector3f(1f)) - val rotation: Bindable = Bindable(Vector3f()) - val billboard: Bindable = Bindable(DisplayBillboard.FIXED) - val brightness: Bindable = Bindable(-1) - val viewRange: Bindable = Bindable(1f) - val shadowRadius: Bindable = Bindable(0f) - val shadowStrength: Bindable = Bindable(1f) - val glowColor: Bindable = Bindable(CustomColor.fromHex("#FFFFFF")) + val interpolationDelay: Bindable = bindablePool.provideBindable(0) + val transformInterpolation: Bindable = bindablePool.provideBindable(0) + val translationInterpolation: Bindable = bindablePool.provideBindable(0) + + val translation: Bindable = bindablePool.provideBindable(Vector3f()) + val scale: Bindable = bindablePool.provideBindable(Vector3f(1f)) + val rotation: Bindable = bindablePool.provideBindable(Vector3f()) + val billboard: Bindable = bindablePool.provideBindable(BillboardConstraints.FIXED) + val brightness: Bindable = bindablePool.provideBindable(-1) + val viewRange: Bindable = bindablePool.provideBindable(1f) + val shadowRadius: Bindable = bindablePool.provideBindable(0f) + val shadowStrength: Bindable = bindablePool.provideBindable(1f) + val glowColor: Bindable = bindablePool.provideBindable(CustomColor.fromHex("#FFFFFF")) + + enum class BillboardConstraints { + FIXED, + VERTICAL, + HORIZONTAL, + CENTER + } init { - interpolationDelay.valueChanged { - val type = EntityMetadataType.DISPLAY_INTERPOLATION_DELAY - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue) + interpolationDelay.valueChanged { event -> + metadata[Metadata.Display.INTERPOLATION_DELAY] = event.newValue } - transformInterpolation.valueChanged { - val type = EntityMetadataType.DISPLAY_TRANSFORM_INTERPOLATION - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue) + transformInterpolation.valueChanged { event -> + metadata[Metadata.Display.TRANSFORMATION_INTERPOLATION_DURATION] = event.newValue } - translationInterpolation.valueChanged { - val type = EntityMetadataType.DISPLAY_TRANSLATION_INTERPOLATION - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue) + translationInterpolation.valueChanged { event -> + metadata[Metadata.Display.TRANSFORMATION_INTERPOLATION_DURATION] = event.newValue } - translation.valueChanged { - val type = EntityMetadataType.DISPLAY_TRANSLATION - metadata[type] = EntityMetadata(type, EntityMetaValue.VECTOR3, it.newValue) + translation.valueChanged { event -> + metadata[Metadata.Display.TRANSLATION] = event.newValue } - scale.valueChanged { - val type = EntityMetadataType.DISPLAY_SCALE - metadata[type] = EntityMetadata(type, EntityMetaValue.VECTOR3, it.newValue) + scale.valueChanged { event -> + metadata[Metadata.Display.SCALE] = event.newValue } - rotation.valueChanged { - val type = EntityMetadataType.DISPLAY_ROTATION_LEFT - val quaternion = Quaternion.fromAxis(it.newValue) - metadata[type] = EntityMetadata(type, EntityMetaValue.QUATERNION, quaternion) + rotation.valueChanged { event -> + val quaternion = Quaternion.fromAxis(event.newValue) + metadata[Metadata.Display.ROTATION_LEFT] = quaternion } - billboard.valueChanged { - val type = EntityMetadataType.DISPLAY_BILLBOARD - metadata[type] = EntityMetadata(type, EntityMetaValue.BYTE, it.newValue.ordinal) + billboard.valueChanged { event -> + metadata[Metadata.Display.BILLBOARD_CONSTRAINTS] = event.newValue.ordinal.toByte() } - brightness.valueChanged { - val type = EntityMetadataType.DISPLAY_BRIGHTNESS - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue) + brightness.valueChanged { event -> + metadata[Metadata.Display.BRIGHTNESS_OVERRIDE] = event.newValue } - viewRange.valueChanged { - val type = EntityMetadataType.DISPLAY_VIEW_RANGE - metadata[type] = EntityMetadata(type, EntityMetaValue.FLOAT, it.newValue) + viewRange.valueChanged { event -> + metadata[Metadata.Display.VIEW_RANGE] = event.newValue } - shadowRadius.valueChanged { - val type = EntityMetadataType.DISPLAY_SHADOW_RADIUS - metadata[type] = EntityMetadata(type, EntityMetaValue.FLOAT, it.newValue) + shadowRadius.valueChanged { event -> + metadata[Metadata.Display.SHADOW_RADIUS] = event.newValue } - shadowStrength.valueChanged { - val type = EntityMetadataType.DISPLAY_SHADOW_STRENGTH - metadata[type] = EntityMetadata(type, EntityMetaValue.FLOAT, it.newValue) + shadowStrength.valueChanged { event -> + metadata[Metadata.Display.SHADOW_STRENGHT] = event.newValue } - glowColor.valueChanged { - val type = EntityMetadataType.DISPLAY_GLOW_COLOR - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue.getPackedInt()) + glowColor.valueChanged { event -> + metadata[Metadata.Display.GLOW_COLOR_OVERRIDE] = event.newValue.getPackedInt() } interpolationDelay.value = -1 } fun setRightRotationFromQuaternion(quaternion: Quaternion) { - val type = EntityMetadataType.DISPLAY_ROTATION_RIGHT - metadata[type] = EntityMetadata(type, EntityMetaValue.QUATERNION, quaternion) + metadata[Metadata.Display.ROTATION_RIGHT] = quaternion } fun setLeftRotationFromQuaternion(quaternion: Quaternion) { - val type = EntityMetadataType.DISPLAY_ROTATION_LEFT - metadata[type] = EntityMetadata(type, EntityMetaValue.QUATERNION, quaternion) + metadata[Metadata.Display.ROTATION_LEFT] = quaternion } fun scaleTo(x: Float, y: Float, z: Float, interpolation: Int? = null) { - if(interpolation != null) transformInterpolation.value = interpolation + if (interpolation != null) transformInterpolation.value = interpolation scale.value = Vector3f(x, y, z) } @@ -111,7 +102,7 @@ open class DisplayEntity(location: Location) : Entity(location) { } fun translateTo(x: Float, y: Float, z: Float, interpolation: Int? = null) { - if(interpolation != null) translationInterpolation.value = interpolation + if (interpolation != null) translationInterpolation.value = interpolation translation.value = Vector3f(x, y, z) } @@ -120,7 +111,7 @@ open class DisplayEntity(location: Location) : Entity(location) { } fun rotateTo(x: Float, y: Float, z: Float, interpolation: Int? = null) { - if(interpolation != null) transformInterpolation.value = interpolation + if (interpolation != null) transformInterpolation.value = interpolation rotation.value = Vector3f(x, y, z) } @@ -129,7 +120,7 @@ open class DisplayEntity(location: Location) : Entity(location) { } fun rotateBy(x: Float, y: Float, z: Float, interpolation: Int? = null) { - if(interpolation != null) transformInterpolation.value = interpolation + if (interpolation != null) transformInterpolation.value = interpolation rotation.value = rotation.value + Vector3f(x, y, z) } @@ -153,9 +144,3 @@ open class DisplayEntity(location: Location) : Entity(location) { } } -enum class DisplayBillboard { - FIXED, - VERTICAL, - HORIZONTAL, - CENTER -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/Entity.kt b/src/main/kotlin/io/github/dockyardmc/entity/Entity.kt index 9ecebc427..82acc6732 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/Entity.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/Entity.kt @@ -8,8 +8,6 @@ import io.github.dockyardmc.config.ConfigManager import io.github.dockyardmc.effects.AppliedPotionEffect import io.github.dockyardmc.entity.EntityManager.despawnEntity import io.github.dockyardmc.entity.handlers.* -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType import io.github.dockyardmc.events.* import io.github.dockyardmc.extentions.sendPacket import io.github.dockyardmc.item.ItemStack @@ -52,7 +50,7 @@ abstract class Entity(open var location: Location, open var world: World) : Disp abstract var type: EntityType abstract val health: Bindable - abstract var inventorySize: Int + open var inventorySize: Int = 0 open var id: Int = EntityManager.entityIdCounter.incrementAndGet() open var uuid: UUID = UUID.randomUUID() @@ -65,12 +63,12 @@ abstract class Entity(open var location: Location, open var world: World) : Disp val customNameVisible: Bindable = bindablePool.provideBindable(false) val metadata: EntityMetadataHandler = EntityMetadataHandler(this) val pose: Bindable = bindablePool.provideBindable(EntityPose.STANDING) - val metadataLayers: BindableMap> = bindablePool.provideBindableMap() val isOnFire: Bindable = bindablePool.provideBindable(false) val freezeTicks: Bindable = bindablePool.provideBindable(0) val hasNoGravity: Bindable = bindablePool.provideBindable(true) val isSilent: Bindable = bindablePool.provideBindable(false) val stuckArrows: Bindable = bindablePool.provideBindable(0) + val stuckStringers: Bindable = bindablePool.provideBindable(0) var gravityTickCount = 0 val maxHealth get() = health.defaultValue @@ -108,7 +106,6 @@ abstract class Entity(open var location: Location, open var world: World) : Disp hasNoGravity = hasNoGravity, entityIsOnFire = isOnFire, freezeTicks = freezeTicks, - metadataLayers = metadataLayers, isGlowing = isGlowing, isInvisible = isInvisible, pose = pose, @@ -116,6 +113,7 @@ abstract class Entity(open var location: Location, open var world: World) : Disp customName = customName, customNameVisible = customNameVisible, stuckArrows = stuckArrows, + stuckStingers = stuckStringers ) team.valueChanged { event -> @@ -157,7 +155,7 @@ abstract class Entity(open var location: Location, open var world: World) : Disp if (!super.addViewer(player)) return false sendMetadataPacket(player) - val entitySpawnPacket = ClientboundSpawnEntityPacket(id, uuid, type.getProtocolId(), location, location.yaw, 0, velocity) + val entitySpawnPacket = ClientboundSpawnEntityPacket(id, uuid, type, location, location.yaw, 0, velocity) isOnGround = true synchronized(player.entityViewSystem.visibleEntities) { @@ -216,7 +214,7 @@ abstract class Entity(open var location: Location, open var world: World) : Disp } open fun sendMetadataPacket(player: Player) { - val metadata = mergeEntityMetadata(this, metadataLayers[player.toPersistent()]) + val metadata = mergeEntityMetadata(this, metadata.getValuesFor(player)) val packet = ClientboundSetEntityMetadataPacket(this, metadata) player.sendPacket(packet) } @@ -291,6 +289,10 @@ abstract class Entity(open var location: Location, open var world: World) : Disp viewers.sendPacket(packet) } + fun playSoundToViewers(sound: String, location: Location? = null, volume: Float = 0.5f, pitch: Float = 1.0f, category: SoundCategory = SoundCategory.MASTER) { + playSoundToViewers(Sound(sound, volume, pitch, category), location) + } + fun playSoundToViewers(sound: Sound, location: Location? = this.location) { viewers.playSound(sound, location) } @@ -396,8 +398,8 @@ abstract class Entity(open var location: Location, open var world: World) : Disp team.value = null equipmentLayers.clear() viewers.toList().forEach { removeViewer(it) } - metadataLayers.clear() passengers.values.forEach(passengers::removeIfPresent) + metadata.dispose() bindablePool.dispose() despawnEntity(this) } diff --git a/src/main/kotlin/io/github/dockyardmc/entity/Guardian.kt b/src/main/kotlin/io/github/dockyardmc/entity/Guardian.kt index eced0cb09..0597dfeca 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/Guardian.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/Guardian.kt @@ -1,19 +1,12 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.location.Location import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType -open class Guardian(location: Location): Entity(location) { - - companion object { - val RETRACTING_SPIKES_METADATA = EntityMetadataType.GUARDIAN_RETRACTING_SPIKES - val TARGET_ENTITY_ID = EntityMetadataType.GUARDIAN_TARGET_ENTITY_ID - } +open class Guardian(location: Location) : Entity(location) { override var type: EntityType = EntityTypes.GUARDIAN override val health: Bindable = bindablePool.provideBindable(30f) @@ -23,12 +16,12 @@ open class Guardian(location: Location): Entity(location) { val target: Bindable = bindablePool.provideBindable(null) init { - isRetractingSpikes.valueChanged { change -> - metadata[RETRACTING_SPIKES_METADATA] = EntityMetadata(RETRACTING_SPIKES_METADATA, EntityMetaValue.BOOLEAN, change.newValue) + isRetractingSpikes.valueChanged { event -> + metadata[Metadata.Guardian.IS_RETRACTING_SPIKES] = event.newValue } - target.valueChanged { change -> - metadata[TARGET_ENTITY_ID] = EntityMetadata(TARGET_ENTITY_ID, EntityMetaValue.VAR_INT, change.newValue?.id ?: 0) + target.valueChanged { event -> + metadata[Metadata.Guardian.TARGET_EID] = event.newValue?.id ?: 0 } } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/InteractionEntity.kt b/src/main/kotlin/io/github/dockyardmc/entity/InteractionEntity.kt index 1d787f7f3..3df5ece65 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/InteractionEntity.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/InteractionEntity.kt @@ -2,16 +2,14 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable import cz.lukynka.bindables.BindableDispatcher -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.events.* import io.github.dockyardmc.location.Location import io.github.dockyardmc.player.Player import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType -class Interaction(location: Location): Entity(location) { +class Interaction(location: Location) : Entity(location) { override var type: EntityType = EntityTypes.INTERACTION override val health: Bindable = bindablePool.provideBindable(0f) @@ -30,33 +28,33 @@ class Interaction(location: Location): Entity(location) { init { eventPool.on { event -> - if(event.entity != this) return@on + if (event.entity != this) return@on rightClickDispatcher.dispatch(event.player) generalInteractionDispatcher.dispatch(event.player) } eventPool.on { event -> - if(event.entity != this) return@on + if (event.entity != this) return@on leftClickDispatcher.dispatch(event.player) generalInteractionDispatcher.dispatch(event.player) } eventPool.on { event -> - if(event.entity != this) return@on + if (event.entity != this) return@on middleClickDispatcher.dispatch(event.player) generalInteractionDispatcher.dispatch(event.player) } width.valueChanged { event -> - metadata[EntityMetadataType.INTERACTION_WIDTH] = EntityMetadata(EntityMetadataType.INTERACTION_WIDTH, EntityMetaValue.FLOAT, event.newValue) + metadata[Metadata.Interaction.WIDTH] = event.newValue } height.valueChanged { event -> - metadata[EntityMetadataType.INTERACTION_HEIGHT] = EntityMetadata(EntityMetadataType.INTERACTION_HEIGHT, EntityMetaValue.FLOAT, event.newValue) + metadata[Metadata.Interaction.HEIGHT] = event.newValue } responsive.valueChanged { event -> - metadata[EntityMetadataType.INTERACTION_RESPONSIVE] = EntityMetadata(EntityMetadataType.INTERACTION_RESPONSIVE, EntityMetaValue.BOOLEAN, event.newValue) + metadata[Metadata.Interaction.RESPONSIVE] = event.newValue } } diff --git a/src/main/kotlin/io/github/dockyardmc/entity/ItemDisplay.kt b/src/main/kotlin/io/github/dockyardmc/entity/ItemDisplay.kt index 0b770a5a4..902e4e16d 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/ItemDisplay.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/ItemDisplay.kt @@ -1,41 +1,37 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.item.ItemStack import io.github.dockyardmc.location.Location import io.github.dockyardmc.registry.EntityTypes import io.github.dockyardmc.registry.registries.EntityType -import io.github.dockyardmc.world.World -class ItemDisplay(location: Location, world: World): DisplayEntity(location) { +class ItemDisplay(location: Location): DisplayEntity(location) { override var type: EntityType = EntityTypes.ITEM_DISPLAY - val item: Bindable = Bindable(ItemStack.AIR) - val renderType: Bindable = Bindable(ItemDisplayRenderType.NONE) + val item: Bindable = bindablePool.provideBindable(ItemStack.AIR) + val renderType: Bindable = bindablePool.provideBindable(RenderType.NONE) + + enum class RenderType { + NONE, + THIRD_PERSON_LEFT_HAND, + THIRD_PERSON_RIGHT_HAND, + FIRST_PERSON_LEFT_HAND, + FIRST_PERSON_RIGHT_HAND, + HEAD, + GUI, + GROUND, + FIXED + } init { - item.valueChanged { - val type = EntityMetadataType.ITEM_DISPLAY_ITEM - metadata[type] = EntityMetadata(type, EntityMetaValue.ITEM_STACK, item.value) + item.valueChanged { event -> + metadata[Metadata.ItemDisplay.DISPLAYED_ITEM] = event.newValue } - renderType.valueChanged { - val type = EntityMetadataType.ITEM_DISPLAY_RENDER_TYPE - metadata[type] = EntityMetadata(type, EntityMetaValue.BYTE, renderType.value.ordinal) + renderType.valueChanged { event -> + metadata[Metadata.ItemDisplay.DISPLAY_TYPE] = event.newValue.ordinal.toByte() } } } -enum class ItemDisplayRenderType { - NONE, - THIRD_PERSON_LEFT_HAND, - THIRD_PERSON_RIGHT_HAND, - FIRST_PERSON_LEFT_HAND, - FIRST_PERSON_RIGHT_HAND, - HEAD, - GUI, - GROUND, - FIXED -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/ItemDropEntity.kt b/src/main/kotlin/io/github/dockyardmc/entity/ItemDropEntity.kt index 20e94e56b..89392d9ea 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/ItemDropEntity.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/ItemDropEntity.kt @@ -1,9 +1,7 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.item.ItemStack import io.github.dockyardmc.location.Location import io.github.dockyardmc.registry.EntityTypes @@ -13,9 +11,9 @@ class ItemDropEntity(override var location: Location, initialItem: ItemStack) : override var type: EntityType = EntityTypes.ITEM override var inventorySize: Int = 0 - override val health: Bindable = Bindable(9999f) + override val health: Bindable = bindablePool.provideBindable(9999f) - val itemStack: Bindable = Bindable(initialItem) + val itemStack: Bindable = bindablePool.provideBindable(initialItem) var canBePickedUp: Boolean = false var canBePickedUpAfter: Int = 20 var pickupDistance: Int = 1 @@ -24,19 +22,18 @@ class ItemDropEntity(override var location: Location, initialItem: ItemStack) : private var lifetime: Int = 0 init { - itemStack.valueChanged { - val type = EntityMetadataType.ITEM_DROP_ITEM_STACK - metadata[type] = EntityMetadata(type, EntityMetaValue.ITEM_STACK, it.newValue) + itemStack.valueChanged { event -> + metadata[Metadata.ItemEntity.ITEM] = event.newValue } itemStack.triggerUpdate() - if(canBePickedUpAfter == 0 || canBePickedUpAfter == -1) canBePickedUp = true + if (canBePickedUpAfter == 0 || canBePickedUpAfter == -1) canBePickedUp = true hasNoGravity.value = true } override fun tick() { - if(!canBePickedUp) { + if (!canBePickedUp) { lifetime++ - if(lifetime == canBePickedUpAfter) { + if (lifetime == canBePickedUpAfter) { canBePickedUp = true } } diff --git a/src/main/kotlin/io/github/dockyardmc/entity/Parrot.kt b/src/main/kotlin/io/github/dockyardmc/entity/Parrot.kt index 6ad238892..89d02672d 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/Parrot.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/Parrot.kt @@ -1,43 +1,29 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType -import io.github.dockyardmc.extentions.sendPacket +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.location.Location -import io.github.dockyardmc.protocol.packets.play.clientbound.ClientboundWorldEventPacket -import io.github.dockyardmc.protocol.packets.play.clientbound.WorldEvent -import io.github.dockyardmc.registry.Blocks import io.github.dockyardmc.registry.EntityTypes -import io.github.dockyardmc.registry.Items import io.github.dockyardmc.registry.registries.EntityType -class Parrot(location: Location): Entity(location) { +class Parrot(location: Location) : Entity(location) { override var type: EntityType = EntityTypes.PARROT - override val health: Bindable = Bindable(6f) + override val health: Bindable = bindablePool.provideBindable(6f) override var inventorySize: Int = 0 - val variant: Bindable = Bindable(ParrotVariant.entries.random()) + val variant: Bindable = bindablePool.provideBindable(Variant.entries.random()) + + enum class Variant { + RED_BLUE, + BLUE, + GREEN, + YELLOW_BLUE, + GRAY; + } init { - variant.valueChanged { - metadata[EntityMetadataType.PARROT_VARIANT] = EntityMetadata(EntityMetadataType.PARROT_VARIANT, EntityMetaValue.VAR_INT, it.newValue.ordinal) + variant.valueChanged { event -> + metadata[Metadata.Parrot.VARIANT] = event.newValue.ordinal } variant.triggerUpdate() } - - fun makeDance() { - val jukeboxLoc = location.subtract(0, 2, 0) - jukeboxLoc.world.setBlock(jukeboxLoc, Blocks.JUKEBOX) - val recordPacket = ClientboundWorldEventPacket(WorldEvent.PLAY_RECORD, jukeboxLoc, Items.MUSIC_DISC_CREATOR.getProtocolId(), false) - viewers.sendPacket(recordPacket) - } -} - -enum class ParrotVariant { - RED_BLUE, - BLUE, - GREEN, - YELLOW_BLUE, - GRAY; } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/TextDisplay.kt b/src/main/kotlin/io/github/dockyardmc/entity/TextDisplay.kt index 26d40a206..70058b46b 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/TextDisplay.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/TextDisplay.kt @@ -1,10 +1,7 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType -import io.github.dockyardmc.entity.metadata.getTextDisplayFormatting +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.extentions.getPackedInt import io.github.dockyardmc.location.Location import io.github.dockyardmc.registry.EntityTypes @@ -15,48 +12,49 @@ import io.github.dockyardmc.scroll.extensions.toComponent class TextDisplay(location: Location): DisplayEntity(location) { override var type: EntityType = EntityTypes.TEXT_DISPLAY - val text: Bindable = Bindable("") - val lineWidth: Bindable = Bindable(200) - val backgroundColor: Bindable = Bindable(CustomColor(64, 0, 0)) - val opacity: Bindable = Bindable(255) - val hasShadow: Bindable = Bindable(false) - val isSeeThrough: Bindable = Bindable(false) - val useDefaultBackgroundColor: Bindable = Bindable(true) - val alignment: Bindable = Bindable(TextDisplayAlignment.CENTER) + val text: Bindable = bindablePool.provideBindable("") + val lineWidth: Bindable = bindablePool.provideBindable(200) + val backgroundColor: Bindable = bindablePool.provideBindable(CustomColor(64, 0, 0)) + val opacity: Bindable = bindablePool.provideBindable(255) + val hasShadow: Bindable = bindablePool.provideBindable(false) + val isSeeThrough: Bindable = bindablePool.provideBindable(false) + val useDefaultBackgroundColor: Bindable = bindablePool.provideBindable(true) + val alignment: Bindable = bindablePool.provideBindable(Alignment.CENTER) - init { - billboard.value = DisplayBillboard.CENTER - text.valueChanged { - val type = EntityMetadataType.TEXT_DISPLAY_TEXT - metadata[type] = EntityMetadata(type, EntityMetaValue.TEXT_COMPONENT, it.newValue.toComponent()) - } - lineWidth.valueChanged { - val type = EntityMetadataType.TEXT_DISPLAY_LINE_WIDTH - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue) - } - backgroundColor.valueChanged { - val type = EntityMetadataType.TEXT_DISPLAY_BACKGROUND_COLOR - metadata[type] = EntityMetadata(type, EntityMetaValue.VAR_INT, it.newValue.getPackedInt()) - } - opacity.valueChanged { - val type = EntityMetadataType.TEXT_DISPLAY_TEXT_OPACITY - metadata[type] = EntityMetadata(type, EntityMetaValue.BYTE, it.newValue) - } - hasShadow.valueChanged { updateTextDisplayFormatting() } - isSeeThrough.valueChanged { updateTextDisplayFormatting() } - useDefaultBackgroundColor.valueChanged { updateTextDisplayFormatting() } - alignment.valueChanged { updateTextDisplayFormatting() } - interpolationDelay.triggerUpdate() + enum class Alignment(val left: Boolean, val right: Boolean) { + CENTER(false, false), + LEFT(true, false), + RIGHT(false, true) } - private fun updateTextDisplayFormatting() { - val type = EntityMetadataType.TEXT_DISPLAY_FORMATTING - metadata[type] = getTextDisplayFormatting(this) + init { + billboard.value = BillboardConstraints.CENTER + text.valueChanged { event -> + metadata[Metadata.TextDisplay.TEXT] = event.newValue.toComponent() + } + lineWidth.valueChanged { event -> + metadata[Metadata.TextDisplay.LINE_WIDTH] = event.newValue + } + backgroundColor.valueChanged { event -> + metadata[Metadata.TextDisplay.BACKGROUND_COLOR] = event.newValue.getPackedInt() + } + opacity.valueChanged { event -> + metadata[Metadata.TextDisplay.TEXT_OPACITY] = event.newValue.toByte() + } + hasShadow.valueChanged { event -> + metadata[Metadata.TextDisplay.HAS_SHADOW] = event.newValue + } + isSeeThrough.valueChanged { event -> + metadata[Metadata.TextDisplay.IS_SEE_THROUGH] = event.newValue + } + useDefaultBackgroundColor.valueChanged { event -> + metadata[Metadata.TextDisplay.USE_DEFAULT_BACKGROUND] = event.newValue + } + alignment.valueChanged { event -> + metadata[Metadata.TextDisplay.ALIGN_LEFT] = event.newValue.left + metadata[Metadata.TextDisplay.ALIGN_RIGHT] = event.newValue.right + } + interpolationDelay.triggerUpdate() } } -enum class TextDisplayAlignment(val mask: Byte) { - CENTER(0x00), - LEFT(0x08), - RIGHT(0x016) -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/Warden.kt b/src/main/kotlin/io/github/dockyardmc/entity/Warden.kt index 7c6c3de94..b945cf6e2 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/Warden.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/Warden.kt @@ -1,9 +1,7 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.extentions.sendPacket import io.github.dockyardmc.location.Location import io.github.dockyardmc.player.EntityPose @@ -14,37 +12,38 @@ import io.github.dockyardmc.registry.registries.EntityType open class Warden(location: Location) : Entity(location) { override var type: EntityType = EntityTypes.WARDEN - override val health: Bindable = Bindable(500f) + override val health: Bindable = bindablePool.provideBindable(500f) override var inventorySize: Int = 0 - val angerLevel: Bindable = Bindable(0) + val angerLevel: Bindable = bindablePool.provideBindable(0) + + enum class Animation { + EMERGE, + ROAR, + SNIFF, + DIGGING, + ATTACK, + SONIC_BOOM, + TENDRIL_SHAKE + } init { - angerLevel.valueChanged { - metadata[EntityMetadataType.WARDEN_ANGER_LEVEL] = EntityMetadata(EntityMetadataType.WARDEN_ANGER_LEVEL, EntityMetaValue.VAR_INT, it.newValue) + angerLevel.valueChanged { event -> + metadata[Metadata.Warden.ANGER_LEVEL] = event.newValue } } - fun playAnimation(animation: WardenAnimation) { + fun playAnimation(animation: Animation) { when (animation) { - WardenAnimation.EMERGE -> pose.value = EntityPose.EMERGING - WardenAnimation.ROAR -> pose.value = EntityPose.ROARING - WardenAnimation.SNIFF -> pose.value = EntityPose.SNIFFING - WardenAnimation.DIGGING -> pose.value = EntityPose.DIGGING - WardenAnimation.ATTACK -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_ATTACK)) - WardenAnimation.SONIC_BOOM -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_SONIC_BOOM)) - WardenAnimation.TENDRIL_SHAKE -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_TENDRIL_SHAKING)) + Animation.EMERGE -> pose.value = EntityPose.EMERGING + Animation.ROAR -> pose.value = EntityPose.ROARING + Animation.SNIFF -> pose.value = EntityPose.SNIFFING + Animation.DIGGING -> pose.value = EntityPose.DIGGING + Animation.ATTACK -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_ATTACK)) + Animation.SONIC_BOOM -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_SONIC_BOOM)) + Animation.TENDRIL_SHAKE -> viewers.sendPacket(ClientboundEntityEventPacket(this, EntityEvent.WARDEN_TENDRIL_SHAKING)) } } } -enum class WardenAnimation { - EMERGE, - ROAR, - SNIFF, - DIGGING, - ATTACK, - SONIC_BOOM, - TENDRIL_SHAKE -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/Zombie.kt b/src/main/kotlin/io/github/dockyardmc/entity/Zombie.kt index 3334022c2..ced36a922 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/Zombie.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/Zombie.kt @@ -1,9 +1,7 @@ package io.github.dockyardmc.entity import cz.lukynka.bindables.Bindable -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.location.Location import io.github.dockyardmc.protocol.packets.play.clientbound.ClientboundPlayerAnimationPacket import io.github.dockyardmc.protocol.packets.play.clientbound.EntityAnimation @@ -23,11 +21,7 @@ open class Zombie(location: Location) : Entity(location) { init { raisedArms.valueChanged { event -> - if (event.newValue) { - this.metadata[EntityMetadataType.ZOMBIE_RAISED_ARMS] = EntityMetadata(EntityMetadataType.ZOMBIE_RAISED_ARMS, EntityMetaValue.BYTE, 0x0) - } else { - this.metadata.remove(EntityMetadataType.ZOMBIE_RAISED_ARMS) - } + this.metadata[Metadata.LivingEntity.IS_HAND_ACTIVE] = event.newValue } } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/entities/Armadillo.kt b/src/main/kotlin/io/github/dockyardmc/entity/entities/Armadillo.kt new file mode 100644 index 000000000..5113d0126 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/entities/Armadillo.kt @@ -0,0 +1,20 @@ +package io.github.dockyardmc.entity.entities + +import cz.lukynka.bindables.Bindable +import io.github.dockyardmc.entity.Entity +import io.github.dockyardmc.location.Location +import io.github.dockyardmc.registry.EntityTypes +import io.github.dockyardmc.registry.registries.EntityType + +open class Armadillo(location: Location): Entity(location) { + override var type: EntityType = EntityTypes.ARMADILLO + override val health: Bindable = bindablePool.provideBindable(12f) + override var inventorySize: Int = 0 + + enum class State { + IDLE, + ROLLING, + SCARED, + UNROLLING + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/entities/CopperGolem.kt b/src/main/kotlin/io/github/dockyardmc/entity/entities/CopperGolem.kt new file mode 100644 index 000000000..d2aff0ee9 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/entities/CopperGolem.kt @@ -0,0 +1,37 @@ +package io.github.dockyardmc.entity.entities + +import cz.lukynka.bindables.Bindable +import io.github.dockyardmc.entity.Entity +import io.github.dockyardmc.entity.metadata.Metadata +import io.github.dockyardmc.location.Location +import io.github.dockyardmc.registry.EntityTypes +import io.github.dockyardmc.registry.registries.EntityType + +// clanker +open class CopperGolem(location: Location) : Entity(location) { + override var type: EntityType = EntityTypes.COPPER_GOLEM + override val health: Bindable = bindablePool.provideBindable(14f) + + val weatherState: Bindable = bindablePool.provideBindable(WeatherState.UNAFFECTED) + + init { + weatherState.valueChanged { event -> + metadata[Metadata.CopperGolem.WEATHER_STATE] = event.newValue + } + } + + enum class WeatherState { + UNAFFECTED, + EXPOSED, + WEATHERED, + OXIDIZED + } + + enum class State { + IDLE, + GETTING_ITEM, + GETTING_NO_ITEM, + DROPPING_ITEM, + DROPPING_NO_ITEM + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/entities/Salmon.kt b/src/main/kotlin/io/github/dockyardmc/entity/entities/Salmon.kt new file mode 100644 index 000000000..d387a6c2f --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/entities/Salmon.kt @@ -0,0 +1,18 @@ +package io.github.dockyardmc.entity.entities + +import cz.lukynka.bindables.Bindable +import io.github.dockyardmc.entity.Entity +import io.github.dockyardmc.location.Location +import io.github.dockyardmc.registry.EntityTypes +import io.github.dockyardmc.registry.registries.EntityType + +open class Salmon(location: Location): Entity(location) { + override var type: EntityType = EntityTypes.SALMON + override val health: Bindable = bindablePool.provideBindable(20f) + + enum class Size { + SMALL, + MEDIUM, + LARGE + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/entities/Sniffer.kt b/src/main/kotlin/io/github/dockyardmc/entity/entities/Sniffer.kt new file mode 100644 index 000000000..33f240d23 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/entities/Sniffer.kt @@ -0,0 +1,22 @@ +package io.github.dockyardmc.entity.entities + +import cz.lukynka.bindables.Bindable +import io.github.dockyardmc.entity.Entity +import io.github.dockyardmc.location.Location +import io.github.dockyardmc.registry.EntityTypes +import io.github.dockyardmc.registry.registries.EntityType + +open class Sniffer(location: Location): Entity(location) { + override var type: EntityType = EntityTypes.SNIFFER + override val health: Bindable = bindablePool.provideBindable(14f) + + enum class State { + IDLING, + FEELING_HAPPY, + SCENTING, + SNIFFIING, + SEARCHING, + DIGGING, + RISING + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/handlers/EntityMetadataHandler.kt b/src/main/kotlin/io/github/dockyardmc/entity/handlers/EntityMetadataHandler.kt index 6f03a6ed9..4e94b3806 100644 --- a/src/main/kotlin/io/github/dockyardmc/entity/handlers/EntityMetadataHandler.kt +++ b/src/main/kotlin/io/github/dockyardmc/entity/handlers/EntityMetadataHandler.kt @@ -1,55 +1,126 @@ package io.github.dockyardmc.entity.handlers import cz.lukynka.bindables.Bindable -import cz.lukynka.bindables.BindableMap import io.github.dockyardmc.entity.Entity -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType -import io.github.dockyardmc.entity.metadata.getEntityMetadataState +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.player.EntityPose -import io.github.dockyardmc.player.PersistentPlayer +import io.github.dockyardmc.player.Player import io.github.dockyardmc.scroll.extensions.toComponent +import io.github.dockyardmc.utils.Disposable -class EntityMetadataHandler(override val entity: Entity) : EntityHandler { +class EntityMetadataHandler(override val entity: Entity) : EntityHandler, Disposable { - private val metadata: MutableMap = mutableMapOf() + private val metadata: MutableMap, Metadata.MetadataDefinition.Value<*>> = mutableMapOf() + private val metadataLayers: MutableMap, Metadata.MetadataDefinition.Value<*>>> = mutableMapOf() - fun getValues(): Map { + fun clearMetadataLayers() { + metadataLayers.clear() + } + + fun getMetadataLayers(): Map, Metadata.MetadataDefinition.Value<*>>> { + return metadataLayers.toMap() + } + + fun getValues(): Map, Metadata.MetadataDefinition.Value<*>> { return metadata.toMap() } - operator fun set(key: EntityMetadataType, value: EntityMetadata) { - require(key == value.type) { "Not matching type" } + fun getValuesFor(player: Player): Map, Metadata.MetadataDefinition.Value<*>> { + if (!metadataLayers.containsKey(player)) { + metadataLayers[player] = mutableMapOf() + } + + return (metadataLayers[player]!!).toMap() + } + + fun getForPlayer(player: Player, definition: Metadata.MetadataDefinition): T { + if (!metadataLayers.containsKey(player)) { + metadataLayers[player] = mutableMapOf() + } + val map = metadataLayers[player]!! + return getInternal(definition, map) + } - synchronized(metadata) { - metadata[key] = value - entity.sendMetadataPacketToViewers() - entity.sendSelfMetadataIfPlayer() + fun setForPlayer(player: Player, definition: Metadata.MetadataDefinition, value: T) { + if (!metadataLayers.containsKey(player)) { + metadataLayers[player] = mutableMapOf() } + + val map = metadataLayers[player]!! + val result = setInternal(definition, value, map) + metadataLayers[player] = map + return result } - fun remove(key: EntityMetadataType) { - synchronized(metadata) { - metadata.remove(key) - entity.sendMetadataPacketToViewers() - entity.sendSelfMetadataIfPlayer() + operator fun get(definition: Metadata.MetadataDefinitionEntry): T { + return getInternal(definition, metadata) + } + + operator fun set(definition: Metadata.MetadataDefinitionEntry, value: T) { + setInternal(definition, value, metadata) + entity.sendMetadataPacketToViewers() + entity.sendSelfMetadataIfPlayer() + } + + fun removeForPlayer(player: Player, definition: Metadata.MetadataDefinitionEntry<*>) { + if (!metadataLayers.containsKey(player)) { + metadataLayers[player] = mutableMapOf() } + val map = metadataLayers[player]!! + removeInternal(definition, map) } - operator fun get(key: EntityMetadataType): EntityMetadata { - return getOrNull(key) ?: throw NoSuchElementException("No entity metadata with type ${key.name} present") + fun remove(definition: Metadata.MetadataDefinitionEntry<*>) { + removeInternal(definition, metadata) } - fun getOrNull(key: EntityMetadataType): EntityMetadata? { - return metadata[key] + private fun removeInternal(definition: Metadata.MetadataDefinitionEntry<*>, map: MutableMap, Metadata.MetadataDefinition.Value<*>>) { + map.remove(definition) + } + + + @Suppress("UNCHECKED_CAST") + private fun getInternal(definition: Metadata.MetadataDefinitionEntry, map: MutableMap, Metadata.MetadataDefinition.Value<*>>): T { + return when (definition) { + is Metadata.MetadataDefinition -> { + map[definition]?.value as T? ?: definition.default + } + + is Metadata.BitmaskFlagDefinition -> { + val parentValue = map[definition.parent]?.value as Byte? ?: definition.parent.default + val isSet = (parentValue.toInt() and definition.bitMask.toInt()) != 0 + isSet as T + } + } + } + + private fun setInternal(definition: Metadata.MetadataDefinitionEntry, value: T, map: MutableMap, Metadata.MetadataDefinition.Value<*>>) { + when (definition) { + is Metadata.MetadataDefinition -> { + map[definition] = Metadata.MetadataDefinition.Value(definition, value) + } + + is Metadata.BitmaskFlagDefinition -> { + val parentValue = map[definition.parent]?.value as Byte? ?: definition.parent.default + val newValue = if (value as Boolean) { + (parentValue.toInt() or definition.bitMask.toInt()).toByte() + } else { + (parentValue.toInt() and definition.bitMask.toInt().inv()).toByte() + } + map[definition.parent] = Metadata.MetadataDefinition.Value(definition.parent, newValue) + } + } + } + + override fun dispose() { + metadataLayers.clear() + metadata.clear() } fun handleBindables( hasNoGravity: Bindable, entityIsOnFire: Bindable, freezeTicks: Bindable, - metadataLayers: BindableMap>, isGlowing: Bindable, isInvisible: Bindable, pose: Bindable, @@ -57,50 +128,51 @@ class EntityMetadataHandler(override val entity: Entity) : EntityHandler { customName: Bindable, customNameVisible: Bindable, stuckArrows: Bindable, + stuckStingers: Bindable, ) { - hasNoGravity.valueChanged { - val noGravityType = EntityMetadataType.HAS_NO_GRAVITY - set(noGravityType, EntityMetadata(noGravityType, EntityMetaValue.BOOLEAN, it.newValue)) + hasNoGravity.valueChanged { event -> + set(Metadata.HAS_NO_GRAVITY, event.newValue) } - entityIsOnFire.valueChanged { - val meta = getEntityMetadataState(entity) { - isOnFire = it.newValue - } - set(EntityMetadataType.STATE, meta) + entityIsOnFire.valueChanged { event -> + set(Metadata.IS_ON_FIRE, event.newValue) } - freezeTicks.valueChanged { - val meta = EntityMetadata(EntityMetadataType.FROZEN_TICKS, EntityMetaValue.VAR_INT, it.newValue) - set(EntityMetadataType.FROZEN_TICKS, meta) + freezeTicks.valueChanged { event -> + set(Metadata.TICKS_FROZEN, event.newValue) } - isSilent.valueChanged { - val meta = EntityMetadata(EntityMetadataType.SILENT, EntityMetaValue.BOOLEAN, it.newValue) - set(EntityMetadataType.SILENT, meta) + isSilent.valueChanged { event -> + set(Metadata.IS_SILENT, event.newValue) } - customName.valueChanged { - val textComponent = if (it.newValue != null) it.newValue!!.toComponent() else null - val meta = EntityMetadata(EntityMetadataType.CUSTOM_NAME, EntityMetaValue.OPTIONAL_TEXT_COMPONENT, textComponent) - set(EntityMetadataType.CUSTOM_NAME, meta) + customName.valueChanged { event -> + val textComponent = if (event.newValue != null) event.newValue!!.toComponent() else null + set(Metadata.CUSTOM_NAME, textComponent) } - customNameVisible.valueChanged { - val meta = EntityMetadata(EntityMetadataType.IS_CUSTOM_NAME_VISIBLE, EntityMetaValue.BOOLEAN, it.newValue) - set(EntityMetadataType.IS_CUSTOM_NAME_VISIBLE, meta) + customNameVisible.valueChanged { event -> + set(Metadata.CUSTOM_NAME_VISIBLE, event.newValue) } - isGlowing.valueChanged { - set(EntityMetadataType.STATE, getEntityMetadataState(entity)) + isGlowing.valueChanged { event -> + set(Metadata.HAS_GLOWING_EFFECT, event.newValue) } - isInvisible.valueChanged { - set(EntityMetadataType.STATE, getEntityMetadataState(entity)) + isInvisible.valueChanged { event -> + set(Metadata.IS_INVISIBLE, event.newValue) } pose.valueChanged { event -> - set(EntityMetadataType.POSE, EntityMetadata(EntityMetadataType.POSE, EntityMetaValue.POSE, event.newValue)) + set(Metadata.POSE, event.newValue) + } + + stuckArrows.valueChanged { event -> + set(Metadata.LivingEntity.NUMBER_OF_ARROWS, event.newValue) + } + + stuckStingers.valueChanged { event -> + set(Metadata.LivingEntity.NUMBER_OF_BEE_STINGERS, event.newValue) } } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/metadata/EntityMetadata.kt b/src/main/kotlin/io/github/dockyardmc/entity/metadata/EntityMetadata.kt deleted file mode 100644 index ad88d55bd..000000000 --- a/src/main/kotlin/io/github/dockyardmc/entity/metadata/EntityMetadata.kt +++ /dev/null @@ -1,391 +0,0 @@ -package io.github.dockyardmc.entity.metadata - -import io.github.dockyardmc.entity.Entity -import io.github.dockyardmc.entity.TextDisplay -import io.github.dockyardmc.extentions.* -import io.github.dockyardmc.item.ItemStack -import io.github.dockyardmc.location.Location -import io.github.dockyardmc.location.writeLocation -import io.github.dockyardmc.player.Direction -import io.github.dockyardmc.player.EntityPose -import io.github.dockyardmc.player.Player -import io.github.dockyardmc.scroll.Component -import io.github.dockyardmc.maths.Quaternion -import io.github.dockyardmc.maths.vectors.Vector3 -import io.github.dockyardmc.maths.vectors.Vector3f -import io.github.dockyardmc.maths.writeQuaternion -import io.github.dockyardmc.registry.registries.ChickenVariant -import io.github.dockyardmc.registry.registries.CowVariant -import io.github.dockyardmc.registry.registries.PigVariant -import io.netty.buffer.ByteBuf -import net.kyori.adventure.nbt.CompoundBinaryTag -import java.util.* -import kotlin.experimental.and -import kotlin.experimental.or - -data class EntityMetadata( - val type: EntityMetadataType, - val writer: EntityMetaValue, - val value: Any? -) { - override fun toString(): String = - "EntityMetadata(${type.name}[${type.protocolIndex}, ${writer.name}[${writer.ordinal}], $value)" -} - -fun ByteBuf.writeMetadata(metadata: EntityMetadata) { - this.writeByte(metadata.type.protocolIndex) - this.writeVarInt(metadata.writer.ordinal) - val valuePresent = metadata.value != null - val v = metadata.value - when(metadata.writer) { - EntityMetaValue.BYTE -> when(v) { - is Int -> this.writeByte(v) - is Byte -> this.writeByte(v.toInt()) - } - EntityMetaValue.VAR_INT -> this.writeVarInt(v as Int) - EntityMetaValue.VAR_LONG -> this.writeVarLong(v as Long) - EntityMetaValue.FLOAT -> this.writeFloat(v as Float) - EntityMetaValue.STRING -> this.writeString(v as String) - EntityMetaValue.TEXT_COMPONENT -> this.writeNBT((metadata.value as Component).toNBT()) - EntityMetaValue.OPTIONAL_TEXT_COMPONENT -> { this.writeBoolean(valuePresent); if(valuePresent) this.writeNBT((metadata.value as Component).toNBT()) } - EntityMetaValue.ITEM_STACK -> (v as ItemStack).write(this) - EntityMetaValue.BOOLEAN -> this.writeBoolean(v as Boolean) - EntityMetaValue.ROTATION -> (v as Vector3f).write(this) - EntityMetaValue.POSITION -> this.writeLocation(v as Location) - EntityMetaValue.OPTIONAL_POSITION -> { this.writeBoolean(valuePresent); if(valuePresent) this.writeLocation(v as Location)} - EntityMetaValue.DIRECTION -> this.writeVarInt((v as Direction).ordinal) - EntityMetaValue.OPTIONAL_UUID -> { this.writeBoolean(valuePresent); if(valuePresent) this.writeUUID(v as UUID)} - EntityMetaValue.BLOCK_STATE -> this.writeVarInt((v as io.github.dockyardmc.world.block.Block).getProtocolId()) - EntityMetaValue.OPTIONAL_BLOCK_STATE -> { this.writeBoolean(valuePresent); if(valuePresent) this.writeVarInt(v as Int)} - EntityMetaValue.NBT -> this.writeNBT(v as CompoundBinaryTag) - EntityMetaValue.PARTICLE -> TODO() - EntityMetaValue.VILLAGER_DATA -> (v as Vector3).write(this) - EntityMetaValue.OPTIONAL_VAR_INT -> { this.writeBoolean(valuePresent); if(valuePresent) this.writeVarInt(v as Int)} - EntityMetaValue.POSE -> this.writeVarInt((v as EntityPose).ordinal) - EntityMetaValue.CAT_VARIANT -> this.writeVarInt(v as Int) - EntityMetaValue.FROG_VARIANT -> this.writeVarInt(v as Int) - EntityMetaValue.OPTIONAL_GLOBAL_POSITION -> TODO() - EntityMetaValue.PAINTING_VARIANT -> this.writeVarInt(v as Int) - EntityMetaValue.SNIFFER_STATE -> this.writeVarInt(v as Int) - EntityMetaValue.VECTOR3 -> (v as Vector3f).write(this) - EntityMetaValue.QUATERNION -> this.writeQuaternion(v as Quaternion) - EntityMetaValue.COW_VARIANT -> this.writeRegistryEntry(v as CowVariant) - EntityMetaValue.CHICKEN_VARIANT -> this.writeRegistryEntry(v as ChickenVariant) - EntityMetaValue.PIG_VARIANT -> this.writeRegistryEntry(v as PigVariant) - else -> throw Exception("noop in entity meta") - } -} - -class EntityStateMetadataBuilder(entity: Entity) { - var isOnFire = entity.isOnFire.value - var isCrouching = if(entity is Player) entity.isSneaking else false - var isSprinting = if(entity is Player) entity.isSprinting else false - //TODO is swimming - var isSwimming = false - var isInvisible = entity.isInvisible.value - var isGlowing = entity.isGlowing.value - //TODO elytra - var isFlying = false -} - -inline fun getEntityMetadataState(entity: Entity, builder: (EntityStateMetadataBuilder.() -> Unit) = {}): EntityMetadata { - - val stateMetadata = EntityStateMetadataBuilder(entity) - builder.invoke(stateMetadata) - - var bitMask: Byte = 0x00 - if (stateMetadata.isOnFire) bitMask = (bitMask or 0x01) - if (stateMetadata.isCrouching) bitMask = (bitMask + 0x02).toByte() - if (stateMetadata.isSprinting) bitMask = (bitMask + 0x08).toByte() - if (stateMetadata.isSwimming) bitMask = (bitMask + 0x10).toByte() - if (stateMetadata.isInvisible) bitMask = (bitMask + 0x20).toByte() - if (stateMetadata.isGlowing) bitMask = (bitMask + 0x40).toByte() - if (stateMetadata.isFlying) bitMask = (bitMask or 0x80.toByte()) - - return EntityMetadata(EntityMetadataType.STATE, EntityMetaValue.BYTE, bitMask) -} - -fun getEntityMetadataStateBuilder(bitMask: Byte, entity: Entity): EntityStateMetadataBuilder { - val stateMetadata = EntityStateMetadataBuilder(entity) - - stateMetadata.isOnFire = (bitMask and 0x01).toInt() != 0 - stateMetadata.isCrouching = (bitMask and 0x02).toInt() != 0 - stateMetadata.isSprinting = (bitMask and 0x08).toInt() != 0 - stateMetadata.isSwimming = (bitMask and 0x10).toInt() != 0 - stateMetadata.isInvisible = (bitMask and 0x20).toInt() != 0 - stateMetadata.isGlowing = (bitMask and 0x40).toInt() != 0 - stateMetadata.isFlying = (bitMask and 0x80.toByte()).toInt() != 0 - - return stateMetadata -} - -class TextDisplayFormattingBuilder(textDisplay: TextDisplay) { - var hasShadow = textDisplay.hasShadow.value - var isSeeThrough = textDisplay.isSeeThrough.value - var useDefaultBackgroundColor = textDisplay.useDefaultBackgroundColor.value - var alignment = textDisplay.alignment.value -} - -inline fun getTextDisplayFormatting(entity: TextDisplay, builder: (TextDisplayFormattingBuilder.() -> Unit) = {}): EntityMetadata { - - val formatting = TextDisplayFormattingBuilder(entity) - builder.invoke(formatting) - - var bitMask: Byte = 0x00 - if (formatting.hasShadow) bitMask = (bitMask or 0x01) - if (formatting.isSeeThrough) bitMask = (bitMask or 0x02) - if (formatting.useDefaultBackgroundColor) bitMask = (bitMask or 0x04) - - bitMask = (bitMask or formatting.alignment.mask).toByte() - - return EntityMetadata(EntityMetadataType.TEXT_DISPLAY_FORMATTING, EntityMetaValue.BYTE, bitMask) -} - -enum class EntityMetadataType(var protocolIndex: Int) { - STATE(0), - AIR_TICKS(1), - CUSTOM_NAME(2), - IS_CUSTOM_NAME_VISIBLE(3), - SILENT(4), - HAS_NO_GRAVITY(5), - POSE(6), - FROZEN_TICKS(7), - INTERACTION_WIDTH(8), - INTERACTION_HEIGHT(9), - INTERACTION_RESPONSIVE(10), - AREA_EFFECT_CLOUD_RADIUS(8), - AREA_EFFECT_CLOUD_COLOR(9), - AREA_EFFECT_CLOUD_PARTICLE(10), - END_CRYSTAL_BEAM_TARGET(8), - END_CRYSTAL_SHOW_BOTTOM(9), - EYE_OF_ENDER_ITEM_STACK(8), - FALLING_BLOCK_POSITION(8), - FIREBALL_ITEM_STACK(8), - FIREWORK_ROCKET_ITEM_STACK(8), - FIREWORK_ROCKET_USED_BY_ENTITY_ID(9), - FIREWORK_ROCKET_IS_SHOT_AT_ANGLE(10), - HAND_STATE(8), - ITEM_DROP_ITEM_STACK(8), - ITEM_FRAME_ITEM_STACK(8), - ITEM_FRAME_ROTATION(9), - OMINOUS_ITEM_SPAWNER_ITEM_STACK(8), - SMALL_FIREBALL_ITEM_STACK(8), - PRIMED_TNT_FUSE_TIME(8), - PRIMED_TNT_BLOCK_STATE(9), - WITHER_SKULL_IS_INVULNERABLE(8), - FISHING_BOBBER_HOOKED_ENTITY_ID(8), - FISHING_BOBBER_IS_CATCHABLE(9), - ABSTRACT_ARROW_BITMASK(8), - ABSTRACT_ARROW_PIERCING_LEVEL(9), - ABSTRACT_ARROW_IS_IN_GROUND(10), - ARROW_COLOR(11), - TRIDENT_LOYALTY_LEVEL(11), - TRIDENT_HAS_ENCHANTMENT_GLINT(12), - BOAT_TYPE(8), - BOAT_IS_LEFT_PADDLE_TURNING(9), - BOAT_IS_RIGHT_PADDLE_TURNING(9), - LIVING_ENTITY_HAND_STATE(8), - LIVING_ENTITY_HEALTH(9), - LIVING_ENTITY_PARTICLES(10), - LIVING_ENTITY_IS_POTION_EFFECT_AMBIENT(11), - LIVING_ENTITY_NUMBER_OF_ARROWS(12), - LIVING_ENTITY_NUMBER_OF_BEE_STRINGERS(13), - LIVING_ENTITY_LOCATION_OF_BED(14), - ARMOR_STAND_BITMASK(15), - ZOMBIE_RAISED_ARMS(15), - ARMOR_STAND_HEAD_ROTATION(16), - ARMOR_STAND_BODY_ROTATION(17), - ARMOR_STAND_LEFT_ARM_ROTATION(18), - ARMOR_STAND_RIGHT_ARM_ROTATION(19), - ARMOR_STAND_LEFT_LEG_ROTATION(20), - ARMOR_STAND_RIGHT_LEG_ROTATION(21), - MOB(16), - BAT_IS_HANGING(16), - ENDER_DRAGON_PHASE(16), - GHAST_IS_ATTACKING(16), - PHANTOM_SIZE(16), - SLIME_SIZE(16), - ALLAY_IS_DANCING(16), - ALLAY_CAN_DUPLICATE(17), - IRON_GOLEM_IS_PLAYER_CREATED(16), - PUFFERFISH_PUFF_STATE(16), - SHULKER_ATTACH_FACE(16), - SHULKER_SHIELD_HEIGHT(17), - SHULKER_COLOR(18), - SNOW_GOLEM_BITMASK(16), - TADPOLE_IS_FROM_BUCKET(16), - AGEABLE_MOB_IS_BABY(16), - DOLPHIN_TREASURE_POSITION(17), - DOLPHIN_HAS_FISH(18), - DOLPHIN_MOISTURE_LEVEL(19), - GLOW_SQUID_DARK_TICKS_REMAINING(17), - ARMADILLO_STATE(17), - AXOLOTL_VARIANT(17), - AXOLOTL_IS_PLAYING_DEAD(18), - AXOLOTL_SPAWNED_FROM_BUCKET(19), - BEE_BIT_MASK(17), - BEE_ANGER_TICKS(18), - MOOSHROOM_VARIANT(17), - FOX_TYPE(17), - FOX_BITMASK(18), - FOX_FIRST_UUID(19), - FOX_SECOND_UUID(20), - FROG_VARIANT(17), - FROG_TONGUE_TARGET(18), - GOAT_IS_SCREAMING_GOAT(17), - GOAT_HAS_LEFT_HORN(18), - GOAT_HAS_RIGHT_HORN(19), - HOGLIN_IS_IMMUNE_TO_ZOMBIFICATION(17), - OCELOT_IS_TRUSTING(17), - PANDA_BREED_TIMER(17), - PANDA_SNEEZE_TIMER(18), - PANDA_EAT_TIMER(19), - PANDA_MAIN_GENE(20), - PANDA_HIDDEN_GENE(21), - PANDA_BITMASK(22), - PIG_HAS_SADDLE(17), - PIG_BOOST_TIME(18), - POLAR_BEAR_IS_STANDING_UP(17), - RABBIT_TYPE(17), - SHEEP_BITMASK(17), - SNIFFER_STATE(17), - SNIFFER_DROP_SEED_AT_TICK(18), - STRIDER_BOOST_TIME(17), - STRIDER_IS_SHAKING(18), - STRIDER_HAS_SADDLE(19), - TURTLE_HOME_POSITION(17), - TURTLE_HAS_EGG(18), - TURTLE_IS_LAYING_EGG(19), - TURTLE_TRAVEL_POSITION(20), - TURTLE_IS_GOING_HOME(22), - TURTLE_IS_TRAVELLING(22), - ABSTRACT_HORSE_BITMASK(17), - CAMEL_IS_DASHING(18), - CAMEL_LAST_POS_CHANGE_TICK(19), - HORSE_VARIANT(18), - CHESTED_HORSE_HAS_CHEST(18), - LLAMA_STRENGTH(19), - LLAMA_CARPET_COLOR(20), - TAMABLE_ANIMAL_STATE(17), - TAMABLE_ANIMAL_OWNER(18), - CAT_VARIANT(19), - CAT_IS_LYING(20), - CAT_IS_RELAXED(21), - CAT_COLLAR_COLOR(22), - WOLF_IS_BEGGING(19), - WOLF_COLLAR_COLOR(20), - WOLF_ANGER_TIME(21), - WOLF_VARIANT(22), - CREAKING_CAN_MOVE(16), - CREAKING_IS_ACTIVE(17), - CREAKING_IS_TEARING_DOWN(18), - CREAKING_HOME_POSITION(19), - CREEPER_STATE(16), - CREEPER_IS_CHARGED(17), - CREEPER_IS_IGNITED(18), - ENDERMAN_CARRIED_BLOCK(16), - ENDERMAN_IS_SCREAMING(17), - ENDERMAN_IS_STARING(18), - PIGLIN_IS_BABY(16), - PIGLIN_IS_CHARGING_CROSSBOW(17), - PIGLIN_IS_DANCING(18), - PIGLIN_BRUTE_IMMUNE_TO_ZOMBIFICATION(16), - SKELETON_IS_BEING_CONVERTED_INTO_STRAY(16), - SPIDER_IS_CLIMBING(16), - VEX_ANGER_LEVEL(16), - WITHER_CENTER_HEAD_TARGET(16), - WITHER_LEFT_HEAD_TARGET(17), - WITHER_RIGHT_HEAD_TARGET(18), - WITHER_INVULNERABLE_TIME(19), - ZOMBIE_IS_BABY(16), - ZOMBIE_IS_BECOMING_DROWNED(18), - ZOMBIE_VILLAGER_IS_CONVERTING(19), - ZOMBIE_VILLAGER_DATA(20), - RAIDER_IS_CELEBRATING(16), - PILLAGER_IS_CHARGING(17), - WITCH_IS_DRINKING_POTION(17), - SPELLCASTER_ILLAGER_TYPE(17), - ABSTRACT_MINECART_CUSTOM_BLOCK_ID(8), - ABSTRACT_MINECART_CUSTOM_BLOCK_Y(9), - ABSTRACT_MINECART_SHOW_CUSTOM_BLOCK(10), - MINECART_WITH_COMMAND_BLOCK_COMMAND(11), - MINECART_WITH_COMMAND_BLOCK_LAST_OUTPUT(12), - MINECART_WITH_FURNACE_HAS_FUEL(11), - THROW_ITEM_PROJECTILE_ITEM_STACK(8), - WARDEN_ANGER_LEVEL(16), - PLAYER_ADDITION_HEARTS(15), - PLAYER_SCORE(16), - PLAYER_LEFT_SHOULDER_ENTITY_DATA(19), - PLAYER_RIGHT_SHOULDER_ENTITY_DATA(19), - PLAYER_DISPLAY_SKIN_PARTS(17), - PLAYER_MAIN_HAND(18), - PARROT_VARIANT(19), - DISPLAY_INTERPOLATION_DELAY(8), - DISPLAY_TRANSFORM_INTERPOLATION(9), - DISPLAY_TRANSLATION_INTERPOLATION(10), - DISPLAY_TRANSLATION(11), - DISPLAY_SCALE(12), - DISPLAY_ROTATION_LEFT(13), - DISPLAY_ROTATION_RIGHT(14), - DISPLAY_BILLBOARD(15), - DISPLAY_BRIGHTNESS(16), - DISPLAY_VIEW_RANGE(17), - DISPLAY_SHADOW_RADIUS(18), - DISPLAY_SHADOW_STRENGTH(19), - LLAMA_VARIANT(19), - COW_VARIANT(17), - PIG_VARIANT(18), - CHICKEN_VARIANT(17), - DISPLAY_WIDTH(20), - DISPLAY_HEIGHT(21), - DISPLAY_GLOW_COLOR(22), - TEXT_DISPLAY_TEXT(23), - TEXT_DISPLAY_LINE_WIDTH(24), - TEXT_DISPLAY_BACKGROUND_COLOR(25), - TEXT_DISPLAY_TEXT_OPACITY(26), - TEXT_DISPLAY_FORMATTING(27), - ITEM_DISPLAY_ITEM(23), - ITEM_DISPLAY_RENDER_TYPE(24), - BLOCK_DISPLAY_BLOCK(23), - GUARDIAN_RETRACTING_SPIKES(16), - GUARDIAN_TARGET_ENTITY_ID(17), -} - - -enum class EntityMetaValue { - BYTE, - VAR_INT, - VAR_LONG, - FLOAT, - STRING, - TEXT_COMPONENT, - OPTIONAL_TEXT_COMPONENT, - ITEM_STACK, - BOOLEAN, - ROTATION, - POSITION, - OPTIONAL_POSITION, - DIRECTION, - OPTIONAL_UUID, - BLOCK_STATE, - OPTIONAL_BLOCK_STATE, - NBT, - PARTICLE, - PARTICLE_LIST, - VILLAGER_DATA, - OPTIONAL_VAR_INT, - POSE, - CAT_VARIANT, - COW_VARIANT, - WOLF_VARIANT, - WOLF_SOUND_VARIANT, - FROG_VARIANT, - PIG_VARIANT, - CHICKEN_VARIANT, - OPTIONAL_GLOBAL_POSITION, - PAINTING_VARIANT, - SNIFFER_STATE, - ARMADILLO_STATE, - VECTOR3, - QUATERNION, -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/metadata/Metadata.kt b/src/main/kotlin/io/github/dockyardmc/entity/metadata/Metadata.kt new file mode 100644 index 000000000..0eb7837fd --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/metadata/Metadata.kt @@ -0,0 +1,616 @@ +package io.github.dockyardmc.entity.metadata + +import io.github.dockyardmc.entity.metadata.MetadataType.MetadataSerializer +import io.github.dockyardmc.item.ItemStack +import io.github.dockyardmc.maths.Quaternion +import io.github.dockyardmc.maths.vectors.Vector3 +import io.github.dockyardmc.maths.vectors.Vector3f +import io.github.dockyardmc.player.Direction +import io.github.dockyardmc.player.EntityPose +import io.github.dockyardmc.protocol.types.ResolvableProfile +import io.github.dockyardmc.registry.* +import io.github.dockyardmc.scroll.Component +import io.github.dockyardmc.world.block.Block + +object Metadata : MetadataGroup() { + + private val DEFAULT_MANEQUINN_DESCRIPTION = Component(translate = "entity.minecraft.mannequin.label") + private val DEFAULT_PRIMED_TNT_BLOCK_STATE = Blocks.TNT.toBlock() + + val ENTITY_FLAGS = define(MetadataType.BYTE, 0) + val IS_ON_FIRE = bitmask(ENTITY_FLAGS, 0x01, false) + val IS_CROUCHING = bitmask(ENTITY_FLAGS, 0x02, false) + val IS_SPRINTING = bitmask(ENTITY_FLAGS, 0x08, false) + val IS_SWIMMING = bitmask(ENTITY_FLAGS, 0x10, false) + val IS_INVISIBLE = bitmask(ENTITY_FLAGS, 0x20, false) + val HAS_GLOWING_EFFECT = bitmask(ENTITY_FLAGS, 0x40, false) + val IS_FLYING_ELYTRA = bitmask(ENTITY_FLAGS, 0x80.toByte(), false) + val AIR_TICKS = define(MetadataType.VAR_INT, 300) + val CUSTOM_NAME = define(MetadataType.OPTIONAL_COMPONENT, null) + val CUSTOM_NAME_VISIBLE = define(MetadataType.BOOLEAN, false) + val IS_SILENT = define(MetadataType.BOOLEAN, false) + val HAS_NO_GRAVITY = define(MetadataType.BOOLEAN, false) + val POSE = define(MetadataType.POSE, EntityPose.STANDING) + val TICKS_FROZEN = define(MetadataType.VAR_INT, 0) + + object Interaction : MetadataGroup(Metadata) { + val WIDTH = define(MetadataType.FLOAT, 1f) + val HEIGHT = define(MetadataType.FLOAT, 1f) + val RESPONSIVE = define(MetadataType.BOOLEAN, false) + } + + object Display : MetadataGroup(Metadata) { + val INTERPOLATION_DELAY = define(MetadataType.VAR_INT, 0) + val TRANSFORMATION_INTERPOLATION_DURATION = define(MetadataType.VAR_INT, 0) + val POSITION_ROTATION_INTERPOLATION_DURATION = define(MetadataType.VAR_INT, 0) + val TRANSLATION = define(MetadataType.VECTOR_3F, Vector3f.ZERO) + val SCALE = define(MetadataType.VECTOR_3F, Vector3f.ZERO) + val ROTATION_LEFT = define(MetadataType.QUATERNION, Quaternion.DEFAULT) + val ROTATION_RIGHT = define(MetadataType.QUATERNION, Quaternion.DEFAULT) + val BILLBOARD_CONSTRAINTS = define(MetadataType.BYTE, 0) + val BRIGHTNESS_OVERRIDE = define(MetadataType.VAR_INT, -1) + val VIEW_RANGE = define(MetadataType.FLOAT, 1f) + val SHADOW_RADIUS = define(MetadataType.FLOAT, 0f) + val SHADOW_STRENGHT = define(MetadataType.FLOAT, 1f) + val WIDTH = define(MetadataType.FLOAT, 0f) + val HEIGHT = define(MetadataType.FLOAT, 0f) + val GLOW_COLOR_OVERRIDE = define(MetadataType.VAR_INT, -1) + } + + object BlockDisplay : MetadataGroup(Display) { + val DISPLAYED_BLOCK_STATE = define(MetadataType.BLOCK_STATE, Block.AIR) + } + + object ItemDisplay : MetadataGroup(Display) { + val DISPLAYED_ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + val DISPLAY_TYPE = define(MetadataType.BYTE, 0) + } + + object TextDisplay : MetadataGroup(Display) { + val TEXT = define(MetadataType.COMPONENT, Component()) + val LINE_WIDTH = define(MetadataType.VAR_INT, 200) + val BACKGROUND_COLOR = define(MetadataType.VAR_INT, 0x40000000) + val TEXT_OPACITY = define(MetadataType.BYTE, -1) + val TEXT_DISPLAY_FLAGS = define(MetadataType.BYTE, 0) + val HAS_SHADOW = bitmask(TEXT_DISPLAY_FLAGS, 0x01, false) + val IS_SEE_THROUGH = bitmask(TEXT_DISPLAY_FLAGS, 0x02, false) + val USE_DEFAULT_BACKGROUND = bitmask(TEXT_DISPLAY_FLAGS, 0x04, false) + val ALIGN_LEFT = bitmask(TEXT_DISPLAY_FLAGS, 0x08, false) + val ALIGN_RIGHT = bitmask(TEXT_DISPLAY_FLAGS, 0x10, false) + } + + object ExperienceOrb : MetadataGroup(Metadata) { + val VALUE = define(MetadataType.VAR_INT, 0) + } + + object ThrowItemProjectile : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + object EyeOfEnder : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + object FallingBlock : MetadataGroup(Metadata) { + val SPAWN_POSITION = define(MetadataType.BLOCK_POSITION, Vector3.ZERO) + } + + object AreaEffectCloud : MetadataGroup(Metadata) { + val RADIUS = define(MetadataType.FLOAT, 0.5f) + val COLOR = define(MetadataType.VAR_INT, 0) + val IGNORE_RADIUS_AND_SINGLE_POINT = define(MetadataType.BOOLEAN, false) + val PARTICLE = define(MetadataType.PARTICLE, Particles.EFFECT) + } + + object FishingHook : MetadataGroup(Metadata) { + val HOOKED = define(MetadataType.VAR_INT, 0) + val IS_CATCHABLE = define(MetadataType.BOOLEAN, false) + } + + object AbstractArrow : MetadataGroup(Metadata) { + val ARROW_FLAGS = define(MetadataType.BYTE, 0) + val IS_CRITICAL = bitmask(ARROW_FLAGS, 0x01, false) + val IS_NO_CLIP = bitmask(ARROW_FLAGS, 0x02, false) + val PIERCING_LEVEL = define(MetadataType.BYTE, 0) + val IN_GROUND = define(MetadataType.BOOLEAN, false) + } + + object Arrow : MetadataGroup(AbstractArrow) { + val COLOR = define(MetadataType.VAR_INT, -1) + } + + object ThrownTrident : MetadataGroup(AbstractArrow) { + val LOYALTY_LEVEL = define(MetadataType.BYTE, 0) + val HAS_ENCHANTMENT_GLINT = define(MetadataType.BOOLEAN, false) + } + + object AbstractVehicle : MetadataGroup(Metadata) { + val SHAKING_POWER = define(MetadataType.VAR_INT, 0) + val SHAKING_DIRECTION = define(MetadataType.VAR_INT, 1) + val SHAKING_MULTIPLIER = define(MetadataType.FLOAT, 0f) + } + + object Boat : MetadataGroup(AbstractVehicle) { + val IS_LEFT_PADDLE_TURNING = define(MetadataType.BOOLEAN, false) + val IS_RIGHT_PADDLE_TURNING = define(MetadataType.BOOLEAN, false) + val SPLASH_TIMER = define(MetadataType.VAR_INT, 0) + } + + object AbstractMinecart : MetadataGroup(AbstractVehicle) { + val CUSTOM_BLOCK_STATE = define(MetadataType.OPTIONAL_BLOCK_STATE, null) + val CUSTOM_BLOCK_Y_POSITION = define(MetadataType.VAR_INT, 6) + } + + object MinecartFurnace : MetadataGroup(AbstractMinecart) { + val HAS_FUEL = define(MetadataType.BOOLEAN, false) + } + + // minceart commadn block?? they dont even work here bro + + object EndCrystal : MetadataGroup(Metadata) { + val BEAM_TARGET = define(MetadataType.OPTIONAL_BLOCK_POSITION, null) + val SHOW_BOTTOM = define(MetadataType.BOOLEAN, true) + } + + object SmartFireball : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + object Fireball : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + object WitherSkull : MetadataGroup(Metadata) { + val IS_INVULNERABLE = define(MetadataType.BOOLEAN, false) + } + + object FireworkRocketEntity : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + val SHOOTER_ENTITY_ID = define(MetadataType.OPTIONAL_VAR_INT, null) + val IS_SHOT_AT_ANGLE = define(MetadataType.BOOLEAN, false) + } + + object Hanging : MetadataGroup(Metadata) { + val DIRECTION = define(MetadataType.DIRECTION, Direction.SOUTH) + } + + object ItemFrame : MetadataGroup(Hanging) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + val ROTATION = define(MetadataType.VAR_INT, 0) + } + + object Painting : MetadataGroup(Hanging) { + val VARIANT = define(MetadataType.PAINTING_VARIANT, PaintingVariants.KEBAB) + } + + object ItemEntity : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + object LivingEntity : MetadataGroup(Metadata) { + val LIVING_ENTITY_FLAGS = define(MetadataType.BYTE, 0) + val IS_HAND_ACTIVE = bitmask(LIVING_ENTITY_FLAGS, 0x01, false) + val ACTIVE_HAND = bitmask(LIVING_ENTITY_FLAGS, 0x02, false) + val IS_RIPTIDE_SPIN_ATTACK = bitmask(LIVING_ENTITY_FLAGS, 0x04, false) + val HEALTH = define(MetadataType.FLOAT, 1f) + val POTION_EFFECT_PARTICLES = define(MetadataType.PARTICLE_LIST, listOf()) + val IS_POTION_EFFECT_AMBIENT = define(MetadataType.BOOLEAN, false) + val NUMBER_OF_ARROWS = define(MetadataType.VAR_INT, 0) + val NUMBER_OF_BEE_STINGERS = define(MetadataType.VAR_INT, 0) + val BED_LOCATION = define(MetadataType.OPTIONAL_BLOCK_POSITION, null) + } + + object Avatar : MetadataGroup(LivingEntity) { + val MAIN_HAND = define(MetadataType.BYTE, 1) + val DISPLAYED_MODEL_PARTS_FLAG = define(MetadataType.BYTE, 1) + val IS_CAPE_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x01, false) + val IS_JACKET_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x02, false) + val IS_LEFT_SLEEVE_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x04, false) + val IS_RIGHT_SLEEVE_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x08, false) + val IS_LEFT_PANTS_LEG_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x10, false) + val IS_RIGHT_PANTS_LEG_ENABLED = bitmask(DISPLAYED_MODEL_PARTS_FLAG, 0x20, false) + val IS_HAT_ENABLED = bitmask(MAIN_HAND, 0x40, false) + } + + object Player : MetadataGroup(Avatar) { + val ADDITIONAL_HEARTS = define(MetadataType.FLOAT, 0f) + val SCORE = define(MetadataType.VAR_INT, 0) + val LEFT_SHOULDER_ENTITY_DATA = define(MetadataType.OPTIONAL_VAR_INT, null) + val RIGHT_SHOULDER_ENTITY_DATA = define(MetadataType.OPTIONAL_VAR_INT, null) + } + + object Mannequin : MetadataGroup(Avatar) { + val PROFILE = define(MetadataType.RESOLVABLE_PROFILE, ResolvableProfile.EMPTY) + val IMMOVABLE = define(MetadataType.BOOLEAN, false) + val DESCRIPTION = define(MetadataType.OPTIONAL_COMPONENT, DEFAULT_MANEQUINN_DESCRIPTION) + } + + object ArmorStand : MetadataGroup(LivingEntity) { + val ARMOR_STAND_FLAGS = define(MetadataType.BYTE, 0) + val IS_SMALL = bitmask(ARMOR_STAND_FLAGS, 0x01, false) + val HAS_ARMS = bitmask(ARMOR_STAND_FLAGS, 0x04, false) + val HAS_NO_BASE_PLATE = bitmask(ARMOR_STAND_FLAGS, 0x08, false) + val IS_MARKER = bitmask(ARMOR_STAND_FLAGS, 0x10, false) + val HEAD_ROTATION = define(MetadataType.ROTATION, Vector3f.ZERO) + val BODY_ROTATION = define(MetadataType.ROTATION, Vector3f.ZERO) + val LEFT_ARM_ROTATION = define(MetadataType.ROTATION, Vector3f(-10, 0, -10)) + val RIGHT_ARM_ROTATION = define(MetadataType.ROTATION, Vector3f(-15, 0, 10)) + val LEFT_LEG_ROTATION = define(MetadataType.ROTATION, Vector3f(-1, 0, -1)) + val RIGHT_LEG_ROTATION = define(MetadataType.ROTATION, Vector3f(1, 0, 1)) + } + + object Mob : MetadataGroup(LivingEntity) { + val MOB_FLAGS = define(MetadataType.BYTE, 0) + val NO_AI = bitmask(MOB_FLAGS, 0x01, false) + val IS_LEFT_HANDED = bitmask(MOB_FLAGS, 0x02, false) + val IS_AGGRESSIVE = bitmask(MOB_FLAGS, 0x04, false) + } + + object Allay : MetadataGroup(Mob) { + val IS_DANCING = define(MetadataType.BOOLEAN, false) + val CAN_DUPLICATE = define(MetadataType.BOOLEAN, true) + } + + object Armadillo : MetadataGroup(Mob) { + val STATE = define(MetadataType.ARMADILLO_STATE, io.github.dockyardmc.entity.entities.Armadillo.State.IDLE) + } + + object Bat : MetadataGroup(Mob) { + val BAT_FLAGS = define(MetadataType.BYTE, 0) + val IS_HANGING = bitmask(BAT_FLAGS, 0x01, false) + } + + object Dolphin : MetadataGroup(Mob) { + val TREASURE_LOCATION = define(MetadataType.BLOCK_POSITION, Vector3.ZERO) + val HAS_FISH = define(MetadataType.BOOLEAN, false) + val MOISTURE_LEVEL = define(MetadataType.VAR_INT, 2400) + } + + object AbstractFish : MetadataGroup(Mob) { + val FROM_BUCKET = define(MetadataType.BOOLEAN, false) + } + + object PufferFish : MetadataGroup(AbstractFish) { + val PUFF_STATE = define(MetadataType.VAR_INT, 0) + } + + object Salmon : MetadataGroup(AbstractFish) { + val SIZE = define(MetadataType.VAR_INT, io.github.dockyardmc.entity.entities.Salmon.Size.SMALL.ordinal) + } + + object TropicalFish : MetadataGroup(AbstractFish) { + val VARIANT = define(MetadataType.VAR_INT, 0) + } + + object AgeableMob : MetadataGroup(Mob) { + val IS_BABY = define(MetadataType.BOOLEAN, false) + } + + object Sniffer : MetadataGroup(AgeableMob) { + val STATE = define(MetadataType.SNIFFER_STATE, io.github.dockyardmc.entity.entities.Sniffer.State.IDLING) + val DROP_SEED_AT_TICK = define(MetadataType.VAR_INT, 0) + } + + object AbstractHorse : MetadataGroup(AgeableMob) { + val ABSTRACT_HORSE_FLAGS = define(MetadataType.BYTE, 0) + val IS_TAME = bitmask(ABSTRACT_HORSE_FLAGS, 0x02, false) + + // 0x04 saddle, no longer used + val HAS_BRED = bitmask(ABSTRACT_HORSE_FLAGS, 0x08, false) + val IS_EATING = bitmask(ABSTRACT_HORSE_FLAGS, 0x10, false) + val IS_REARING = bitmask(ABSTRACT_HORSE_FLAGS, 0x20, false) + val IS_MOUTH_OPEN = bitmask(ABSTRACT_HORSE_FLAGS, 0x40, false) + } + + object Horse : MetadataGroup(AbstractHorse) { + val VARIANT = define(MetadataType.VAR_INT, 0) + } + + object Camel : MetadataGroup(AbstractHorse) { + val DASHING = define(MetadataType.BOOLEAN, false) + val LAST_POSE_CHANGE_TICK = define(MetadataType.LONG, 0) + } + + object ChestedHorse : MetadataGroup(AbstractHorse) { + val HAS_CHEST = define(MetadataType.BOOLEAN, false) + } + + object Llama : MetadataGroup(ChestedHorse) { + val STRENGHT = define(MetadataType.VAR_INT, 0) + val CARPET_COLOR = define(MetadataType.VAR_INT, -1) + val VARIANT = define(MetadataType.VAR_INT, 0) + } + + object Axolotl : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.VAR_INT, 0) + val IS_PLAYING_DEAD = define(MetadataType.BOOLEAN, false) + val IS_FROM_BUCKET = define(MetadataType.BOOLEAN, false) + } + + object Bee : MetadataGroup(AgeableMob) { + val BEE_FLAGS = define(MetadataType.BYTE, 0) + val IS_ANGRY = bitmask(BEE_FLAGS, 0x02, false) + val HAS_STUNG = bitmask(BEE_FLAGS, 0x04, false) + val HAS_NECTAR = bitmask(BEE_FLAGS, 0x08, false) + val ANGER_TIME_TICKS = define(MetadataType.VAR_INT, 0) + } + + object GlowSquid : MetadataGroup(AgeableMob) { + val DARK_TICKS_REMAINING = define(MetadataType.VAR_INT, 0) + } + + object Fox : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.VAR_INT, 0) + val FOX_FLAGS = define(MetadataType.BYTE, 0) + val IS_SITTING = bitmask(FOX_FLAGS, 0x01, false) + val IS_CROUCHING = bitmask(FOX_FLAGS, 0x04, false) + val IS_INTERESTED = bitmask(FOX_FLAGS, 0x08, false) + val IS_POUNCING = bitmask(FOX_FLAGS, 0x10, false) + val IS_SLEEPING = bitmask(FOX_FLAGS, 0x20, false) + val IS_FACEPLANTED = bitmask(FOX_FLAGS, 0x40, false) + val IS_DEFENDING = bitmask(FOX_FLAGS, 0x80.toByte(), false) + val FIRST_UUID = define(MetadataType.OPTIONAL_UUID, null) + val SECOND_UUID = define(MetadataType.OPTIONAL_UUID, null) + } + + object Frog : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.FROG_VARIANT, FrogVariants.TEMPERATE) + val TONGUE_TARGET = define(MetadataType.OPTIONAL_VAR_INT, 0) + } + + object Ocelot : MetadataGroup(AgeableMob) { + val IS_TRUSTING = define(MetadataType.BOOLEAN, false) + } + + object Panda : MetadataGroup(AgeableMob) { + val BREED_TIMER = define(MetadataType.VAR_INT, 0) + val SNEEZE_TIMER = define(MetadataType.VAR_INT, 0) + val EAT_TIMER = define(MetadataType.VAR_INT, 0) + val MAIN_GENE = define(MetadataType.BYTE, 0) + val HIDDEN_GENE = define(MetadataType.BYTE, 0) + val PANDA_FLAGS = define(MetadataType.BYTE, 0) + val IS_SNEEZING = bitmask(PANDA_FLAGS, 0x02, false) + val IS_ROLLING = bitmask(PANDA_FLAGS, 0x04, false) + val IS_SITTING = bitmask(PANDA_FLAGS, 0x08, false) + val IS_ON_BACK = bitmask(PANDA_FLAGS, 0x10, false) + } + + object Chicken : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.CHICKEN_VARIANT, ChickenVariants.TEMPERATE) + } + + object Cow : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.COW_VARIANT, CowVariants.TEMPERATE) + } + + object Pig : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.PIG_VARIANT, PigVariants.TEMPERATE) + } + + //TODO rabbit + + object Turtle : MetadataGroup(AgeableMob) { + val HAS_EGG = define(MetadataType.BOOLEAN, false) + val IS_LAYING_EGGS = define(MetadataType.BOOLEAN, false) + } + + object PolarBear : MetadataGroup(AgeableMob) { + val IS_STANDING_UP = define(MetadataType.BOOLEAN, false) + } + + object Mooshroom : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.VAR_INT, 0) + } + + object Hoglin : MetadataGroup(AgeableMob) { + val IMMUNE_ZOMBIFICATION = define(MetadataType.BOOLEAN, false) + } + + object Sheep : MetadataGroup(AgeableMob) { + val SHEEP_FLAGS = define(MetadataType.BYTE, 0) + //TODO bytemask + } + + object Strider : MetadataGroup(AgeableMob) { + val FUNGUS_BOOST = define(MetadataType.VAR_INT, 0) + val IS_SHAKING = define(MetadataType.BOOLEAN, false) + } + + object Goat : MetadataGroup(AgeableMob) { + val IS_SCREAMING_GOAT = define(MetadataType.BOOLEAN, false) // me too goat, me too + val HAS_LEFT_HORN = define(MetadataType.BOOLEAN, true) + val HAS_RIGHT_HORN = define(MetadataType.BOOLEAN, true) + } + + object TameableAnimal : MetadataGroup(AgeableMob) { + val TAMABLE_ANIMAL_FLAGS = define(MetadataType.BYTE, 0) + val IS_SITTING = bitmask(TAMABLE_ANIMAL_FLAGS, 0x01, false) + val IS_TAMED = bitmask(TAMABLE_ANIMAL_FLAGS, 0x04, false) + val OWNER = define(MetadataType.OPTIONAL_UUID, null) + } + + object Cat : MetadataGroup(TameableAnimal) { + val VARIANT = define(MetadataType.CAT_VARIANT, CatVariants.BLACK) + val IS_LYING = define(MetadataType.BOOLEAN, false) + val IS_RELAXED = define(MetadataType.BOOLEAN, false) + val COLLAR_COLOR = define(MetadataType.VAR_INT, 14) + } + + object Wolf : MetadataGroup(TameableAnimal) { + val IS_BEGGING = define(MetadataType.BOOLEAN, false) + val COLLAR_COLOR = define(MetadataType.VAR_INT, 14) + val ANGER_TIME = define(MetadataType.VAR_INT, 0) + val VARIANT = define(MetadataType.WOLF_VARIANT, WolfVariants.PALE) + val SOUND_VARIANT = define(MetadataType.WOLF_SOUND_VARIANT, WolfSoundVariants.CLASSIC) + } + + object Parrot : MetadataGroup(AgeableMob) { + val VARIANT = define(MetadataType.VAR_INT, 0) + } + + object AbstractVillager : MetadataGroup(AgeableMob) { + val HEAD_SHAKE_TIMER = define(MetadataType.VAR_INT, 0) + } + + //TODO Villager (need to do villager data, professions and stuff) +// object Villager: MetadataGroup(AbstractVillager) { +// +// } + + object HappyGhast : MetadataGroup(AgeableMob) { + val IS_LEASH_HOLDER = define(MetadataType.BOOLEAN, false) + val STAYS_STILL = define(MetadataType.BOOLEAN, false) + } + + object IronGolem : MetadataGroup(Mob) { + val IRON_GOLEM_FLAGS = define(MetadataType.BYTE, 0) + val IS_PLAYER_CREATED = bitmask(IRON_GOLEM_FLAGS, 0x01, false) + } + + object SnowGolem : MetadataGroup(Mob) { + val SNOW_GOLEM_FLAGS = define(MetadataType.BYTE, 0) + val PUMPKIN_HAT = bitmask(SNOW_GOLEM_FLAGS, 0x01, false) + } + + object Shulker : MetadataGroup(Mob) { + val ATTACH_FACE = define(MetadataType.DIRECTION, Direction.DOWN) + val SHIELD_HEIGHT = define(MetadataType.BYTE, 0) + val COLOR = define(MetadataType.BYTE, 16) + } + + object CopperGolem : MetadataGroup(Mob) { + val WEATHER_STATE = define(MetadataType.COPPER_GOLEM_WEATHER_STATE, io.github.dockyardmc.entity.entities.CopperGolem.WeatherState.UNAFFECTED) + val STATE = define(MetadataType.COPPER_GOLEM_STATE, io.github.dockyardmc.entity.entities.CopperGolem.State.IDLE) + } + + object BasePiglin : MetadataGroup(Mob) { + val IMMUNE_ZOMBIFICATION = define(MetadataType.BOOLEAN, false) + } + + object Piglin : MetadataGroup(BasePiglin) { + val IS_BABY = define(MetadataType.BOOLEAN, false) + val IS_CHARING_CROSSBOW = define(MetadataType.BOOLEAN, false) + val IS_DANCING = define(MetadataType.BOOLEAN, false) + } + + object Blaze : MetadataGroup(Mob) { + val BLAZE_FLAGS = define(MetadataType.BYTE, 0) + val IS_ON_FIRE = bitmask(BLAZE_FLAGS, 0x01, false) + } + + object Bogged : MetadataGroup(Mob) { + val IS_SHEARED = define(MetadataType.BOOLEAN, false) + } + + object Creeking : MetadataGroup(Mob) { + val CAN_MOVE = define(MetadataType.BOOLEAN, true) + val IS_ACTIVE = define(MetadataType.BOOLEAN, false) + val IS_TEARING_DOWN = define(MetadataType.BOOLEAN, false) + val HOME_POS = define(MetadataType.OPTIONAL_BLOCK_POSITION, null) + } + + object Creeper : MetadataGroup(Mob) { + val STATE = define(MetadataType.VAR_INT, -1) + val IS_CHARGED = define(MetadataType.BOOLEAN, false) + val IS_IGNITED = define(MetadataType.BOOLEAN, false) + } + + object Guardian : MetadataGroup(Mob) { + val IS_RETRACTING_SPIKES = define(MetadataType.BOOLEAN, false) + val TARGET_EID = define(MetadataType.VAR_INT, 0) + } + + object Raider : MetadataGroup(Mob) { + val IS_CELEBRATING = define(MetadataType.BOOLEAN, false) + } + + object Pillager : MetadataGroup(Raider) { + val IS_CHARING = define(MetadataType.BOOLEAN, false) + } + + object SpellcasterIllager : MetadataGroup(Raider) { + val SPELL = define(MetadataType.BYTE, 0) + } + + object Witch : MetadataGroup(Raider) { + val IS_DRINKING_POTION = define(MetadataType.BOOLEAN, false) + } + + object Spider : MetadataGroup(Mob) { + val SPIDER_FLAGS = define(MetadataType.BYTE, 0) + val IS_CLIMBING = bitmask(SPIDER_FLAGS, 0x01, false) + } + + object Vex : MetadataGroup(Mob) { + val VEX_FLAGS = define(MetadataType.BYTE, 0) + val IS_ATTACKING = bitmask(VEX_FLAGS, 0x01, false) + } + + object Warden : MetadataGroup(Mob) { + val ANGER_LEVEL = define(MetadataType.VAR_INT, 0) + } + + object Wither : MetadataGroup(Mob) { + val CENTER_HEAD_TARGET = define(MetadataType.VAR_INT, 0) + val LEFT_HEAD_TARGET = define(MetadataType.VAR_INT, 0) + val RIGHT_HEAD_TARGET = define(MetadataType.VAR_INT, 0) + val INVULNERABLE_TIME = define(MetadataType.VAR_INT, 0) + } + + object Zoglin : MetadataGroup(Mob) { + val IS_BABY = define(MetadataType.BOOLEAN, false) + } + + object Zombie : MetadataGroup(Mob) { + val IS_BABY = define(MetadataType.BOOLEAN, false) + val IS_BECOMING_DROWNED = define(MetadataType.BOOLEAN, false) + } + + object ZombieVillager : MetadataGroup(Mob) { + val IS_CONVERTING = define(MetadataType.BOOLEAN, false) + } + + object Enderman : MetadataGroup(Mob) { + val CARRIED_BLOCK = define(MetadataType.OPTIONAL_BLOCK_STATE, null) + val IS_SCREAMING = define(MetadataType.BOOLEAN, false) + val IS_STARING = define(MetadataType.BOOLEAN, false) + } + + object EnderDragon : MetadataGroup(Mob) { + val DRAGON_PHASE = define(MetadataType.VAR_INT, 10) + } + + object Ghast : MetadataGroup(Mob) { + val IS_ATTACKING = define(MetadataType.BOOLEAN, false) + } + + object Phantom : MetadataGroup(Mob) { + val SIZE = define(MetadataType.VAR_INT, 0) + } + + object Slime : MetadataGroup(Mob) { + val SIZE = define(MetadataType.VAR_INT, 1) + } + + object PrimedTnt : MetadataGroup(Metadata) { + val FUSE_TIME = define(MetadataType.VAR_INT, 80) + val BLOCK_STATE = define(MetadataType.BLOCK_STATE, DEFAULT_PRIMED_TNT_BLOCK_STATE) + } + + object OminousItemSpawner : MetadataGroup(Metadata) { + val ITEM = define(MetadataType.ITEM_STACK, ItemStack.AIR) + } + + sealed interface MetadataDefinitionEntry + + data class MetadataDefinition(val index: Int, val type: MetadataSerializer, val default: T) : MetadataDefinitionEntry { + data class Value(val parent: MetadataDefinition, val value: T) + } + + data class BitmaskFlagDefinition( + val parent: MetadataDefinition, + val bitMask: Byte, + val defaultValue: Boolean + ) : MetadataDefinitionEntry + +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataGroup.kt b/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataGroup.kt new file mode 100644 index 000000000..5f6150216 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataGroup.kt @@ -0,0 +1,19 @@ +package io.github.dockyardmc.entity.metadata + +import io.github.dockyardmc.entity.metadata.Metadata.MetadataDefinition +import io.github.dockyardmc.entity.metadata.MetadataType.MetadataSerializer +import java.util.concurrent.atomic.AtomicInteger + +abstract class MetadataGroup(initialValue: Int = 0) { + constructor(parent: MetadataGroup) : this(parent.counter.get()) + + protected val counter = AtomicInteger(initialValue) + + protected fun define(type: MetadataSerializer, default: T): MetadataDefinition { + return MetadataDefinition(counter.getAndIncrement(), type, default) + } + + protected fun bitmask(parent: MetadataDefinition, bitMask: Byte, defaultValue: Boolean): Metadata.BitmaskFlagDefinition { + return Metadata.BitmaskFlagDefinition(parent, bitMask, defaultValue) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataType.kt b/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataType.kt new file mode 100644 index 000000000..9a42eebb7 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/entity/metadata/MetadataType.kt @@ -0,0 +1,71 @@ +package io.github.dockyardmc.entity.metadata + +import io.github.dockyardmc.codec.ComponentCodecs +import io.github.dockyardmc.codec.LocationCodecs +import io.github.dockyardmc.codec.RegistryCodec +import io.github.dockyardmc.entity.entities.Armadillo +import io.github.dockyardmc.entity.entities.CopperGolem +import io.github.dockyardmc.entity.entities.Sniffer +import io.github.dockyardmc.item.ItemStack +import io.github.dockyardmc.maths.Quaternion +import io.github.dockyardmc.maths.vectors.Vector3f +import io.github.dockyardmc.player.Direction +import io.github.dockyardmc.player.EntityPose +import io.github.dockyardmc.protocol.types.ResolvableProfile +import io.github.dockyardmc.registry.registries.* +import io.github.dockyardmc.tide.stream.StreamCodec +import io.github.dockyardmc.world.block.Block +import java.util.concurrent.atomic.AtomicInteger + +object MetadataType { + private val serializers = mutableListOf>() + private val metadataType = AtomicInteger() + + val BYTE = next(StreamCodec.BYTE) + val VAR_INT = next(StreamCodec.VAR_INT) + val LONG = next(StreamCodec.LONG) + val FLOAT = next(StreamCodec.FLOAT) + val STRING = next(StreamCodec.STRING) + val COMPONENT = next(ComponentCodecs.STREAM) + val OPTIONAL_COMPONENT = next(ComponentCodecs.STREAM.optional()) + val ITEM_STACK = next(ItemStack.STREAM_CODEC) + val BOOLEAN = next(StreamCodec.BOOLEAN) + val ROTATION = next(Vector3f.STREAM_CODEC) + val BLOCK_POSITION = next(LocationCodecs.BLOCK_POSITION) + val OPTIONAL_BLOCK_POSITION = next(LocationCodecs.BLOCK_POSITION.optional()) + val DIRECTION = next(StreamCodec.enum()) + val OPTIONAL_UUID = next(StreamCodec.UUID.optional()) + val BLOCK_STATE = next(Block.STREAM_CODEC) + val OPTIONAL_BLOCK_STATE = next(Block.STREAM_CODEC.optional()) + val PARTICLE = next(RegistryCodec.stream(ParticleRegistry)) + val PARTICLE_LIST = next(RegistryCodec.stream(ParticleRegistry).list()) + val VILLAGER_DATA = skip() + val OPTIONAL_VAR_INT = next(StreamCodec.VAR_INT.optional()) + val POSE = next(StreamCodec.enum()) + val CAT_VARIANT = next(RegistryCodec.stream(CatVariantRegistry)) + val COW_VARIANT = next(RegistryCodec.stream(CowVariantRegistry)) + val WOLF_VARIANT = next(RegistryCodec.stream(WolfVariantRegistry)) + val WOLF_SOUND_VARIANT = next(RegistryCodec.stream(WolfSoundVariantRegistry)) + val FROG_VARIANT = next(RegistryCodec.stream(FrogVariantRegistry)) + val PIG_VARIANT = next(RegistryCodec.stream(PigVariantRegistry)) + val CHICKEN_VARIANT = next(RegistryCodec.stream(ChickenVariantRegistry)) + val OPTIONAL_GLOBAL_POSITION = skip() // unused in vanilla? + val PAINTING_VARIANT = next(RegistryCodec.stream(PaintingVariantRegistry)) + val SNIFFER_STATE = next(StreamCodec.enum()) + val ARMADILLO_STATE = next(StreamCodec.enum()) + val COPPER_GOLEM_STATE = next(StreamCodec.enum()) + val COPPER_GOLEM_WEATHER_STATE = next(StreamCodec.enum()) + val VECTOR_3F = next(Vector3f.STREAM_CODEC) + val QUATERNION = next(Quaternion.STREAM_CODEC) + val RESOLVABLE_PROFILE = next(ResolvableProfile.STREAM_CODEC) + + data class MetadataSerializer(val index: Int, val streamCodec: StreamCodec) + + fun next(streamCodec: StreamCodec): MetadataSerializer { + return MetadataSerializer(metadataType.getAndIncrement(), streamCodec) + } + + fun skip() { + metadataType.getAndIncrement() + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/events/PlayerAcceptCodeOfConductEvent.kt b/src/main/kotlin/io/github/dockyardmc/events/PlayerAcceptCodeOfConductEvent.kt new file mode 100644 index 000000000..06d2fc08a --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/events/PlayerAcceptCodeOfConductEvent.kt @@ -0,0 +1,7 @@ +package io.github.dockyardmc.events + +import io.github.dockyardmc.annotations.EventDocumentation +import io.github.dockyardmc.player.Player + +@EventDocumentation("when player accepts the server code of conduct") +data class PlayerAcceptCodeOfConductEvent(val player: Player, override val context: Event.Context) : Event \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/extentions/ExtendedEnum.kt b/src/main/kotlin/io/github/dockyardmc/extentions/ExtendedEnum.kt index 75f31f657..cfa9f5c31 100644 --- a/src/main/kotlin/io/github/dockyardmc/extentions/ExtendedEnum.kt +++ b/src/main/kotlin/io/github/dockyardmc/extentions/ExtendedEnum.kt @@ -1,3 +1,17 @@ package io.github.dockyardmc.extentions -inline fun > enumRandom(): T = enumValues().random() \ No newline at end of file +inline fun > enumRandom(): T = enumValues().random() + +inline fun > T.next(): T { + val values = enumValues() + val nextOrdinal = (this.ordinal + 1) % values.size + return values[nextOrdinal] +} + +inline fun > T.previous(): T { + val values = enumValues() + val size = values.size + // (this.ordinal - 1 + size) ensures the result is always non-negative before the modulo + val previousOrdinal = (this.ordinal - 1 + size) % size + return values[previousOrdinal] +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/item/ItemStack.kt b/src/main/kotlin/io/github/dockyardmc/item/ItemStack.kt index 4ac390f6d..830d38c82 100644 --- a/src/main/kotlin/io/github/dockyardmc/item/ItemStack.kt +++ b/src/main/kotlin/io/github/dockyardmc/item/ItemStack.kt @@ -22,6 +22,7 @@ import io.github.dockyardmc.scroll.CustomColor import io.github.dockyardmc.scroll.extensions.stripComponentTags import io.github.dockyardmc.scroll.extensions.toComponent import io.github.dockyardmc.sounds.BuiltinSoundEvent +import io.github.dockyardmc.tide.stream.StreamCodec import io.github.dockyardmc.utils.CustomDataHolder import io.netty.buffer.ByteBuf import net.kyori.adventure.nbt.* @@ -46,6 +47,18 @@ data class ItemStack( companion object { val AIR = ItemStack(Items.AIR, 1) + val STREAM_CODEC = object : StreamCodec { + + override fun write(buffer: ByteBuf, value: ItemStack) { + value.write(buffer) + } + + override fun read(buffer: ByteBuf): ItemStack { + return ItemStack.read(buffer) + } + + } + fun read(buffer: ByteBuf, isPatch: Boolean = true, isTrusted: Boolean = true): ItemStack { val count = buffer.readVarInt() if (count <= 0) return AIR diff --git a/src/main/kotlin/io/github/dockyardmc/maths/MathUtils.kt b/src/main/kotlin/io/github/dockyardmc/maths/MathUtils.kt index 97b88fea0..843ffd654 100644 --- a/src/main/kotlin/io/github/dockyardmc/maths/MathUtils.kt +++ b/src/main/kotlin/io/github/dockyardmc/maths/MathUtils.kt @@ -7,10 +7,7 @@ import io.github.dockyardmc.world.chunk.ChunkUtils.isPowerOfTwo import io.github.dockyardmc.world.chunk.ChunkUtils.roundUpPow2 import java.io.File import java.security.MessageDigest -import kotlin.math.PI -import kotlin.math.cos -import kotlin.math.sin -import kotlin.math.sqrt +import kotlin.math.* import kotlin.random.Random private val MULTIPLY_DE_BRUIJN_BIT_POSITION = intArrayOf( @@ -32,6 +29,10 @@ fun ceilLog2(value: Int): Int { return MULTIPLY_DE_BRUIJN_BIT_POSITION[(temp.toLong() * 125613361L shr 27 and 31).toInt()] } +fun absMax(first: Double, second: Double): Double { + return max(abs(first), abs(second)) +} + fun degreesToRadians(degrees: Float): Float = (degrees * (PI / 180.0)).toFloat() fun eulerToQuaternion(euler: Vector3f): Quaternion = @@ -154,3 +155,8 @@ fun chunkInSpiral(id: Int, xOffset: Int = 0, zOffset: Int = 0): Pair { fun sin(float: Float): Float { return sin(float.toDouble()).toFloat() } + +fun ceilLong(value: Double): Long { + val i = value.toLong() + return if (value > i) i + 1L else i +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/maths/Quaternion.kt b/src/main/kotlin/io/github/dockyardmc/maths/Quaternion.kt index fa2572daf..5e0cac5b7 100644 --- a/src/main/kotlin/io/github/dockyardmc/maths/Quaternion.kt +++ b/src/main/kotlin/io/github/dockyardmc/maths/Quaternion.kt @@ -1,6 +1,7 @@ package io.github.dockyardmc.maths import io.github.dockyardmc.maths.vectors.Vector3f +import io.github.dockyardmc.tide.stream.StreamCodec import io.netty.buffer.ByteBuf import kotlin.math.PI import kotlin.math.cos @@ -26,6 +27,17 @@ data class Quaternion( fun conjugate(): Quaternion = Quaternion(this.w, -this.x, -this.y, -this.z) companion object { + + val DEFAULT = Quaternion(0f, 0f, 0f, 1f) + + val STREAM_CODEC = StreamCodec.of( + StreamCodec.FLOAT, Quaternion::x, + StreamCodec.FLOAT, Quaternion::y, + StreamCodec.FLOAT, Quaternion::z, + StreamCodec.FLOAT, Quaternion::w, + ::Quaternion + ) + fun fromAxis(axisX: Float, axisY: Float, axisZ: Float): Quaternion { val xRadians = degreesToRadians(axisX) val yRadians = degreesToRadians(axisY) diff --git a/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3.kt b/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3.kt index 28ef770a8..76cded9b7 100644 --- a/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3.kt +++ b/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3.kt @@ -143,6 +143,8 @@ data class Vector3( companion object : NetworkReadable { + val ZERO = Vector3(0) + val CODEC = Codec.INT_ARRAY.transform({ from -> from.toVector3() }, { to -> to.toIntArray() }) val STREAM_CODEC = StreamCodec.of( diff --git a/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3f.kt b/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3f.kt index 2d1311e71..5b85ba5d2 100644 --- a/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3f.kt +++ b/src/main/kotlin/io/github/dockyardmc/maths/vectors/Vector3f.kt @@ -114,6 +114,8 @@ data class Vector3f( companion object : NetworkReadable { + val ZERO = Vector3f(0f) + val STREAM_CODEC = StreamCodec.of( StreamCodec.FLOAT, Vector3f::x, StreamCodec.FLOAT, Vector3f::y, diff --git a/src/main/kotlin/io/github/dockyardmc/npc/FakePlayer.kt b/src/main/kotlin/io/github/dockyardmc/npc/FakePlayer.kt index f725c8576..4892eafc0 100644 --- a/src/main/kotlin/io/github/dockyardmc/npc/FakePlayer.kt +++ b/src/main/kotlin/io/github/dockyardmc/npc/FakePlayer.kt @@ -7,9 +7,7 @@ import io.github.dockyardmc.apis.Hologram import io.github.dockyardmc.apis.hologram import io.github.dockyardmc.entity.Entity import io.github.dockyardmc.entity.EntityManager.despawnEntity -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.events.* import io.github.dockyardmc.events.system.EventFilter import io.github.dockyardmc.extentions.sendPacket @@ -115,7 +113,7 @@ class FakePlayer(location: Location, val name: String = UUID.randomUUID().toStri } displayedSkinParts.listUpdated { - metadata[EntityMetadataType.PLAYER_DISPLAY_SKIN_PARTS] = EntityMetadata(EntityMetadataType.PLAYER_DISPLAY_SKIN_PARTS, EntityMetaValue.BYTE, displayedSkinParts.values.getBitMask()) + metadata[Metadata.Avatar.DISPLAYED_MODEL_PARTS_FLAG] = displayedSkinParts.values.getBitMask() } team.value = npcTeam } diff --git a/src/main/kotlin/io/github/dockyardmc/player/Player.kt b/src/main/kotlin/io/github/dockyardmc/player/Player.kt index 302d33a96..ec85000ff 100644 --- a/src/main/kotlin/io/github/dockyardmc/player/Player.kt +++ b/src/main/kotlin/io/github/dockyardmc/player/Player.kt @@ -2,7 +2,6 @@ package io.github.dockyardmc.player import cz.lukynka.bindables.Bindable import cz.lukynka.bindables.BindableList -import cz.lukynka.prettylog.log import io.github.dockyardmc.DockyardServer import io.github.dockyardmc.advancement.PlayerAdvancementTracker import io.github.dockyardmc.attributes.PlayerAttributes @@ -13,9 +12,7 @@ import io.github.dockyardmc.entity.EntityManager.despawnEntity import io.github.dockyardmc.entity.EntityManager.spawnEntity import io.github.dockyardmc.entity.ItemDropEntity import io.github.dockyardmc.entity.LightningBolt -import io.github.dockyardmc.entity.metadata.EntityMetaValue -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.events.* import io.github.dockyardmc.extentions.sendPacket import io.github.dockyardmc.inventory.PlayerInventory @@ -32,7 +29,7 @@ import io.github.dockyardmc.player.systems.* import io.github.dockyardmc.protocol.PlayerNetworkManager import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.protocol.packets.ProtocolState -import io.github.dockyardmc.protocol.packets.configurations.ClientboundConfigurationPluginMessagePacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundConfigurationPluginMessagePacket import io.github.dockyardmc.protocol.packets.play.clientbound.* import io.github.dockyardmc.protocol.packets.play.serverbound.ServerboundChatCommandPacket import io.github.dockyardmc.protocol.packets.play.serverbound.ServerboundClientInputPacket @@ -204,7 +201,7 @@ class Player( } displayedSkinParts.listUpdated { - metadata[EntityMetadataType.PLAYER_DISPLAY_SKIN_PARTS] = EntityMetadata(EntityMetadataType.PLAYER_DISPLAY_SKIN_PARTS, EntityMetaValue.BYTE, displayedSkinParts.values.getBitMask()) + metadata[Metadata.Avatar.DISPLAYED_MODEL_PARTS_FLAG] = displayedSkinParts.values.getBitMask() } experienceBar.valueChanged { sendUpdateExperiencePacket() } @@ -241,7 +238,7 @@ class Player( } } - hasNoGravity.value = false +// hasNoGravity.value = false } fun sendResourcePack(resourcePack: ResourcePack): CompletableFuture { @@ -437,12 +434,18 @@ class Player( } } + fun swingHand(hand: PlayerHand = PlayerHand.MAIN_HAND) { + val packet = ClientboundPlayerAnimationPacket(this, if (hand == PlayerHand.MAIN_HAND) EntityAnimation.SWING_MAIN_ARM else EntityAnimation.SWING_OFFHAND) + viewers.sendPacket(packet) + this.sendPacket(packet) + } + fun refreshGameProfileState() { val currentLocation = this.location val removeInfo = ClientboundPlayerInfoRemovePacket(this) val entityRemovePacket = ClientboundEntityRemovePacket(this) - val spawnEntityPacket = ClientboundSpawnEntityPacket(this.id, this.uuid, this.type.getProtocolId(), this.location, this.location.yaw, 0, this.velocity) + val spawnEntityPacket = ClientboundSpawnEntityPacket(this.id, this.uuid, this.type, this.location, this.location.yaw, 0, this.velocity) val updates = mutableListOf( PlayerInfoUpdate.AddPlayer(this.gameProfile), PlayerInfoUpdate.UpdateListed(this.isListed.value), diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ConfigurationHandler.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ConfigurationHandler.kt index 0863b3882..79343b76d 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ConfigurationHandler.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ConfigurationHandler.kt @@ -1,7 +1,6 @@ package io.github.dockyardmc.protocol.packets.configurations //import io.github.dockyardmc.player.setSkin -import cz.lukynka.prettylog.log import io.github.dockyardmc.DockyardServer import io.github.dockyardmc.apis.serverlinks.ServerLinks import io.github.dockyardmc.commands.buildCommandGraph @@ -13,6 +12,10 @@ import io.github.dockyardmc.player.PlayerInfoUpdate import io.github.dockyardmc.protocol.PlayerNetworkManager import io.github.dockyardmc.protocol.packets.PacketHandler import io.github.dockyardmc.protocol.packets.ProtocolState +import io.github.dockyardmc.protocol.packets.configurations.clientbound.* +import io.github.dockyardmc.protocol.packets.configurations.serverbound.ServerboundClientInformationPacket +import io.github.dockyardmc.protocol.packets.configurations.serverbound.ServerboundConfigurationPluginMessagePacket +import io.github.dockyardmc.protocol.packets.configurations.serverbound.ServerboundFinishConfigurationAcknowledgePacket import io.github.dockyardmc.protocol.packets.play.clientbound.* import io.github.dockyardmc.protocol.plugin.PluginMessageRegistry import io.github.dockyardmc.protocol.plugin.messages.BrandPluginMessage diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundCodeOfConductPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundCodeOfConductPacket.kt new file mode 100644 index 000000000..7b63a5ac3 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundCodeOfConductPacket.kt @@ -0,0 +1,17 @@ +package io.github.dockyardmc.protocol.packets.configurations.clientbound + +import io.github.dockyardmc.protocol.packets.ClientboundPacket +import io.github.dockyardmc.tide.stream.StreamCodec + +data class ClientboundCodeOfConductPacket(val codeOfConduct: String) : ClientboundPacket() { + companion object { + val STREAM_CODEC = StreamCodec.of( + StreamCodec.STRING, ClientboundCodeOfConductPacket::codeOfConduct, + ::ClientboundCodeOfConductPacket + ) + } + + init { + STREAM_CODEC.write(buffer, this) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationAddResourcePackPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationAddResourcePackPacket.kt similarity index 81% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationAddResourcePackPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationAddResourcePackPacket.kt index 0b52d81b4..c59bf3c23 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationAddResourcePackPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationAddResourcePackPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.resourcepack.ResourcePack diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationClearDialogPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationClearDialogPacket.kt similarity index 70% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationClearDialogPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationClearDialogPacket.kt index 54b6851ab..3d8c36e4b 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationClearDialogPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationClearDialogPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.play.clientbound.ClientboundClearDialogPacket diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationPluginMessagePacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationPluginMessagePacket.kt similarity index 89% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationPluginMessagePacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationPluginMessagePacket.kt index 8d33581e4..86ffa47a1 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationPluginMessagePacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationPluginMessagePacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.protocol.plugin.messages.PluginMessage diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationRemoveResourcePackPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationRemoveResourcePackPacket.kt similarity index 85% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationRemoveResourcePackPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationRemoveResourcePackPacket.kt index cab605722..52d9e19f6 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationRemoveResourcePackPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationRemoveResourcePackPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.resourcepack.ResourcePack diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationServerLinksPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationServerLinksPacket.kt similarity index 83% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationServerLinksPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationServerLinksPacket.kt index e08b038f1..d2edfa112 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundConfigurationServerLinksPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundConfigurationServerLinksPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.protocol.types.writeList diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFeatureFlagsPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFeatureFlagsPacket.kt similarity index 86% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFeatureFlagsPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFeatureFlagsPacket.kt index 31b86f109..afc0bd306 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFeatureFlagsPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFeatureFlagsPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.extentions.writeString import io.github.dockyardmc.extentions.writeVarInt diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFinishConfigurationPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFinishConfigurationPacket.kt similarity index 63% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFinishConfigurationPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFinishConfigurationPacket.kt index 1d6b811a6..6377135da 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundFinishConfigurationPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundFinishConfigurationPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundKnownPacksPackets.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundKnownPacksPackets.kt similarity index 88% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundKnownPacksPackets.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundKnownPacksPackets.kt index b3ad566b8..821815ffa 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundKnownPacksPackets.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundKnownPacksPackets.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.extentions.writeString import io.github.dockyardmc.extentions.writeVarInt diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundRegistryDataPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundRegistryDataPacket.kt similarity index 77% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundRegistryDataPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundRegistryDataPacket.kt index 6f0c22a97..55294f893 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundRegistryDataPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundRegistryDataPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.protocol.packets.ClientboundPacket import io.github.dockyardmc.registry.Registry diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundUpdateTagsPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundUpdateTagsPacket.kt similarity index 96% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundUpdateTagsPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundUpdateTagsPacket.kt index 389d6f851..a786fcb60 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ClientboundUpdateTagsPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/clientbound/ClientboundUpdateTagsPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.clientbound import io.github.dockyardmc.extentions.writeString import io.github.dockyardmc.extentions.writeVarInt diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundAcceptCodeOfConductPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundAcceptCodeOfConductPacket.kt new file mode 100644 index 000000000..5964c766d --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundAcceptCodeOfConductPacket.kt @@ -0,0 +1,21 @@ +package io.github.dockyardmc.protocol.packets.configurations.serverbound + +import io.github.dockyardmc.events.Events +import io.github.dockyardmc.events.PlayerAcceptCodeOfConductEvent +import io.github.dockyardmc.protocol.PlayerNetworkManager +import io.github.dockyardmc.protocol.packets.ServerboundPacket +import io.github.dockyardmc.tide.stream.StreamCodec +import io.github.dockyardmc.utils.getPlayerEventContext +import io.netty.channel.ChannelHandlerContext + +class ServerboundAcceptCodeOfConductPacket : ServerboundPacket { + + companion object { + val STREAM_CODEC = StreamCodec.of(::ServerboundAcceptCodeOfConductPacket) + } + + override fun handle(processor: PlayerNetworkManager, connection: ChannelHandlerContext, size: Int, id: Int) { + Events.dispatch(PlayerAcceptCodeOfConductEvent(processor.player, getPlayerEventContext(processor.player))) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundClientInformationPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundClientInformationPacket.kt similarity index 93% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundClientInformationPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundClientInformationPacket.kt index da4ef56e6..a18a0c330 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundClientInformationPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundClientInformationPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.serverbound import io.github.dockyardmc.protocol.PlayerNetworkManager import io.github.dockyardmc.protocol.packets.ServerboundPacket diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationCustomClickActionPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationCustomClickActionPacket.kt similarity index 82% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationCustomClickActionPacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationCustomClickActionPacket.kt index fa6717c20..78759e25c 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationCustomClickActionPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationCustomClickActionPacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.serverbound import io.github.dockyardmc.protocol.packets.play.serverbound.ServerboundCustomClickActionPacket import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationPluginMessagePacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationPluginMessagePacket.kt similarity index 93% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationPluginMessagePacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationPluginMessagePacket.kt index 4ccdbfe3a..53a2416b0 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundConfigurationPluginMessagePacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundConfigurationPluginMessagePacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.serverbound import io.github.dockyardmc.protocol.PlayerNetworkManager import io.github.dockyardmc.protocol.packets.ServerboundPacket diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundFinishConfigurationAcknowledgePacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundFinishConfigurationAcknowledgePacket.kt similarity index 90% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundFinishConfigurationAcknowledgePacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundFinishConfigurationAcknowledgePacket.kt index 6df17fa11..c3a5458d6 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundFinishConfigurationAcknowledgePacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundFinishConfigurationAcknowledgePacket.kt @@ -1,4 +1,4 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.serverbound import io.github.dockyardmc.protocol.PlayerNetworkManager import io.github.dockyardmc.protocol.packets.ServerboundPacket diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundResourcepackResponsePacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundResourcepackResponsePacket.kt similarity index 85% rename from src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundResourcepackResponsePacket.kt rename to src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundResourcepackResponsePacket.kt index f14775b45..f9ef5bac3 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/ServerboundResourcepackResponsePacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/configurations/serverbound/ServerboundResourcepackResponsePacket.kt @@ -1,8 +1,5 @@ -package io.github.dockyardmc.protocol.packets.configurations +package io.github.dockyardmc.protocol.packets.configurations.serverbound -import cz.lukynka.prettylog.LogType -import cz.lukynka.prettylog.log -import io.github.dockyardmc.extentions.broadcastMessage import io.github.dockyardmc.extentions.readEnum import io.github.dockyardmc.extentions.readUUID import io.github.dockyardmc.protocol.PlayerNetworkManager diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSetEntityMetadataPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSetEntityMetadataPacket.kt index 1acf12cc4..95f955506 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSetEntityMetadataPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSetEntityMetadataPacket.kt @@ -1,19 +1,24 @@ package io.github.dockyardmc.protocol.packets.play.clientbound import io.github.dockyardmc.entity.Entity -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.writeMetadata +import io.github.dockyardmc.entity.metadata.Metadata import io.github.dockyardmc.extentions.writeVarInt import io.github.dockyardmc.protocol.packets.ClientboundPacket -class ClientboundSetEntityMetadataPacket(entity: Entity, metadata: Collection) : ClientboundPacket() { +class ClientboundSetEntityMetadataPacket(entity: Entity, metadata: Collection>) : ClientboundPacket() { init { buffer.writeVarInt(entity.id) - metadata.forEach { - buffer.writeMetadata(it) - } + metadata.forEach { entry -> writeMetadataValue(entry) } // array end byte buffer.writeByte(0xFF) } + + @Suppress("UNCHECKED_CAST") + private fun writeMetadataValue(value: Metadata.MetadataDefinition.Value<*>) { + val typedValue = value as Metadata.MetadataDefinition.Value + buffer.writeByte(value.parent.index) + buffer.writeVarInt(typedValue.parent.type.index) + typedValue.parent.type.streamCodec.write(buffer, typedValue.value) + } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSpawnEntityPacket.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSpawnEntityPacket.kt index f2ae4fba1..cf6da2b4f 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSpawnEntityPacket.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/play/clientbound/ClientboundSpawnEntityPacket.kt @@ -1,5 +1,6 @@ package io.github.dockyardmc.protocol.packets.play.clientbound +import io.github.dockyardmc.extentions.writeByte import io.github.dockyardmc.extentions.writeUUID import io.github.dockyardmc.extentions.writeVarInt import io.github.dockyardmc.location.Location @@ -7,27 +8,32 @@ import io.github.dockyardmc.location.writeLocation import io.github.dockyardmc.location.writeRotation import io.github.dockyardmc.maths.vectors.Vector3d import io.github.dockyardmc.protocol.packets.ClientboundPacket +import io.github.dockyardmc.protocol.types.LpVector3d +import io.github.dockyardmc.registry.registries.EntityType import io.github.dockyardmc.utils.writeVelocity import java.util.* -class ClientboundSpawnEntityPacket( - entityId: Int, - entityUUID: UUID, - entityType: Int, - location: Location, - headYaw: Float, - entityData: Int, - velocity: Vector3d +data class ClientboundSpawnEntityPacket( + val entityId: Int, + val entityUUID: UUID, + val entityType: EntityType, + val location: Location, + val headYaw: Float, + val entityData: Int, + val velocity: Vector3d ) : ClientboundPacket() { init { buffer.writeVarInt(entityId) buffer.writeUUID(entityUUID) - buffer.writeVarInt(entityType) + buffer.writeVarInt(entityType.getProtocolId()) buffer.writeLocation(location) - buffer.writeRotation(location, true) - buffer.writeByte((headYaw * 256 / 360).toInt()) + + LpVector3d.STREAM_CODEC.write(buffer, LpVector3d(velocity)) + + buffer.writeByte((location.pitch * 256f / 360f).toInt()) + buffer.writeByte((location.yaw * 256f / 360f).toInt()) + buffer.writeByte((headYaw * 256f / 360).toInt()) buffer.writeVarInt(entityData) - buffer.writeVelocity(velocity) } } \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ClientPacketRegistry.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ClientPacketRegistry.kt index 3b2a24dbf..72ffe09bf 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ClientPacketRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ClientPacketRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.protocol.packets.registry -import io.github.dockyardmc.protocol.packets.configurations.* +import io.github.dockyardmc.protocol.packets.configurations.clientbound.* import io.github.dockyardmc.protocol.packets.handshake.ClientboundPingResponsePacket import io.github.dockyardmc.protocol.packets.handshake.ClientboundStatusResponsePacket import io.github.dockyardmc.protocol.packets.login.* @@ -38,6 +38,7 @@ object ClientPacketRegistry : PacketRegistry() { addConfiguration(ClientboundConfigurationServerLinksPacket::class) addConfiguration(ClientboundConfigurationClearDialogPacket::class) skipConfiguration("show dialog") + addConfiguration(ClientboundCodeOfConductPacket::class) skipPlay("Bundle") addPlay(ClientboundSpawnEntityPacket::class) @@ -65,7 +66,11 @@ object ClientPacketRegistry : PacketRegistry() { skipPlay("Chat suggestion") addPlay(ClientboundPlayPluginMessagePacket::class) addPlay(ClientboundDamageEventPacket::class) - skipPlay("Debug sample") + skipPlay("debug block value") + skipPlay("debug chunk value") + skipPlay("debug entity value") + skipPlay("debug event") + skipPlay("debug sample") skipPlay("Delete chat") addPlay(ClientboundDisconnectPacket::class) skipPlay("Disguised chat packet") @@ -74,6 +79,7 @@ object ClientPacketRegistry : PacketRegistry() { skipPlay("Explosion") addPlay(ClientboundUnloadChunkPacket::class) addPlay(ClientboundGameEventPacket::class) + skipPlay("game test highlight pos") skipPlay("open horse inventory") skipPlay("hit animation") addPlay(ClientboundInitializeWorldBorderPacket::class) diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ServerPacketRegistry.kt b/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ServerPacketRegistry.kt index 96dec3fce..74f4850f3 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ServerPacketRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/packets/registry/ServerPacketRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.protocol.packets.registry -import io.github.dockyardmc.protocol.packets.configurations.* +import io.github.dockyardmc.protocol.packets.configurations.serverbound.* import io.github.dockyardmc.protocol.packets.handshake.ServerboundHandshakePacket import io.github.dockyardmc.protocol.packets.handshake.ServerboundPingRequestPacket import io.github.dockyardmc.protocol.packets.handshake.ServerboundStatusRequestPacket @@ -57,7 +57,7 @@ object ServerPacketRegistry : PacketRegistry() { skipPlay("container slot state") skipPlay("cookie response") addPlay(ServerboundPlayPluginMessagePacket::class) - skipPlay("debug sample subscription") + skipPlay("debug subscription request") skipPlay("edit book") skipPlay("query entity nbt") addPlay(ServerboundEntityInteractPacket::class) @@ -101,5 +101,6 @@ object ServerPacketRegistry : PacketRegistry() { addPlay(ServerboundUseItemOnBlockPacket::class) addPlay(ServerboundUseItemPacket::class) addPlay(ServerboundCustomClickActionPacket::class) + addPlay(ServerboundAcceptCodeOfConductPacket::class) } } diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/types/Either.kt b/src/main/kotlin/io/github/dockyardmc/protocol/types/Either.kt deleted file mode 100644 index dfc24360d..000000000 --- a/src/main/kotlin/io/github/dockyardmc/protocol/types/Either.kt +++ /dev/null @@ -1,43 +0,0 @@ -package io.github.dockyardmc.protocol.types - -import io.netty.buffer.ByteBuf - - -interface Either { - - data class Left(val value: L) : Either - - data class Right(val value: R) : Either - - companion object { - fun left(value: L): Either { - return Left(value) - } - - fun right(value: R): Either { - return Right(value) - } - } -} - -inline fun ByteBuf.readEither(leftReader: (ByteBuf) -> L, rightReader: (ByteBuf) -> R): Either { - return if (this.readBoolean()) { - Either.left(leftReader.invoke(this)) - } else { - Either.right(rightReader.invoke(this)) - } -} - -inline fun ByteBuf.writeEither(either: Either, leftWriter: (ByteBuf, L) -> Unit, rightWriter: (ByteBuf, R) -> Unit) { - when (either) { - is Either.Left -> { - this.writeBoolean(true) - leftWriter.invoke(this, either.value) - } - - is Either.Right -> { - this.writeBoolean(false) - rightWriter.invoke(this, either.value) - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/types/GameProfile.kt b/src/main/kotlin/io/github/dockyardmc/protocol/types/GameProfile.kt index 211c5a25b..c2a7d42da 100644 --- a/src/main/kotlin/io/github/dockyardmc/protocol/types/GameProfile.kt +++ b/src/main/kotlin/io/github/dockyardmc/protocol/types/GameProfile.kt @@ -1,13 +1,11 @@ package io.github.dockyardmc.protocol.types -import io.github.dockyardmc.extentions.readString -import io.github.dockyardmc.extentions.readUUID -import io.github.dockyardmc.extentions.writeString -import io.github.dockyardmc.extentions.writeUUID +import io.github.dockyardmc.codec.mutableList import io.github.dockyardmc.protocol.NetworkReadable import io.github.dockyardmc.protocol.NetworkWritable -import io.github.dockyardmc.protocol.readOptional -import io.github.dockyardmc.protocol.writeOptional +import io.github.dockyardmc.tide.codec.Codec +import io.github.dockyardmc.tide.codec.StructCodec +import io.github.dockyardmc.tide.stream.StreamCodec import io.netty.buffer.ByteBuf import kotlinx.serialization.Serializable import java.util.* @@ -15,14 +13,26 @@ import java.util.* data class GameProfile(val uuid: UUID, val username: String, val properties: MutableList = mutableListOf()) : NetworkWritable { override fun write(buffer: ByteBuf) { - buffer.writeUUID(uuid) - buffer.writeString(username) - buffer.writeList(properties, Property::write) + STREAM_CODEC.write(buffer, this) } companion object : NetworkReadable { + val STREAM_CODEC = StreamCodec.of( + StreamCodec.UUID, GameProfile::uuid, + StreamCodec.STRING, GameProfile::username, + Property.STREAM_CODEC.mutableList(), GameProfile::properties, + ::GameProfile + ) + + val CODEC = StructCodec.of( + "uuid", Codec.UUID, GameProfile::uuid, + "username", Codec.STRING, GameProfile::username, + "properties", Property.CODEC.mutableList(), GameProfile::properties, + ::GameProfile + ) + override fun read(buffer: ByteBuf): GameProfile { - return GameProfile(buffer.readUUID(), buffer.readString(), buffer.readList(Property::read).toMutableList()) + return STREAM_CODEC.read(buffer) } } @@ -35,15 +45,27 @@ data class GameProfile(val uuid: UUID, val username: String, val properties: Mut data class Property(val name: String, val value: String, val signature: String? = null) : NetworkWritable { companion object : NetworkReadable { + val STREAM_CODEC = StreamCodec.of( + StreamCodec.STRING, Property::name, + StreamCodec.STRING, Property::value, + StreamCodec.STRING.optional(), Property::signature, + ::Property + ) + + val CODEC = StructCodec.of( + "name", Codec.STRING, Property::name, + "value", Codec.STRING, Property::value, + "signature", Codec.STRING.optional(), Property::signature, + ::Property + ) + override fun read(buffer: ByteBuf): Property { - return Property(buffer.readString(), buffer.readString(), buffer.readOptional(ByteBuf::readString)) + return STREAM_CODEC.read(buffer) } } override fun write(buffer: ByteBuf) { - buffer.writeString(name) - buffer.writeString(value) - buffer.writeOptional(signature, ByteBuf::writeString) + STREAM_CODEC.write(buffer, this) } } diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/types/LpVector3d.kt b/src/main/kotlin/io/github/dockyardmc/protocol/types/LpVector3d.kt new file mode 100644 index 000000000..d73d9ec13 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/protocol/types/LpVector3d.kt @@ -0,0 +1,74 @@ +package io.github.dockyardmc.protocol.types + +import io.github.dockyardmc.extentions.writeByte +import io.github.dockyardmc.extentions.writeVarInt +import io.github.dockyardmc.maths.absMax +import io.github.dockyardmc.maths.ceilLong +import io.github.dockyardmc.maths.vectors.Vector3 +import io.github.dockyardmc.maths.vectors.Vector3d +import io.github.dockyardmc.maths.vectors.Vector3f +import io.github.dockyardmc.tide.stream.StreamCodec +import io.netty.buffer.ByteBuf + +data class LpVector3d(val x: Double, val y: Double, val z: Double) { + + constructor(vector3d: Vector3d) : this(vector3d.x, vector3d.y, vector3d.y) + constructor(vector3d: Vector3f) : this(vector3d.x.toDouble(), vector3d.y.toDouble(), vector3d.y.toDouble()) + constructor(vector3d: Vector3) : this(vector3d.x.toDouble(), vector3d.y.toDouble(), vector3d.y.toDouble()) + + companion object { + private const val DATA_BITS_MASK = 0b111111111111111 + private const val MAX_QUANTIZED_VALUE = 32766.0 + private const val SCALE_BITS_MASK: Long = 0b11 + private const val CONTINUATION_FLAG: Long = 4 + private const val X_OFFSET = 3 + private const val Y_OFFSET = 18 + private const val Z_OFFSET = 33 + private const val ABS_MAX_VALUE = 1.7179869183E10 + private const val ABS_MIN_VALUE = 3.051944088384301E-5 + + private fun sanitize(value: Double): Double { + return if (value.isNaN()) 0.0 else Math.clamp(value, -ABS_MAX_VALUE, ABS_MAX_VALUE) + } + + private fun pack(value: Double): Long { + return Math.round((value * 0.5 + 0.5) * MAX_QUANTIZED_VALUE) + } + + private fun unpack(value: Long): Double { + return (value and DATA_BITS_MASK.toLong()).toDouble().coerceAtMost(MAX_QUANTIZED_VALUE) * 2.0 / MAX_QUANTIZED_VALUE - 1.0 + } + + val STREAM_CODEC = object : StreamCodec { + + override fun write(buffer: ByteBuf, value: LpVector3d) { + val x = sanitize(value.x) + val y = sanitize(value.y) + val z = sanitize(value.z) + val max = absMax(x, absMax(y, z)) + if (max < ABS_MIN_VALUE) { + buffer.writeByte(0) + } else { + val i = ceilLong(max) + val hasContinuationBit = (i and SCALE_BITS_MASK) != i + val flags = if (hasContinuationBit) i and SCALE_BITS_MASK or CONTINUATION_FLAG else i + val px = pack(x / i) shl X_OFFSET + val py = pack(y / i) shl Y_OFFSET + val pz = pack(z / i) shl Z_OFFSET + val packed = flags or px or py or pz + buffer.writeByte(packed.toByte()) + buffer.writeByte((packed shr 8).toByte()) + buffer.writeByte((packed shr 16).toByte()) + if (hasContinuationBit) { + buffer.writeVarInt((i shr 2).toInt()) + } + } + } + + override fun read(buffer: ByteBuf): LpVector3d { + TODO("Not yet implemented") + } + + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/types/PlayerSkin.kt b/src/main/kotlin/io/github/dockyardmc/protocol/types/PlayerSkin.kt new file mode 100644 index 000000000..1a4a51f7f --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/protocol/types/PlayerSkin.kt @@ -0,0 +1,49 @@ +package io.github.dockyardmc.protocol.types + +import io.github.dockyardmc.tide.codec.Codec +import io.github.dockyardmc.tide.codec.StructCodec +import io.github.dockyardmc.tide.stream.StreamCodec +import io.github.dockyardmc.utils.MojangUtil +import java.util.* + +data class PlayerSkin(val textures: String, val signature: String) { + + companion object { + fun fetchFromUuid(uuid: UUID): PlayerSkin? { + var returnValue: PlayerSkin? = null + MojangUtil.getSkinFromUUID(uuid).thenAccept { data -> + if (data == null) return@thenAccept + if (data.signature == null) return@thenAccept + returnValue = PlayerSkin(data.value, data.signature) + } + return returnValue + } + } + + data class Patch( + val body: String?, + val cape: String?, + val elytra: String?, + val slim: Boolean? + ) { + companion object { + val EMPTY = Patch(null, null, null, null) + + val STREAM_CODEC = StreamCodec.of( + StreamCodec.STRING.optional(), Patch::body, + StreamCodec.STRING.optional(), Patch::cape, + StreamCodec.STRING.optional(), Patch::elytra, + StreamCodec.BOOLEAN.optional(), Patch::slim, + ::Patch + ) + + val CODEC = StructCodec.of( + "body", Codec.STRING.optional(), Patch::body, + "cape", Codec.STRING.optional(), Patch::cape, + "elytra", Codec.STRING.optional(), Patch::elytra, + "slim", Codec.BOOLEAN.optional(), Patch::slim, + ::Patch + ) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/protocol/types/ResolvableProfile.kt b/src/main/kotlin/io/github/dockyardmc/protocol/types/ResolvableProfile.kt new file mode 100644 index 000000000..9756c39a4 --- /dev/null +++ b/src/main/kotlin/io/github/dockyardmc/protocol/types/ResolvableProfile.kt @@ -0,0 +1,53 @@ +package io.github.dockyardmc.protocol.types + +import io.github.dockyardmc.tide.codec.Codec +import io.github.dockyardmc.tide.codec.StructCodec +import io.github.dockyardmc.tide.stream.StreamCodec +import io.github.dockyardmc.tide.types.Either +import java.util.* + +data class ResolvableProfile(val profile: Either, val patch: PlayerSkin.Patch) { + + constructor(profile: GameProfile) : this(Either.left(profile), PlayerSkin.Patch.EMPTY) + + constructor(profile: GameProfile, patch: PlayerSkin.Patch) : this(Either.left(profile), patch) + + constructor(partial: Partial) : this(Either.right(partial), PlayerSkin.Patch.EMPTY) + + constructor(partial: Partial, patch: PlayerSkin.Patch) : this(Either.right(partial), patch) + + companion object { + val EMPTY = ResolvableProfile(Either.right(Partial.EMPTY), PlayerSkin.Patch.EMPTY) + + val STREAM_CODEC = StreamCodec.of( + StreamCodec.either(GameProfile.STREAM_CODEC, Partial.STREAM_CODEC), ResolvableProfile::profile, + PlayerSkin.Patch.STREAM_CODEC, ResolvableProfile::patch, + ::ResolvableProfile + ) + + val CODEC = StructCodec.of( + StructCodec.INLINE, Codec.either(GameProfile.CODEC, Partial.CODEC), ResolvableProfile::profile, + StructCodec.INLINE, PlayerSkin.Patch.CODEC, ResolvableProfile::patch, + ::ResolvableProfile + ) + } + + data class Partial(val name: String?, val uuid: UUID?, val properties: List) { + companion object { + val EMPTY = Partial(null, null, listOf()) + val STREAM_CODEC = StreamCodec.of( + StreamCodec.STRING.optional(), Partial::name, + StreamCodec.UUID.optional(), Partial::uuid, + GameProfile.Property.STREAM_CODEC.list(), Partial::properties, + ::Partial + ) + + val CODEC = StructCodec.of( + "name", Codec.STRING.optional(), Partial::name, + "uuid", Codec.UUID.optional(), Partial::uuid, + "properties", GameProfile.Property.CODEC.list(), Partial::properties, + ::Partial + ) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Blocks.kt b/src/main/kotlin/io/github/dockyardmc/registry/Blocks.kt index 439de899e..95bc1e176 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Blocks.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Blocks.kt @@ -182,6 +182,18 @@ object Blocks { val TNT = BlockRegistry["minecraft:tnt"] val BOOKSHELF = BlockRegistry["minecraft:bookshelf"] val CHISELED_BOOKSHELF = BlockRegistry["minecraft:chiseled_bookshelf"] + val ACACIA_SHELF = BlockRegistry["minecraft:acacia_shelf"] + val BAMBOO_SHELF = BlockRegistry["minecraft:bamboo_shelf"] + val BIRCH_SHELF = BlockRegistry["minecraft:birch_shelf"] + val CHERRY_SHELF = BlockRegistry["minecraft:cherry_shelf"] + val CRIMSON_SHELF = BlockRegistry["minecraft:crimson_shelf"] + val DARK_OAK_SHELF = BlockRegistry["minecraft:dark_oak_shelf"] + val JUNGLE_SHELF = BlockRegistry["minecraft:jungle_shelf"] + val MANGROVE_SHELF = BlockRegistry["minecraft:mangrove_shelf"] + val OAK_SHELF = BlockRegistry["minecraft:oak_shelf"] + val PALE_OAK_SHELF = BlockRegistry["minecraft:pale_oak_shelf"] + val SPRUCE_SHELF = BlockRegistry["minecraft:spruce_shelf"] + val WARPED_SHELF = BlockRegistry["minecraft:warped_shelf"] val MOSSY_COBBLESTONE = BlockRegistry["minecraft:mossy_cobblestone"] val OBSIDIAN = BlockRegistry["minecraft:obsidian"] val TORCH = BlockRegistry["minecraft:torch"] @@ -282,6 +294,8 @@ object Blocks { val POLISHED_BASALT = BlockRegistry["minecraft:polished_basalt"] val SOUL_TORCH = BlockRegistry["minecraft:soul_torch"] val SOUL_WALL_TORCH = BlockRegistry["minecraft:soul_wall_torch"] + val COPPER_TORCH = BlockRegistry["minecraft:copper_torch"] + val COPPER_WALL_TORCH = BlockRegistry["minecraft:copper_wall_torch"] val GLOWSTONE = BlockRegistry["minecraft:glowstone"] val NETHER_PORTAL = BlockRegistry["minecraft:nether_portal"] val CARVED_PUMPKIN = BlockRegistry["minecraft:carved_pumpkin"] @@ -330,7 +344,23 @@ object Blocks { val RED_MUSHROOM_BLOCK = BlockRegistry["minecraft:red_mushroom_block"] val MUSHROOM_STEM = BlockRegistry["minecraft:mushroom_stem"] val IRON_BARS = BlockRegistry["minecraft:iron_bars"] - val CHAIN = BlockRegistry["minecraft:chain"] + val COPPER_BARS = BlockRegistry["minecraft:copper_bars"] + val EXPOSED_COPPER_BARS = BlockRegistry["minecraft:exposed_copper_bars"] + val WEATHERED_COPPER_BARS = BlockRegistry["minecraft:weathered_copper_bars"] + val OXIDIZED_COPPER_BARS = BlockRegistry["minecraft:oxidized_copper_bars"] + val WAXED_COPPER_BARS = BlockRegistry["minecraft:waxed_copper_bars"] + val WAXED_EXPOSED_COPPER_BARS = BlockRegistry["minecraft:waxed_exposed_copper_bars"] + val WAXED_WEATHERED_COPPER_BARS = BlockRegistry["minecraft:waxed_weathered_copper_bars"] + val WAXED_OXIDIZED_COPPER_BARS = BlockRegistry["minecraft:waxed_oxidized_copper_bars"] + val IRON_CHAIN = BlockRegistry["minecraft:iron_chain"] + val COPPER_CHAIN = BlockRegistry["minecraft:copper_chain"] + val EXPOSED_COPPER_CHAIN = BlockRegistry["minecraft:exposed_copper_chain"] + val WEATHERED_COPPER_CHAIN = BlockRegistry["minecraft:weathered_copper_chain"] + val OXIDIZED_COPPER_CHAIN = BlockRegistry["minecraft:oxidized_copper_chain"] + val WAXED_COPPER_CHAIN = BlockRegistry["minecraft:waxed_copper_chain"] + val WAXED_EXPOSED_COPPER_CHAIN = BlockRegistry["minecraft:waxed_exposed_copper_chain"] + val WAXED_WEATHERED_COPPER_CHAIN = BlockRegistry["minecraft:waxed_weathered_copper_chain"] + val WAXED_OXIDIZED_COPPER_CHAIN = BlockRegistry["minecraft:waxed_oxidized_copper_chain"] val GLASS_PANE = BlockRegistry["minecraft:glass_pane"] val PUMPKIN = BlockRegistry["minecraft:pumpkin"] val MELON = BlockRegistry["minecraft:melon"] @@ -822,6 +852,14 @@ object Blocks { val BELL = BlockRegistry["minecraft:bell"] val LANTERN = BlockRegistry["minecraft:lantern"] val SOUL_LANTERN = BlockRegistry["minecraft:soul_lantern"] + val COPPER_LANTERN = BlockRegistry["minecraft:copper_lantern"] + val EXPOSED_COPPER_LANTERN = BlockRegistry["minecraft:exposed_copper_lantern"] + val WEATHERED_COPPER_LANTERN = BlockRegistry["minecraft:weathered_copper_lantern"] + val OXIDIZED_COPPER_LANTERN = BlockRegistry["minecraft:oxidized_copper_lantern"] + val WAXED_COPPER_LANTERN = BlockRegistry["minecraft:waxed_copper_lantern"] + val WAXED_EXPOSED_COPPER_LANTERN = BlockRegistry["minecraft:waxed_exposed_copper_lantern"] + val WAXED_WEATHERED_COPPER_LANTERN = BlockRegistry["minecraft:waxed_weathered_copper_lantern"] + val WAXED_OXIDIZED_COPPER_LANTERN = BlockRegistry["minecraft:waxed_oxidized_copper_lantern"] val CAMPFIRE = BlockRegistry["minecraft:campfire"] val SOUL_CAMPFIRE = BlockRegistry["minecraft:soul_campfire"] val SWEET_BERRY_BUSH = BlockRegistry["minecraft:sweet_berry_bush"] @@ -1044,7 +1082,30 @@ object Blocks { val WAXED_EXPOSED_COPPER_BULB = BlockRegistry["minecraft:waxed_exposed_copper_bulb"] val WAXED_WEATHERED_COPPER_BULB = BlockRegistry["minecraft:waxed_weathered_copper_bulb"] val WAXED_OXIDIZED_COPPER_BULB = BlockRegistry["minecraft:waxed_oxidized_copper_bulb"] + val COPPER_CHEST = BlockRegistry["minecraft:copper_chest"] + val EXPOSED_COPPER_CHEST = BlockRegistry["minecraft:exposed_copper_chest"] + val WEATHERED_COPPER_CHEST = BlockRegistry["minecraft:weathered_copper_chest"] + val OXIDIZED_COPPER_CHEST = BlockRegistry["minecraft:oxidized_copper_chest"] + val WAXED_COPPER_CHEST = BlockRegistry["minecraft:waxed_copper_chest"] + val WAXED_EXPOSED_COPPER_CHEST = BlockRegistry["minecraft:waxed_exposed_copper_chest"] + val WAXED_WEATHERED_COPPER_CHEST = BlockRegistry["minecraft:waxed_weathered_copper_chest"] + val WAXED_OXIDIZED_COPPER_CHEST = BlockRegistry["minecraft:waxed_oxidized_copper_chest"] + val COPPER_GOLEM_STATUE = BlockRegistry["minecraft:copper_golem_statue"] + val EXPOSED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:exposed_copper_golem_statue"] + val WEATHERED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:weathered_copper_golem_statue"] + val OXIDIZED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:oxidized_copper_golem_statue"] + val WAXED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:waxed_copper_golem_statue"] + val WAXED_EXPOSED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:waxed_exposed_copper_golem_statue"] + val WAXED_WEATHERED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:waxed_weathered_copper_golem_statue"] + val WAXED_OXIDIZED_COPPER_GOLEM_STATUE = BlockRegistry["minecraft:waxed_oxidized_copper_golem_statue"] val LIGHTNING_ROD = BlockRegistry["minecraft:lightning_rod"] + val EXPOSED_LIGHTNING_ROD = BlockRegistry["minecraft:exposed_lightning_rod"] + val WEATHERED_LIGHTNING_ROD = BlockRegistry["minecraft:weathered_lightning_rod"] + val OXIDIZED_LIGHTNING_ROD = BlockRegistry["minecraft:oxidized_lightning_rod"] + val WAXED_LIGHTNING_ROD = BlockRegistry["minecraft:waxed_lightning_rod"] + val WAXED_EXPOSED_LIGHTNING_ROD = BlockRegistry["minecraft:waxed_exposed_lightning_rod"] + val WAXED_WEATHERED_LIGHTNING_ROD = BlockRegistry["minecraft:waxed_weathered_lightning_rod"] + val WAXED_OXIDIZED_LIGHTNING_ROD = BlockRegistry["minecraft:waxed_oxidized_lightning_rod"] val POINTED_DRIPSTONE = BlockRegistry["minecraft:pointed_dripstone"] val DRIPSTONE_BLOCK = BlockRegistry["minecraft:dripstone_block"] val CAVE_VINES = BlockRegistry["minecraft:cave_vines"] diff --git a/src/main/kotlin/io/github/dockyardmc/registry/EntityTypes.kt b/src/main/kotlin/io/github/dockyardmc/registry/EntityTypes.kt index 67a1687f9..6902553c9 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/EntityTypes.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/EntityTypes.kt @@ -30,6 +30,7 @@ object EntityTypes { val CHEST_MINECART = EntityTypeRegistry["minecraft:chest_minecart"] val CHICKEN = EntityTypeRegistry["minecraft:chicken"] val COD = EntityTypeRegistry["minecraft:cod"] + val COPPER_GOLEM = EntityTypeRegistry["minecraft:copper_golem"] val COMMAND_BLOCK_MINECART = EntityTypeRegistry["minecraft:command_block_minecart"] val COW = EntityTypeRegistry["minecraft:cow"] val CREAKING = EntityTypeRegistry["minecraft:creaking"] @@ -84,6 +85,7 @@ object EntityTypes { val MAGMA_CUBE = EntityTypeRegistry["minecraft:magma_cube"] val MANGROVE_BOAT = EntityTypeRegistry["minecraft:mangrove_boat"] val MANGROVE_CHEST_BOAT = EntityTypeRegistry["minecraft:mangrove_chest_boat"] + val MANNEQUIN = EntityTypeRegistry["minecraft:mannequin"] val MARKER = EntityTypeRegistry["minecraft:marker"] val MINECART = EntityTypeRegistry["minecraft:minecart"] val MOOSHROOM = EntityTypeRegistry["minecraft:mooshroom"] diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Items.kt b/src/main/kotlin/io/github/dockyardmc/registry/Items.kt index 2f85e4dc5..c85fc2fa2 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Items.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Items.kt @@ -308,6 +308,18 @@ object Items { val SMOOTH_SANDSTONE = ItemRegistry["minecraft:smooth_sandstone"] val SMOOTH_STONE = ItemRegistry["minecraft:smooth_stone"] val BRICKS = ItemRegistry["minecraft:bricks"] + val ACACIA_SHELF = ItemRegistry["minecraft:acacia_shelf"] + val BAMBOO_SHELF = ItemRegistry["minecraft:bamboo_shelf"] + val BIRCH_SHELF = ItemRegistry["minecraft:birch_shelf"] + val CHERRY_SHELF = ItemRegistry["minecraft:cherry_shelf"] + val CRIMSON_SHELF = ItemRegistry["minecraft:crimson_shelf"] + val DARK_OAK_SHELF = ItemRegistry["minecraft:dark_oak_shelf"] + val JUNGLE_SHELF = ItemRegistry["minecraft:jungle_shelf"] + val MANGROVE_SHELF = ItemRegistry["minecraft:mangrove_shelf"] + val OAK_SHELF = ItemRegistry["minecraft:oak_shelf"] + val PALE_OAK_SHELF = ItemRegistry["minecraft:pale_oak_shelf"] + val SPRUCE_SHELF = ItemRegistry["minecraft:spruce_shelf"] + val WARPED_SHELF = ItemRegistry["minecraft:warped_shelf"] val BOOKSHELF = ItemRegistry["minecraft:bookshelf"] val CHISELED_BOOKSHELF = ItemRegistry["minecraft:chiseled_bookshelf"] val DECORATED_POT = ItemRegistry["minecraft:decorated_pot"] @@ -357,6 +369,7 @@ object Items { val POLISHED_BASALT = ItemRegistry["minecraft:polished_basalt"] val SMOOTH_BASALT = ItemRegistry["minecraft:smooth_basalt"] val SOUL_TORCH = ItemRegistry["minecraft:soul_torch"] + val COPPER_TORCH = ItemRegistry["minecraft:copper_torch"] val GLOWSTONE = ItemRegistry["minecraft:glowstone"] val INFESTED_STONE = ItemRegistry["minecraft:infested_stone"] val INFESTED_COBBLESTONE = ItemRegistry["minecraft:infested_cobblestone"] @@ -381,7 +394,23 @@ object Items { val RED_MUSHROOM_BLOCK = ItemRegistry["minecraft:red_mushroom_block"] val MUSHROOM_STEM = ItemRegistry["minecraft:mushroom_stem"] val IRON_BARS = ItemRegistry["minecraft:iron_bars"] - val CHAIN = ItemRegistry["minecraft:chain"] + val COPPER_BARS = ItemRegistry["minecraft:copper_bars"] + val EXPOSED_COPPER_BARS = ItemRegistry["minecraft:exposed_copper_bars"] + val WEATHERED_COPPER_BARS = ItemRegistry["minecraft:weathered_copper_bars"] + val OXIDIZED_COPPER_BARS = ItemRegistry["minecraft:oxidized_copper_bars"] + val WAXED_COPPER_BARS = ItemRegistry["minecraft:waxed_copper_bars"] + val WAXED_EXPOSED_COPPER_BARS = ItemRegistry["minecraft:waxed_exposed_copper_bars"] + val WAXED_WEATHERED_COPPER_BARS = ItemRegistry["minecraft:waxed_weathered_copper_bars"] + val WAXED_OXIDIZED_COPPER_BARS = ItemRegistry["minecraft:waxed_oxidized_copper_bars"] + val IRON_CHAIN = ItemRegistry["minecraft:iron_chain"] + val COPPER_CHAIN = ItemRegistry["minecraft:copper_chain"] + val EXPOSED_COPPER_CHAIN = ItemRegistry["minecraft:exposed_copper_chain"] + val WEATHERED_COPPER_CHAIN = ItemRegistry["minecraft:weathered_copper_chain"] + val OXIDIZED_COPPER_CHAIN = ItemRegistry["minecraft:oxidized_copper_chain"] + val WAXED_COPPER_CHAIN = ItemRegistry["minecraft:waxed_copper_chain"] + val WAXED_EXPOSED_COPPER_CHAIN = ItemRegistry["minecraft:waxed_exposed_copper_chain"] + val WAXED_WEATHERED_COPPER_CHAIN = ItemRegistry["minecraft:waxed_weathered_copper_chain"] + val WAXED_OXIDIZED_COPPER_CHAIN = ItemRegistry["minecraft:waxed_oxidized_copper_chain"] val GLASS_PANE = ItemRegistry["minecraft:glass_pane"] val MELON = ItemRegistry["minecraft:melon"] val VINE = ItemRegistry["minecraft:vine"] @@ -708,6 +737,13 @@ object Items { val TARGET = ItemRegistry["minecraft:target"] val LEVER = ItemRegistry["minecraft:lever"] val LIGHTNING_ROD = ItemRegistry["minecraft:lightning_rod"] + val EXPOSED_LIGHTNING_ROD = ItemRegistry["minecraft:exposed_lightning_rod"] + val WEATHERED_LIGHTNING_ROD = ItemRegistry["minecraft:weathered_lightning_rod"] + val OXIDIZED_LIGHTNING_ROD = ItemRegistry["minecraft:oxidized_lightning_rod"] + val WAXED_LIGHTNING_ROD = ItemRegistry["minecraft:waxed_lightning_rod"] + val WAXED_EXPOSED_LIGHTNING_ROD = ItemRegistry["minecraft:waxed_exposed_lightning_rod"] + val WAXED_WEATHERED_LIGHTNING_ROD = ItemRegistry["minecraft:waxed_weathered_lightning_rod"] + val WAXED_OXIDIZED_LIGHTNING_ROD = ItemRegistry["minecraft:waxed_oxidized_lightning_rod"] val DAYLIGHT_DETECTOR = ItemRegistry["minecraft:daylight_detector"] val SCULK_SENSOR = ItemRegistry["minecraft:sculk_sensor"] val CALIBRATED_SCULK_SENSOR = ItemRegistry["minecraft:calibrated_sculk_sensor"] @@ -883,6 +919,11 @@ object Items { val WOODEN_PICKAXE = ItemRegistry["minecraft:wooden_pickaxe"] val WOODEN_AXE = ItemRegistry["minecraft:wooden_axe"] val WOODEN_HOE = ItemRegistry["minecraft:wooden_hoe"] + val COPPER_SWORD = ItemRegistry["minecraft:copper_sword"] + val COPPER_SHOVEL = ItemRegistry["minecraft:copper_shovel"] + val COPPER_PICKAXE = ItemRegistry["minecraft:copper_pickaxe"] + val COPPER_AXE = ItemRegistry["minecraft:copper_axe"] + val COPPER_HOE = ItemRegistry["minecraft:copper_hoe"] val STONE_SWORD = ItemRegistry["minecraft:stone_sword"] val STONE_SHOVEL = ItemRegistry["minecraft:stone_shovel"] val STONE_PICKAXE = ItemRegistry["minecraft:stone_pickaxe"] @@ -920,6 +961,10 @@ object Items { val LEATHER_CHESTPLATE = ItemRegistry["minecraft:leather_chestplate"] val LEATHER_LEGGINGS = ItemRegistry["minecraft:leather_leggings"] val LEATHER_BOOTS = ItemRegistry["minecraft:leather_boots"] + val COPPER_HELMET = ItemRegistry["minecraft:copper_helmet"] + val COPPER_CHESTPLATE = ItemRegistry["minecraft:copper_chestplate"] + val COPPER_LEGGINGS = ItemRegistry["minecraft:copper_leggings"] + val COPPER_BOOTS = ItemRegistry["minecraft:copper_boots"] val CHAINMAIL_HELMET = ItemRegistry["minecraft:chainmail_helmet"] val CHAINMAIL_CHESTPLATE = ItemRegistry["minecraft:chainmail_chestplate"] val CHAINMAIL_LEGGINGS = ItemRegistry["minecraft:chainmail_leggings"] @@ -1101,6 +1146,7 @@ object Items { val CAVE_SPIDER_SPAWN_EGG = ItemRegistry["minecraft:cave_spider_spawn_egg"] val CHICKEN_SPAWN_EGG = ItemRegistry["minecraft:chicken_spawn_egg"] val COD_SPAWN_EGG = ItemRegistry["minecraft:cod_spawn_egg"] + val COPPER_GOLEM_SPAWN_EGG = ItemRegistry["minecraft:copper_golem_spawn_egg"] val COW_SPAWN_EGG = ItemRegistry["minecraft:cow_spawn_egg"] val CREEPER_SPAWN_EGG = ItemRegistry["minecraft:creeper_spawn_egg"] val DOLPHIN_SPAWN_EGG = ItemRegistry["minecraft:dolphin_spawn_egg"] @@ -1208,6 +1254,7 @@ object Items { val RABBIT_FOOT = ItemRegistry["minecraft:rabbit_foot"] val RABBIT_HIDE = ItemRegistry["minecraft:rabbit_hide"] val ARMOR_STAND = ItemRegistry["minecraft:armor_stand"] + val COPPER_HORSE_ARMOR = ItemRegistry["minecraft:copper_horse_armor"] val IRON_HORSE_ARMOR = ItemRegistry["minecraft:iron_horse_armor"] val GOLDEN_HORSE_ARMOR = ItemRegistry["minecraft:golden_horse_armor"] val DIAMOND_HORSE_ARMOR = ItemRegistry["minecraft:diamond_horse_armor"] @@ -1250,6 +1297,7 @@ object Items { val TOTEM_OF_UNDYING = ItemRegistry["minecraft:totem_of_undying"] val SHULKER_SHELL = ItemRegistry["minecraft:shulker_shell"] val IRON_NUGGET = ItemRegistry["minecraft:iron_nugget"] + val COPPER_NUGGET = ItemRegistry["minecraft:copper_nugget"] val KNOWLEDGE_BOOK = ItemRegistry["minecraft:knowledge_book"] val DEBUG_STICK = ItemRegistry["minecraft:debug_stick"] val MUSIC_DISC_13 = ItemRegistry["minecraft:music_disc_13"] @@ -1303,6 +1351,14 @@ object Items { val BELL = ItemRegistry["minecraft:bell"] val LANTERN = ItemRegistry["minecraft:lantern"] val SOUL_LANTERN = ItemRegistry["minecraft:soul_lantern"] + val COPPER_LANTERN = ItemRegistry["minecraft:copper_lantern"] + val EXPOSED_COPPER_LANTERN = ItemRegistry["minecraft:exposed_copper_lantern"] + val WEATHERED_COPPER_LANTERN = ItemRegistry["minecraft:weathered_copper_lantern"] + val OXIDIZED_COPPER_LANTERN = ItemRegistry["minecraft:oxidized_copper_lantern"] + val WAXED_COPPER_LANTERN = ItemRegistry["minecraft:waxed_copper_lantern"] + val WAXED_EXPOSED_COPPER_LANTERN = ItemRegistry["minecraft:waxed_exposed_copper_lantern"] + val WAXED_WEATHERED_COPPER_LANTERN = ItemRegistry["minecraft:waxed_weathered_copper_lantern"] + val WAXED_OXIDIZED_COPPER_LANTERN = ItemRegistry["minecraft:waxed_oxidized_copper_lantern"] val SWEET_BERRIES = ItemRegistry["minecraft:sweet_berries"] val GLOW_BERRIES = ItemRegistry["minecraft:glow_berries"] val CAMPFIRE = ItemRegistry["minecraft:campfire"] @@ -1414,6 +1470,22 @@ object Items { val WAXED_EXPOSED_COPPER_BULB = ItemRegistry["minecraft:waxed_exposed_copper_bulb"] val WAXED_WEATHERED_COPPER_BULB = ItemRegistry["minecraft:waxed_weathered_copper_bulb"] val WAXED_OXIDIZED_COPPER_BULB = ItemRegistry["minecraft:waxed_oxidized_copper_bulb"] + val COPPER_CHEST = ItemRegistry["minecraft:copper_chest"] + val EXPOSED_COPPER_CHEST = ItemRegistry["minecraft:exposed_copper_chest"] + val WEATHERED_COPPER_CHEST = ItemRegistry["minecraft:weathered_copper_chest"] + val OXIDIZED_COPPER_CHEST = ItemRegistry["minecraft:oxidized_copper_chest"] + val WAXED_COPPER_CHEST = ItemRegistry["minecraft:waxed_copper_chest"] + val WAXED_EXPOSED_COPPER_CHEST = ItemRegistry["minecraft:waxed_exposed_copper_chest"] + val WAXED_WEATHERED_COPPER_CHEST = ItemRegistry["minecraft:waxed_weathered_copper_chest"] + val WAXED_OXIDIZED_COPPER_CHEST = ItemRegistry["minecraft:waxed_oxidized_copper_chest"] + val COPPER_GOLEM_STATUE = ItemRegistry["minecraft:copper_golem_statue"] + val EXPOSED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:exposed_copper_golem_statue"] + val WEATHERED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:weathered_copper_golem_statue"] + val OXIDIZED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:oxidized_copper_golem_statue"] + val WAXED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:waxed_copper_golem_statue"] + val WAXED_EXPOSED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:waxed_exposed_copper_golem_statue"] + val WAXED_WEATHERED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:waxed_weathered_copper_golem_statue"] + val WAXED_OXIDIZED_COPPER_GOLEM_STATUE = ItemRegistry["minecraft:waxed_oxidized_copper_golem_statue"] val TRIAL_SPAWNER = ItemRegistry["minecraft:trial_spawner"] val TRIAL_KEY = ItemRegistry["minecraft:trial_key"] val OMINOUS_TRIAL_KEY = ItemRegistry["minecraft:ominous_trial_key"] diff --git a/src/main/kotlin/io/github/dockyardmc/registry/MinecraftVersions.kt b/src/main/kotlin/io/github/dockyardmc/registry/MinecraftVersions.kt index 970dd4f29..bd3e8e96b 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/MinecraftVersions.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/MinecraftVersions.kt @@ -3,6 +3,7 @@ package io.github.dockyardmc.registry import io.github.dockyardmc.registry.registries.MinecraftVersionRegistry object MinecraftVersions { + val v1_21_9 = MinecraftVersionRegistry[773] val v1_21_8 = MinecraftVersionRegistry[772] val v1_21_7 = MinecraftVersionRegistry[772] val v1_21_6 = MinecraftVersionRegistry[771] diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Particles.kt b/src/main/kotlin/io/github/dockyardmc/registry/Particles.kt index 286870e4f..6a5c53ed0 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Particles.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Particles.kt @@ -8,6 +8,7 @@ object Particles { val BLOCK_MARKER = ParticleRegistry["minecraft:block_marker"] val BUBBLE = ParticleRegistry["minecraft:bubble"] val CLOUD = ParticleRegistry["minecraft:cloud"] + val COPPER_FIRE_FLAME = ParticleRegistry["minecraft:copper_fire_flame"] val CRIT = ParticleRegistry["minecraft:crit"] val DAMAGE_INDICATOR = ParticleRegistry["minecraft:damage_indicator"] val DRAGON_BREATH = ParticleRegistry["minecraft:dragon_breath"] diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Registry.kt b/src/main/kotlin/io/github/dockyardmc/registry/Registry.kt index 61a629ed8..fdfdb8bdd 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Registry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Registry.kt @@ -1,14 +1,12 @@ package io.github.dockyardmc.registry -import cz.lukynka.prettylog.log import io.github.dockyardmc.extentions.readVarInt import io.github.dockyardmc.extentions.writeNBT import io.github.dockyardmc.extentions.writeString import io.github.dockyardmc.extentions.writeVarInt import io.github.dockyardmc.protocol.NetworkWritable -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.protocol.writeOptional -import io.github.dockyardmc.registry.registries.BannerPatternRegistry import io.github.dockyardmc.utils.BiMap import io.github.dockyardmc.utils.MutableBiMap import io.netty.buffer.ByteBuf diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Sounds.kt b/src/main/kotlin/io/github/dockyardmc/registry/Sounds.kt index 76a0c1a49..2a3d3d577 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Sounds.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Sounds.kt @@ -75,6 +75,7 @@ object Sounds { const val ITEM_ARMOR_EQUIP_GOLD = "minecraft:item.armor.equip_gold" const val ITEM_ARMOR_EQUIP_IRON = "minecraft:item.armor.equip_iron" const val ITEM_ARMOR_EQUIP_LEATHER = "minecraft:item.armor.equip_leather" + const val ITEM_ARMOR_EQUIP_COPPER = "minecraft:item.armor.equip_copper" const val ITEM_ARMOR_EQUIP_NETHERITE = "minecraft:item.armor.equip_netherite" const val ITEM_ARMOR_EQUIP_TURTLE = "minecraft:item.armor.equip_turtle" const val ITEM_ARMOR_EQUIP_WOLF = "minecraft:item.armor.equip_wolf" @@ -356,8 +357,38 @@ object Sounds { const val BLOCK_COPPER_PLACE = "minecraft:block.copper.place" const val BLOCK_COPPER_HIT = "minecraft:block.copper.hit" const val BLOCK_COPPER_FALL = "minecraft:block.copper.fall" + const val BLOCK_COPPER_CHEST_CLOSE = "minecraft:block.copper_chest.close" + const val BLOCK_COPPER_CHEST_OPEN = "minecraft:block.copper_chest.open" + const val BLOCK_COPPER_CHEST_WEATHERED_CLOSE = "minecraft:block.copper_chest_weathered.close" + const val BLOCK_COPPER_CHEST_WEATHERED_OPEN = "minecraft:block.copper_chest_weathered.open" + const val BLOCK_COPPER_CHEST_OXIDIZED_CLOSE = "minecraft:block.copper_chest_oxidized.close" + const val BLOCK_COPPER_CHEST_OXIDIZED_OPEN = "minecraft:block.copper_chest_oxidized.open" const val BLOCK_COPPER_DOOR_CLOSE = "minecraft:block.copper_door.close" const val BLOCK_COPPER_DOOR_OPEN = "minecraft:block.copper_door.open" + const val ENTITY_COPPER_GOLEM_STEP = "minecraft:entity.copper_golem.step" + const val ENTITY_COPPER_GOLEM_HURT = "minecraft:entity.copper_golem.hurt" + const val ENTITY_COPPER_GOLEM_DEATH = "minecraft:entity.copper_golem.death" + const val ENTITY_COPPER_GOLEM_WEATHERED_STEP = "minecraft:entity.copper_golem_weathered.step" + const val ENTITY_COPPER_GOLEM_WEATHERED_HURT = "minecraft:entity.copper_golem_weathered.hurt" + const val ENTITY_COPPER_GOLEM_WEATHERED_DEATH = "minecraft:entity.copper_golem_weathered.death" + const val ENTITY_COPPER_GOLEM_OXIDIZED_STEP = "minecraft:entity.copper_golem_oxidized.step" + const val ENTITY_COPPER_GOLEM_OXIDIZED_HURT = "minecraft:entity.copper_golem_oxidized.hurt" + const val ENTITY_COPPER_GOLEM_OXIDIZED_DEATH = "minecraft:entity.copper_golem_oxidized.death" + const val ENTITY_COPPER_GOLEM_SPIN = "minecraft:entity.copper_golem.spin" + const val ENTITY_COPPER_GOLEM_WEATHERED_SPIN = "minecraft:entity.copper_golem_weathered.spin" + const val ENTITY_COPPER_GOLEM_OXIDIZED_SPIN = "minecraft:entity.copper_golem_oxidized.spin" + const val ENTITY_COPPER_GOLEM_NO_ITEM_GET = "minecraft:entity.copper_golem.no_item_get" + const val ENTITY_COPPER_GOLEM_NO_ITEM_NO_GET = "minecraft:entity.copper_golem.no_item_no_get" + const val ENTITY_COPPER_GOLEM_ITEM_DROP = "minecraft:entity.copper_golem.item_drop" + const val ENTITY_COPPER_GOLEM_ITEM_NO_DROP = "minecraft:entity.copper_golem.item_no_drop" + const val ENTITY_COPPER_GOLEM_BECOME_STATUE = "minecraft:entity.copper_golem_become_statue" + const val BLOCK_COPPER_GOLEM_STATUE_BREAK = "minecraft:block.copper_golem_statue.break" + const val BLOCK_COPPER_GOLEM_STATUE_PLACE = "minecraft:block.copper_golem_statue.place" + const val BLOCK_COPPER_GOLEM_STATUE_HIT = "minecraft:block.copper_golem_statue.hit" + const val BLOCK_COPPER_GOLEM_STATUE_STEP = "minecraft:block.copper_golem_statue.step" + const val BLOCK_COPPER_GOLEM_STATUE_FALL = "minecraft:block.copper_golem_statue.fall" + const val ENTITY_COPPER_GOLEM_SPAWN = "minecraft:entity.copper_golem.spawn" + const val ENTITY_COPPER_GOLEM_SHEAR = "minecraft:entity.copper_golem.shear" const val BLOCK_COPPER_GRATE_BREAK = "minecraft:block.copper_grate.break" const val BLOCK_COPPER_GRATE_STEP = "minecraft:block.copper_grate.step" const val BLOCK_COPPER_GRATE_PLACE = "minecraft:block.copper_grate.place" @@ -1299,6 +1330,17 @@ object Sounds { const val ENTITY_SHEEP_SHEAR = "minecraft:entity.sheep.shear" const val ENTITY_SHEEP_STEP = "minecraft:entity.sheep.step" const val ITEM_SHEARS_SNIP = "minecraft:item.shears.snip" + const val BLOCK_SHELF_ACTIVATE = "minecraft:block.shelf.activate" + const val BLOCK_SHELF_BREAK = "minecraft:block.shelf.break" + const val BLOCK_SHELF_DEACTIVATE = "minecraft:block.shelf.deactivate" + const val BLOCK_SHELF_FALL = "minecraft:block.shelf.fall" + const val BLOCK_SHELF_HIT = "minecraft:block.shelf.hit" + const val BLOCK_SHELF_MULTI_SWAP = "minecraft:block.shelf.multi_swap" + const val BLOCK_SHELF_PLACE = "minecraft:block.shelf.place" + const val BLOCK_SHELF_PLACE_ITEM = "minecraft:block.shelf.place_item" + const val BLOCK_SHELF_SINGLE_SWAP = "minecraft:block.shelf.single_swap" + const val BLOCK_SHELF_STEP = "minecraft:block.shelf.step" + const val BLOCK_SHELF_TAKE_ITEM = "minecraft:block.shelf.take_item" const val ITEM_SHIELD_BLOCK = "minecraft:item.shield.block" const val ITEM_SHIELD_BREAK = "minecraft:item.shield.break" const val BLOCK_SHROOMLIGHT_BREAK = "minecraft:block.shroomlight.break" @@ -1599,6 +1641,7 @@ object Sounds { const val BLOCK_HANGING_SIGN_WAXED_INTERACT_FAIL = "minecraft:block.hanging_sign.waxed_interact_fail" const val BLOCK_SIGN_WAXED_INTERACT_FAIL = "minecraft:block.sign.waxed_interact_fail" const val BLOCK_WATER_AMBIENT = "minecraft:block.water.ambient" + const val WEATHER_END_FLASH = "minecraft:weather.end_flash" const val WEATHER_RAIN = "minecraft:weather.rain" const val WEATHER_RAIN_ABOVE = "minecraft:weather.rain.above" const val BLOCK_WET_GRASS_BREAK = "minecraft:block.wet_grass.break" diff --git a/src/main/kotlin/io/github/dockyardmc/registry/Tags.kt b/src/main/kotlin/io/github/dockyardmc/registry/Tags.kt index daba71923..17aa1744b 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/Tags.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/Tags.kt @@ -3,490 +3,513 @@ package io.github.dockyardmc.registry import io.github.dockyardmc.registry.registries.tags.* object Tags { - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_SWAMP = BiomeTagRegistry["minecraft:has_structure/ruined_portal_swamp"] - val BIOME_HAS_STRUCTURE_VILLAGE_PLAINS = BiomeTagRegistry["minecraft:has_structure/village_plains"] - val BIOME_SPAWNS_WARM_VARIANT_FARM_ANIMALS = BiomeTagRegistry["minecraft:spawns_warm_variant_farm_animals"] - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_STANDARD = BiomeTagRegistry["minecraft:has_structure/ruined_portal_standard"] - val BIOME_IS_NETHER = BiomeTagRegistry["minecraft:is_nether"] - val BIOME_HAS_STRUCTURE_NETHER_FORTRESS = BiomeTagRegistry["minecraft:has_structure/nether_fortress"] - val BIOME_HAS_STRUCTURE_STRONGHOLD = BiomeTagRegistry["minecraft:has_structure/stronghold"] - val BIOME_IS_HILL = BiomeTagRegistry["minecraft:is_hill"] - val BIOME_REQUIRED_OCEAN_MONUMENT_SURROUNDING = BiomeTagRegistry["minecraft:required_ocean_monument_surrounding"] + val BIOME_SNOW_GOLEM_MELTS = BiomeTagRegistry["minecraft:snow_golem_melts"] + val BIOME_IS_DEEP_OCEAN = BiomeTagRegistry["minecraft:is_deep_ocean"] + val BIOME_HAS_STRUCTURE_VILLAGE_SNOWY = BiomeTagRegistry["minecraft:has_structure/village_snowy"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_DESERT = BiomeTagRegistry["minecraft:has_structure/ruined_portal_desert"] + val BIOME_HAS_STRUCTURE_VILLAGE_DESERT = BiomeTagRegistry["minecraft:has_structure/village_desert"] + val BIOME_ALLOWS_SURFACE_SLIME_SPAWNS = BiomeTagRegistry["minecraft:allows_surface_slime_spawns"] val BIOME_STRONGHOLD_BIASED_TO = BiomeTagRegistry["minecraft:stronghold_biased_to"] - val BIOME_IS_RIVER = BiomeTagRegistry["minecraft:is_river"] - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_NETHER = BiomeTagRegistry["minecraft:has_structure/ruined_portal_nether"] - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_OCEAN = BiomeTagRegistry["minecraft:has_structure/ruined_portal_ocean"] - val BIOME_SPAWNS_COLD_VARIANT_FROGS = BiomeTagRegistry["minecraft:spawns_cold_variant_frogs"] - val BIOME_HAS_STRUCTURE_VILLAGE_TAIGA = BiomeTagRegistry["minecraft:has_structure/village_taiga"] + val BIOME_HAS_STRUCTURE_BURIED_TREASURE = BiomeTagRegistry["minecraft:has_structure/buried_treasure"] + val BIOME_WITHOUT_ZOMBIE_SIEGES = BiomeTagRegistry["minecraft:without_zombie_sieges"] + val BIOME_IS_TAIGA = BiomeTagRegistry["minecraft:is_taiga"] + val BIOME_IS_OVERWORLD = BiomeTagRegistry["minecraft:is_overworld"] + val BIOME_PRODUCES_CORALS_FROM_BONEMEAL = BiomeTagRegistry["minecraft:produces_corals_from_bonemeal"] + val BIOME_ALLOWS_TROPICAL_FISH_SPAWNS_AT_ANY_HEIGHT = BiomeTagRegistry["minecraft:allows_tropical_fish_spawns_at_any_height"] val BIOME_MINESHAFT_BLOCKING = BiomeTagRegistry["minecraft:mineshaft_blocking"] - val BIOME_HAS_STRUCTURE_JUNGLE_TEMPLE = BiomeTagRegistry["minecraft:has_structure/jungle_temple"] + val BIOME_HAS_STRUCTURE_TRIAL_CHAMBERS = BiomeTagRegistry["minecraft:has_structure/trial_chambers"] + val BIOME_REQUIRED_OCEAN_MONUMENT_SURROUNDING = BiomeTagRegistry["minecraft:required_ocean_monument_surrounding"] + val BIOME_HAS_STRUCTURE_STRONGHOLD = BiomeTagRegistry["minecraft:has_structure/stronghold"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_NETHER = BiomeTagRegistry["minecraft:has_structure/ruined_portal_nether"] + val BIOME_HAS_STRUCTURE_ANCIENT_CITY = BiomeTagRegistry["minecraft:has_structure/ancient_city"] val BIOME_SPAWNS_SNOW_FOXES = BiomeTagRegistry["minecraft:spawns_snow_foxes"] - val BIOME_PRODUCES_CORALS_FROM_BONEMEAL = BiomeTagRegistry["minecraft:produces_corals_from_bonemeal"] + val BIOME_SPAWNS_COLD_VARIANT_FROGS = BiomeTagRegistry["minecraft:spawns_cold_variant_frogs"] + val BIOME_HAS_STRUCTURE_OCEAN_MONUMENT = BiomeTagRegistry["minecraft:has_structure/ocean_monument"] val BIOME_HAS_STRUCTURE_RUINED_PORTAL_JUNGLE = BiomeTagRegistry["minecraft:has_structure/ruined_portal_jungle"] - val BIOME_HAS_STRUCTURE_WOODLAND_MANSION = BiomeTagRegistry["minecraft:has_structure/woodland_mansion"] - val BIOME_HAS_STRUCTURE_VILLAGE_SNOWY = BiomeTagRegistry["minecraft:has_structure/village_snowy"] - val BIOME_SPAWNS_COLD_VARIANT_FARM_ANIMALS = BiomeTagRegistry["minecraft:spawns_cold_variant_farm_animals"] - val BIOME_ALLOWS_SURFACE_SLIME_SPAWNS = BiomeTagRegistry["minecraft:allows_surface_slime_spawns"] - val BIOME_POLAR_BEARS_SPAWN_ON_ALTERNATE_BLOCKS = BiomeTagRegistry["minecraft:polar_bears_spawn_on_alternate_blocks"] - val BIOME_HAS_STRUCTURE_IGLOO = BiomeTagRegistry["minecraft:has_structure/igloo"] + val BIOME_HAS_STRUCTURE_PILLAGER_OUTPOST = BiomeTagRegistry["minecraft:has_structure/pillager_outpost"] val BIOME_WITHOUT_WANDERING_TRADER_SPAWNS = BiomeTagRegistry["minecraft:without_wandering_trader_spawns"] - val BIOME_HAS_STRUCTURE_OCEAN_RUIN_COLD = BiomeTagRegistry["minecraft:has_structure/ocean_ruin_cold"] - val BIOME_IS_TAIGA = BiomeTagRegistry["minecraft:is_taiga"] - val BIOME_HAS_STRUCTURE_MINESHAFT = BiomeTagRegistry["minecraft:has_structure/mineshaft"] - val BIOME_IS_BEACH = BiomeTagRegistry["minecraft:is_beach"] - val BIOME_ALLOWS_TROPICAL_FISH_SPAWNS_AT_ANY_HEIGHT = BiomeTagRegistry["minecraft:allows_tropical_fish_spawns_at_any_height"] - val BIOME_IS_OCEAN = BiomeTagRegistry["minecraft:is_ocean"] - val BIOME_HAS_STRUCTURE_VILLAGE_SAVANNA = BiomeTagRegistry["minecraft:has_structure/village_savanna"] - val BIOME_SNOW_GOLEM_MELTS = BiomeTagRegistry["minecraft:snow_golem_melts"] - val BIOME_IS_DEEP_OCEAN = BiomeTagRegistry["minecraft:is_deep_ocean"] - val BIOME_HAS_STRUCTURE_OCEAN_RUIN_WARM = BiomeTagRegistry["minecraft:has_structure/ocean_ruin_warm"] - val BIOME_HAS_STRUCTURE_END_CITY = BiomeTagRegistry["minecraft:has_structure/end_city"] - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_MOUNTAIN = BiomeTagRegistry["minecraft:has_structure/ruined_portal_mountain"] - val BIOME_SPAWNS_WHITE_RABBITS = BiomeTagRegistry["minecraft:spawns_white_rabbits"] + val BIOME_HAS_STRUCTURE_IGLOO = BiomeTagRegistry["minecraft:has_structure/igloo"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_OCEAN = BiomeTagRegistry["minecraft:has_structure/ruined_portal_ocean"] + val BIOME_MORE_FREQUENT_DROWNED_SPAWNS = BiomeTagRegistry["minecraft:more_frequent_drowned_spawns"] + val BIOME_IS_BADLANDS = BiomeTagRegistry["minecraft:is_badlands"] val BIOME_HAS_STRUCTURE_SWAMP_HUT = BiomeTagRegistry["minecraft:has_structure/swamp_hut"] - val BIOME_SPAWNS_WARM_VARIANT_FROGS = BiomeTagRegistry["minecraft:spawns_warm_variant_frogs"] + val BIOME_HAS_STRUCTURE_END_CITY = BiomeTagRegistry["minecraft:has_structure/end_city"] val BIOME_SPAWNS_GOLD_RABBITS = BiomeTagRegistry["minecraft:spawns_gold_rabbits"] - val BIOME_HAS_CLOSER_WATER_FOG = BiomeTagRegistry["minecraft:has_closer_water_fog"] - val BIOME_HAS_STRUCTURE_TRAIL_RUINS = BiomeTagRegistry["minecraft:has_structure/trail_ruins"] + val BIOME_HAS_STRUCTURE_MINESHAFT = BiomeTagRegistry["minecraft:has_structure/mineshaft"] val BIOME_HAS_STRUCTURE_SHIPWRECK_BEACHED = BiomeTagRegistry["minecraft:has_structure/shipwreck_beached"] - val BIOME_MORE_FREQUENT_DROWNED_SPAWNS = BiomeTagRegistry["minecraft:more_frequent_drowned_spawns"] - val BIOME_HAS_STRUCTURE_VILLAGE_DESERT = BiomeTagRegistry["minecraft:has_structure/village_desert"] - val BIOME_PLAYS_UNDERWATER_MUSIC = BiomeTagRegistry["minecraft:plays_underwater_music"] - val BIOME_HAS_STRUCTURE_TRIAL_CHAMBERS = BiomeTagRegistry["minecraft:has_structure/trial_chambers"] - val BIOME_WITHOUT_ZOMBIE_SIEGES = BiomeTagRegistry["minecraft:without_zombie_sieges"] - val BIOME_HAS_STRUCTURE_SHIPWRECK = BiomeTagRegistry["minecraft:has_structure/shipwreck"] - val BIOME_HAS_STRUCTURE_MINESHAFT_MESA = BiomeTagRegistry["minecraft:has_structure/mineshaft_mesa"] - val BIOME_IS_OVERWORLD = BiomeTagRegistry["minecraft:is_overworld"] - val BIOME_INCREASED_FIRE_BURNOUT = BiomeTagRegistry["minecraft:increased_fire_burnout"] - val BIOME_IS_END = BiomeTagRegistry["minecraft:is_end"] - val BIOME_HAS_STRUCTURE_BURIED_TREASURE = BiomeTagRegistry["minecraft:has_structure/buried_treasure"] - val BIOME_HAS_STRUCTURE_PILLAGER_OUTPOST = BiomeTagRegistry["minecraft:has_structure/pillager_outpost"] - val BIOME_IS_MOUNTAIN = BiomeTagRegistry["minecraft:is_mountain"] - val BIOME_IS_BADLANDS = BiomeTagRegistry["minecraft:is_badlands"] - val BIOME_REDUCE_WATER_AMBIENT_SPAWNS = BiomeTagRegistry["minecraft:reduce_water_ambient_spawns"] - val BIOME_IS_FOREST = BiomeTagRegistry["minecraft:is_forest"] - val BIOME_IS_JUNGLE = BiomeTagRegistry["minecraft:is_jungle"] - val BIOME_HAS_STRUCTURE_ANCIENT_CITY = BiomeTagRegistry["minecraft:has_structure/ancient_city"] - val BIOME_HAS_STRUCTURE_NETHER_FOSSIL = BiomeTagRegistry["minecraft:has_structure/nether_fossil"] val BIOME_HAS_STRUCTURE_BASTION_REMNANT = BiomeTagRegistry["minecraft:has_structure/bastion_remnant"] + val BIOME_IS_HILL = BiomeTagRegistry["minecraft:is_hill"] + val BIOME_IS_NETHER = BiomeTagRegistry["minecraft:is_nether"] + val BIOME_HAS_STRUCTURE_DESERT_PYRAMID = BiomeTagRegistry["minecraft:has_structure/desert_pyramid"] val BIOME_IS_SAVANNA = BiomeTagRegistry["minecraft:is_savanna"] - val BIOME_HAS_STRUCTURE_RUINED_PORTAL_DESERT = BiomeTagRegistry["minecraft:has_structure/ruined_portal_desert"] - val BIOME_HAS_STRUCTURE_OCEAN_MONUMENT = BiomeTagRegistry["minecraft:has_structure/ocean_monument"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_STANDARD = BiomeTagRegistry["minecraft:has_structure/ruined_portal_standard"] + val BIOME_HAS_STRUCTURE_OCEAN_RUIN_WARM = BiomeTagRegistry["minecraft:has_structure/ocean_ruin_warm"] + val BIOME_IS_END = BiomeTagRegistry["minecraft:is_end"] + val BIOME_IS_RIVER = BiomeTagRegistry["minecraft:is_river"] + val BIOME_INCREASED_FIRE_BURNOUT = BiomeTagRegistry["minecraft:increased_fire_burnout"] + val BIOME_IS_OCEAN = BiomeTagRegistry["minecraft:is_ocean"] + val BIOME_IS_BEACH = BiomeTagRegistry["minecraft:is_beach"] + val BIOME_HAS_STRUCTURE_WOODLAND_MANSION = BiomeTagRegistry["minecraft:has_structure/woodland_mansion"] + val BIOME_HAS_STRUCTURE_VILLAGE_PLAINS = BiomeTagRegistry["minecraft:has_structure/village_plains"] val BIOME_WATER_ON_MAP_OUTLINES = BiomeTagRegistry["minecraft:water_on_map_outlines"] - val BIOME_HAS_STRUCTURE_DESERT_PYRAMID = BiomeTagRegistry["minecraft:has_structure/desert_pyramid"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_SWAMP = BiomeTagRegistry["minecraft:has_structure/ruined_portal_swamp"] + val BIOME_IS_JUNGLE = BiomeTagRegistry["minecraft:is_jungle"] + val BIOME_HAS_CLOSER_WATER_FOG = BiomeTagRegistry["minecraft:has_closer_water_fog"] + val BIOME_HAS_STRUCTURE_VILLAGE_TAIGA = BiomeTagRegistry["minecraft:has_structure/village_taiga"] + val BIOME_IS_FOREST = BiomeTagRegistry["minecraft:is_forest"] + val BIOME_SPAWNS_COLD_VARIANT_FARM_ANIMALS = BiomeTagRegistry["minecraft:spawns_cold_variant_farm_animals"] + val BIOME_HAS_STRUCTURE_SHIPWRECK = BiomeTagRegistry["minecraft:has_structure/shipwreck"] + val BIOME_HAS_STRUCTURE_OCEAN_RUIN_COLD = BiomeTagRegistry["minecraft:has_structure/ocean_ruin_cold"] + val BIOME_HAS_STRUCTURE_VILLAGE_SAVANNA = BiomeTagRegistry["minecraft:has_structure/village_savanna"] + val BIOME_SPAWNS_WARM_VARIANT_FROGS = BiomeTagRegistry["minecraft:spawns_warm_variant_frogs"] + val BIOME_REDUCE_WATER_AMBIENT_SPAWNS = BiomeTagRegistry["minecraft:reduce_water_ambient_spawns"] + val BIOME_SPAWNS_WARM_VARIANT_FARM_ANIMALS = BiomeTagRegistry["minecraft:spawns_warm_variant_farm_animals"] val BIOME_WITHOUT_PATROL_SPAWNS = BiomeTagRegistry["minecraft:without_patrol_spawns"] - val BLOCK_BAMBOO_PLANTABLE_ON = BlockTagRegistry["minecraft:bamboo_plantable_on"] + val BIOME_HAS_STRUCTURE_NETHER_FOSSIL = BiomeTagRegistry["minecraft:has_structure/nether_fossil"] + val BIOME_POLAR_BEARS_SPAWN_ON_ALTERNATE_BLOCKS = BiomeTagRegistry["minecraft:polar_bears_spawn_on_alternate_blocks"] + val BIOME_HAS_STRUCTURE_TRAIL_RUINS = BiomeTagRegistry["minecraft:has_structure/trail_ruins"] + val BIOME_HAS_STRUCTURE_NETHER_FORTRESS = BiomeTagRegistry["minecraft:has_structure/nether_fortress"] + val BIOME_HAS_STRUCTURE_MINESHAFT_MESA = BiomeTagRegistry["minecraft:has_structure/mineshaft_mesa"] + val BIOME_PLAYS_UNDERWATER_MUSIC = BiomeTagRegistry["minecraft:plays_underwater_music"] + val BIOME_HAS_STRUCTURE_JUNGLE_TEMPLE = BiomeTagRegistry["minecraft:has_structure/jungle_temple"] + val BIOME_SPAWNS_WHITE_RABBITS = BiomeTagRegistry["minecraft:spawns_white_rabbits"] + val BIOME_IS_MOUNTAIN = BiomeTagRegistry["minecraft:is_mountain"] + val BIOME_HAS_STRUCTURE_RUINED_PORTAL_MOUNTAIN = BiomeTagRegistry["minecraft:has_structure/ruined_portal_mountain"] + val BLOCK_RABBITS_SPAWNABLE_ON = BlockTagRegistry["minecraft:rabbits_spawnable_on"] + val BLOCK_WALL_SIGNS = BlockTagRegistry["minecraft:wall_signs"] + val BLOCK_MOB_INTERACTABLE_DOORS = BlockTagRegistry["minecraft:mob_interactable_doors"] val BLOCK_INCORRECT_FOR_DIAMOND_TOOL = BlockTagRegistry["minecraft:incorrect_for_diamond_tool"] - val BLOCK_POLAR_BEARS_SPAWNABLE_ON_ALTERNATE = BlockTagRegistry["minecraft:polar_bears_spawnable_on_alternate"] - val BLOCK_CAMEL_SAND_STEP_SOUND_BLOCKS = BlockTagRegistry["minecraft:camel_sand_step_sound_blocks"] - val BLOCK_INCORRECT_FOR_GOLD_TOOL = BlockTagRegistry["minecraft:incorrect_for_gold_tool"] - val BLOCK_CRYSTAL_SOUND_BLOCKS = BlockTagRegistry["minecraft:crystal_sound_blocks"] - val BLOCK_GOLD_ORES = BlockTagRegistry["minecraft:gold_ores"] - val BLOCK_MINEABLE_HOE = BlockTagRegistry["minecraft:mineable/hoe"] - val BLOCK_IMPERMEABLE = BlockTagRegistry["minecraft:impermeable"] - val BLOCK_TRAPDOORS = BlockTagRegistry["minecraft:trapdoors"] - val BLOCK_MAINTAINS_FARMLAND = BlockTagRegistry["minecraft:maintains_farmland"] - val BLOCK_WOLVES_SPAWNABLE_ON = BlockTagRegistry["minecraft:wolves_spawnable_on"] - val BLOCK_GUARDED_BY_PIGLINS = BlockTagRegistry["minecraft:guarded_by_piglins"] - val BLOCK_FENCES = BlockTagRegistry["minecraft:fences"] - val BLOCK_WOODEN_SLABS = BlockTagRegistry["minecraft:wooden_slabs"] - val BLOCK_TRAIL_RUINS_REPLACEABLE = BlockTagRegistry["minecraft:trail_ruins_replaceable"] - val BLOCK_HOGLIN_REPELLENTS = BlockTagRegistry["minecraft:hoglin_repellents"] - val BLOCK_SNOW_LAYER_CAN_SURVIVE_ON = BlockTagRegistry["minecraft:snow_layer_can_survive_on"] - val BLOCK_BADLANDS_TERRACOTTA = BlockTagRegistry["minecraft:badlands_terracotta"] - val BLOCK_FROG_PREFER_JUMP_TO = BlockTagRegistry["minecraft:frog_prefer_jump_to"] - val BLOCK_WALL_POST_OVERRIDE = BlockTagRegistry["minecraft:wall_post_override"] - val BLOCK_CAULDRONS = BlockTagRegistry["minecraft:cauldrons"] - val BLOCK_CORAL_PLANTS = BlockTagRegistry["minecraft:coral_plants"] - val BLOCK_NETHER_CARVER_REPLACEABLES = BlockTagRegistry["minecraft:nether_carver_replaceables"] - val BLOCK_WALL_CORALS = BlockTagRegistry["minecraft:wall_corals"] - val BLOCK_SNIFFER_DIGGABLE_BLOCK = BlockTagRegistry["minecraft:sniffer_diggable_block"] - val BLOCK_FOXES_SPAWNABLE_ON = BlockTagRegistry["minecraft:foxes_spawnable_on"] - val BLOCK_OVERWORLD_CARVER_REPLACEABLES = BlockTagRegistry["minecraft:overworld_carver_replaceables"] - val BLOCK_ANVIL = BlockTagRegistry["minecraft:anvil"] val BLOCK_RAILS = BlockTagRegistry["minecraft:rails"] - val BLOCK_ACACIA_LOGS = BlockTagRegistry["minecraft:acacia_logs"] - val BLOCK_NEEDS_STONE_TOOL = BlockTagRegistry["minecraft:needs_stone_tool"] - val BLOCK_OCCLUDES_VIBRATION_SIGNALS = BlockTagRegistry["minecraft:occludes_vibration_signals"] - val BLOCK_PIGLIN_REPELLENTS = BlockTagRegistry["minecraft:piglin_repellents"] - val BLOCK_CANDLE_CAKES = BlockTagRegistry["minecraft:candle_cakes"] - val BLOCK_JUNGLE_LOGS = BlockTagRegistry["minecraft:jungle_logs"] - val BLOCK_WITHER_SUMMON_BASE_BLOCKS = BlockTagRegistry["minecraft:wither_summon_base_blocks"] - val BLOCK_WARPED_STEMS = BlockTagRegistry["minecraft:warped_stems"] - val BLOCK_BASE_STONE_NETHER = BlockTagRegistry["minecraft:base_stone_nether"] - val BLOCK_PARROTS_SPAWNABLE_ON = BlockTagRegistry["minecraft:parrots_spawnable_on"] - val BLOCK_CONCRETE_POWDER = BlockTagRegistry["minecraft:concrete_powder"] + val BLOCK_BEE_GROWABLES = BlockTagRegistry["minecraft:bee_growables"] + val BLOCK_UNSTABLE_BOTTOM_CENTER = BlockTagRegistry["minecraft:unstable_bottom_center"] + val BLOCK_INVALID_SPAWN_INSIDE = BlockTagRegistry["minecraft:invalid_spawn_inside"] val BLOCK_UNDERWATER_BONEMEALS = BlockTagRegistry["minecraft:underwater_bonemeals"] - val BLOCK_BAMBOO_BLOCKS = BlockTagRegistry["minecraft:bamboo_blocks"] - val BLOCK_INFINIBURN_NETHER = BlockTagRegistry["minecraft:infiniburn_nether"] - val BLOCK_BIRCH_LOGS = BlockTagRegistry["minecraft:birch_logs"] - val BLOCK_WALL_HANGING_SIGNS = BlockTagRegistry["minecraft:wall_hanging_signs"] - val BLOCK_WALL_SIGNS = BlockTagRegistry["minecraft:wall_signs"] - val BLOCK_CAMPFIRES = BlockTagRegistry["minecraft:campfires"] - val BLOCK_SMALL_FLOWERS = BlockTagRegistry["minecraft:small_flowers"] + val BLOCK_WALL_CORALS = BlockTagRegistry["minecraft:wall_corals"] + val BLOCK_CANDLES = BlockTagRegistry["minecraft:candles"] + val BLOCK_NEEDS_DIAMOND_TOOL = BlockTagRegistry["minecraft:needs_diamond_tool"] + val BLOCK_REDSTONE_ORES = BlockTagRegistry["minecraft:redstone_ores"] + val BLOCK_FLOWERS = BlockTagRegistry["minecraft:flowers"] + val BLOCK_WOODEN_TRAPDOORS = BlockTagRegistry["minecraft:wooden_trapdoors"] + val BLOCK_COPPER_GOLEM_STATUES = BlockTagRegistry["minecraft:copper_golem_statues"] + val BLOCK_CAULDRONS = BlockTagRegistry["minecraft:cauldrons"] + val BLOCK_COAL_ORES = BlockTagRegistry["minecraft:coal_ores"] + val BLOCK_ENDERMAN_HOLDABLE = BlockTagRegistry["minecraft:enderman_holdable"] + val BLOCK_INCORRECT_FOR_STONE_TOOL = BlockTagRegistry["minecraft:incorrect_for_stone_tool"] + val BLOCK_JUNGLE_LOGS = BlockTagRegistry["minecraft:jungle_logs"] + val BLOCK_TERRACOTTA = BlockTagRegistry["minecraft:terracotta"] + val BLOCK_FROG_PREFER_JUMP_TO = BlockTagRegistry["minecraft:frog_prefer_jump_to"] + val BLOCK_DIRT = BlockTagRegistry["minecraft:dirt"] + val BLOCK_WOODEN_PRESSURE_PLATES = BlockTagRegistry["minecraft:wooden_pressure_plates"] val BLOCK_TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS = BlockTagRegistry["minecraft:triggers_ambient_desert_dry_vegetation_block_sounds"] - val BLOCK_WALLS = BlockTagRegistry["minecraft:walls"] - val BLOCK_SCULK_REPLACEABLE = BlockTagRegistry["minecraft:sculk_replaceable"] - val BLOCK_CORALS = BlockTagRegistry["minecraft:corals"] - val BLOCK_WOODEN_STAIRS = BlockTagRegistry["minecraft:wooden_stairs"] - val BLOCK_DAMPENS_VIBRATIONS = BlockTagRegistry["minecraft:dampens_vibrations"] - val BLOCK_SNOW_LAYER_CANNOT_SURVIVE_ON = BlockTagRegistry["minecraft:snow_layer_cannot_survive_on"] - val BLOCK_NEEDS_IRON_TOOL = BlockTagRegistry["minecraft:needs_iron_tool"] - val BLOCK_FENCE_GATES = BlockTagRegistry["minecraft:fence_gates"] - val BLOCK_FALL_DAMAGE_RESETTING = BlockTagRegistry["minecraft:fall_damage_resetting"] - val BLOCK_DRY_VEGETATION_MAY_PLACE_ON = BlockTagRegistry["minecraft:dry_vegetation_may_place_on"] - val BLOCK_NYLIUM = BlockTagRegistry["minecraft:nylium"] - val BLOCK_ENCHANTMENT_POWER_PROVIDER = BlockTagRegistry["minecraft:enchantment_power_provider"] - val BLOCK_SMALL_DRIPLEAF_PLACEABLE = BlockTagRegistry["minecraft:small_dripleaf_placeable"] - val BLOCK_COPPER_ORES = BlockTagRegistry["minecraft:copper_ores"] - val BLOCK_FROGS_SPAWNABLE_ON = BlockTagRegistry["minecraft:frogs_spawnable_on"] - val BLOCK_SWORD_INSTANTLY_MINES = BlockTagRegistry["minecraft:sword_instantly_mines"] - val BLOCK_WOOL_CARPETS = BlockTagRegistry["minecraft:wool_carpets"] - val BLOCK_GOATS_SPAWNABLE_ON = BlockTagRegistry["minecraft:goats_spawnable_on"] - val BLOCK_ANCIENT_CITY_REPLACEABLE = BlockTagRegistry["minecraft:ancient_city_replaceable"] - val BLOCK_WOODEN_FENCES = BlockTagRegistry["minecraft:wooden_fences"] - val BLOCK_EDIBLE_FOR_SHEEP = BlockTagRegistry["minecraft:edible_for_sheep"] - val BLOCK_CHERRY_LOGS = BlockTagRegistry["minecraft:cherry_logs"] - val BLOCK_BIG_DRIPLEAF_PLACEABLE = BlockTagRegistry["minecraft:big_dripleaf_placeable"] - val BLOCK_MINEABLE_SHOVEL = BlockTagRegistry["minecraft:mineable/shovel"] - val BLOCK_SIGNS = BlockTagRegistry["minecraft:signs"] + val BLOCK_POLAR_BEARS_SPAWNABLE_ON_ALTERNATE = BlockTagRegistry["minecraft:polar_bears_spawnable_on_alternate"] + val BLOCK_PIGLIN_REPELLENTS = BlockTagRegistry["minecraft:piglin_repellents"] + val BLOCK_INFINIBURN_OVERWORLD = BlockTagRegistry["minecraft:infiniburn_overworld"] + val BLOCK_FLOWER_POTS = BlockTagRegistry["minecraft:flower_pots"] val BLOCK_TRIGGERS_AMBIENT_DESERT_SAND_BLOCK_SOUNDS = BlockTagRegistry["minecraft:triggers_ambient_desert_sand_block_sounds"] - val BLOCK_INCORRECT_FOR_STONE_TOOL = BlockTagRegistry["minecraft:incorrect_for_stone_tool"] - val BLOCK_ALL_SIGNS = BlockTagRegistry["minecraft:all_signs"] + val BLOCK_DOES_NOT_BLOCK_HOPPERS = BlockTagRegistry["minecraft:does_not_block_hoppers"] + val BLOCK_BUTTONS = BlockTagRegistry["minecraft:buttons"] + val BLOCK_CANDLE_CAKES = BlockTagRegistry["minecraft:candle_cakes"] + val BLOCK_FALL_DAMAGE_RESETTING = BlockTagRegistry["minecraft:fall_damage_resetting"] + val BLOCK_MUSHROOM_GROW_BLOCK = BlockTagRegistry["minecraft:mushroom_grow_block"] + val BLOCK_FEATURES_CANNOT_REPLACE = BlockTagRegistry["minecraft:features_cannot_replace"] + val BLOCK_STONE_BUTTONS = BlockTagRegistry["minecraft:stone_buttons"] + val BLOCK_FIRE = BlockTagRegistry["minecraft:fire"] + val BLOCK_CROPS = BlockTagRegistry["minecraft:crops"] + val BLOCK_WOODEN_DOORS = BlockTagRegistry["minecraft:wooden_doors"] + val BLOCK_WALL_HANGING_SIGNS = BlockTagRegistry["minecraft:wall_hanging_signs"] val BLOCK_GEODE_INVALID_BLOCKS = BlockTagRegistry["minecraft:geode_invalid_blocks"] - val BLOCK_INFINIBURN_END = BlockTagRegistry["minecraft:infiniburn_end"] - val BLOCK_WOOL = BlockTagRegistry["minecraft:wool"] + val BLOCK_BEACON_BASE_BLOCKS = BlockTagRegistry["minecraft:beacon_base_blocks"] val BLOCK_ENCHANTMENT_POWER_TRANSMITTER = BlockTagRegistry["minecraft:enchantment_power_transmitter"] - val BLOCK_CLIMBABLE = BlockTagRegistry["minecraft:climbable"] val BLOCK_SAPLINGS = BlockTagRegistry["minecraft:saplings"] - val BLOCK_BEE_GROWABLES = BlockTagRegistry["minecraft:bee_growables"] - val BLOCK_STONE_BUTTONS = BlockTagRegistry["minecraft:stone_buttons"] - val BLOCK_AXOLOTLS_SPAWNABLE_ON = BlockTagRegistry["minecraft:axolotls_spawnable_on"] - val BLOCK_TERRACOTTA = BlockTagRegistry["minecraft:terracotta"] - val BLOCK_LAVA_POOL_STONE_CANNOT_REPLACE = BlockTagRegistry["minecraft:lava_pool_stone_cannot_replace"] - val BLOCK_BANNERS = BlockTagRegistry["minecraft:banners"] - val BLOCK_SPRUCE_LOGS = BlockTagRegistry["minecraft:spruce_logs"] - val BLOCK_COMBINATION_STEP_SOUND_BLOCKS = BlockTagRegistry["minecraft:combination_step_sound_blocks"] - val BLOCK_INVALID_SPAWN_INSIDE = BlockTagRegistry["minecraft:invalid_spawn_inside"] - val BLOCK_DOES_NOT_BLOCK_HOPPERS = BlockTagRegistry["minecraft:does_not_block_hoppers"] - val BLOCK_AZALEA_ROOT_REPLACEABLE = BlockTagRegistry["minecraft:azalea_root_replaceable"] - val BLOCK_WOODEN_DOORS = BlockTagRegistry["minecraft:wooden_doors"] val BLOCK_ICE = BlockTagRegistry["minecraft:ice"] - val BLOCK_DRIPSTONE_REPLACEABLE_BLOCKS = BlockTagRegistry["minecraft:dripstone_replaceable_blocks"] - val BLOCK_SLABS = BlockTagRegistry["minecraft:slabs"] - val BLOCK_OAK_LOGS = BlockTagRegistry["minecraft:oak_logs"] - val BLOCK_CRIMSON_STEMS = BlockTagRegistry["minecraft:crimson_stems"] - val BLOCK_SOUL_FIRE_BASE_BLOCKS = BlockTagRegistry["minecraft:soul_fire_base_blocks"] - val BLOCK_WOODEN_PRESSURE_PLATES = BlockTagRegistry["minecraft:wooden_pressure_plates"] - val BLOCK_FIRE = BlockTagRegistry["minecraft:fire"] - val BLOCK_LOGS_THAT_BURN = BlockTagRegistry["minecraft:logs_that_burn"] - val BLOCK_NEEDS_DIAMOND_TOOL = BlockTagRegistry["minecraft:needs_diamond_tool"] - val BLOCK_COAL_ORES = BlockTagRegistry["minecraft:coal_ores"] - val BLOCK_RABBITS_SPAWNABLE_ON = BlockTagRegistry["minecraft:rabbits_spawnable_on"] - val BLOCK_MOSS_REPLACEABLE = BlockTagRegistry["minecraft:moss_replaceable"] - val BLOCK_PORTALS = BlockTagRegistry["minecraft:portals"] + val BLOCK_SNOW = BlockTagRegistry["minecraft:snow"] + val BLOCK_CAMELS_SPAWNABLE_ON = BlockTagRegistry["minecraft:camels_spawnable_on"] + val BLOCK_INCORRECT_FOR_WOODEN_TOOL = BlockTagRegistry["minecraft:incorrect_for_wooden_tool"] + val BLOCK_MANGROVE_LOGS_CAN_GROW_THROUGH = BlockTagRegistry["minecraft:mangrove_logs_can_grow_through"] + val BLOCK_IRON_ORES = BlockTagRegistry["minecraft:iron_ores"] + val BLOCK_WITHER_IMMUNE = BlockTagRegistry["minecraft:wither_immune"] + val BLOCK_MINEABLE_AXE = BlockTagRegistry["minecraft:mineable/axe"] + val BLOCK_BATS_SPAWNABLE_ON = BlockTagRegistry["minecraft:bats_spawnable_on"] + val BLOCK_EMERALD_ORES = BlockTagRegistry["minecraft:emerald_ores"] + val BLOCK_PARROTS_SPAWNABLE_ON = BlockTagRegistry["minecraft:parrots_spawnable_on"] + val BLOCK_AZALEA_ROOT_REPLACEABLE = BlockTagRegistry["minecraft:azalea_root_replaceable"] + val BLOCK_CHERRY_LOGS = BlockTagRegistry["minecraft:cherry_logs"] + val BLOCK_LEAVES = BlockTagRegistry["minecraft:leaves"] + val BLOCK_BIG_DRIPLEAF_PLACEABLE = BlockTagRegistry["minecraft:big_dripleaf_placeable"] + val BLOCK_WOODEN_BUTTONS = BlockTagRegistry["minecraft:wooden_buttons"] + val BLOCK_SWORD_INSTANTLY_MINES = BlockTagRegistry["minecraft:sword_instantly_mines"] + val BLOCK_CAMEL_SAND_STEP_SOUND_BLOCKS = BlockTagRegistry["minecraft:camel_sand_step_sound_blocks"] + val BLOCK_NEEDS_IRON_TOOL = BlockTagRegistry["minecraft:needs_iron_tool"] + val BLOCK_MINEABLE_HOE = BlockTagRegistry["minecraft:mineable/hoe"] + val BLOCK_REPLACEABLE = BlockTagRegistry["minecraft:replaceable"] + val BLOCK_BASE_STONE_OVERWORLD = BlockTagRegistry["minecraft:base_stone_overworld"] + val BLOCK_MANGROVE_LOGS = BlockTagRegistry["minecraft:mangrove_logs"] + val BLOCK_CONVERTABLE_TO_MUD = BlockTagRegistry["minecraft:convertable_to_mud"] + val BLOCK_EDIBLE_FOR_SHEEP = BlockTagRegistry["minecraft:edible_for_sheep"] val BLOCK_DIAMOND_ORES = BlockTagRegistry["minecraft:diamond_ores"] - val BLOCK_OVERWORLD_NATURAL_LOGS = BlockTagRegistry["minecraft:overworld_natural_logs"] + val BLOCK_CONCRETE_POWDER = BlockTagRegistry["minecraft:concrete_powder"] + val BLOCK_LOGS_THAT_BURN = BlockTagRegistry["minecraft:logs_that_burn"] + val BLOCK_BAMBOO_PLANTABLE_ON = BlockTagRegistry["minecraft:bamboo_plantable_on"] + val BLOCK_ALL_HANGING_SIGNS = BlockTagRegistry["minecraft:all_hanging_signs"] + val BLOCK_NETHER_CARVER_REPLACEABLES = BlockTagRegistry["minecraft:nether_carver_replaceables"] + val BLOCK_AXOLOTLS_SPAWNABLE_ON = BlockTagRegistry["minecraft:axolotls_spawnable_on"] + val BLOCK_WOLVES_SPAWNABLE_ON = BlockTagRegistry["minecraft:wolves_spawnable_on"] + val BLOCK_HAPPY_GHAST_AVOIDS = BlockTagRegistry["minecraft:happy_ghast_avoids"] + val BLOCK_PLANKS = BlockTagRegistry["minecraft:planks"] + val BLOCK_SNOW_LAYER_CAN_SURVIVE_ON = BlockTagRegistry["minecraft:snow_layer_can_survive_on"] + val BLOCK_COPPER_ORES = BlockTagRegistry["minecraft:copper_ores"] + val BLOCK_STONE_PRESSURE_PLATES = BlockTagRegistry["minecraft:stone_pressure_plates"] + val BLOCK_ANVIL = BlockTagRegistry["minecraft:anvil"] + val BLOCK_IMPERMEABLE = BlockTagRegistry["minecraft:impermeable"] + val BLOCK_SOUL_SPEED_BLOCKS = BlockTagRegistry["minecraft:soul_speed_blocks"] + val BLOCK_ANCIENT_CITY_REPLACEABLE = BlockTagRegistry["minecraft:ancient_city_replaceable"] + val BLOCK_WOOL_CARPETS = BlockTagRegistry["minecraft:wool_carpets"] + val BLOCK_INFINIBURN_NETHER = BlockTagRegistry["minecraft:infiniburn_nether"] + val BLOCK_STONE_BRICKS = BlockTagRegistry["minecraft:stone_bricks"] + val BLOCK_DRAGON_TRANSPARENT = BlockTagRegistry["minecraft:dragon_transparent"] + val BLOCK_BLOCKS_WIND_CHARGE_EXPLOSIONS = BlockTagRegistry["minecraft:blocks_wind_charge_explosions"] + val BLOCK_WOODEN_SHELVES = BlockTagRegistry["minecraft:wooden_shelves"] + val BLOCK_SHULKER_BOXES = BlockTagRegistry["minecraft:shulker_boxes"] + val BLOCK_GUARDED_BY_PIGLINS = BlockTagRegistry["minecraft:guarded_by_piglins"] + val BLOCK_WITHER_SUMMON_BASE_BLOCKS = BlockTagRegistry["minecraft:wither_summon_base_blocks"] + val BLOCK_SLABS = BlockTagRegistry["minecraft:slabs"] + val BLOCK_VIBRATION_RESONATORS = BlockTagRegistry["minecraft:vibration_resonators"] + val BLOCK_INCORRECT_FOR_IRON_TOOL = BlockTagRegistry["minecraft:incorrect_for_iron_tool"] + val BLOCK_BEEHIVES = BlockTagRegistry["minecraft:beehives"] + val BLOCK_OCCLUDES_VIBRATION_SIGNALS = BlockTagRegistry["minecraft:occludes_vibration_signals"] + val BLOCK_CLIMBABLE = BlockTagRegistry["minecraft:climbable"] + val BLOCK_PRESSURE_PLATES = BlockTagRegistry["minecraft:pressure_plates"] + val BLOCK_ALL_SIGNS = BlockTagRegistry["minecraft:all_signs"] + val BLOCK_BANNERS = BlockTagRegistry["minecraft:banners"] + val BLOCK_TRAIL_RUINS_REPLACEABLE = BlockTagRegistry["minecraft:trail_ruins_replaceable"] + val BLOCK_BADLANDS_TERRACOTTA = BlockTagRegistry["minecraft:badlands_terracotta"] + val BLOCK_STANDING_SIGNS = BlockTagRegistry["minecraft:standing_signs"] + val BLOCK_FENCES = BlockTagRegistry["minecraft:fences"] + val BLOCK_LIGHTNING_RODS = BlockTagRegistry["minecraft:lightning_rods"] + val BLOCK_SNOW_LAYER_CANNOT_SURVIVE_ON = BlockTagRegistry["minecraft:snow_layer_cannot_survive_on"] + val BLOCK_MINEABLE_SHOVEL = BlockTagRegistry["minecraft:mineable/shovel"] + val BLOCK_SAND = BlockTagRegistry["minecraft:sand"] + val BLOCK_WOODEN_FENCES = BlockTagRegistry["minecraft:wooden_fences"] + val BLOCK_TRAPDOORS = BlockTagRegistry["minecraft:trapdoors"] val BLOCK_TRIGGERS_AMBIENT_DRIED_GHAST_BLOCK_SOUNDS = BlockTagRegistry["minecraft:triggers_ambient_dried_ghast_block_sounds"] + val BLOCK_SMALL_DRIPLEAF_PLACEABLE = BlockTagRegistry["minecraft:small_dripleaf_placeable"] + val BLOCK_MOOSHROOMS_SPAWNABLE_ON = BlockTagRegistry["minecraft:mooshrooms_spawnable_on"] + val BLOCK_WARPED_STEMS = BlockTagRegistry["minecraft:warped_stems"] + val BLOCK_CAVE_VINES = BlockTagRegistry["minecraft:cave_vines"] + val BLOCK_ENCHANTMENT_POWER_PROVIDER = BlockTagRegistry["minecraft:enchantment_power_provider"] + val BLOCK_SPRUCE_LOGS = BlockTagRegistry["minecraft:spruce_logs"] + val BLOCK_FOXES_SPAWNABLE_ON = BlockTagRegistry["minecraft:foxes_spawnable_on"] + val BLOCK_OVERWORLD_NATURAL_LOGS = BlockTagRegistry["minecraft:overworld_natural_logs"] + val BLOCK_STAIRS = BlockTagRegistry["minecraft:stairs"] + val BLOCK_LAPIS_ORES = BlockTagRegistry["minecraft:lapis_ores"] val BLOCK_ANIMALS_SPAWNABLE_ON = BlockTagRegistry["minecraft:animals_spawnable_on"] - val BLOCK_AIR = BlockTagRegistry["minecraft:air"] + val BLOCK_DEEPSLATE_ORE_REPLACEABLES = BlockTagRegistry["minecraft:deepslate_ore_replaceables"] + val BLOCK_SNAPS_GOAT_HORN = BlockTagRegistry["minecraft:snaps_goat_horn"] + val BLOCK_WALLS = BlockTagRegistry["minecraft:walls"] + val BLOCK_CORAL_PLANTS = BlockTagRegistry["minecraft:coral_plants"] + val BLOCK_COMPLETES_FIND_TREE_TUTORIAL = BlockTagRegistry["minecraft:completes_find_tree_tutorial"] val BLOCK_BEDS = BlockTagRegistry["minecraft:beds"] - val BLOCK_WITHER_IMMUNE = BlockTagRegistry["minecraft:wither_immune"] + val BLOCK_FROGS_SPAWNABLE_ON = BlockTagRegistry["minecraft:frogs_spawnable_on"] + val BLOCK_DRAGON_IMMUNE = BlockTagRegistry["minecraft:dragon_immune"] + val BLOCK_WOODEN_STAIRS = BlockTagRegistry["minecraft:wooden_stairs"] + val BLOCK_MINEABLE_PICKAXE = BlockTagRegistry["minecraft:mineable/pickaxe"] + val BLOCK_GOATS_SPAWNABLE_ON = BlockTagRegistry["minecraft:goats_spawnable_on"] + val BLOCK_DRY_VEGETATION_MAY_PLACE_ON = BlockTagRegistry["minecraft:dry_vegetation_may_place_on"] + val BLOCK_CHAINS = BlockTagRegistry["minecraft:chains"] val BLOCK_PREVENT_MOB_SPAWNING_INSIDE = BlockTagRegistry["minecraft:prevent_mob_spawning_inside"] - val BLOCK_BUTTONS = BlockTagRegistry["minecraft:buttons"] - val BLOCK_FLOWERS = BlockTagRegistry["minecraft:flowers"] - val BLOCK_REDSTONE_ORES = BlockTagRegistry["minecraft:redstone_ores"] - val BLOCK_CANDLES = BlockTagRegistry["minecraft:candles"] - val BLOCK_CAVE_VINES = BlockTagRegistry["minecraft:cave_vines"] + val BLOCK_SCULK_REPLACEABLE = BlockTagRegistry["minecraft:sculk_replaceable"] + val BLOCK_HOGLIN_REPELLENTS = BlockTagRegistry["minecraft:hoglin_repellents"] + val BLOCK_PALE_OAK_LOGS = BlockTagRegistry["minecraft:pale_oak_logs"] + val BLOCK_AZALEA_GROWS_ON = BlockTagRegistry["minecraft:azalea_grows_on"] + val BLOCK_CRIMSON_STEMS = BlockTagRegistry["minecraft:crimson_stems"] + val BLOCK_PORTALS = BlockTagRegistry["minecraft:portals"] + val BLOCK_FENCE_GATES = BlockTagRegistry["minecraft:fence_gates"] + val BLOCK_SMALL_FLOWERS = BlockTagRegistry["minecraft:small_flowers"] + val BLOCK_NEEDS_STONE_TOOL = BlockTagRegistry["minecraft:needs_stone_tool"] + val BLOCK_WALL_POST_OVERRIDE = BlockTagRegistry["minecraft:wall_post_override"] + val BLOCK_STONE_ORE_REPLACEABLES = BlockTagRegistry["minecraft:stone_ore_replaceables"] val BLOCK_INSIDE_STEP_SOUND_BLOCKS = BlockTagRegistry["minecraft:inside_step_sound_blocks"] + val BLOCK_GOLD_ORES = BlockTagRegistry["minecraft:gold_ores"] val BLOCK_SCULK_REPLACEABLE_WORLD_GEN = BlockTagRegistry["minecraft:sculk_replaceable_world_gen"] - val BLOCK_MOOSHROOMS_SPAWNABLE_ON = BlockTagRegistry["minecraft:mooshrooms_spawnable_on"] - val BLOCK_HAPPY_GHAST_AVOIDS = BlockTagRegistry["minecraft:happy_ghast_avoids"] + val BLOCK_CRYSTAL_SOUND_BLOCKS = BlockTagRegistry["minecraft:crystal_sound_blocks"] + val BLOCK_REPLACEABLE_BY_MUSHROOMS = BlockTagRegistry["minecraft:replaceable_by_mushrooms"] + val BLOCK_OAK_LOGS = BlockTagRegistry["minecraft:oak_logs"] + val BLOCK_AIR = BlockTagRegistry["minecraft:air"] + val BLOCK_CORALS = BlockTagRegistry["minecraft:corals"] val BLOCK_DARK_OAK_LOGS = BlockTagRegistry["minecraft:dark_oak_logs"] val BLOCK_MANGROVE_ROOTS_CAN_GROW_THROUGH = BlockTagRegistry["minecraft:mangrove_roots_can_grow_through"] - val BLOCK_PLANKS = BlockTagRegistry["minecraft:planks"] - val BLOCK_MINEABLE_PICKAXE = BlockTagRegistry["minecraft:mineable/pickaxe"] - val BLOCK_REPLACEABLE_BY_MUSHROOMS = BlockTagRegistry["minecraft:replaceable_by_mushrooms"] - val BLOCK_CEILING_HANGING_SIGNS = BlockTagRegistry["minecraft:ceiling_hanging_signs"] - val BLOCK_SNAPS_GOAT_HORN = BlockTagRegistry["minecraft:snaps_goat_horn"] + val BLOCK_MOSS_REPLACEABLE = BlockTagRegistry["minecraft:moss_replaceable"] + val BLOCK_NYLIUM = BlockTagRegistry["minecraft:nylium"] + val BLOCK_CORAL_BLOCKS = BlockTagRegistry["minecraft:coral_blocks"] + val BLOCK_LUSH_GROUND_REPLACEABLE = BlockTagRegistry["minecraft:lush_ground_replaceable"] + val BLOCK_DAMPENS_VIBRATIONS = BlockTagRegistry["minecraft:dampens_vibrations"] + val BLOCK_COPPER = BlockTagRegistry["minecraft:copper"] + val BLOCK_COPPER_CHESTS = BlockTagRegistry["minecraft:copper_chests"] + val BLOCK_DOORS = BlockTagRegistry["minecraft:doors"] val BLOCK_INCORRECT_FOR_NETHERITE_TOOL = BlockTagRegistry["minecraft:incorrect_for_netherite_tool"] - val BLOCK_INCORRECT_FOR_IRON_TOOL = BlockTagRegistry["minecraft:incorrect_for_iron_tool"] - val BLOCK_ALL_HANGING_SIGNS = BlockTagRegistry["minecraft:all_hanging_signs"] - val BLOCK_ARMADILLO_SPAWNABLE_ON = BlockTagRegistry["minecraft:armadillo_spawnable_on"] - val BLOCK_IRON_ORES = BlockTagRegistry["minecraft:iron_ores"] + val BLOCK_WOODEN_SLABS = BlockTagRegistry["minecraft:wooden_slabs"] + val BLOCK_MAINTAINS_FARMLAND = BlockTagRegistry["minecraft:maintains_farmland"] + val BLOCK_INCORRECT_FOR_COPPER_TOOL = BlockTagRegistry["minecraft:incorrect_for_copper_tool"] + val BLOCK_DRIPSTONE_REPLACEABLE_BLOCKS = BlockTagRegistry["minecraft:dripstone_replaceable_blocks"] + val BLOCK_SNIFFER_EGG_HATCH_BOOST = BlockTagRegistry["minecraft:sniffer_egg_hatch_boost"] + val BLOCK_WOOL = BlockTagRegistry["minecraft:wool"] + val BLOCK_OVERWORLD_CARVER_REPLACEABLES = BlockTagRegistry["minecraft:overworld_carver_replaceables"] + val BLOCK_SWORD_EFFICIENT = BlockTagRegistry["minecraft:sword_efficient"] val BLOCK_BEE_ATTRACTIVE = BlockTagRegistry["minecraft:bee_attractive"] - val BLOCK_CAMELS_SPAWNABLE_ON = BlockTagRegistry["minecraft:camels_spawnable_on"] + val BLOCK_ARMADILLO_SPAWNABLE_ON = BlockTagRegistry["minecraft:armadillo_spawnable_on"] val BLOCK_STRIDER_WARM_BLOCKS = BlockTagRegistry["minecraft:strider_warm_blocks"] - val BLOCK_BLOCKS_WIND_CHARGE_EXPLOSIONS = BlockTagRegistry["minecraft:blocks_wind_charge_explosions"] - val BLOCK_LUSH_GROUND_REPLACEABLE = BlockTagRegistry["minecraft:lush_ground_replaceable"] - val BLOCK_SNOW = BlockTagRegistry["minecraft:snow"] - val BLOCK_MUSHROOM_GROW_BLOCK = BlockTagRegistry["minecraft:mushroom_grow_block"] - val BLOCK_CROPS = BlockTagRegistry["minecraft:crops"] - val BLOCK_MANGROVE_LOGS = BlockTagRegistry["minecraft:mangrove_logs"] - val BLOCK_SWORD_EFFICIENT = BlockTagRegistry["minecraft:sword_efficient"] - val BLOCK_STONE_BRICKS = BlockTagRegistry["minecraft:stone_bricks"] - val BLOCK_MINEABLE_AXE = BlockTagRegistry["minecraft:mineable/axe"] - val BLOCK_BEACON_BASE_BLOCKS = BlockTagRegistry["minecraft:beacon_base_blocks"] - val BLOCK_EMERALD_ORES = BlockTagRegistry["minecraft:emerald_ores"] - val BLOCK_SOUL_SPEED_BLOCKS = BlockTagRegistry["minecraft:soul_speed_blocks"] - val BLOCK_VALID_SPAWN = BlockTagRegistry["minecraft:valid_spawn"] - val BLOCK_ENDERMAN_HOLDABLE = BlockTagRegistry["minecraft:enderman_holdable"] - val BLOCK_PALE_OAK_LOGS = BlockTagRegistry["minecraft:pale_oak_logs"] - val BLOCK_REPLACEABLE = BlockTagRegistry["minecraft:replaceable"] - val BLOCK_MOB_INTERACTABLE_DOORS = BlockTagRegistry["minecraft:mob_interactable_doors"] - val BLOCK_SAND = BlockTagRegistry["minecraft:sand"] - val BLOCK_INFINIBURN_OVERWORLD = BlockTagRegistry["minecraft:infiniburn_overworld"] - val BLOCK_STONE_ORE_REPLACEABLES = BlockTagRegistry["minecraft:stone_ore_replaceables"] - val BLOCK_DRAGON_IMMUNE = BlockTagRegistry["minecraft:dragon_immune"] - val BLOCK_FEATURES_CANNOT_REPLACE = BlockTagRegistry["minecraft:features_cannot_replace"] - val BLOCK_DRAGON_TRANSPARENT = BlockTagRegistry["minecraft:dragon_transparent"] - val BLOCK_LOGS = BlockTagRegistry["minecraft:logs"] - val BLOCK_MANGROVE_LOGS_CAN_GROW_THROUGH = BlockTagRegistry["minecraft:mangrove_logs_can_grow_through"] - val BLOCK_DEEPSLATE_ORE_REPLACEABLES = BlockTagRegistry["minecraft:deepslate_ore_replaceables"] - val BLOCK_VIBRATION_RESONATORS = BlockTagRegistry["minecraft:vibration_resonators"] - val BLOCK_WART_BLOCKS = BlockTagRegistry["minecraft:wart_blocks"] - val BLOCK_INCORRECT_FOR_WOODEN_TOOL = BlockTagRegistry["minecraft:incorrect_for_wooden_tool"] - val BLOCK_BATS_SPAWNABLE_ON = BlockTagRegistry["minecraft:bats_spawnable_on"] - val BLOCK_LEAVES = BlockTagRegistry["minecraft:leaves"] - val BLOCK_BEEHIVES = BlockTagRegistry["minecraft:beehives"] - val BLOCK_LAPIS_ORES = BlockTagRegistry["minecraft:lapis_ores"] - val BLOCK_SNIFFER_EGG_HATCH_BOOST = BlockTagRegistry["minecraft:sniffer_egg_hatch_boost"] - val BLOCK_AZALEA_GROWS_ON = BlockTagRegistry["minecraft:azalea_grows_on"] - val BLOCK_WOODEN_BUTTONS = BlockTagRegistry["minecraft:wooden_buttons"] - val BLOCK_DOORS = BlockTagRegistry["minecraft:doors"] - val BLOCK_CONVERTABLE_TO_MUD = BlockTagRegistry["minecraft:convertable_to_mud"] + val BLOCK_SOUL_FIRE_BASE_BLOCKS = BlockTagRegistry["minecraft:soul_fire_base_blocks"] val BLOCK_REPLACEABLE_BY_TREES = BlockTagRegistry["minecraft:replaceable_by_trees"] - val BLOCK_CORAL_BLOCKS = BlockTagRegistry["minecraft:coral_blocks"] - val BLOCK_FLOWER_POTS = BlockTagRegistry["minecraft:flower_pots"] - val BLOCK_COMPLETES_FIND_TREE_TUTORIAL = BlockTagRegistry["minecraft:completes_find_tree_tutorial"] - val BLOCK_DIRT = BlockTagRegistry["minecraft:dirt"] - val BLOCK_STAIRS = BlockTagRegistry["minecraft:stairs"] - val BLOCK_STANDING_SIGNS = BlockTagRegistry["minecraft:standing_signs"] + val BLOCK_WART_BLOCKS = BlockTagRegistry["minecraft:wart_blocks"] + val BLOCK_ACACIA_LOGS = BlockTagRegistry["minecraft:acacia_logs"] + val BLOCK_COMBINATION_STEP_SOUND_BLOCKS = BlockTagRegistry["minecraft:combination_step_sound_blocks"] + val BLOCK_BARS = BlockTagRegistry["minecraft:bars"] + val BLOCK_LAVA_POOL_STONE_CANNOT_REPLACE = BlockTagRegistry["minecraft:lava_pool_stone_cannot_replace"] + val BLOCK_SIGNS = BlockTagRegistry["minecraft:signs"] val BLOCK_SMELTS_TO_GLASS = BlockTagRegistry["minecraft:smelts_to_glass"] - val BLOCK_WOODEN_TRAPDOORS = BlockTagRegistry["minecraft:wooden_trapdoors"] - val BLOCK_SHULKER_BOXES = BlockTagRegistry["minecraft:shulker_boxes"] - val BLOCK_BASE_STONE_OVERWORLD = BlockTagRegistry["minecraft:base_stone_overworld"] - val BLOCK_STONE_PRESSURE_PLATES = BlockTagRegistry["minecraft:stone_pressure_plates"] - val BLOCK_UNSTABLE_BOTTOM_CENTER = BlockTagRegistry["minecraft:unstable_bottom_center"] - val BLOCK_PRESSURE_PLATES = BlockTagRegistry["minecraft:pressure_plates"] - val ENTITY_TYPE_SENSITIVE_TO_IMPALING = EntityTypeTagRegistry["minecraft:sensitive_to_impaling"] - val ENTITY_TYPE_FREEZE_HURTS_EXTRA_TYPES = EntityTypeTagRegistry["minecraft:freeze_hurts_extra_types"] - val ENTITY_TYPE_POWDER_SNOW_WALKABLE_MOBS = EntityTypeTagRegistry["minecraft:powder_snow_walkable_mobs"] - val ENTITY_TYPE_FREEZE_IMMUNE_ENTITY_TYPES = EntityTypeTagRegistry["minecraft:freeze_immune_entity_types"] + val BLOCK_LANTERNS = BlockTagRegistry["minecraft:lanterns"] + val BLOCK_SNIFFER_DIGGABLE_BLOCK = BlockTagRegistry["minecraft:sniffer_diggable_block"] + val BLOCK_VALID_SPAWN = BlockTagRegistry["minecraft:valid_spawn"] + val BLOCK_LOGS = BlockTagRegistry["minecraft:logs"] + val BLOCK_BASE_STONE_NETHER = BlockTagRegistry["minecraft:base_stone_nether"] + val BLOCK_INFINIBURN_END = BlockTagRegistry["minecraft:infiniburn_end"] + val BLOCK_CAMPFIRES = BlockTagRegistry["minecraft:campfires"] + val BLOCK_INCORRECT_FOR_GOLD_TOOL = BlockTagRegistry["minecraft:incorrect_for_gold_tool"] + val BLOCK_BIRCH_LOGS = BlockTagRegistry["minecraft:birch_logs"] + val BLOCK_CEILING_HANGING_SIGNS = BlockTagRegistry["minecraft:ceiling_hanging_signs"] + val BLOCK_BAMBOO_BLOCKS = BlockTagRegistry["minecraft:bamboo_blocks"] val ENTITY_TYPE_CAN_WEAR_HORSE_ARMOR = EntityTypeTagRegistry["minecraft:can_wear_horse_armor"] + val ENTITY_TYPE_CAN_EQUIP_HARNESS = EntityTypeTagRegistry["minecraft:can_equip_harness"] val ENTITY_TYPE_FALL_DAMAGE_IMMUNE = EntityTypeTagRegistry["minecraft:fall_damage_immune"] - val ENTITY_TYPE_ARROWS = EntityTypeTagRegistry["minecraft:arrows"] - val ENTITY_TYPE_REDIRECTABLE_PROJECTILE = EntityTypeTagRegistry["minecraft:redirectable_projectile"] - val ENTITY_TYPE_FOLLOWABLE_FRIENDLY_MOBS = EntityTypeTagRegistry["minecraft:followable_friendly_mobs"] - val ENTITY_TYPE_SKELETONS = EntityTypeTagRegistry["minecraft:skeletons"] - val ENTITY_TYPE_ARTHROPOD = EntityTypeTagRegistry["minecraft:arthropod"] - val ENTITY_TYPE_IMMUNE_TO_INFESTED = EntityTypeTagRegistry["minecraft:immune_to_infested"] + val ENTITY_TYPE_ACCEPTS_IRON_GOLEM_GIFT = EntityTypeTagRegistry["minecraft:accepts_iron_golem_gift"] val ENTITY_TYPE_IGNORES_POISON_AND_REGEN = EntityTypeTagRegistry["minecraft:ignores_poison_and_regen"] + val ENTITY_TYPE_SENSITIVE_TO_IMPALING = EntityTypeTagRegistry["minecraft:sensitive_to_impaling"] + val ENTITY_TYPE_IMMUNE_TO_OOZING = EntityTypeTagRegistry["minecraft:immune_to_oozing"] + val ENTITY_TYPE_FROG_FOOD = EntityTypeTagRegistry["minecraft:frog_food"] + val ENTITY_TYPE_RAIDERS = EntityTypeTagRegistry["minecraft:raiders"] + val ENTITY_TYPE_REDIRECTABLE_PROJECTILE = EntityTypeTagRegistry["minecraft:redirectable_projectile"] + val ENTITY_TYPE_FREEZE_IMMUNE_ENTITY_TYPES = EntityTypeTagRegistry["minecraft:freeze_immune_entity_types"] + val ENTITY_TYPE_NON_CONTROLLING_RIDER = EntityTypeTagRegistry["minecraft:non_controlling_rider"] val ENTITY_TYPE_CAN_EQUIP_SADDLE = EntityTypeTagRegistry["minecraft:can_equip_saddle"] + val ENTITY_TYPE_CAN_TURN_IN_BOATS = EntityTypeTagRegistry["minecraft:can_turn_in_boats"] + val ENTITY_TYPE_IMPACT_PROJECTILES = EntityTypeTagRegistry["minecraft:impact_projectiles"] + val ENTITY_TYPE_FREEZE_HURTS_EXTRA_TYPES = EntityTypeTagRegistry["minecraft:freeze_hurts_extra_types"] + val ENTITY_TYPE_CANDIDATE_FOR_IRON_GOLEM_GIFT = EntityTypeTagRegistry["minecraft:candidate_for_iron_golem_gift"] + val ENTITY_TYPE_ARTHROPOD = EntityTypeTagRegistry["minecraft:arthropod"] + val ENTITY_TYPE_POWDER_SNOW_WALKABLE_MOBS = EntityTypeTagRegistry["minecraft:powder_snow_walkable_mobs"] + val ENTITY_TYPE_DEFLECTS_PROJECTILES = EntityTypeTagRegistry["minecraft:deflects_projectiles"] + val ENTITY_TYPE_CANNOT_BE_PUSHED_ONTO_BOATS = EntityTypeTagRegistry["minecraft:cannot_be_pushed_onto_boats"] + val ENTITY_TYPE_AXOLOTL_HUNT_TARGETS = EntityTypeTagRegistry["minecraft:axolotl_hunt_targets"] + val ENTITY_TYPE_UNDEAD = EntityTypeTagRegistry["minecraft:undead"] + val ENTITY_TYPE_NOT_SCARY_FOR_PUFFERFISH = EntityTypeTagRegistry["minecraft:not_scary_for_pufferfish"] val ENTITY_TYPE_AQUATIC = EntityTypeTagRegistry["minecraft:aquatic"] - val ENTITY_TYPE_ZOMBIES = EntityTypeTagRegistry["minecraft:zombies"] + val ENTITY_TYPE_SENSITIVE_TO_BANE_OF_ARTHROPODS = EntityTypeTagRegistry["minecraft:sensitive_to_bane_of_arthropods"] + val ENTITY_TYPE_BOAT = EntityTypeTagRegistry["minecraft:boat"] + val ENTITY_TYPE_IMMUNE_TO_INFESTED = EntityTypeTagRegistry["minecraft:immune_to_infested"] + val ENTITY_TYPE_CAN_BREATHE_UNDER_WATER = EntityTypeTagRegistry["minecraft:can_breathe_under_water"] + val ENTITY_TYPE_BEEHIVE_INHABITORS = EntityTypeTagRegistry["minecraft:beehive_inhabitors"] val ENTITY_TYPE_ILLAGER_FRIENDS = EntityTypeTagRegistry["minecraft:illager_friends"] + val ENTITY_TYPE_SENSITIVE_TO_SMITE = EntityTypeTagRegistry["minecraft:sensitive_to_smite"] val ENTITY_TYPE_INVERTED_HEALING_AND_HARM = EntityTypeTagRegistry["minecraft:inverted_healing_and_harm"] - val ENTITY_TYPE_UNDEAD = EntityTypeTagRegistry["minecraft:undead"] - val ENTITY_TYPE_AXOLOTL_ALWAYS_HOSTILES = EntityTypeTagRegistry["minecraft:axolotl_always_hostiles"] - val ENTITY_TYPE_BOAT = EntityTypeTagRegistry["minecraft:boat"] - val ENTITY_TYPE_IMPACT_PROJECTILES = EntityTypeTagRegistry["minecraft:impact_projectiles"] - val ENTITY_TYPE_SENSITIVE_TO_BANE_OF_ARTHROPODS = EntityTypeTagRegistry["minecraft:sensitive_to_bane_of_arthropods"] - val ENTITY_TYPE_FROG_FOOD = EntityTypeTagRegistry["minecraft:frog_food"] - val ENTITY_TYPE_NON_CONTROLLING_RIDER = EntityTypeTagRegistry["minecraft:non_controlling_rider"] - val ENTITY_TYPE_WITHER_FRIENDS = EntityTypeTagRegistry["minecraft:wither_friends"] val ENTITY_TYPE_ILLAGER = EntityTypeTagRegistry["minecraft:illager"] - val ENTITY_TYPE_DEFLECTS_PROJECTILES = EntityTypeTagRegistry["minecraft:deflects_projectiles"] - val ENTITY_TYPE_CAN_TURN_IN_BOATS = EntityTypeTagRegistry["minecraft:can_turn_in_boats"] - val ENTITY_TYPE_NO_ANGER_FROM_WIND_CHARGE = EntityTypeTagRegistry["minecraft:no_anger_from_wind_charge"] - val ENTITY_TYPE_BEEHIVE_INHABITORS = EntityTypeTagRegistry["minecraft:beehive_inhabitors"] + val ENTITY_TYPE_SKELETONS = EntityTypeTagRegistry["minecraft:skeletons"] + val ENTITY_TYPE_FOLLOWABLE_FRIENDLY_MOBS = EntityTypeTagRegistry["minecraft:followable_friendly_mobs"] + val ENTITY_TYPE_WITHER_FRIENDS = EntityTypeTagRegistry["minecraft:wither_friends"] val ENTITY_TYPE_DISMOUNTS_UNDERWATER = EntityTypeTagRegistry["minecraft:dismounts_underwater"] - val ENTITY_TYPE_SENSITIVE_TO_SMITE = EntityTypeTagRegistry["minecraft:sensitive_to_smite"] - val ENTITY_TYPE_IMMUNE_TO_OOZING = EntityTypeTagRegistry["minecraft:immune_to_oozing"] - val ENTITY_TYPE_NOT_SCARY_FOR_PUFFERFISH = EntityTypeTagRegistry["minecraft:not_scary_for_pufferfish"] - val ENTITY_TYPE_RAIDERS = EntityTypeTagRegistry["minecraft:raiders"] - val ENTITY_TYPE_CAN_BREATHE_UNDER_WATER = EntityTypeTagRegistry["minecraft:can_breathe_under_water"] - val ENTITY_TYPE_AXOLOTL_HUNT_TARGETS = EntityTypeTagRegistry["minecraft:axolotl_hunt_targets"] - val ENTITY_TYPE_CAN_EQUIP_HARNESS = EntityTypeTagRegistry["minecraft:can_equip_harness"] - val FLUID_WATER = FluidTagRegistry["minecraft:water"] + val ENTITY_TYPE_NO_ANGER_FROM_WIND_CHARGE = EntityTypeTagRegistry["minecraft:no_anger_from_wind_charge"] + val ENTITY_TYPE_ARROWS = EntityTypeTagRegistry["minecraft:arrows"] + val ENTITY_TYPE_ZOMBIES = EntityTypeTagRegistry["minecraft:zombies"] + val ENTITY_TYPE_AXOLOTL_ALWAYS_HOSTILES = EntityTypeTagRegistry["minecraft:axolotl_always_hostiles"] val FLUID_LAVA = FluidTagRegistry["minecraft:lava"] - val ITEM_ENCHANTABLE_MINING = ItemTagRegistry["minecraft:enchantable/mining"] - val ITEM_REPAIRS_IRON_ARMOR = ItemTagRegistry["minecraft:repairs_iron_armor"] - val ITEM_CREEPER_DROP_MUSIC_DISCS = ItemTagRegistry["minecraft:creeper_drop_music_discs"] - val ITEM_COMPASSES = ItemTagRegistry["minecraft:compasses"] - val ITEM_JUNGLE_LOGS = ItemTagRegistry["minecraft:jungle_logs"] - val ITEM_SMELTS_TO_GLASS = ItemTagRegistry["minecraft:smelts_to_glass"] - val ITEM_BREAKS_DECORATED_POTS = ItemTagRegistry["minecraft:breaks_decorated_pots"] - val ITEM_FISHES = ItemTagRegistry["minecraft:fishes"] - val ITEM_REPAIRS_LEATHER_ARMOR = ItemTagRegistry["minecraft:repairs_leather_armor"] - val ITEM_IRON_ORES = ItemTagRegistry["minecraft:iron_ores"] - val ITEM_TRIM_MATERIALS = ItemTagRegistry["minecraft:trim_materials"] - val ITEM_REPAIRS_DIAMOND_ARMOR = ItemTagRegistry["minecraft:repairs_diamond_armor"] - val ITEM_WITHER_SKELETON_DISLIKED_WEAPONS = ItemTagRegistry["minecraft:wither_skeleton_disliked_weapons"] - val ITEM_MANGROVE_LOGS = ItemTagRegistry["minecraft:mangrove_logs"] - val ITEM_STONE_TOOL_MATERIALS = ItemTagRegistry["minecraft:stone_tool_materials"] - val ITEM_PLANKS = ItemTagRegistry["minecraft:planks"] - val ITEM_ENCHANTABLE_WEAPON = ItemTagRegistry["minecraft:enchantable/weapon"] - val ITEM_REPAIRS_WOLF_ARMOR = ItemTagRegistry["minecraft:repairs_wolf_armor"] - val ITEM_CAT_FOOD = ItemTagRegistry["minecraft:cat_food"] - val ITEM_DECORATED_POT_SHERDS = ItemTagRegistry["minecraft:decorated_pot_sherds"] - val ITEM_CLUSTER_MAX_HARVESTABLES = ItemTagRegistry["minecraft:cluster_max_harvestables"] - val ITEM_IRON_TOOL_MATERIALS = ItemTagRegistry["minecraft:iron_tool_materials"] - val ITEM_LLAMA_FOOD = ItemTagRegistry["minecraft:llama_food"] - val ITEM_ENCHANTABLE_FOOT_ARMOR = ItemTagRegistry["minecraft:enchantable/foot_armor"] - val ITEM_BOOK_CLONING_TARGET = ItemTagRegistry["minecraft:book_cloning_target"] - val ITEM_RABBIT_FOOD = ItemTagRegistry["minecraft:rabbit_food"] - val ITEM_CHEST_ARMOR = ItemTagRegistry["minecraft:chest_armor"] - val ITEM_ENCHANTABLE_TRIDENT = ItemTagRegistry["minecraft:enchantable/trident"] - val ITEM_ENCHANTABLE_MINING_LOOT = ItemTagRegistry["minecraft:enchantable/mining_loot"] + val FLUID_WATER = FluidTagRegistry["minecraft:water"] + val ITEM_WOODEN_TRAPDOORS = ItemTagRegistry["minecraft:wooden_trapdoors"] + val ITEM_FREEZE_IMMUNE_WEARABLES = ItemTagRegistry["minecraft:freeze_immune_wearables"] + val ITEM_LLAMA_TEMPT_ITEMS = ItemTagRegistry["minecraft:llama_tempt_items"] + val ITEM_FURNACE_MINECART_FUEL = ItemTagRegistry["minecraft:furnace_minecart_fuel"] val ITEM_DAMPENS_VIBRATIONS = ItemTagRegistry["minecraft:dampens_vibrations"] - val ITEM_NETHERITE_TOOL_MATERIALS = ItemTagRegistry["minecraft:netherite_tool_materials"] - val ITEM_BUNDLES = ItemTagRegistry["minecraft:bundles"] - val ITEM_PARROT_POISONOUS_FOOD = ItemTagRegistry["minecraft:parrot_poisonous_food"] - val ITEM_SHOVELS = ItemTagRegistry["minecraft:shovels"] - val ITEM_CHICKEN_FOOD = ItemTagRegistry["minecraft:chicken_food"] + val ITEM_BOATS = ItemTagRegistry["minecraft:boats"] + val ITEM_LANTERNS = ItemTagRegistry["minecraft:lanterns"] + val ITEM_CHERRY_LOGS = ItemTagRegistry["minecraft:cherry_logs"] + val ITEM_WOOL_CARPETS = ItemTagRegistry["minecraft:wool_carpets"] + val ITEM_ENCHANTABLE_TRIDENT = ItemTagRegistry["minecraft:enchantable/trident"] + val ITEM_LLAMA_FOOD = ItemTagRegistry["minecraft:llama_food"] val ITEM_REPAIRS_TURTLE_HELMET = ItemTagRegistry["minecraft:repairs_turtle_helmet"] - val ITEM_MEAT = ItemTagRegistry["minecraft:meat"] - val ITEM_REDSTONE_ORES = ItemTagRegistry["minecraft:redstone_ores"] - val ITEM_DROWNED_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:drowned_preferred_weapons"] - val ITEM_LEG_ARMOR = ItemTagRegistry["minecraft:leg_armor"] - val ITEM_HOES = ItemTagRegistry["minecraft:hoes"] - val ITEM_COPPER_ORES = ItemTagRegistry["minecraft:copper_ores"] - val ITEM_WARPED_STEMS = ItemTagRegistry["minecraft:warped_stems"] - val ITEM_AXOLOTL_FOOD = ItemTagRegistry["minecraft:axolotl_food"] - val ITEM_GOLD_ORES = ItemTagRegistry["minecraft:gold_ores"] - val ITEM_PICKAXES = ItemTagRegistry["minecraft:pickaxes"] - val ITEM_ENCHANTABLE_FIRE_ASPECT = ItemTagRegistry["minecraft:enchantable/fire_aspect"] - val ITEM_REPAIRS_CHAIN_ARMOR = ItemTagRegistry["minecraft:repairs_chain_armor"] + val ITEM_SHOVELS = ItemTagRegistry["minecraft:shovels"] + val ITEM_ENCHANTABLE_FISHING = ItemTagRegistry["minecraft:enchantable/fishing"] + val ITEM_WOOL = ItemTagRegistry["minecraft:wool"] + val ITEM_MAP_INVISIBILITY_EQUIPMENT = ItemTagRegistry["minecraft:map_invisibility_equipment"] + val ITEM_SIGNS = ItemTagRegistry["minecraft:signs"] val ITEM_WOLF_FOOD = ItemTagRegistry["minecraft:wolf_food"] - val ITEM_LLAMA_TEMPT_ITEMS = ItemTagRegistry["minecraft:llama_tempt_items"] - val ITEM_PANDA_EATS_FROM_GROUND = ItemTagRegistry["minecraft:panda_eats_from_ground"] - val ITEM_BUTTONS = ItemTagRegistry["minecraft:buttons"] - val ITEM_ENCHANTABLE_DURABILITY = ItemTagRegistry["minecraft:enchantable/durability"] - val ITEM_DIRT = ItemTagRegistry["minecraft:dirt"] - val ITEM_SWORDS = ItemTagRegistry["minecraft:swords"] - val ITEM_VILLAGER_PLANTABLE_SEEDS = ItemTagRegistry["minecraft:villager_plantable_seeds"] - val ITEM_WOODEN_SLABS = ItemTagRegistry["minecraft:wooden_slabs"] - val ITEM_DIAMOND_TOOL_MATERIALS = ItemTagRegistry["minecraft:diamond_tool_materials"] + val ITEM_WOODEN_PRESSURE_PLATES = ItemTagRegistry["minecraft:wooden_pressure_plates"] + val ITEM_ENCHANTABLE_WEAPON = ItemTagRegistry["minecraft:enchantable/weapon"] + val ITEM_CREEPER_DROP_MUSIC_DISCS = ItemTagRegistry["minecraft:creeper_drop_music_discs"] + val ITEM_ARMADILLO_FOOD = ItemTagRegistry["minecraft:armadillo_food"] val ITEM_BIRCH_LOGS = ItemTagRegistry["minecraft:birch_logs"] - val ITEM_HAPPY_GHAST_FOOD = ItemTagRegistry["minecraft:happy_ghast_food"] - val ITEM_FURNACE_MINECART_FUEL = ItemTagRegistry["minecraft:furnace_minecart_fuel"] + val ITEM_LOGS_THAT_BURN = ItemTagRegistry["minecraft:logs_that_burn"] val ITEM_SHEEP_FOOD = ItemTagRegistry["minecraft:sheep_food"] - val ITEM_PIG_FOOD = ItemTagRegistry["minecraft:pig_food"] + val ITEM_CANDLES = ItemTagRegistry["minecraft:candles"] + val ITEM_HEAD_ARMOR = ItemTagRegistry["minecraft:head_armor"] val ITEM_STONE_CRAFTING_MATERIALS = ItemTagRegistry["minecraft:stone_crafting_materials"] - val ITEM_EGGS = ItemTagRegistry["minecraft:eggs"] - val ITEM_TERRACOTTA = ItemTagRegistry["minecraft:terracotta"] + val ITEM_CHICKEN_FOOD = ItemTagRegistry["minecraft:chicken_food"] + val ITEM_TRIMMABLE_ARMOR = ItemTagRegistry["minecraft:trimmable_armor"] + val ITEM_NETHERITE_TOOL_MATERIALS = ItemTagRegistry["minecraft:netherite_tool_materials"] + val ITEM_SNIFFER_FOOD = ItemTagRegistry["minecraft:sniffer_food"] + val ITEM_BAMBOO_BLOCKS = ItemTagRegistry["minecraft:bamboo_blocks"] + val ITEM_STRIDER_TEMPT_ITEMS = ItemTagRegistry["minecraft:strider_tempt_items"] + val ITEM_LEG_ARMOR = ItemTagRegistry["minecraft:leg_armor"] + val ITEM_SWORDS = ItemTagRegistry["minecraft:swords"] + val ITEM_DIAMOND_TOOL_MATERIALS = ItemTagRegistry["minecraft:diamond_tool_materials"] + val ITEM_COPPER_GOLEM_STATUES = ItemTagRegistry["minecraft:copper_golem_statues"] + val ITEM_REPAIRS_DIAMOND_ARMOR = ItemTagRegistry["minecraft:repairs_diamond_armor"] + val ITEM_ENCHANTABLE_MINING_LOOT = ItemTagRegistry["minecraft:enchantable/mining_loot"] + val ITEM_LAPIS_ORES = ItemTagRegistry["minecraft:lapis_ores"] + val ITEM_IRON_TOOL_MATERIALS = ItemTagRegistry["minecraft:iron_tool_materials"] + val ITEM_REPAIRS_CHAIN_ARMOR = ItemTagRegistry["minecraft:repairs_chain_armor"] val ITEM_CRIMSON_STEMS = ItemTagRegistry["minecraft:crimson_stems"] - val ITEM_IGNORED_BY_PIGLIN_BABIES = ItemTagRegistry["minecraft:ignored_by_piglin_babies"] + val ITEM_EGGS = ItemTagRegistry["minecraft:eggs"] + val ITEM_WOODEN_SHELVES = ItemTagRegistry["minecraft:wooden_shelves"] + val ITEM_LEAVES = ItemTagRegistry["minecraft:leaves"] + val ITEM_BANNERS = ItemTagRegistry["minecraft:banners"] val ITEM_ANVIL = ItemTagRegistry["minecraft:anvil"] - val ITEM_FENCES = ItemTagRegistry["minecraft:fences"] - val ITEM_PIGLIN_SAFE_ARMOR = ItemTagRegistry["minecraft:piglin_safe_armor"] - val ITEM_GOLD_TOOL_MATERIALS = ItemTagRegistry["minecraft:gold_tool_materials"] - val ITEM_ENCHANTABLE_CHEST_ARMOR = ItemTagRegistry["minecraft:enchantable/chest_armor"] - val ITEM_STAIRS = ItemTagRegistry["minecraft:stairs"] - val ITEM_COALS = ItemTagRegistry["minecraft:coals"] - val ITEM_FOOT_ARMOR = ItemTagRegistry["minecraft:foot_armor"] - val ITEM_SAPLINGS = ItemTagRegistry["minecraft:saplings"] - val ITEM_ENCHANTABLE_VANISHING = ItemTagRegistry["minecraft:enchantable/vanishing"] + val ITEM_WOODEN_SLABS = ItemTagRegistry["minecraft:wooden_slabs"] val ITEM_CHEST_BOATS = ItemTagRegistry["minecraft:chest_boats"] - val ITEM_LOGS = ItemTagRegistry["minecraft:logs"] - val ITEM_DIAMOND_ORES = ItemTagRegistry["minecraft:diamond_ores"] - val ITEM_WOOL = ItemTagRegistry["minecraft:wool"] + val ITEM_NOTEBLOCK_TOP_INSTRUMENTS = ItemTagRegistry["minecraft:noteblock_top_instruments"] + val ITEM_PILLAGER_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:pillager_preferred_weapons"] + val ITEM_SKULLS = ItemTagRegistry["minecraft:skulls"] + val ITEM_STAIRS = ItemTagRegistry["minecraft:stairs"] + val ITEM_BARS = ItemTagRegistry["minecraft:bars"] + val ITEM_WOODEN_TOOL_MATERIALS = ItemTagRegistry["minecraft:wooden_tool_materials"] + val ITEM_ENCHANTABLE_SWORD = ItemTagRegistry["minecraft:enchantable/sword"] val ITEM_FOX_FOOD = ItemTagRegistry["minecraft:fox_food"] - val ITEM_WOODEN_FENCES = ItemTagRegistry["minecraft:wooden_fences"] + val ITEM_STONE_TOOL_MATERIALS = ItemTagRegistry["minecraft:stone_tool_materials"] + val ITEM_DUPLICATES_ALLAYS = ItemTagRegistry["minecraft:duplicates_allays"] + val ITEM_REPAIRS_IRON_ARMOR = ItemTagRegistry["minecraft:repairs_iron_armor"] + val ITEM_IRON_ORES = ItemTagRegistry["minecraft:iron_ores"] + val ITEM_DECORATED_POT_INGREDIENTS = ItemTagRegistry["minecraft:decorated_pot_ingredients"] + val ITEM_DROWNED_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:drowned_preferred_weapons"] val ITEM_WOODEN_STAIRS = ItemTagRegistry["minecraft:wooden_stairs"] - val ITEM_BOATS = ItemTagRegistry["minecraft:boats"] - val ITEM_TRIMMABLE_ARMOR = ItemTagRegistry["minecraft:trimmable_armor"] - val ITEM_WOOL_CARPETS = ItemTagRegistry["minecraft:wool_carpets"] - val ITEM_COAL_ORES = ItemTagRegistry["minecraft:coal_ores"] - val ITEM_HORSE_TEMPT_ITEMS = ItemTagRegistry["minecraft:horse_tempt_items"] - val ITEM_GAZE_DISGUISE_EQUIPMENT = ItemTagRegistry["minecraft:gaze_disguise_equipment"] - val ITEM_REPAIRS_GOLD_ARMOR = ItemTagRegistry["minecraft:repairs_gold_armor"] - val ITEM_SMALL_FLOWERS = ItemTagRegistry["minecraft:small_flowers"] - val ITEM_DOORS = ItemTagRegistry["minecraft:doors"] - val ITEM_PIGLIN_LOVED = ItemTagRegistry["minecraft:piglin_loved"] - val ITEM_STONE_BRICKS = ItemTagRegistry["minecraft:stone_bricks"] - val ITEM_HAPPY_GHAST_TEMPT_ITEMS = ItemTagRegistry["minecraft:happy_ghast_tempt_items"] + val ITEM_WARPED_STEMS = ItemTagRegistry["minecraft:warped_stems"] val ITEM_STRIDER_FOOD = ItemTagRegistry["minecraft:strider_food"] - val ITEM_WART_BLOCKS = ItemTagRegistry["minecraft:wart_blocks"] - val ITEM_WOODEN_PRESSURE_PLATES = ItemTagRegistry["minecraft:wooden_pressure_plates"] - val ITEM_ARMADILLO_FOOD = ItemTagRegistry["minecraft:armadillo_food"] - val ITEM_PIGLIN_FOOD = ItemTagRegistry["minecraft:piglin_food"] - val ITEM_SKELETON_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:skeleton_preferred_weapons"] - val ITEM_DYEABLE = ItemTagRegistry["minecraft:dyeable"] - val ITEM_REPAIRS_NETHERITE_ARMOR = ItemTagRegistry["minecraft:repairs_netherite_armor"] - val ITEM_PILLAGER_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:pillager_preferred_weapons"] - val ITEM_BEDS = ItemTagRegistry["minecraft:beds"] - val ITEM_BREWING_FUEL = ItemTagRegistry["minecraft:brewing_fuel"] - val ITEM_FLOWERS = ItemTagRegistry["minecraft:flowers"] - val ITEM_ENCHANTABLE_SWORD = ItemTagRegistry["minecraft:enchantable/sword"] - val ITEM_FROG_FOOD = ItemTagRegistry["minecraft:frog_food"] - val ITEM_SAND = ItemTagRegistry["minecraft:sand"] - val ITEM_SNIFFER_FOOD = ItemTagRegistry["minecraft:sniffer_food"] - val ITEM_LECTERN_BOOKS = ItemTagRegistry["minecraft:lectern_books"] + val ITEM_COMPASSES = ItemTagRegistry["minecraft:compasses"] + val ITEM_PLANKS = ItemTagRegistry["minecraft:planks"] + val ITEM_SLABS = ItemTagRegistry["minecraft:slabs"] + val ITEM_ENCHANTABLE_ARMOR = ItemTagRegistry["minecraft:enchantable/armor"] + val ITEM_MEAT = ItemTagRegistry["minecraft:meat"] + val ITEM_SPRUCE_LOGS = ItemTagRegistry["minecraft:spruce_logs"] + val ITEM_PARROT_FOOD = ItemTagRegistry["minecraft:parrot_food"] + val ITEM_ENCHANTABLE_CROSSBOW = ItemTagRegistry["minecraft:enchantable/crossbow"] + val ITEM_TRIM_MATERIALS = ItemTagRegistry["minecraft:trim_materials"] val ITEM_PIGLIN_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:piglin_preferred_weapons"] + val ITEM_SAPLINGS = ItemTagRegistry["minecraft:saplings"] + val ITEM_SHULKER_BOXES = ItemTagRegistry["minecraft:shulker_boxes"] + val ITEM_PANDA_EATS_FROM_GROUND = ItemTagRegistry["minecraft:panda_eats_from_ground"] + val ITEM_CHEST_ARMOR = ItemTagRegistry["minecraft:chest_armor"] + val ITEM_ENCHANTABLE_DURABILITY = ItemTagRegistry["minecraft:enchantable/durability"] + val ITEM_EMERALD_ORES = ItemTagRegistry["minecraft:emerald_ores"] + val ITEM_ENCHANTABLE_BOW = ItemTagRegistry["minecraft:enchantable/bow"] + val ITEM_HANGING_SIGNS = ItemTagRegistry["minecraft:hanging_signs"] + val ITEM_BUNDLES = ItemTagRegistry["minecraft:bundles"] + val ITEM_GOLD_ORES = ItemTagRegistry["minecraft:gold_ores"] + val ITEM_OAK_LOGS = ItemTagRegistry["minecraft:oak_logs"] + val ITEM_ENCHANTABLE_SHARP_WEAPON = ItemTagRegistry["minecraft:enchantable/sharp_weapon"] + val ITEM_VILLAGER_PICKS_UP = ItemTagRegistry["minecraft:villager_picks_up"] + val ITEM_FROG_FOOD = ItemTagRegistry["minecraft:frog_food"] val ITEM_OCELOT_FOOD = ItemTagRegistry["minecraft:ocelot_food"] - val ITEM_DUPLICATES_ALLAYS = ItemTagRegistry["minecraft:duplicates_allays"] - val ITEM_RAILS = ItemTagRegistry["minecraft:rails"] + val ITEM_SAND = ItemTagRegistry["minecraft:sand"] + val ITEM_NON_FLAMMABLE_WOOD = ItemTagRegistry["minecraft:non_flammable_wood"] + val ITEM_CAMEL_FOOD = ItemTagRegistry["minecraft:camel_food"] + val ITEM_CAT_FOOD = ItemTagRegistry["minecraft:cat_food"] + val ITEM_BUTTONS = ItemTagRegistry["minecraft:buttons"] + val ITEM_RABBIT_FOOD = ItemTagRegistry["minecraft:rabbit_food"] + val ITEM_FISHES = ItemTagRegistry["minecraft:fishes"] + val ITEM_COPPER_ORES = ItemTagRegistry["minecraft:copper_ores"] + val ITEM_DIRT = ItemTagRegistry["minecraft:dirt"] + val ITEM_TERRACOTTA = ItemTagRegistry["minecraft:terracotta"] + val ITEM_WOODEN_DOORS = ItemTagRegistry["minecraft:wooden_doors"] + val ITEM_REPAIRS_NETHERITE_ARMOR = ItemTagRegistry["minecraft:repairs_netherite_armor"] + val ITEM_PARROT_POISONOUS_FOOD = ItemTagRegistry["minecraft:parrot_poisonous_food"] + val ITEM_PIGLIN_SAFE_ARMOR = ItemTagRegistry["minecraft:piglin_safe_armor"] + val ITEM_ENCHANTABLE_FOOT_ARMOR = ItemTagRegistry["minecraft:enchantable/foot_armor"] + val ITEM_ENCHANTABLE_FIRE_ASPECT = ItemTagRegistry["minecraft:enchantable/fire_aspect"] + val ITEM_BOOK_CLONING_TARGET = ItemTagRegistry["minecraft:book_cloning_target"] + val ITEM_HAPPY_GHAST_TEMPT_ITEMS = ItemTagRegistry["minecraft:happy_ghast_tempt_items"] + val ITEM_WOODEN_BUTTONS = ItemTagRegistry["minecraft:wooden_buttons"] + val ITEM_ENCHANTABLE_VANISHING = ItemTagRegistry["minecraft:enchantable/vanishing"] + val ITEM_BEE_FOOD = ItemTagRegistry["minecraft:bee_food"] val ITEM_FENCE_GATES = ItemTagRegistry["minecraft:fence_gates"] - val ITEM_ENCHANTABLE_CROSSBOW = ItemTagRegistry["minecraft:enchantable/crossbow"] + val ITEM_BEDS = ItemTagRegistry["minecraft:beds"] val ITEM_COW_FOOD = ItemTagRegistry["minecraft:cow_food"] - val ITEM_BAMBOO_BLOCKS = ItemTagRegistry["minecraft:bamboo_blocks"] + val ITEM_DOORS = ItemTagRegistry["minecraft:doors"] val ITEM_ACACIA_LOGS = ItemTagRegistry["minecraft:acacia_logs"] - val ITEM_SHULKER_BOXES = ItemTagRegistry["minecraft:shulker_boxes"] - val ITEM_FREEZE_IMMUNE_WEARABLES = ItemTagRegistry["minecraft:freeze_immune_wearables"] - val ITEM_ENCHANTABLE_SHARP_WEAPON = ItemTagRegistry["minecraft:enchantable/sharp_weapon"] - val ITEM_WOODEN_TOOL_MATERIALS = ItemTagRegistry["minecraft:wooden_tool_materials"] - val ITEM_LEAVES = ItemTagRegistry["minecraft:leaves"] - val ITEM_HOGLIN_FOOD = ItemTagRegistry["minecraft:hoglin_food"] - val ITEM_PARROT_FOOD = ItemTagRegistry["minecraft:parrot_food"] - val ITEM_DECORATED_POT_INGREDIENTS = ItemTagRegistry["minecraft:decorated_pot_ingredients"] - val ITEM_PALE_OAK_LOGS = ItemTagRegistry["minecraft:pale_oak_logs"] - val ITEM_BEE_FOOD = ItemTagRegistry["minecraft:bee_food"] - val ITEM_CREEPER_IGNITERS = ItemTagRegistry["minecraft:creeper_igniters"] - val ITEM_NON_FLAMMABLE_WOOD = ItemTagRegistry["minecraft:non_flammable_wood"] - val ITEM_HANGING_SIGNS = ItemTagRegistry["minecraft:hanging_signs"] - val ITEM_ENCHANTABLE_HEAD_ARMOR = ItemTagRegistry["minecraft:enchantable/head_armor"] - val ITEM_ARROWS = ItemTagRegistry["minecraft:arrows"] + val ITEM_SOUL_FIRE_BASE_BLOCKS = ItemTagRegistry["minecraft:soul_fire_base_blocks"] val ITEM_HARNESSES = ItemTagRegistry["minecraft:harnesses"] - val ITEM_NOTEBLOCK_TOP_INSTRUMENTS = ItemTagRegistry["minecraft:noteblock_top_instruments"] - val ITEM_ENCHANTABLE_MACE = ItemTagRegistry["minecraft:enchantable/mace"] - val ITEM_GOAT_FOOD = ItemTagRegistry["minecraft:goat_food"] - val ITEM_ENCHANTABLE_FISHING = ItemTagRegistry["minecraft:enchantable/fishing"] - val ITEM_LAPIS_ORES = ItemTagRegistry["minecraft:lapis_ores"] - val ITEM_BANNERS = ItemTagRegistry["minecraft:banners"] - val ITEM_WALLS = ItemTagRegistry["minecraft:walls"] - val ITEM_WOODEN_TRAPDOORS = ItemTagRegistry["minecraft:wooden_trapdoors"] - val ITEM_VILLAGER_PICKS_UP = ItemTagRegistry["minecraft:villager_picks_up"] val ITEM_BEACON_PAYMENT_ITEMS = ItemTagRegistry["minecraft:beacon_payment_items"] - val ITEM_TURTLE_FOOD = ItemTagRegistry["minecraft:turtle_food"] + val ITEM_COPPER = ItemTagRegistry["minecraft:copper"] + val ITEM_BOOKSHELF_BOOKS = ItemTagRegistry["minecraft:bookshelf_books"] + val ITEM_LECTERN_BOOKS = ItemTagRegistry["minecraft:lectern_books"] + val ITEM_TRAPDOORS = ItemTagRegistry["minecraft:trapdoors"] + val ITEM_PIGLIN_REPELLENTS = ItemTagRegistry["minecraft:piglin_repellents"] + val ITEM_VILLAGER_PLANTABLE_SEEDS = ItemTagRegistry["minecraft:villager_plantable_seeds"] + val ITEM_GOLD_TOOL_MATERIALS = ItemTagRegistry["minecraft:gold_tool_materials"] + val ITEM_LOGS = ItemTagRegistry["minecraft:logs"] + val ITEM_COPPER_TOOL_MATERIALS = ItemTagRegistry["minecraft:copper_tool_materials"] + val ITEM_HORSE_TEMPT_ITEMS = ItemTagRegistry["minecraft:horse_tempt_items"] + val ITEM_FENCES = ItemTagRegistry["minecraft:fences"] + val ITEM_PIGLIN_LOVED = ItemTagRegistry["minecraft:piglin_loved"] + val ITEM_ENCHANTABLE_HEAD_ARMOR = ItemTagRegistry["minecraft:enchantable/head_armor"] + val ITEM_BREAKS_DECORATED_POTS = ItemTagRegistry["minecraft:breaks_decorated_pots"] + val ITEM_REPAIRS_WOLF_ARMOR = ItemTagRegistry["minecraft:repairs_wolf_armor"] + val ITEM_SMALL_FLOWERS = ItemTagRegistry["minecraft:small_flowers"] + val ITEM_REPAIRS_LEATHER_ARMOR = ItemTagRegistry["minecraft:repairs_leather_armor"] + val ITEM_RAILS = ItemTagRegistry["minecraft:rails"] val ITEM_PANDA_FOOD = ItemTagRegistry["minecraft:panda_food"] - val ITEM_SLABS = ItemTagRegistry["minecraft:slabs"] - val ITEM_CHERRY_LOGS = ItemTagRegistry["minecraft:cherry_logs"] - val ITEM_ENCHANTABLE_LEG_ARMOR = ItemTagRegistry["minecraft:enchantable/leg_armor"] + val ITEM_DIAMOND_ORES = ItemTagRegistry["minecraft:diamond_ores"] + val ITEM_WOODEN_FENCES = ItemTagRegistry["minecraft:wooden_fences"] + val ITEM_COALS = ItemTagRegistry["minecraft:coals"] + val ITEM_WART_BLOCKS = ItemTagRegistry["minecraft:wart_blocks"] + val ITEM_REDSTONE_ORES = ItemTagRegistry["minecraft:redstone_ores"] val ITEM_HORSE_FOOD = ItemTagRegistry["minecraft:horse_food"] - val ITEM_SKULLS = ItemTagRegistry["minecraft:skulls"] - val ITEM_CAMEL_FOOD = ItemTagRegistry["minecraft:camel_food"] - val ITEM_WOODEN_BUTTONS = ItemTagRegistry["minecraft:wooden_buttons"] - val ITEM_WOODEN_DOORS = ItemTagRegistry["minecraft:wooden_doors"] - val ITEM_SPRUCE_LOGS = ItemTagRegistry["minecraft:spruce_logs"] - val ITEM_STRIDER_TEMPT_ITEMS = ItemTagRegistry["minecraft:strider_tempt_items"] - val ITEM_HEAD_ARMOR = ItemTagRegistry["minecraft:head_armor"] - val ITEM_COMPLETES_FIND_TREE_TUTORIAL = ItemTagRegistry["minecraft:completes_find_tree_tutorial"] - val ITEM_EMERALD_ORES = ItemTagRegistry["minecraft:emerald_ores"] - val ITEM_DARK_OAK_LOGS = ItemTagRegistry["minecraft:dark_oak_logs"] - val ITEM_SIGNS = ItemTagRegistry["minecraft:signs"] - val ITEM_OAK_LOGS = ItemTagRegistry["minecraft:oak_logs"] - val ITEM_ENCHANTABLE_BOW = ItemTagRegistry["minecraft:enchantable/bow"] - val ITEM_MAP_INVISIBILITY_EQUIPMENT = ItemTagRegistry["minecraft:map_invisibility_equipment"] - val ITEM_ENCHANTABLE_ARMOR = ItemTagRegistry["minecraft:enchantable/armor"] - val ITEM_SOUL_FIRE_BASE_BLOCKS = ItemTagRegistry["minecraft:soul_fire_base_blocks"] - val ITEM_BOOKSHELF_BOOKS = ItemTagRegistry["minecraft:bookshelf_books"] - val ITEM_STONE_BUTTONS = ItemTagRegistry["minecraft:stone_buttons"] + val ITEM_MANGROVE_LOGS = ItemTagRegistry["minecraft:mangrove_logs"] + val ITEM_DECORATED_POT_SHERDS = ItemTagRegistry["minecraft:decorated_pot_sherds"] + val ITEM_CREEPER_IGNITERS = ItemTagRegistry["minecraft:creeper_igniters"] val ITEM_ENCHANTABLE_EQUIPPABLE = ItemTagRegistry["minecraft:enchantable/equippable"] - val ITEM_LOGS_THAT_BURN = ItemTagRegistry["minecraft:logs_that_burn"] - val ITEM_PIGLIN_REPELLENTS = ItemTagRegistry["minecraft:piglin_repellents"] + val ITEM_HOES = ItemTagRegistry["minecraft:hoes"] + val ITEM_AXOLOTL_FOOD = ItemTagRegistry["minecraft:axolotl_food"] + val ITEM_GOAT_FOOD = ItemTagRegistry["minecraft:goat_food"] + val ITEM_COMPLETES_FIND_TREE_TUTORIAL = ItemTagRegistry["minecraft:completes_find_tree_tutorial"] + val ITEM_JUNGLE_LOGS = ItemTagRegistry["minecraft:jungle_logs"] + val ITEM_WITHER_SKELETON_DISLIKED_WEAPONS = ItemTagRegistry["minecraft:wither_skeleton_disliked_weapons"] + val ITEM_TURTLE_FOOD = ItemTagRegistry["minecraft:turtle_food"] + val ITEM_WALLS = ItemTagRegistry["minecraft:walls"] + val ITEM_ARROWS = ItemTagRegistry["minecraft:arrows"] + val ITEM_ENCHANTABLE_LEG_ARMOR = ItemTagRegistry["minecraft:enchantable/leg_armor"] + val ITEM_GAZE_DISGUISE_EQUIPMENT = ItemTagRegistry["minecraft:gaze_disguise_equipment"] + val ITEM_CHAINS = ItemTagRegistry["minecraft:chains"] + val ITEM_PALE_OAK_LOGS = ItemTagRegistry["minecraft:pale_oak_logs"] val ITEM_AXES = ItemTagRegistry["minecraft:axes"] - val ITEM_TRAPDOORS = ItemTagRegistry["minecraft:trapdoors"] - val ITEM_CANDLES = ItemTagRegistry["minecraft:candles"] + val ITEM_IGNORED_BY_PIGLIN_BABIES = ItemTagRegistry["minecraft:ignored_by_piglin_babies"] + val ITEM_REPAIRS_COPPER_ARMOR = ItemTagRegistry["minecraft:repairs_copper_armor"] + val ITEM_PIGLIN_FOOD = ItemTagRegistry["minecraft:piglin_food"] + val ITEM_STONE_BUTTONS = ItemTagRegistry["minecraft:stone_buttons"] + val ITEM_ENCHANTABLE_CHEST_ARMOR = ItemTagRegistry["minecraft:enchantable/chest_armor"] + val ITEM_DARK_OAK_LOGS = ItemTagRegistry["minecraft:dark_oak_logs"] + val ITEM_COAL_ORES = ItemTagRegistry["minecraft:coal_ores"] + val ITEM_SMELTS_TO_GLASS = ItemTagRegistry["minecraft:smelts_to_glass"] + val ITEM_REPAIRS_GOLD_ARMOR = ItemTagRegistry["minecraft:repairs_gold_armor"] + val ITEM_BREWING_FUEL = ItemTagRegistry["minecraft:brewing_fuel"] + val ITEM_DYEABLE = ItemTagRegistry["minecraft:dyeable"] + val ITEM_HOGLIN_FOOD = ItemTagRegistry["minecraft:hoglin_food"] + val ITEM_PIG_FOOD = ItemTagRegistry["minecraft:pig_food"] + val ITEM_HAPPY_GHAST_FOOD = ItemTagRegistry["minecraft:happy_ghast_food"] + val ITEM_ENCHANTABLE_MACE = ItemTagRegistry["minecraft:enchantable/mace"] + val ITEM_SHEARABLE_FROM_COPPER_GOLEM = ItemTagRegistry["minecraft:shearable_from_copper_golem"] + val ITEM_ENCHANTABLE_MINING = ItemTagRegistry["minecraft:enchantable/mining"] + val ITEM_FOOT_ARMOR = ItemTagRegistry["minecraft:foot_armor"] + val ITEM_CLUSTER_MAX_HARVESTABLES = ItemTagRegistry["minecraft:cluster_max_harvestables"] + val ITEM_LIGHTNING_RODS = ItemTagRegistry["minecraft:lightning_rods"] + val ITEM_COPPER_CHESTS = ItemTagRegistry["minecraft:copper_chests"] + val ITEM_STONE_BRICKS = ItemTagRegistry["minecraft:stone_bricks"] + val ITEM_FLOWERS = ItemTagRegistry["minecraft:flowers"] + val ITEM_SKELETON_PREFERRED_WEAPONS = ItemTagRegistry["minecraft:skeleton_preferred_weapons"] + val ITEM_PICKAXES = ItemTagRegistry["minecraft:pickaxes"] } diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/ChatTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/ChatTypeRegistry.kt index 1fe1297ee..3a2e35331 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/ChatTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/ChatTypeRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.registry.registries -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogActionTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogActionTypeRegistry.kt index 1e933e348..294cead18 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogActionTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogActionTypeRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.registry.registries -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogBodyTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogBodyTypeRegistry.kt index 227a9e834..c8434cff3 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogBodyTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogBodyTypeRegistry.kt @@ -3,7 +3,7 @@ package io.github.dockyardmc.registry.registries import io.github.dockyardmc.dialog.body.DialogBody import io.github.dockyardmc.dialog.body.DialogItemBody import io.github.dockyardmc.dialog.body.PlainMessage -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogInputTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogInputTypeRegistry.kt index ce5043d71..5da407a35 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogInputTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogInputTypeRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.registry.registries -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogRegistry.kt index 79c6b7cd8..f0425accf 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogRegistry.kt @@ -1,7 +1,7 @@ package io.github.dockyardmc.registry.registries import io.github.dockyardmc.dialog.Dialog -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogTypeRegistry.kt index 86411fa70..8756a2c33 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DialogTypeRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.registry.registries -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/DimensionTypeRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/DimensionTypeRegistry.kt index 1cb9222c0..6f55404cb 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/DimensionTypeRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/DimensionTypeRegistry.kt @@ -1,7 +1,7 @@ package io.github.dockyardmc.registry.registries import io.github.dockyardmc.nbt.nbt -import io.github.dockyardmc.protocol.packets.configurations.ClientboundRegistryDataPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundRegistryDataPacket import io.github.dockyardmc.registry.DynamicRegistry import io.github.dockyardmc.registry.RegistryEntry import net.kyori.adventure.nbt.CompoundBinaryTag diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/MinecraftVersionRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/MinecraftVersionRegistry.kt index 51e93a921..7cf6265f7 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/MinecraftVersionRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/MinecraftVersionRegistry.kt @@ -11,6 +11,7 @@ object MinecraftVersionRegistry { } init { + addEntry(MinecraftVersion(773, "1.21.9")) addEntry(MinecraftVersion(772, "1.21.8")) addEntry(MinecraftVersion(771, "1.21.6")) addEntry(MinecraftVersion(0x40000100, "1.21.6 Release Candidate 1")) diff --git a/src/main/kotlin/io/github/dockyardmc/registry/registries/tags/TagRegistry.kt b/src/main/kotlin/io/github/dockyardmc/registry/registries/tags/TagRegistry.kt index a0063b4e1..c993534d8 100644 --- a/src/main/kotlin/io/github/dockyardmc/registry/registries/tags/TagRegistry.kt +++ b/src/main/kotlin/io/github/dockyardmc/registry/registries/tags/TagRegistry.kt @@ -1,6 +1,6 @@ package io.github.dockyardmc.registry.registries.tags -import io.github.dockyardmc.protocol.packets.configurations.Tag +import io.github.dockyardmc.protocol.packets.configurations.clientbound.Tag import io.github.dockyardmc.registry.DataDrivenRegistry abstract class TagRegistry : DataDrivenRegistry() \ No newline at end of file diff --git a/src/main/kotlin/io/github/dockyardmc/resourcepack/ResourcepackManager.kt b/src/main/kotlin/io/github/dockyardmc/resourcepack/ResourcepackManager.kt index e4cf302d3..875439657 100644 --- a/src/main/kotlin/io/github/dockyardmc/resourcepack/ResourcepackManager.kt +++ b/src/main/kotlin/io/github/dockyardmc/resourcepack/ResourcepackManager.kt @@ -2,7 +2,7 @@ package io.github.dockyardmc.resourcepack import io.github.dockyardmc.player.Player import io.github.dockyardmc.protocol.packets.ProtocolState -import io.github.dockyardmc.protocol.packets.configurations.ClientboundConfigurationAddResourcePackPacket +import io.github.dockyardmc.protocol.packets.configurations.clientbound.ClientboundConfigurationAddResourcePackPacket import io.github.dockyardmc.protocol.packets.play.clientbound.ClientboundPlayAddResourcepackPacket import io.github.dockyardmc.utils.debug import java.util.* diff --git a/src/main/kotlin/io/github/dockyardmc/scheduler/Scheduler.kt b/src/main/kotlin/io/github/dockyardmc/scheduler/Scheduler.kt index b0c0e1b32..490c10733 100644 --- a/src/main/kotlin/io/github/dockyardmc/scheduler/Scheduler.kt +++ b/src/main/kotlin/io/github/dockyardmc/scheduler/Scheduler.kt @@ -2,7 +2,6 @@ package io.github.dockyardmc.scheduler import io.github.dockyardmc.extentions.round import io.github.dockyardmc.utils.Disposable -import io.github.dockyardmc.utils.debug import java.time.Instant import java.util.concurrent.CompletableFuture import java.util.concurrent.Executors diff --git a/src/main/kotlin/io/github/dockyardmc/utils/MetadataUtils.kt b/src/main/kotlin/io/github/dockyardmc/utils/MetadataUtils.kt index 120c6dd27..3277bfcbd 100644 --- a/src/main/kotlin/io/github/dockyardmc/utils/MetadataUtils.kt +++ b/src/main/kotlin/io/github/dockyardmc/utils/MetadataUtils.kt @@ -1,13 +1,13 @@ package io.github.dockyardmc.utils import io.github.dockyardmc.entity.Entity -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType +import io.github.dockyardmc.entity.metadata.Metadata + +fun mergeEntityMetadata(base: Entity, layer: Map, Metadata.MetadataDefinition.Value<*>>?): List> { + if (layer == null) return base.metadata.getValues().values.toList() -fun mergeEntityMetadata(base: Entity, layer: Map?): List { - if(layer == null) return base.metadata.getValues().values.toList() val metadata = base.metadata.getValues() - val final = mutableMapOf() + val final = mutableMapOf, Metadata.MetadataDefinition.Value<*>>() metadata.forEach { val index = it.key final[index] = it.value diff --git a/src/main/kotlin/io/github/dockyardmc/utils/Utils.kt b/src/main/kotlin/io/github/dockyardmc/utils/Utils.kt index f3bca1e3b..61063a401 100644 --- a/src/main/kotlin/io/github/dockyardmc/utils/Utils.kt +++ b/src/main/kotlin/io/github/dockyardmc/utils/Utils.kt @@ -1,11 +1,5 @@ package io.github.dockyardmc.utils -import io.github.dockyardmc.entity.Entity -import io.github.dockyardmc.entity.metadata.EntityMetadata -import io.github.dockyardmc.entity.metadata.EntityMetadataType -import io.github.dockyardmc.entity.metadata.getEntityMetadataState -import io.github.dockyardmc.player.Player -import io.github.dockyardmc.player.toPersistent import java.net.InetSocketAddress import java.net.ServerSocket import java.net.SocketException @@ -40,46 +34,6 @@ fun bitMask(mask: Byte, compare: Int): Boolean { fun getEnumEntries(enumClass: KClass>): List> = enumClass.java.enumConstants.toList() -fun Entity.setGlowingFor(player: Player, state: Boolean) { - val entityState = getEntityMetadataState(this) { - isGlowing = state - } - val playerMetadataLayer = this.metadataLayers[player.toPersistent()] ?: mutableMapOf() - - playerMetadataLayer[EntityMetadataType.STATE] = entityState - this.metadataLayers[player.toPersistent()] = playerMetadataLayer -} - -fun Entity.setInvisibleFor(player: Player, state: Boolean) { - val entityState = getEntityMetadataState(this) { - isInvisible = state - } - val playerMetadataLayer = this.metadataLayers[player.toPersistent()] ?: mutableMapOf() - - playerMetadataLayer[EntityMetadataType.STATE] = entityState - this.metadataLayers[player.toPersistent()] = playerMetadataLayer -} - -fun Entity.setIsOnFireFor(player: Player, state: Boolean) { - val entityState = getEntityMetadataState(this) { - isOnFire = state - } - val playerMetadataLayer = this.metadataLayers[player.toPersistent()] ?: mutableMapOf() - - playerMetadataLayer[EntityMetadataType.STATE] = entityState - this.metadataLayers[player.toPersistent()] = playerMetadataLayer -} - -fun Entity.setIsCrouchingFor(player: Player, state: Boolean) { - val entityState = getEntityMetadataState(this) { - isCrouching = state - } - val playerMetadataLayer = this.metadataLayers[player.toPersistent()] ?: mutableMapOf() - - playerMetadataLayer[EntityMetadataType.STATE] = entityState - this.metadataLayers[player.toPersistent()] = playerMetadataLayer -} - fun generateSHA1(input: String): String { val messageDigest = MessageDigest.getInstance("SHA-1") diff --git a/src/main/kotlin/io/github/dockyardmc/world/block/Block.kt b/src/main/kotlin/io/github/dockyardmc/world/block/Block.kt index b9c91bab7..271157937 100644 --- a/src/main/kotlin/io/github/dockyardmc/world/block/Block.kt +++ b/src/main/kotlin/io/github/dockyardmc/world/block/Block.kt @@ -5,6 +5,7 @@ import io.github.dockyardmc.registry.registries.BlockRegistry import io.github.dockyardmc.registry.registries.Item import io.github.dockyardmc.registry.registries.ItemRegistry import io.github.dockyardmc.registry.registries.RegistryBlock +import io.github.dockyardmc.tide.stream.StreamCodec import io.github.dockyardmc.utils.CustomDataHolder data class Block( @@ -73,6 +74,8 @@ data class Block( companion object { + val STREAM_CODEC = StreamCodec.VAR_INT.transform({ from -> from.getProtocolId() }, { to -> getBlockByStateId(to) }) + val AIR = Block(BlockRegistry.AIR) val STONE = Block(BlockRegistry["minecraft:stone"]) diff --git a/src/main/kotlin/io/github/dockyardmc/world/waypoint/Waypoint.kt b/src/main/kotlin/io/github/dockyardmc/world/waypoint/Waypoint.kt index f580cfda1..4b181964d 100644 --- a/src/main/kotlin/io/github/dockyardmc/world/waypoint/Waypoint.kt +++ b/src/main/kotlin/io/github/dockyardmc/world/waypoint/Waypoint.kt @@ -10,7 +10,7 @@ import io.github.dockyardmc.extentions.sendPacket import io.github.dockyardmc.location.Location import io.github.dockyardmc.player.Player import io.github.dockyardmc.protocol.packets.play.clientbound.ClientboundTrackedWaypointPacket -import io.github.dockyardmc.protocol.types.Either +import io.github.dockyardmc.tide.types.Either import io.github.dockyardmc.utils.Disposable import io.github.dockyardmc.utils.viewable.Viewable import java.util.* diff --git a/src/main/kotlin/io/github/dockyardmc/world/waypoint/WaypointData.kt b/src/main/kotlin/io/github/dockyardmc/world/waypoint/WaypointData.kt index 6c2f586f7..12023e891 100644 --- a/src/main/kotlin/io/github/dockyardmc/world/waypoint/WaypointData.kt +++ b/src/main/kotlin/io/github/dockyardmc/world/waypoint/WaypointData.kt @@ -1,42 +1,54 @@ package io.github.dockyardmc.world.waypoint -import io.github.dockyardmc.extentions.* +import io.github.dockyardmc.codec.ExtraCodecs +import io.github.dockyardmc.extentions.readEnum +import io.github.dockyardmc.extentions.writeEnum import io.github.dockyardmc.location.Location import io.github.dockyardmc.maths.vectors.Vector3 import io.github.dockyardmc.protocol.NetworkReadable import io.github.dockyardmc.protocol.NetworkWritable -import io.github.dockyardmc.protocol.readOptional -import io.github.dockyardmc.protocol.types.Either -import io.github.dockyardmc.protocol.types.writeEither -import io.github.dockyardmc.protocol.writeOptional import io.github.dockyardmc.scroll.CustomColor +import io.github.dockyardmc.tide.stream.StreamCodec +import io.github.dockyardmc.tide.types.Either import io.github.dockyardmc.world.chunk.ChunkPos import io.netty.buffer.ByteBuf import java.util.* data class WaypointData(val id: Either, val icon: Icon, val target: Target) : NetworkWritable { + companion object { + val STREAM_CODEC = StreamCodec.of( + StreamCodec.either(StreamCodec.UUID, StreamCodec.STRING), WaypointData::id, + Icon.STREAM_CODEC, WaypointData::icon, + Target.STREAM_CODEC, WaypointData::target, + ::WaypointData + ) + } + override fun write(buffer: ByteBuf) { - buffer.writeEither(id, ByteBuf::writeUUID, ByteBuf::writeString) - icon.write(buffer) - target.write(buffer) + STREAM_CODEC.write(buffer, this) } data class Icon(val style: String, val color: CustomColor?) : NetworkWritable { companion object : NetworkReadable { + val STREAM_CODEC = StreamCodec.of( + StreamCodec.STRING, Icon::style, + ExtraCodecs.CUSTOM_COLOR_STREAM.optional(), Icon::color, + ::Icon + ) + const val DEFAULT_STYLE = "minecraft:default" val DEFAULT = Icon(DEFAULT_STYLE, null) override fun read(buffer: ByteBuf): Icon { - return Icon(buffer.readString(), buffer.readOptional(CustomColor::read)) + return STREAM_CODEC.read(buffer) } } override fun write(buffer: ByteBuf) { - buffer.writeString(style) - buffer.writeOptional(color, CustomColor::write) + STREAM_CODEC.write(buffer, this) } } @@ -57,6 +69,18 @@ data class WaypointData(val id: Either, val icon: Icon, val target companion object : NetworkReadable { + val STREAM_CODEC = object : StreamCodec { + + override fun write(buffer: ByteBuf, value: Target) { + value.write(buffer) + } + + override fun read(buffer: ByteBuf): Target { + return Companion.read(buffer) + } + + } + override fun read(buffer: ByteBuf): Target { val type = buffer.readEnum() return when (type) { diff --git a/src/main/resources/registry/biome_tags.json.gz b/src/main/resources/registry/biome_tags.json.gz index 73cd9b255..be16dca02 100644 Binary files a/src/main/resources/registry/biome_tags.json.gz and b/src/main/resources/registry/biome_tags.json.gz differ diff --git a/src/main/resources/registry/block_registry.json.gz b/src/main/resources/registry/block_registry.json.gz index 1d889f3f6..790d97d6c 100644 Binary files a/src/main/resources/registry/block_registry.json.gz and b/src/main/resources/registry/block_registry.json.gz differ diff --git a/src/main/resources/registry/block_tags.json.gz b/src/main/resources/registry/block_tags.json.gz index dcaf4385b..238f8c9eb 100644 Binary files a/src/main/resources/registry/block_tags.json.gz and b/src/main/resources/registry/block_tags.json.gz differ diff --git a/src/main/resources/registry/components.bin b/src/main/resources/registry/components.bin index cce98dd5a..d154786c2 100644 Binary files a/src/main/resources/registry/components.bin and b/src/main/resources/registry/components.bin differ diff --git a/src/main/resources/registry/entity_type_registry.json.gz b/src/main/resources/registry/entity_type_registry.json.gz index 40fe83eba..c3ad78e51 100644 Binary files a/src/main/resources/registry/entity_type_registry.json.gz and b/src/main/resources/registry/entity_type_registry.json.gz differ diff --git a/src/main/resources/registry/entity_type_tags.json.gz b/src/main/resources/registry/entity_type_tags.json.gz index 2384099a9..c006380e2 100644 Binary files a/src/main/resources/registry/entity_type_tags.json.gz and b/src/main/resources/registry/entity_type_tags.json.gz differ diff --git a/src/main/resources/registry/fluid_tags.json.gz b/src/main/resources/registry/fluid_tags.json.gz index 4e46b7136..780f7407d 100644 Binary files a/src/main/resources/registry/fluid_tags.json.gz and b/src/main/resources/registry/fluid_tags.json.gz differ diff --git a/src/main/resources/registry/item_registry.json.gz b/src/main/resources/registry/item_registry.json.gz index c2c70a2b2..4f686d4a5 100644 Binary files a/src/main/resources/registry/item_registry.json.gz and b/src/main/resources/registry/item_registry.json.gz differ diff --git a/src/main/resources/registry/item_tags.json.gz b/src/main/resources/registry/item_tags.json.gz index 8d111679d..914262c99 100644 Binary files a/src/main/resources/registry/item_tags.json.gz and b/src/main/resources/registry/item_tags.json.gz differ diff --git a/src/main/resources/registry/particle_registry.json.gz b/src/main/resources/registry/particle_registry.json.gz index 7464c30d2..215c11ac3 100644 Binary files a/src/main/resources/registry/particle_registry.json.gz and b/src/main/resources/registry/particle_registry.json.gz differ diff --git a/src/main/resources/registry/sound_registry.json.gz b/src/main/resources/registry/sound_registry.json.gz index 3672f4732..9669ca563 100644 Binary files a/src/main/resources/registry/sound_registry.json.gz and b/src/main/resources/registry/sound_registry.json.gz differ diff --git a/src/main/resources/registry/trim_material_registry.json.gz b/src/main/resources/registry/trim_material_registry.json.gz index abd158147..62c7d34f1 100644 Binary files a/src/main/resources/registry/trim_material_registry.json.gz and b/src/main/resources/registry/trim_material_registry.json.gz differ diff --git a/src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTest.kt b/src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTypeTest.kt similarity index 98% rename from src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTest.kt rename to src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTypeTest.kt index be16713c0..fc224b490 100644 --- a/src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTest.kt +++ b/src/test/kotlin/io/github/dockyard/tests/entity/metadata/MetadataTypeTest.kt @@ -12,7 +12,7 @@ import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals -class MetadataTest { +class MetadataTypeTest { @BeforeTest fun prepare() { diff --git a/src/test/kotlin/io/github/dockyard/tests/packets/PacketsReadableTest.kt b/src/test/kotlin/io/github/dockyard/tests/packets/PacketsReadableTest.kt index ce4449c43..4f7b488f9 100644 --- a/src/test/kotlin/io/github/dockyard/tests/packets/PacketsReadableTest.kt +++ b/src/test/kotlin/io/github/dockyard/tests/packets/PacketsReadableTest.kt @@ -3,7 +3,7 @@ package io.github.dockyard.tests.packets import cz.lukynka.prettylog.LogType import cz.lukynka.prettylog.log import io.github.dockyard.tests.TestServer -import io.github.dockyardmc.protocol.packets.configurations.ServerboundConfigurationCustomClickActionPacket +import io.github.dockyardmc.protocol.packets.configurations.serverbound.ServerboundConfigurationCustomClickActionPacket import io.github.dockyardmc.protocol.packets.registry.ServerPacketRegistry import kotlin.reflect.KClass import kotlin.reflect.full.companionObject