Error with time #11

Closed
opened 2024-07-27 14:06:14 -04:00 by CoderMonkey1956 · 4 comments
CoderMonkey1956 commented 2024-07-27 14:06:14 -04:00 (Migrated from github.com)

Have you searched the wiki and looked for existing issues for this?

  • This is not a common issue or cannot be fixed by the solutions provided
  • This issue has not been reported yet

What's happening

Hello. I am in the America/Chicago timezone. Even though right now it is about noon, the plugin seems to think that it is sunset? Not sure what to do here, i have debug mode on, and there are no errors in console. Also im running on paper and downloaded from modrinth (my browser couldn't use the drop down for whatever reason)

What's supposed to happen

The plugin would recognize its about noon and it would be daytime in game.

Server Software

Spigot

Minecraft version

1.20

Server log

No response

RTW configuration

No response

Additional information

No response

### Have you searched the wiki and looked for existing issues for this? - [X] This is not a common issue or cannot be fixed by the solutions provided - [X] This issue has not been reported yet ### What's happening Hello. I am in the America/Chicago timezone. Even though right now it is about noon, the plugin seems to think that it is sunset? Not sure what to do here, i have debug mode on, and there are no errors in console. Also im running on paper and downloaded from modrinth (my browser couldn't use the drop down for whatever reason) ### What's supposed to happen The plugin would recognize its about noon and it would be daytime in game. ### Server Software Spigot ### Minecraft version 1.20 ### Server log _No response_ ### RTW configuration _No response_ ### Additional information _No response_
CoderMonkey1956 commented 2024-07-27 14:10:21 -04:00 (Migrated from github.com)
Heres my config: https://pastebin.com/2jJHku89
Jack1424 commented 2024-07-27 14:21:48 -04:00 (Migrated from github.com)

Thank you for letting me know. I'll look into this as soon as I can.

Thank you for letting me know. I'll look into this as soon as I can.
CoderMonkey1956 commented 2024-07-27 21:57:07 -04:00 (Migrated from github.com)

Thank you for letting me know. I'll look into this as soon as I can.

It may have something to do with daylight savings? I'm really not too sure

> Thank you for letting me know. I'll look into this as soon as I can. It may have something to do with daylight savings? I'm really not too sure
hunter232 commented 2024-08-01 12:09:08 -04:00 (Migrated from github.com)

Looked into this myself and it seems to me these return lines have an issue with variable types.

int currentMinutes; long sunriseMinutes; long sunsetMinutes;

RealTimeWeather.java:167
return ((currentMinutes - sunriseMinutes) / (sunsetMinutes - sunriseMinutes) * 13569) + 23041;
RealTimeWeather.java:172
return ((currentMinutes - sunsetMinutes) / (1440 - sunsetMinutes + sunriseMinutes) * 13569) + 12610;

The result of the division is an integer(long?) type and thus only ever 0 or 1. I'd test throwing in a type cast to double, however I installed java today specifically for Minecraft and really don't feel like trying to figure out how to set up a build environment just for this.

looking forward to seeing this mod in action!

Looked into this myself and it seems to me these return lines have an issue with variable types. `int currentMinutes; long sunriseMinutes; long sunsetMinutes;` RealTimeWeather.java:167 `return ((currentMinutes - sunriseMinutes) / (sunsetMinutes - sunriseMinutes) * 13569) + 23041; ` RealTimeWeather.java:172 ` return ((currentMinutes - sunsetMinutes) / (1440 - sunsetMinutes + sunriseMinutes) * 13569) + 12610; ` The result of the division is an integer(long?) type and thus only ever 0 or 1. I'd test throwing in a type cast to double, however I installed java today specifically for Minecraft and really don't feel like trying to figure out how to set up a build environment just for this. looking forward to seeing this mod in action!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minster586/RealTimeWeather#11
No description provided.