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

Can't get cats to give gifts #96

Open
hahaluckyme opened this issue Jul 31, 2021 · 5 comments
Open

Can't get cats to give gifts #96

hahaluckyme opened this issue Jul 31, 2021 · 5 comments

Comments

@hahaluckyme
Copy link

I play on a server that uses Harbor to skip the night, but I have been unsuccessful at getting cats to give gifts after sleeping. This blocks obtaining phantom membranes on servers that turn off nighttime phantoms.
https://minecraft.fandom.com/wiki/Cat#Gifts

My suspicion is that the non-instant version of skipping the night is interfering with cats being able to give a gift, but I'm not able to confirm it. Is this something that's been considered already?

@nkomarn
Copy link
Owner

nkomarn commented Aug 1, 2021

Honestly didn't even know about this vanilla feature.

I can look into the vanilla server code and check which exact conditions are being checked for gift giving and see if Harbor conflicts.

@hahaluckyme
Copy link
Author

Thanks! Yeah, I only found it about it a few days ago, seems like it's not really well known. Just from looking at the code briefly, it looks like calling setTime in small increments acts more like normal passage of time and overlooking the night skipping logic.

world.setTime(time + (int) timeRate);

@hahaluckyme
Copy link
Author

After further investigation, you need to set the TimeSkipEvent reason to be NIGHT_SKIP and not COMMAND.

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/world/TimeSkipEvent.SkipReason.html

@hahaluckyme
Copy link
Author

hahaluckyme commented Aug 3, 2021

Something like this at the very end of the skip cycle

TimeSkipEvent event = new TimeSkipEvent(worldserver.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, 0);
Bukkit.getPluginManager().callEvent(event);

@nkomarn
Copy link
Owner

nkomarn commented Aug 3, 2021

Looks like the time of day and player sleep counter need to be between a specific range for the gifts logic to run.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants