-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 16 additions & 3 deletions
19
src/main/java/com/gtnewhorizon/gtnhlib/api/CapturingTesselator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |