This commit is contained in:
2026-04-25 19:21:30 +00:00
9 changed files with 166 additions and 55 deletions

View File

@@ -37,6 +37,7 @@ class CaseBlockEntity(blockPos: BlockPos, blockState: BlockState): NodeBlockEnti
val stacks: NonNullList<ItemStack> = NonNullList<ItemStack>.withSize(7, ItemStack.EMPTY)
var isOn = false
var isDisking = false // TOOD: writing writers and reading readers
var err: String? = null
var arch = "Lua 5.3"
var soundInstance: SoundInstance? = null
@@ -49,12 +50,14 @@ class CaseBlockEntity(blockPos: BlockPos, blockState: BlockState): NodeBlockEnti
override fun encodeDownstreamData(packet: FriendlyByteBuf) {
super.encodeDownstreamData(packet)
packet.writeBoolean(isOn)
packet.writeBoolean(isDisking)
packet.writeUtf(err ?: "")
}
override fun syncWithUpstream(packet: FriendlyByteBuf) {
super.syncWithUpstream(packet)
setRunning(packet.readBoolean())
isDisking = packet.readBoolean()
err = packet.readUtf().ifEmpty { null }
}

View File

@@ -17,10 +17,9 @@ class ScreenEntity(blockPos: BlockPos, blockState: BlockState) :
override val node = Networking.Node()
var bound = "screen/unbound"
var render_on_block = false
val scrwidth: Short = 160
val scrheight: Short = 50
val scrwidth: Short = 50
val scrheight: Short = 16
private var cleanrenderer: () -> Unit = { }; // TODO: THIS SUCKS, FIND A BETTER WAY
@@ -32,7 +31,7 @@ class ScreenEntity(blockPos: BlockPos, blockState: BlockState) :
override fun tickNode(level: Level) {
super.tickNode(level)
if (bound == "screen/unbound" && level.isClientSide) { // am i epstein or am i just retarded?
if (bound == "screen/unbound") { // am i epstein or am i just retarded?
createscreenstuffs()
}
}