Skip to content

Conversation

@Intybyte
Copy link
Member

No description provided.

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.

Nice work, generally happy with how this is implemented

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.

Can confirm it (somehow) works over server restarts

@Seggan Seggan linked an issue Dec 20, 2025 that may be closed by this pull request
Copy link
Contributor

@OhmV-IR OhmV-IR left a comment

Choose a reason for hiding this comment

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

LGTM CW

Comment on lines 140 to 155
@EventHandler(ignoreCancelled = true)
private fun fallingBlockDrop(event: EntityDropItemEvent) {
val entity = event.entity

if (entity !is FallingBlock) return

val blockSchema = fallMap[entity.uniqueId] ?: return
val relativeItem = PylonRegistry.ITEMS[blockSchema.key]
fallMap.remove(entity.uniqueId)
if (relativeItem == null) {
event.isCancelled = true
return
}

event.itemDrop.itemStack = relativeItem.getItemStack()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This and the whole fallMap system I think should be replaced. Not all falling blocks always drop an item (like anvils for example) or they change state when landing & dropping items (again anvils)

I think the item drop should come from a method of PylonFallingBlock (have it default to the item sure but), and it should be a method call for onDropItem instead of putting all of the logic here

Copy link
Member Author

Choose a reason for hiding this comment

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

This and the whole fallMap system I think should be replaced. Not all falling blocks always drop an item (like anvils for example) or they change state when landing & dropping items (again anvils)

There is little i can do about that, there is no way to know if a falling block will drop items or change state, and i won't make a map for each specific case, unless you have a better idea

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I misunderstood fall map and you misunderstood my comment. The onDropItem was all I really needed I just thought we could get rid of fallMap but now assuming I've understood you need it because the entity drops the item after it's been removed? So entity storage doesn't track it anymore even though it's still being used in code

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes exactly

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.

Bug with gravity Pylon blocks

6 participants