Skip to content

Commit

Permalink
"Fix" world time.... (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 authored Oct 30, 2024
1 parent e43cd6f commit 538b388
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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

0 comments on commit 538b388

Please sign in to comment.