Get rid of block entity specific onceLevel
This commit is contained in:
parent
d5f1d3cde0
commit
7c9657c6d2
@ -454,13 +454,6 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
|
||||
_sides[blockRotation.dir2Side(dir)]!!.updateTracked()
|
||||
}
|
||||
|
||||
protected fun onceServer(action: (ServerLevel) -> Unit) {
|
||||
val level = level
|
||||
if (level is ServerLevel) {
|
||||
tickList.once { action.invoke(level) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun setChanged() {
|
||||
super.setChanged()
|
||||
|
||||
|
@ -17,6 +17,7 @@ import ru.dbotthepony.mc.otm.core.math.BlockRotation
|
||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
||||
import ru.dbotthepony.mc.otm.graph.GraphNode
|
||||
import ru.dbotthepony.mc.otm.onceServer
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import java.util.Collections
|
||||
import java.util.EnumMap
|
||||
@ -53,11 +54,11 @@ class EnergyCableBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matte
|
||||
node.graph.livelyNodes.add(node)
|
||||
}
|
||||
|
||||
ru.dbotthepony.mc.otm.onceServer {
|
||||
onceServer {
|
||||
updateBlockState(blockRotation.side2Dir(side), true)
|
||||
}
|
||||
} else {
|
||||
ru.dbotthepony.mc.otm.onceServer {
|
||||
onceServer {
|
||||
updateBlockState(blockRotation.side2Dir(side), false)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user