Skip to content

Listener Interface Update#786

Open
JustAHuman-xD wants to merge 12 commits into
masterfrom
human/listener-interface-update
Open

Listener Interface Update#786
JustAHuman-xD wants to merge 12 commits into
masterfrom
human/listener-interface-update

Conversation

@JustAHuman-xD
Copy link
Copy Markdown
Contributor

@JustAHuman-xD JustAHuman-xD commented May 28, 2026

#753 as well as renaming a number of the interface methods so that they aren't as generic, and fixing a number of mistakes in a few of the interfaces (i.e. the various projectile interfaces)

Currently this only covers items to see how everyone feels about this new scheme, if we like it Ill do the block & entity interfaces next

The idea is to split the concept of item interfaces & rebar item handlers, rebar item handlers only process events, and item interfaces add/change core functionality, any item interfaces that did both have been split into a designated handler and item interface instead

The diff isn't perfect because git is funny so some interfaces are shown to be deleted but have just been renamed (ex: RebarWeapon -> EntityAttackRebarItemHandler)

@JustAHuman-xD
Copy link
Copy Markdown
Contributor Author

Current before and after of item interfaces:

Before:
image

After:
image

@Seggan
Copy link
Copy Markdown
Member

Seggan commented May 28, 2026

you forgot to do RebarArmorItem -> ArmorRebarItem

@LordIdra
Copy link
Copy Markdown
Contributor

The only thing id suggest is to remove the handlers folder and have it all in one directory, or organise them differently (e.g. by type like on the wiki). Just seems a bit weird to have some listeners at the top level and some in a subfolder, rather than all at the top level or all in subfolders. But it's a relatively minor thing

@LordIdra
Copy link
Copy Markdown
Contributor

Now that I'm looking at it again, does it make sense to split them up into Handler? Are we sure we don't want to just call them like SignRebarBlock, SneakRebarBlock, HopperRebarBlock, etc? Just so it's less wordy and for consistency (I don't think the 'handler' distinction is very useful)

@JustAHuman-xD
Copy link
Copy Markdown
Contributor Author

Now that I'm looking at it again, does it make sense to split them up into Handler? Are we sure we don't want to just call them like SignRebarBlock, SneakRebarBlock, HopperRebarBlock, etc? Just so it's less wordy and for consistency (I don't think the 'handler' distinction is very useful)

I think so, the idea is that we strictly split up interfaces that only process events (handlers) with anything else. If you're searching for an inference to do something for the first time and you know that you're looking for a handler you won't waste time on all the other interfaces, and vice versa.

If we just call something "BedRebarBlock" instead of handler it could imply that that interface adds the ability for a block to be used as a bed, because some of the interfaces (which are not handlers) add functionality that isn't there by default. (e.g. TickingRebarBlock for ex) By calling it a handler the implication is instead that you are only handling something that already happens, not making something happen.

@JustAHuman-xD
Copy link
Copy Markdown
Contributor Author

The only thing id suggest is to remove the handlers folder and have it all in one directory, or organise them differently (e.g. by type like on the wiki). Just seems a bit weird to have some listeners at the top level and some in a subfolder, rather than all at the top level or all in subfolders. But it's a relatively minor thing

I mean its just organization, splitting handlers and non handlers, but like I could put them at the same level just different folders for ex

@JustAHuman-xD
Copy link
Copy Markdown
Contributor Author

todo: sort the provided item/block/entity interfaces (idra is doing this ty kind sir)

@LordIdra LordIdra marked this pull request as ready for review May 30, 2026 22:00
@LordIdra LordIdra assigned LordIdra and unassigned LordIdra May 30, 2026
@LordIdra LordIdra requested a review from a team May 30, 2026 22:00
Comment thread rebar/src/main/kotlin/io/github/pylonmc/rebar/nms/NmsAccessor.kt
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.

3 participants