Fix compilation warnings

This commit is contained in:
Raven Szewczyk committed 2023-01-26 13:26:25 +00:00
1 parent b064d8ba07
commit f14ad7fbdc
4 files changed
+18 -1

No files matched your search

@@ -6,6 +6,7 @@ import java.util.HashMap;
public class CommonProxy {
public void registerF3Handler() {}
@SuppressWarnings("unchecked")
public void runCompatHooks() {
// Fix crash with OpenComputers/COFHCore due to a class extending OpenALException
try {
@@ -22,7 +22,7 @@ import java.lang.reflect.Field;
import java.util.Optional;
import sun.misc.Unsafe;
@SuppressWarnings("restriction")
@SuppressWarnings({"restriction", "sunapi"})
public class UnsafeHacks {
private static final Unsafe UNSAFE;
@@ -31,6 +31,10 @@ public class ItemStackHolderRef {
private static MethodHandle fieldSetter;
/**
* @author eigenraven
* @reason Simple helper function
*/
@Overwrite(remap = false)
private static void makeWritable(Field f) {
try {
@@ -41,6 +45,10 @@ public class ItemStackHolderRef {
}
}
/**
* @author eigenraven
* @reason Logic has to be significantly altered
*/
@Overwrite
public void apply() {
ItemStack is;
@@ -31,6 +31,10 @@ public class ObjectHolderRef {
private MethodHandle fieldSetter = null;
/**
* @author eigenraven
* @reason Simple helper function
*/
@Overwrite(remap = false)
private static void makeWritable(Field f) {
try {
@@ -40,6 +44,10 @@ public class ObjectHolderRef {
}
}
/**
* @author eigenraven
* @reason Logic has to be significantly altered
*/
@Overwrite(remap = false)
public void apply() {
if (fieldSetter == null) {