mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-12 03:47:34 +00:00
RenderUtil cleanup
This commit is contained in:
1 parent
173e60ac58
commit
31826c9415
1 file changed
+9
-9
@@ -39,15 +39,7 @@ import static net.minecraft.client.Minecraft.getMinecraft;
|
||||
@NoArgsConstructor(access = PRIVATE)
|
||||
@StableAPI(since = "0.8.0")
|
||||
public final class RenderUtil {
|
||||
private final static Timer MINECRAFT_TIMER = getMinecraftTimer();
|
||||
|
||||
@StableAPI.Expose
|
||||
@SneakyThrows
|
||||
private static Timer getMinecraftTimer() {
|
||||
val timerField = ReflectionHelper.findField(Minecraft.class, "timer", "field_71428_T");
|
||||
timerField.setAccessible(true);
|
||||
return (Timer) timerField.get(getMinecraft());
|
||||
}
|
||||
private static final Timer MINECRAFT_TIMER = getMinecraftTimer();
|
||||
|
||||
@StableAPI.Expose(since = "0.10.0")
|
||||
public static IIcon getFullTextureIcon(String iconName, int width, int height) {
|
||||
@@ -103,4 +95,12 @@ public final class RenderUtil {
|
||||
public static float partialTick() {
|
||||
return MINECRAFT_TIMER.renderPartialTicks;
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
@SneakyThrows
|
||||
private static Timer getMinecraftTimer() {
|
||||
val timerField = ReflectionHelper.findField(Minecraft.class, "timer", "field_71428_T");
|
||||
timerField.setAccessible(true);
|
||||
return (Timer) timerField.get(getMinecraft());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user