-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Use BlockEntity.getType to check for valid block state #1442
Conversation
Last commit published: 514b6861feb5d84e17f3c29f23f2149bf5f7c4a4. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #1442' // https://github.com/neoforged/NeoForge/pull/1442
url 'https://prmaven.neoforged.net/NeoForge/pr1442'
content {
includeModule('net.neoforged', 'neoforge')
includeModule('net.neoforged', 'testframework')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr1442
cd NeoForge-pr1442
curl -L https://prmaven.neoforged.net/NeoForge/pr1442/net/neoforged/neoforge/21.1.7-pr-1442-block-entity-type-fix/mdk-pr1442.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip To test a production environment, you can download the installer from here. |
514b686
🚀 This PR has been released as NeoForge version |
} | ||
|
||
public boolean isValidBlockState(BlockState p_353131_) { | ||
- return this.type.isValid(p_353131_); |
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.
Maybe add a // TODO Remove in next breaking phase
? It's just here to unbreak old mods that were made before the vanilla change and is not needed for new mods that can override this method themselves.
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.
It shouldn't be a requirement for mods to override both this and getType
, IMO.
Changes the logic in
BlockEntity.isValidBlockState
to usegetType
, rather than the privatetype
field, to allow subclasses that use a different block entity type to work properly, since it is not always possible to provide the new type to the superclass.