Now more thread safe (#484)

* Now more thread safe
This commit is contained in:
Jason Mitchell authored and GitHub committed 2024-03-02 21:42:40 +01:00
1 parent 72218b010f
commit ed2150287c
17 files changed
+140 -178

No files matched your search

@@ -40,7 +40,8 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class BusRenderHelper implements IPartRenderHelper {
public static final BusRenderHelper INSTANCE = new BusRenderHelper();
public static final ThreadLocal<BusRenderHelper> instances = ThreadLocal.withInitial(BusRenderHelper::new);
private static final int HEX_WHITE = 0xffffff;
private final BoundBoxCalculator bbc;
@@ -438,8 +439,8 @@ public final class BusRenderHelper implements IPartRenderHelper {
final AEBaseBlock block = (AEBaseBlock) multiPart;
final BlockRenderInfo info = block.getRendererInstance();
final ForgeDirection forward = BusRenderHelper.INSTANCE.az;
final ForgeDirection up = BusRenderHelper.INSTANCE.ay;
final ForgeDirection forward = BusRenderHelper.instances.get().az;
final ForgeDirection up = BusRenderHelper.instances.get().ay;
renderer.uvRotateBottom = info.getTexture(ForgeDirection.DOWN)
.setFlip(BaseBlockRender.getOrientation(ForgeDirection.DOWN, forward, up));