-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
[1.21.4] Encourage more usage of IConditionBuider #1716
[1.21.4] Encourage more usage of IConditionBuider #1716
Conversation
Last commit published: 8620fb6e6c04d1e9dad7481b591d2e95c28f02fe. 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 #1716' // https://github.com/neoforged/NeoForge/pull/1716
url 'https://prmaven.neoforged.net/NeoForge/pr1716'
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-pr1716
cd NeoForge-pr1716
curl -L https://prmaven.neoforged.net/NeoForge/pr1716/net/neoforged/neoforge/21.4.41-beta-pr-1716-pr-condition-builder/mdk-pr1716.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. |
src/main/java/net/neoforged/neoforge/common/conditions/TagEmptyCondition.java
Outdated
Show resolved
Hide resolved
tests/src/main/java/net/neoforged/neoforge/debug/data/registries/DatapackEntryTests.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/IConditionBuilder.java
Outdated
Show resolved
Hide resolved
e2da34f
to
4a0cbc3
Compare
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.
Also: did you check for true
and false
conditions in the non-generated resource files?
src/main/java/net/neoforged/neoforge/common/conditions/IConditionBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/IConditionBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/IConditionBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/IConditionBuilder.java
Outdated
Show resolved
Hide resolved
tests/src/main/java/net/neoforged/neoforge/oldtest/conditions/ConditionalCodecTest.java
Show resolved
Hide resolved
1b4d449
to
25a288c
Compare
25a288c
to
589f506
Compare
@ApexModder, this PR introduces breaking changes. Compatibility checks
|
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.
I like this! I have a few minor comments.
src/main/java/net/neoforged/neoforge/common/conditions/ElementExistsCondition.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/ElementExistsCondition.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/ElementExistsCondition.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/NeoForgeConditions.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/TagEmptyCondition.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/TagEmptyCondition.java
Outdated
Show resolved
Hide resolved
tests/src/main/java/net/neoforged/neoforge/oldtest/DataGeneratorTest.java
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/common/conditions/NeoForgeConditions.java
Outdated
Show resolved
Hide resolved
by deprecating all shortcut constructors and moving them into `IConditionBuilder`
less of a breaking change
Convert `ItemExistsCondition` to a record
Rename `IConditionBuilder` -> `NeoForgeConditions`
… type Defaulting to `ITEM` registry if omitted Rename `ItemExistsCondition` to `ElementExistsCondition`
Also rename `element` property to `value`
`elementsExists` -> `isRegistered` `itemExists` -> `itemRegistered`
9fb2e69
to
e3926eb
Compare
…rgeMod` left over from initial class rename
🚀 This PR has been released as NeoForge version |
This PR aims to encourage modders to make more use of
IConditionBuilder
rather than constructing condition instances themselvesthis is done by
DataProvider
s which support conditions to now implementIConditionBuilder
making all of its helpers freely available to all inheritors.of
method allowing users to construct an instance in places where they do not have aDataProvider
or can implement it themselves.ICondtionBuilder
TRUE
/FALSE
conditions in favor of the newalways
/never
conditions