-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement new Wrapper Events #241
Conversation
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
===========================================
- Coverage 13.65% 13.5% -0.16%
Complexity 652 652
===========================================
Files 395 395
Lines 11387 11516 +129
Branches 1246 1246
===========================================
Hits 1555 1555
- Misses 9734 9863 +129
Partials 98 98
Continue to review full report at Codecov.
|
5ba8a5d
to
efd1587
Compare
efd1587
to
1dcb7f1
Compare
@@ -64,6 +66,10 @@ public void damage(double amount, DamageType type) { | |||
living.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); | |||
} | |||
} | |||
if (entity != null) { |
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.
Would entity
being null break the rest of the code?
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.
That was done because of BWEntityFX
, but I have a better fix for that now.
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.
This line wouldn’t have prevented a NPE anyway, as that would have been thrown already
FWTile tile = (block instanceof Updater) ? updaterInjector.inject(block, new Class[] { String.class }, new Object[] { blockID }) : injector.inject(block, new Class[] { | ||
String.class }, new Object[] { blockID }); | ||
FWTile tile = (block instanceof Updater) ? updaterInjector.inject(block, new Class[] { String.class }, new Object[] { blockID }) : | ||
injector.inject(block, new Class[] { String.class }, new Object[] { blockID }); |
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.
This ternary expression is pretty long, why not do this:
ComponentInjector<FWTile> injector = (block instanceof Updater) ? updaterInjector : injector;
injector.inject(block, new Class[] { String.class }, new Object[] { blockID });
@@ -64,6 +66,10 @@ public void damage(double amount, DamageType type) { | |||
living.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); | |||
} | |||
} | |||
if (entity != null) { |
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.
Ditto
1dcb7f1
to
478c075
Compare
Needed for wrappers to add wrapper-specific Components to backward wrappers.
For 1.9+: Needed for wrappers to add wrapper-specific Forge Capabilities (Forge’s equivalent of NOVA Components) to forward wrappers (eg. NOVA-Team/NOVA-Energy#4).
Split off from #235