Skip to content

Commit 839971b

Browse files
committed
fix: remove unnecessary safe call on a non-null receiver of view.getStringOr("id", "")
1 parent a6020da commit 839971b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/one/oktw/galaxy/block/entity/DummyBlockEntity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import one.oktw.galaxy.block.CustomBlock
2828
class DummyBlockEntity(type: BlockEntityType<*>, pos: BlockPos) : CustomBlockEntity(type, pos) {
2929
override fun loadAdditional(view: ValueInput) {
3030
super.loadAdditional(view)
31-
view.getStringOr("id", "")?.let(Identifier::tryParse)?.let(CustomBlock.registry::get)?.let {
31+
view.getStringOr("id", "").let(Identifier::tryParse)?.let(CustomBlock.registry::get)?.let {
3232
if (it != CustomBlock.DUMMY) {
3333
level?.removeBlockEntity(worldPosition)
3434
level?.setBlockEntity(it.createBlockEntity(worldPosition).apply { readCopyableData(view) })

0 commit comments

Comments
 (0)