Store "is bulk" flag inside painting table itself

This commit is contained in:
DBotThePony 2023-08-22 12:16:24 +07:00
parent e61d98e54d
commit edd16768e3
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 8 additions and 4 deletions

View File

@ -30,9 +30,16 @@ class PainterBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryDe
private val dyeStored = EnumMap<DyeColor, Int>(DyeColor::class.java)
val dyeStoredView: Map<DyeColor, Int> = Collections.unmodifiableMap(dyeStored)
var isBulk = false
set(value) {
field = value
markDirtyFast()
}
init {
addDroppableContainer(dyeInput)
savetables.stateful(dyeInput, INVENTORY_KEY)
savetables.bool(::isBulk)
}
fun takeDyes(dyes: Map<DyeColor, Int>) {

View File

@ -427,8 +427,6 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
private var nextDischargeHurt = 20
private var nextHealTick = 0
var painterBulkCrafting = false
// players tracking us
// stored separately because EntityTracker and ChunkMup, etc are buried deep and
// getting them unburied will be a very work intense task
@ -568,7 +566,6 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
savetables.int(::ticksIExist)
savetables.int(::iteration)
savetables.bool(::painterBulkCrafting)
savetables.bool(::shouldSendIteration)
savetables.bool(::wasInLiquid)
savetables.bool(::isAndroid)

View File

@ -44,7 +44,7 @@ class PainterMenu(
private var lastRecipe: PainterRecipe? = null
var selectedRecipe by mSynchronizer.Field(null, ResourceLocationValueCodec.nullable).also { it.addListener { rescan() } }
val isBulk = BooleanInputWithFeedback(this, true, player.matteryPlayer!!::painterBulkCrafting)
val isBulk = BooleanInputWithFeedback(this, tile?.let { it::isBulk })
val selectRecipe = PlayerInput(ResourceLocationValueCodec) {
selectedRecipe = it