aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kubatech/api/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kubatech/api/helpers')
-rw-r--r--src/main/java/kubatech/api/helpers/EnderIOHelper.java28
-rw-r--r--src/main/java/kubatech/api/helpers/GTHelper.java2
-rw-r--r--src/main/java/kubatech/api/helpers/InfernalHelper.java34
-rw-r--r--src/main/java/kubatech/api/helpers/ReflectionHelper.java25
4 files changed, 35 insertions, 54 deletions
diff --git a/src/main/java/kubatech/api/helpers/EnderIOHelper.java b/src/main/java/kubatech/api/helpers/EnderIOHelper.java
index c5bb281b7e..30158500c7 100644
--- a/src/main/java/kubatech/api/helpers/EnderIOHelper.java
+++ b/src/main/java/kubatech/api/helpers/EnderIOHelper.java
@@ -1,31 +1,25 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.api.helpers;
-import crazypants.enderio.EnderIO;
import kubatech.api.LoaderReference;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.boss.IBossDisplayData;
+import crazypants.enderio.EnderIO;
+
public class EnderIOHelper {
+
public static boolean canEntityBeCapturedWithSoulVial(Entity entity, String entityID) {
if (!LoaderReference.EnderIO) return true;
if (ReflectionHelper.<Boolean>callMethod(EnderIO.itemSoulVessel, "isBlackListed", false, entityID))
diff --git a/src/main/java/kubatech/api/helpers/GTHelper.java b/src/main/java/kubatech/api/helpers/GTHelper.java
index 782c697232..16abbe348c 100644
--- a/src/main/java/kubatech/api/helpers/GTHelper.java
+++ b/src/main/java/kubatech/api/helpers/GTHelper.java
@@ -3,9 +3,9 @@ package kubatech.api.helpers;
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity;
import static kubatech.api.Variables.ln4;
+import kubatech.api.implementations.KubaTechGTMultiBlockBase;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import kubatech.api.implementations.KubaTechGTMultiBlockBase;
public class GTHelper {
diff --git a/src/main/java/kubatech/api/helpers/InfernalHelper.java b/src/main/java/kubatech/api/helpers/InfernalHelper.java
index dcfd87daad..a2842d66a7 100644
--- a/src/main/java/kubatech/api/helpers/InfernalHelper.java
+++ b/src/main/java/kubatech/api/helpers/InfernalHelper.java
@@ -1,34 +1,28 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.api.helpers;
-import atomicstryker.infernalmobs.common.InfernalMobsCore;
-import atomicstryker.infernalmobs.common.mods.api.ModifierLoader;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
+
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
+import atomicstryker.infernalmobs.common.InfernalMobsCore;
+import atomicstryker.infernalmobs.common.mods.api.ModifierLoader;
+
@SuppressWarnings("unchecked")
public class InfernalHelper {
+
private static Method isClassAllowed = null;
public static boolean isClassAllowed(EntityLivingBase e) {
@@ -49,8 +43,8 @@ public class InfernalHelper {
public static boolean checkEntityClassForced(EntityLivingBase e) {
try {
if (checkEntityClassForced == null) {
- checkEntityClassForced =
- InfernalMobsCore.class.getDeclaredMethod("checkEntityClassForced", EntityLivingBase.class);
+ checkEntityClassForced = InfernalMobsCore.class
+ .getDeclaredMethod("checkEntityClassForced", EntityLivingBase.class);
checkEntityClassForced.setAccessible(true);
}
return (boolean) checkEntityClassForced.invoke(InfernalMobsCore.instance(), e);
diff --git a/src/main/java/kubatech/api/helpers/ReflectionHelper.java b/src/main/java/kubatech/api/helpers/ReflectionHelper.java
index 03fc9f45d9..404d1de5f9 100644
--- a/src/main/java/kubatech/api/helpers/ReflectionHelper.java
+++ b/src/main/java/kubatech/api/helpers/ReflectionHelper.java
@@ -1,20 +1,11 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.api.helpers;
@@ -24,7 +15,9 @@ import java.lang.reflect.Method;
import java.util.HashMap;
public class ReflectionHelper {
+
private static class _FieldsMethods {
+
HashMap<String, Field> fields = new HashMap<>();
HashMap<String, Method> methods = new HashMap<>();
}