Skip to content

Commit c024846

Browse files
committed
fix: axiom registered for non noteblock blocks
1 parent e1dfbfc commit c024846

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/main/kotlin/com/mineinabyss/blocky/BlockyBrigadierCommands.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ object BlockyBrigadierCommands {
5151
val amount by IntegerArgumentType.integer(1)
5252
playerExecutes {
5353
val gearyItems = location.world.toGeary().getAddon(ItemTracking)
54-
val (player, item, amount) = (executor as? Player
55-
?: return@playerExecutes) to item()!! to amount()!!
54+
val (player, item, amount) = (executor as? Player ?: return@playerExecutes) to item() to amount()!!
5655
if (player.inventory.firstEmpty() == -1) return@playerExecutes player.error("No empty slots in inventory")
5756

5857
val itemstack = gearyItems.createItem(PrefabKey.of(item.asString()))?.asQuantity(amount)

src/main/kotlin/com/mineinabyss/blocky/systems/AxiomCompatibility.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package com.mineinabyss.blocky.systems
33
import com.mineinabyss.blocky.blocky
44
import com.mineinabyss.blocky.components.features.blocks.BlockyDirectional
55
import com.mineinabyss.blocky.helpers.blockyNoteBlock
6-
import com.mineinabyss.blocky.helpers.blockyTripWire
76
import com.mineinabyss.geary.modules.Geary
8-
import com.mineinabyss.geary.papermc.gearyPaper
97
import com.mineinabyss.geary.papermc.tracking.blocks.components.SetBlock
108
import com.mineinabyss.geary.prefabs.PrefabKey
119
import com.mineinabyss.idofront.textcomponents.serialize
@@ -38,7 +36,7 @@ object AxiomCompatibility {
3836
fun registerCustomBlocks() {
3937
AxiomCustomBlocksAPI.getAPI().unregisterAll(blocky.plugin)
4038
blocky.blockQuery.forEach { (prefab, block, directional, itemstack) ->
41-
if (block.blockType == SetBlock.BlockType.NOTEBLOCK && directional != null) return@forEach
39+
if (block.blockType != SetBlock.BlockType.NOTEBLOCK || directional != null) return@forEach
4240

4341
val key = Key.key(prefab.full)
4442
val translationKey = itemstack?.getData(DataComponentTypes.ITEM_NAME)?.serialize() ?: prefab.full
@@ -56,17 +54,17 @@ object AxiomCompatibility {
5654

5755
val key = Key.key(prefab.full)
5856
val translationKey = itemstack?.getData(DataComponentTypes.ITEM_NAME)?.serialize() ?: prefab.full
59-
val directionalBlocks = AxiomCompatibility.DirectionalBlocks(directional)
57+
val directionalBlocks = DirectionalBlocks(directional)
6058
val builder = when(directionalBlocks.type) {
61-
AxiomCompatibility.DirectionalType.AXIS -> {
59+
DirectionalType.AXIS -> {
6260
val (x, y, z) = directionalBlocks.blocks.take(3).map { it.blockyNoteBlock() }
6361
AxiomCustomBlocksAPI.getAPI().createAxis(key, translationKey, x, y, z)
6462
}
65-
AxiomCompatibility.DirectionalType.HORIZONTAL_FACING -> {
63+
DirectionalType.HORIZONTAL_FACING -> {
6664
val (n,e,s,w) = directionalBlocks.blocks.take(4).map { it.blockyNoteBlock() }
6765
AxiomCustomBlocksAPI.getAPI().createHorizontalFacing(key, translationKey, n, e, s, w)
6866
}
69-
AxiomCompatibility.DirectionalType.FACING -> {
67+
DirectionalType.FACING -> {
7068
val (n,e,s,w) = directionalBlocks.blocks.take(4).map { it.blockyNoteBlock() }
7169
val (u,d) = directionalBlocks.blocks.takeLast(2).map { it.blockyNoteBlock() }
7270
AxiomCustomBlocksAPI.getAPI().createFacing(key, translationKey, n,e,s,w,u,d)

0 commit comments

Comments
 (0)