Skip to content

Commit

Permalink
Add getThreadTesselator to the API
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-OOG-ah committed Nov 11, 2024
1 parent 7c0b341 commit 8597e02
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
package com.gtnewhorizon.gtnhlib.api;

import com.gtnewhorizon.gtnhlib.client.renderer.TessellatorManager;
import net.minecraft.client.renderer.Tessellator;

public class CapturingTesselator {

public static boolean isCapturing() {
@SuppressWarnings("unused")
public interface CapturingTesselator {
/**
* @return True if this thread is capturing quads, false otherwise
*/
static boolean isCapturing() {
return TessellatorManager.isCurrentlyCapturing();
}

/**
* @throws IllegalStateException If the thread is not capturing and is not the main one.
* @return The CapturingTesselator for this thread if capturing, or else {@link Tessellator#instance} if on the main
* one.
*/
static Tessellator getThreadTesselator() {
return TessellatorManager.get();
}
}

0 comments on commit 8597e02

Please sign in to comment.