Skip to content

Commit

Permalink
resolved review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Itskillerluc committed Jul 12, 2024
1 parent 11f405d commit 448b241
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package earth.terrarium.techarium.common.blocks.base

import earth.terrarium.techarium.common.util.toRotation
import earth.terrarium.techarium.common.utils.toRotation
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState

class BasicDeployChildBlockEntity(type: BlockEntityType<*>, pos: BlockPos, blockState: BlockState): BlockEntity(type, pos,
blockState, ) {
class BasicDeployChildBlockEntity(type: BlockEntityType<*>, pos: BlockPos, blockState: BlockState) :
BlockEntity(type, pos, blockState) {
lateinit var parentPos: BlockPos
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.world.level.block.entity.BlockEntityType

object ModBlockEntityTypes {
val registry: ResourcefulRegistry<BlockEntityType<*>> = ResourcefulRegistries.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, TechariumConstants.MOD_ID)
val registry: ResourcefulRegistry<BlockEntityType<*>> =
ResourcefulRegistries.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, TechariumConstants.MOD_ID)

val basicDeployChildBlockEntity: BlockEntityType<BasicDeployChildBlockEntity> by registry.register("basic_deploy_child_blockentity") {BlockEntityType.Builder.of({pos, state -> BasicDeployChildBlockEntity(basicDeployChildBlockEntity, pos, state)
}, ModBlocks.basicDeployChildBlock).build(null)}
val basicDeployChildBlockEntity: BlockEntityType<BasicDeployChildBlockEntity> by registry.register("basic_deploy_child_blockentity") {
BlockEntityType.Builder.of({ pos, state ->
BasicDeployChildBlockEntity(basicDeployChildBlockEntity, pos, state)
}, ModBlocks.basicDeployChildBlock).build(null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ import net.minecraft.world.level.material.PushReaction
object ModBlocks {
val registry: ResourcefulRegistry<Block> = ResourcefulRegistries.create(BuiltInRegistries.BLOCK, TechariumConstants.MOD_ID)

val basicDeployChildBlock: BasicDeployChildBlock by registry.register("basic_deploy_child_block") {BasicDeployChildBlock(BlockBehaviour.Properties.of().requiresCorrectToolForDrops().noOcclusion().pushReaction(PushReaction.BLOCK)) }
val basicDeployChildBlock: BasicDeployChildBlock by registry.register("basic_deploy_child_block") {
BasicDeployChildBlock(BlockBehaviour.Properties.of().requiresCorrectToolForDrops().noOcclusion().pushReaction(PushReaction.BLOCK))
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package earth.terrarium.techarium.common.util
package earth.terrarium.techarium.common.utils

import net.minecraft.core.Direction
import net.minecraft.world.level.block.Rotation

fun Direction.toRotation(): Rotation {
return when (this) {
fun Direction.toRotation(): Rotation =
when (this) {
Direction.SOUTH -> Rotation.CLOCKWISE_180
Direction.WEST -> Rotation.COUNTERCLOCKWISE_90
Direction.EAST -> Rotation.CLOCKWISE_90
else -> Rotation.NONE
}
}
}

0 comments on commit 448b241

Please sign in to comment.