-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Add config to only lobotomize villagers that have been traded with #1466
Conversation
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.
Merge this patch into the lobotomize patch, feel free to add yourself as a co-author.
- this.isLobotomized = !canTravelFrom(BlockPos.containing(this.position().x, this.getBoundingBox().minY + 0.0625D, this.position().z)); | ||
+ boolean canLobotomize = true; | ||
+ if(shouldCheckForTradeLocked) { | ||
+ canLobotomize = this.getVillagerXp() != 0; | ||
+ } | ||
+ this.isLobotomized = canLobotomize && !canTravelFrom(BlockPos.containing(this.position().x, this.getBoundingBox().minY + 0.0625D, this.position().z)); |
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.
inline the canLobotomize check into the this.isLobotomized = ...
line.
this.isLobotomized = (shouldCheckForTradeLocked && this.getVillagerXp() != 0) && ...
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.
condensed the logic, yours was a bit off when I double checked it. here's a truth table I used to check my work:
C = only lobotomize traded with
X = has no xp
E = existing lobotomize condition
F = is lobotomized
(C -> !X) ^ E
(!C v !X) ^ E
!(C ^ X) ^ E
C X E F
0 0 0 0 !(0 ^ 0) ^ 0 0
0 0 1 1 !(0 ^ 0) ^ 1 1
0 1 0 0 !(0 ^ 1) ^ 0 0
0 1 1 1 !(0 ^ 1) ^ 1 1
1 0 0 0 !(1 ^ 0) ^ 0 0
1 0 1 1 !(1 ^ 0) ^ 1 1
1 1 0 0 !(1 ^ 1) ^ 0 0
1 1 1 0 !(1 ^ 1) ^ 1 0
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.
LGTM! All that's left is creating a PR to PurpurDocs documenting the new option :) Once that's done both PRs will be merged later today (PST)
Added a config (defaults to old behavior) that makes villagers only get lobotomized if they've been traded with at least once (their trades are locked).