mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-25 06:34:35 +00:00
Angelica Thread Safety
This commit is contained in:
1 parent
e9e63d6fc5
commit
06ec360694
15 files changed
+82
-38
No files matched your search
@@ -17,7 +17,8 @@ import lombok.Getter;
|
||||
public class SubmapManagerCTM implements ISubmapManager {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTM rb;
|
||||
private static final ThreadLocal<RenderBlocksCTM> renderBlocksThreadLocal = ThreadLocal
|
||||
.withInitial(RenderBlocksCTM::new);
|
||||
|
||||
@Getter
|
||||
private TextureSubmap submap, submapSmall;
|
||||
@@ -54,9 +55,7 @@ public class SubmapManagerCTM implements ISubmapManager {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||
if (rb == null) {
|
||||
rb = new RenderBlocksCTM();
|
||||
}
|
||||
RenderBlocksCTM rb = renderBlocksThreadLocal.get();
|
||||
rb.setRenderBoundsFromBlock(block);
|
||||
rb.submap = submap;
|
||||
rb.submapSmall = submapSmall;
|
||||
|
||||
Reference in new issue
Block a user