-
Notifications
You must be signed in to change notification settings - Fork 275
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
Tick fake players in network updating phase #1847
base: master
Are you sure you want to change the base?
Conversation
See this discussion on scicraft discord in 2020, for gnembon's opinion on the player action pack timing: https://discord.com/channels/211786369951989762/573613501164159016/771405054632394782
|
Also, "EN" and "NU" are not commonly used terms in the non-Chinese community. I would suggest using more precise words to describe them |
Could you provide more suggestions? what word should i use for tick phases?
In fact, in most situations we just expect fake players to be ticked and interact with other things in the game (actions) like real players, so that most farms can work both for real and fake players such as raid farms. Btw, there is an option to configure--if you want pig-like fake players you can just turn it on. |
src/main/java/carpet/mixins/ServerConnectionListener_fakePlayersMixin.java
Outdated
Show resolved
Hide resolved
connection.player.doTick(); | ||
// connection.player.absMoveTo(connection.firstGoodX, connection.firstGoodY, connection.firstGoodZ, connection.player.getYRot(), connection.player.getXRot()); | ||
|
||
// todo: vehicle? |
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'll suggest to mark the PR as a draft, if it's not completed yet
desc = "make fake players ticked in entity update phase, like legacy carpet.", | ||
category = CREATIVE | ||
) | ||
public static boolean fakePlayerTicksInEU = false; |
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.
Use a default value that changes the existing behavior is BAD. It breaks people's contraptions that rely on the old behavior sliently
} | ||
} | ||
|
||
@Inject(method = "doTick", at = @At(value = "HEAD")) |
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.
You are alternating where real player's action pack gets ticked right? then the same as https://github.com/gnembon/fabric-carpet/pull/1847/files#r1412213260
@@ -23,6 +25,11 @@ public void send(final Packet<?> packetIn) | |||
{ | |||
} | |||
|
|||
@Override |
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.
any explanations for the changes in these files? they don't seem related
import java.util.List; | ||
|
||
public class FakePlayerManager { | ||
public static List<ServerGamePacketListenerImpl> connections = new ArrayList<>(); |
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.
Suggestion: use concurrency-proof containers to handle potential concurrent access in certain situations (e.g. using mods)
that's gnembon's opinion, I'll suggest to ask him directly
See #1847 (comment) |
Is there any downside to only ticking them in the right/more correct phase? If there isn't I'd remove the old behaviour completely. |
Some contraptions may be breoken after we changed this, so I think it is a right choice not to cchange the existing behavior and add an option to tick them in the correct phases. |
How many contraptions depend on fake players working differently than real ones? (outside of ones built specifically to detect them). I'd expect fake players would be used to test things where real players would be the actual target, so having them work for real-like players would be the idea (that's been the idea of fake players from the start, just wasn't completely accurate). Having two code paths seems redundant when one is clearly "better" (more accurate). We'd also release this on a snapshot/major (mojang versioning wise) version anyway and we don't usually backport, so the chances of breaking being unnoticed are lower. |
afaik, some raid farms are specially designed for fake players for the tick phase order, this makes them 1gt faster then real players
Yes, it is a breaking change so I just suggest we shoulld be more careful, I totally agree that a contraption that real players cannot use it not "useful". |
In this PR, I moved fake player logic from EN to NU, so they can be ticked like real players.
There is also a new rule called
fakePlayerTicksInEU
for players who want the old fake player mechanics, it is false by default.