Add MC hold to eat delay #4144
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4144
Loading…
Reference in New Issue
No description provided.
Delete Branch "Eliy21/MineClone2:eating_delay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #3256
Testing
-Test eating foods by holding right-click or holding a double tap on touchscreen. (Make sure your hunger bar is not full)
-Test eating cakes, potions, golden apples, milk buckets and sus stew
-Test on creative and survival
-Test the mcl_eating_delay in settings
Oh crap. Please help. I allowed edits to PR if that can help. Otherwise I'll just remake the branch and PR without the settingtypes.txt as everything else is functional.
Looks good!, just like MC. Question, Is the default delay the exact same as in MC?
Pull the branch and apply the settings change again.
I can help!
Let me get setup.
Yes. https://minecraft.wiki/w/Food#Usage
I'll remake the whole thing again. Please wait.
Mesehub falling apart again... wait before pulling.
Okay, I'll not remake the whole thing again for now while I wait for your help.
Don't remake. Just pull master into your branch and add the change.
Is that why the "Update by rebase" button keeps failing?
Yeah. It may take a few hours or so until in works properly.
umm, how do i make a PR for a repo thats already a fork?
or can you just add me to your repo?
I have no idea. It's probably easier if I remake the whole thing.
Okay here's my plan. I make an empty branch and make a new PR and then rebase it before doing any commits. Please wait...
Just a question, How long does it take for someone to get write access on this repo @the-real-herowl?
It would be useful so i can work on a PR's branch.
Okay, but i really need to learn how to do that, so i can contribute to other peoples PRs
Um should I wait for you on that. It's fine with me but I already PR'ed the thing. I'm fine either way but I'll just finish the other PR first. I don't mind if I waste my time there.
Can you give me write access to your repo please?
So i can push changes.
I cant figure out how to make a PR on a fork of a fork.
I don't know how to do that. Can you tell me how?
Write access to regular branches on this repo has no hard cutoff, depends on how we feel about it, some got it after their first PR.
So anyway yes this mean that @Eliy21, you are eligible for it – if you want. You @Impulse not yet. Both of you, join our discord if you want. The link is in the Readme.md file.
Now, returning to the question, @Impulse, write access to regular branches of the repo doesn't grant you access to branches on forks anyway, even if someone ticks the "allow edits..." box.
And while you don't have access to the regular branches of the repo, you can make a PR targeting a branch (even those with master write access sometimes make such PRs, see #4019). You theoretically should be able to make a PR on a fork, but tbh better don't. Better keep it all in one place.
@Eliy21 making the second PR for the same thing was unnecessary really over such a small thing.
Thank you for the write access offer but I don't trust myself to not accidentally nuke stuff like when I oopsie'd my whole main fork and branches to oblivion. If there's a pressing need for it maybe but for now I'll just gratefully appreciate the thought.
lol sorry
Okay i am ready to push to your fork, fixed it. I just need privs @Eliy21
How can I do it? Please teach me. @Impulse
Here is the patch file:
These are the instructions @Eliy21
git pull
yourmaster
branch so its updated withupstream
eating_delay
branch tomaster
git apply /path/to/my_patch.patch
Um how do I do it in the gui?
Go here and add me and i can push the changed for you:
https://git.minetest.land/Eliy21/MineClone2/settings/collaboration
EDIT: sorry i put wrong url in, now it works.
It says 404:
EDIT:
Ohh okay I see it now. Wait...
I don't think you can do it via a GUI, at least easily. If you add me i can push the changes for you.
Ok I added you now @Impulse
e4549d327a
toc70ae8e535
@Impulse Did it work properly? When I look at my eating_delay branch it seems like everything got reset. (https://git.minetest.land/Eliy21/MineClone2/src/branch/eating_delay)
Sorry its taking a while, the patch file has a conflict, i am just fixing it.
Okay I'll leave it all up to you here since I gotta go for now.
Fixed it. Was a pa lava, because another commit in master modified the
init.lua
file as well as thesettingtypes.txt
and i had to resolve the conflicts. It should be fine now.Just make sure to run git pull before you push your changes @Eliy21
It reduces these issues.
Congrats on fixing it. I don't know what a "pa lava" is but I'm glad to be of use even as a Guinea pig. Thank you for helping me with this PR.
I don't use git but I'll try to keep that in mind if I ever do use it in the future. Thanks.
c580071ec5
to2c52c9009f
5db662f5ed
to760909f49c
@ -183,1 +183,4 @@
local function eat_gapple_delayed(itemstack, placer, pointed_thing)
local function eat_gapple(itemstack, placer, pointed_thing)
Gapples have the same issue as milk, duped infinitely with itemframes.
Done
@ -147,1 +147,4 @@
local function drink_milk_delayed(itemstack, player, pointed_thing)
local function drink_milk(itemstack, player, pointed_thing)
Milk bucket gets duplicated when putting it into an item frame. I'll leave it to you to find and patch the cause for now.
Done
@ -79,2 +79,4 @@
end
local function eat_stew_delayed(itemstack, user, pointed_thing)
-- Wrapper for handling mcl_hunger delayed eating
This function doesn't handle block right-click function when "placing". This results in not being able to put stews in itemframes, among other things. Look at or utilize the normal code for this maybe.
Done
@ -42,0 +48,4 @@
mcl_hunger.eat_internal[name].replace_with_item = replace_with_item
mcl_hunger.eat_internal[name].itemstack = itemstack
mcl_hunger.eat_internal[name].user = user
mcl_hunger.eat_internal[name].pointed_thing = pointed_thing
Use
table.update()
(defined in mcl_util) when changing so many predefined fields in one table in one go.Done
@ -187,0 +289,4 @@
end
if not mcl_hunger.eat_internal[player_name].pitch then
mcl_hunger.eat_internal[player_name].pitch = 1 + math.random(-10, 10)*0.005
Out of curiosity, where is this formula from?
And, can it be documented? Just trying to prevent "magic numbers" as in the future someone will come along, and wonder what the numbers specifically mean. A lot of the code has this, and when we have to do a rewrite it becomes really annoying.
The formula was always there before this PR. It was in lines 140 and 171 of /mods/PLAYER/mcl_hunger/hunger.lua previously.
This deals with randomizing the pitch each time a player eats from 0.95 to 1.05 but now that due to this PR the eating behavior will play those consecutively then the code was placed at the start of each eating session so that there is one chosen random pitch for the rest instead of randomizing all the sounds within one eating session.
Of course all of this is negated by the fact that there are two eating sound files that are chosen in random anyways (mcl_hunger_bite.1.ogg and mcl_hunger_bite.2.ogg) but the code is there if in the future the decision to opt for one sound per eating session is chosen.
06962ebd95
to5154dce8d0