Skip to content

Conversation

@Intybyte
Copy link
Member

@Intybyte Intybyte commented Nov 14, 2025

Fixes #456

Co-authored-by: Seggan <seggan21@gmail.com>
Copy link
Contributor

@LordIdra LordIdra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few things missing here - I would suggest including the following in this PR, but if you don't want to do them in this PR just make sure open issues for them so we can keep track:

  • Needs async ticking option as we have for blocks
  • Needs error handling (we have error handling set up for other entity interfaces)
  • Currently you're using a getter for tickDelay, but the convention with these sorts of interface variables is to use setTickInterval and setAsync and so on. The reason for this is to avoid having loads of getters for trivial properties which became quite a problem especially w/ the fluid stuff. It should hopefully be fairly straightforward as you can replicate what ticking blocks do.

(also docs :P - you can just do something similar to the block tickers for this)

Copy link
Contributor

@LordIdra LordIdra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing but otherwise I'm happy

Copy link
Member

@Seggan Seggan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than Idra comments LGTM

@Intybyte Intybyte changed the title PylonTickableEntity PylonTickingEntity Jan 2, 2026
Copy link
Contributor

@LordIdra LordIdra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry 1 big issue that I missed in my previous pass

Comment on lines +818 to +820
@JvmSynthetic
internal fun logEventHandleErrTicking(e: Exception, entity: PylonEntity<*>) {
PylonCore.logger.severe("Error when handling ticking entity(${entity.key}, ${entity.uuid}, ${entity.entity.location}): ${e.localizedMessage}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 small things for clarity. no event handling going on here so would be best to call it something like logTickingErr and change the message to "Error when ticking entity"

Comment on lines +87 to +93
@EventHandler
private fun onSerialize(event: PylonEntityAddEvent) { //todo serialize
val entity = event.pylonEntity
if (entity is PylonTickingEntity) {
entity.entity.persistentDataContainer.set(tickingEntityKey, PylonSerializers.TICKING_ENTITY_DATA, tickingEntities[entity]!!)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't serialization be happening on serialize, not on add? Just checked and there's no event for this... I would add PylonEntitySerialize and PylonEntityDeserialize events here for consistency with blocks, because AFAICT this will not work properly if only called on PylonEntityAdd (won't respect tick inteval set later)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tickable Pylon Entities

4 participants