-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate FabricEntityTypeBuilder & FabricBlockEntityTypeBuilder in favour of the vanilla classes #3677
Deprecate FabricEntityTypeBuilder & FabricBlockEntityTypeBuilder in favour of the vanilla classes #3677
Conversation
Can this be done to FabricBlockEntityTypeBuilder too? Since there's already BlockEntityType.Builder. |
Good idea, I'll take a look. 👍 |
Just had a look as as far as I can tell FabricBlockEntityTypeBuilder is useless? The only thing we add in FabricBlockEntityTypeBuilder is methods to add the supported blocks, but this can be set when creating the vanilla builder using |
Deprecated FabricEntityTypeBuilder and interface injected a |
default EntityType.Builder<T> alwaysUpdateVelocity(boolean alwaysUpdateVelocity) { | ||
throw new AssertionError("Implemented in Mixin"); | ||
} | ||
|
||
/** | ||
* Build the entity type from the builder. Same as {@link EntityType.Builder#build(String)} but without an id. | ||
* | ||
* @return the entity type instance | ||
*/ | ||
default EntityType<T> build() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both need fabric_
prefixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is part of the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh is this an existing API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is new (based off the old one). The vanilla build() method takes a string that will almost always be null for mods, this is an overload of the vanilla build().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the consensus to not prefix user-facing things and just hope other mods do, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, will bear in mind 👍
...er-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/EntityTypeBuilderMixin.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
/** | ||
* Creates an entity type builder for a mob entity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we set the constructor? PlayerEntity
is the only one in vanilla where constructor is skipped. Otherwise client sync/biome spawn/etc wouldn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see good point. The previous API you would set the factory via the builder methods, of course this cannot happen now.
…avour of the vanilla classes (#3677) * Replace FabricEntityTypeBuilder with EntityTypeBuilder + iface injection * Finish and test entity type builder * Deprecate FabricBlockEntityTypeBuilder * Review fix * Fixes based on review * Some fixes * Checkstyle
Depends on #3666 due to generic interface injection