Skip to content

Commit

Permalink
Revert fluid animation fix for Quartz Tank to mitigate FPS issue (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Aug 27, 2023
1 parent 4de0ee4 commit 1f55def
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1690907958
//version: 1692122114
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -562,9 +562,6 @@ repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
Expand Down Expand Up @@ -1152,7 +1149,10 @@ tasks.named("processIdeaSettings").configure {

tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar", "spotlessCheck")
dependsOn("jar", "reobfJar")
if (!disableSpotless) {
dependsOn("spotlessCheck")
}
}

// workaround variable hiding in pom processing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Nonnull;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
Expand Down Expand Up @@ -78,7 +75,7 @@ public static int[] getFluidDisplayLists(FluidStack fluidStack, World world, boo
return null;
}
Map<Fluid, int[]> cache = flowing ? flowingRenderCache : stillRenderCache;
int[] diplayLists = getCachedData(fluid, cache);
int[] diplayLists = cache.get(fluid);
if (diplayLists != null) {
return diplayLists;
}
Expand Down Expand Up @@ -122,11 +119,4 @@ public static int[] getFluidDisplayLists(FluidStack fluidStack, World world, boo
return diplayLists;
}

private static int[] getCachedData(@Nonnull Fluid fluid, Map<Fluid, int[]> cache) {
IIcon icon = fluid.getIcon();
if (icon instanceof TextureAtlasSprite sprite && sprite.hasAnimationMetadata()) {
return null;
}
return cache.get(fluid);
}
}

0 comments on commit 1f55def

Please sign in to comment.