Skip to content

Commit a94e5d2

Browse files
committed
Implement ADMediaHolder for the splicing table
1 parent a45941e commit a94e5d2

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
99
### Added
1010

1111
- Added keyboard shortcuts to the Splicing Table, configurable in HexDebug's client config menu.
12+
- The Splicing Table now works with Media Purification from [Hexpose](https://miyucomics.github.io/hexpose) (requires at least build [2e90cf5b](https://github.com/miyucomics/hexpose/commit/2e90cf5babb7677a26ca211bd66ac2777e5518cd), or any version after 1.0.0).
1213

1314
### Fixed
1415

Common/src/main/kotlin/gay/object/hexdebug/blocks/splicing/SplicingTableBlockEntity.kt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gay.`object`.hexdebug.blocks.splicing
22

33
import at.petrak.hexcasting.api.HexAPI
44
import at.petrak.hexcasting.api.addldata.ADIotaHolder
5+
import at.petrak.hexcasting.api.addldata.ADMediaHolder
56
import at.petrak.hexcasting.api.block.HexBlockEntity
67
import at.petrak.hexcasting.api.casting.ParticleSpray
78
import at.petrak.hexcasting.api.casting.eval.ResolvedPatternType
@@ -17,6 +18,7 @@ import at.petrak.hexcasting.api.utils.extractMedia
1718
import at.petrak.hexcasting.api.utils.getInt
1819
import at.petrak.hexcasting.api.utils.getList
1920
import at.petrak.hexcasting.xplat.IXplatAbstractions
21+
import gay.`object`.hexdebug.HexDebug
2022
import gay.`object`.hexdebug.blocks.base.BaseContainer
2123
import gay.`object`.hexdebug.blocks.base.ContainerDataDelegate
2224
import gay.`object`.hexdebug.blocks.base.ContainerDataLongDelegate
@@ -51,7 +53,7 @@ import kotlin.math.min
5153

5254
class SplicingTableBlockEntity(pos: BlockPos, state: BlockState) :
5355
HexBlockEntity(HexDebugBlockEntities.SPLICING_TABLE.value, pos, state),
54-
ISplicingTable, BaseContainer, MenuProvider, ADIotaHolder
56+
ISplicingTable, BaseContainer, MenuProvider, ADIotaHolder, ADMediaHolder
5557
{
5658
override val stacks = BaseContainer.withSize(SplicingTableItemSlot.container_size)
5759

@@ -428,6 +430,8 @@ class SplicingTableBlockEntity(pos: BlockPos, state: BlockState) :
428430
}
429431
}
430432

433+
// ADIotaHolder
434+
431435
override fun readIotaTag() = listHolder?.readIotaTag()
432436

433437
override fun writeIota(iota: Iota?, simulate: Boolean): Boolean {
@@ -440,6 +444,24 @@ class SplicingTableBlockEntity(pos: BlockPos, state: BlockState) :
440444

441445
override fun writeable() = listHolder?.writeable() ?: false
442446

447+
// ADMediaHolder
448+
449+
override fun getMedia() = media
450+
451+
override fun getMaxMedia() = SplicingTableBlockEntity.maxMedia
452+
453+
override fun setMedia(media: Long) {
454+
HexDebug.LOGGER.warn("Something attempted to call setMedia($media) on a splicing table.")
455+
}
456+
457+
override fun canRecharge() = false
458+
459+
override fun canProvide() = false
460+
461+
override fun getConsumptionPriority() = -1
462+
463+
override fun canConstructBattery() = false
464+
443465
companion object {
444466
private val config get() = HexDebugServerConfig.config
445467

0 commit comments

Comments
 (0)