-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added an OnPvP compatability event #356
Added an OnPvP compatability event #356
Conversation
Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice.
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.
Looks good overall, here is my code review.
src/main/java/pvpmode/internal/server/PvPServerEventHandler.java
Outdated
Show resolved
Hide resolved
* function will be invoked twice per attack - this is because of a Forge bug. | ||
* Cancels combat events associated with PvP-disabled players. Note that | ||
* this function will be invoked twice per attack - this is because of a | ||
* Forge bug, but the {@link PvPCommonUtils isCurrentAttackDuplicate} call |
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.
* Forge bug, but the {@link PvPCommonUtils isCurrentAttackDuplicate} call | |
* Forge bug, but the {@link PvPCommonUtils#isCurrentAttackDuplicate()} call |
Possibly the parentheses after the method are not required, not too sure.
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 works with them, so they might as well be added.
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.
Nice! Just a few little things, but then I think we can merge it.
@VinyarionHyarmendacil When @mahtaran does approve it too, please do a squash-merge (should be the only option) and use |
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.
Almost (see comment for why I approved it.)
src/main/java/pvpmode/internal/server/PvPServerEventHandler.java
Outdated
Show resolved
Hide resolved
`pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]`
Co-Authored-By: Mahtaran <[email protected]>
@VinyarionHyarmendacil The pvpadmin change doesn't belong to this PR. PRs are centered around one feature. Please move that to another one. |
This reverts commit f69c7c9.
Yeah, I accidently pushed it, didn't mean to. |
cccc19c
into
Lembas-Modding-Team:development_not-reviewed
* Added an OnPvP compatability event See Issue #338: #338 * Fixed duplicate LivingAttackEvents Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice. * Review 1: Added an OnPvP compatability event * Improved pvpadmin command `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Review 2: Added an OnPvP compatability event Co-Authored-By: Mahtaran <[email protected]> Update src/main/java/pvpmode/api/server/compatibility/events/OnPvPEvent.java Co-Authored-By: Mahtaran <[email protected]>
* Added an OnPvP compatability event See Issue #338: #338 * Fixed duplicate LivingAttackEvents Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice. * Review 1: Added an OnPvP compatability event * Improved pvpadmin command `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Review 2: Added an OnPvP compatability event Co-Authored-By: Mahtaran <[email protected]> Update src/main/java/pvpmode/api/server/compatibility/events/OnPvPEvent.java Co-Authored-By: Mahtaran <[email protected]>
* Added an OnPvP compatability event See Issue #338: #338 * Fixed duplicate LivingAttackEvents Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice. * Review 1: Added an OnPvP compatability event * Improved pvpadmin command `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Review 2: Added an OnPvP compatability event Co-Authored-By: Mahtaran <[email protected]> Update src/main/java/pvpmode/api/server/compatibility/events/OnPvPEvent.java Co-Authored-By: Mahtaran <[email protected]>
* Renamed the faction placeholders HARAD and RHUN Fixes a warning because the faction RHUN exists too. * Added support for pledging specifiers * Updated to v35.2 of the LOTR Mod * Fixed a crash in singleplayer * Added an OnPvP compatability event See Issue #338: #338 * Fixed duplicate LivingAttackEvents Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice. * Review 1: Added an OnPvP compatability event * Improved pvpadmin command `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Review 2: Added an OnPvP compatability event Co-Authored-By: Mahtaran <[email protected]> * Revert "Improved pvpadmin command" This reverts commit f69c7c9. * Added an OnPvP compatability event (#356) * Added an OnPvP compatability event See Issue #338: #338 * Fixed duplicate LivingAttackEvents Alleviate the Forge bug causing duplicate posts of the LivingAttackEvent. Forge posts this event twice, once in EntityPlayer, and once in EntityLivingBase, so this tells if an EntityPlayer got hurt but the event was posted as an EntityLivingBase, then immediately returns, so nothing important gets run twice. * Review 1: Added an OnPvP compatability event * Improved pvpadmin command `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Review 2: Added an OnPvP compatability event Co-Authored-By: Mahtaran <[email protected]> * Improved pvpadmin command, again `pvpadmin resetCooldown <player>` and `pvpadmin spy <player> [on|off]` * Added togglable ability to poison drinks See Issue #333 * Revert "Added togglable ability to poison drinks" This reverts commit 510ebdd. * Update src/main/java/pvpmode/internal/server/command/PvPCommandAdmin.java Co-Authored-By: Mahtaran <[email protected]> * Update CHANGELOG.md * Update ServerCommandConstants.java * Fixed whitespace and incorrect conflict resolution
See Issue #338.