Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ public class MathHelperMixin_CompactLUT {
@Final
private static float[] SIN_TABLE;

@SuppressWarnings("InstantiationOfUtilityClass")
@Inject(method = "<clinit>", at = @At("RETURN"))
private static void clearSinTable(CallbackInfo ci) {
new CompactSineLUT(); // Force class initialisation
CompactSineLUT.init(); // Force class initialization
MathHelperMixin_CompactLUT.SIN_TABLE = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public class CompactSineLUT {
}
}

public static void init() {
// This is just to force class initialization
}

// [VanillaCopy] MathHelper#sin(float)
public static float sin(float f) {
return lookup((int) (f * 10430.378f) & 0xFFFF);
Expand Down
Loading