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

"Fix" world time.... #693

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void updateStage(ImmutableList<Uniform> uniforms) {

private static long getCurrentTick() {
if (Minecraft.getMinecraft().theWorld != null) {
return Minecraft.getMinecraft().theWorld.getWorldTime();
return Minecraft.getMinecraft().theWorld.getTotalWorldTime();
} else {
return 0L;
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/net/coderbot/iris/gui/element/IrisGuiSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.amountScrolled += ((float) mouseY - this.initialClickY);
this.initialClickY = mouseY;
} else if (this.mc.currentScreen != null ){
for (; !this.mc.gameSettings.touchscreen && Mouse.next(); this.mc.currentScreen.handleMouseInput()) {
while (!this.mc.gameSettings.touchscreen && Mouse.next()) {
if(this.mc.currentScreen != null) {
this.mc.currentScreen.handleMouseInput();
}
int dWheel = Mouse.getEventDWheel();

if (dWheel != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static float getTimeAngle() {
}

private static int getWorldDayTime() {
return (int) (Minecraft.getMinecraft().theWorld.getWorldTime() % 24000L);
return (int) (Minecraft.getMinecraft().theWorld.getTotalWorldTime() % 24000L);
// Level level = Minecraft.getMinecraft().theWorld;
// long timeOfDay = level.getDayTime();
// long dayTime = ((DimensionTypeAccessor) level.dimensionType()).getFixedTime().orElse(timeOfDay % 24000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public static void addWorldTimeUniforms(UniformHolder uniforms) {
}

static int getWorldDayTime() {
return (int) (getWorld().getWorldTime() % 24000L);
return (int) (getWorld().getTotalWorldTime() % 24000L);

// long dayTime = ((DimensionTypeAccessor) getWorld().dimensionType()).getFixedTime().orElse(timeOfDay % 24000L);
}

private static int getWorldDay() {
return (int) (getWorld().getWorldTime() / 24000L);
return (int) (getWorld().getTotalWorldTime() / 24000L);
}

private static WorldClient getWorld() {
Expand Down