-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Handle ClientboundTickingStatePacket correctly and fix Throwable Scales #4850
base: master
Are you sure you want to change the base?
Conversation
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
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.
thank you!
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
It would also be nice to implement ClientboundTickingStepPacket if you're able |
47e69a1
to
83fab59
Compare
Fixed in latest commit. |
Can review in 12hrs |
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/entity/type/Tickable.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
Co-authored-by: rtm516 <[email protected]>
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
Some issues I've noticed, handling of block breaking speed when tick rate is less than 20 is not correct and player speed/gravity is not correct |
Also animations are way too quick on the bedrock side, for other players I think we could send that they have mining fatigue to the session so that their arm animation speeds are slower Most stuff like this we probably cant fix, though |
Yeah, I don't think we should aim to resolve every single thing, seeing as Bedrock will still be operating under a 20 ticks per second cycle. I assume most people will be using this as a debugging tool, or is that assessment incorrect? |
Its mostly used for testing redstone, in my case I use it for testing plugins. |
nvm i dont think it updates the tick count every frame, should keep draw tick updating at the same speed as the game |
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, the setInvisible method for throwable items used to be able to force the entity to be invisible. would be nice to restore that behaviour
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
I'm going to try complete this today, if i can't finish it today I will try tomorrow. |
…/Geyser into tick-rate-handling
@@ -91,7 +92,8 @@ public static void sendCooldown(GeyserSession session) { | |||
*/ | |||
private static void computeCooldown(GeyserSession session, CooldownType sessionPreference, long lastHitTime) { | |||
if (session.isClosed()) return; // Don't run scheduled tasks if the client left | |||
if (lastHitTime != session.getLastHitTime()) return; // Means another cooldown has started so there's no need to continue this one | |||
if (lastHitTime != session.getLastHitTime()) | |||
return; // Means another cooldown has started so there's no need to continue this one |
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.
revert or add braces
@@ -58,7 +58,8 @@ public static void sendCooldown(GeyserSession session) { | |||
CooldownType sessionPreference = session.getPreferencesCache().getCooldownPreference(); | |||
if (sessionPreference == CooldownType.DISABLED) return; | |||
|
|||
if (session.getAttackSpeed() == 0.0 || session.getAttackSpeed() > 20) return; // 0.0 usually happens on login and causes issues with visuals; anything above 20 means a plugin like OldCombatMechanics is being used | |||
if (session.getAttackSpeed() == 0.0 || session.getAttackSpeed() > 20) | |||
return; // 0.0 usually happens on login and causes issues with visuals; anything above 20 means a plugin like OldCombatMechanics is being used |
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.
revert or add braces
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
Outdated
Show resolved
Hide resolved
Okay, I've fixed title animations, attack indicator and some item cooldowns to be updated with tick rate. I'm not sure what other things require changes but it should be ready for testing if anyone can |
@@ -652,6 +655,17 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { | |||
|
|||
private MinecraftProtocol protocol; | |||
|
|||
@Getter |
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.
The class is annotated with a getter, this is likely unnecessary
@@ -652,6 +655,17 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { | |||
|
|||
private MinecraftProtocol protocol; | |||
|
|||
@Getter | |||
private int nanosecondsPerTick = 50000000; | |||
@Getter |
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.
same as above
Co-authored-by: chris <[email protected]>
Handles custom tick rates sent from the ClientboundTickingStatePacket correctly. This freezes all tickable entitys and changes the geyser session tick() function update speed correctly.