Skip to content
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

Move everything to a tick loop #170

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Move everything to a tick loop #170

merged 1 commit into from
Aug 11, 2023

Conversation

grepsedawk
Copy link
Collaborator

@grepsedawk grepsedawk commented Jul 28, 2023

Only digging, use hand, change hotbar slot, and physics are part of this
loops sofar

Speed up the specs greatly using event emitter callbacks

Add apple to eating

Fix a ton of random anti-cheat issues

Fix a few inventory desync issues

Resolves #98
Resolves #97

@grepsedawk grepsedawk marked this pull request as draft July 28, 2023 19:03
@grepsedawk grepsedawk changed the title WIP: Move everything to a tick loop Move everything to a tick loop Aug 1, 2023
@grepsedawk grepsedawk marked this pull request as ready for review August 1, 2023 05:40
@grepsedawk grepsedawk requested review from Gjum, ArtificialDriver and awoo-civ and removed request for Gjum August 1, 2023 05:57
@grepsedawk grepsedawk force-pushed the ticker-i-hardly-know-her branch 4 times, most recently from 22aa285 to aa06fe9 Compare August 2, 2023 09:59
Comment on lines +167 to +173
def using_hand_delay_for(slot)
if slot.edible?
32
else
4
end
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not how vanilla does this code-wise, but I think it actually works in context

@@ -46,8 +46,8 @@ class Rosegold::Block
best_tool?(slot) || harvest_tools.try &.keys.includes? slot.item_id_int.to_s
end

def break_time(main_hand : Slot, player : Player, creative : Bool = false) : Int32
return 0 if creative
def break_damage(main_hand : Slot, player : Player, creative : Bool = false) : Float64
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is because blocks take "damage" every tick (fraction of 1) until you get to 1.0

Only digging, use hand, change hotbar slot, and physics are part of this
loops sofar

Speed up the specs greatly using event emitter callbacks

Add apple to eating

Fix a ton of random anti-cheat issues

Fix a few inventory desync issues

Fixes the occasional eating problems

Resolves #98
Resolves #97
@grepsedawk grepsedawk enabled auto-merge (rebase) August 11, 2023 04:34
@grepsedawk grepsedawk merged commit f568416 into main Aug 11, 2023
5 checks passed
@grepsedawk grepsedawk deleted the ticker-i-hardly-know-her branch August 11, 2023 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants