Fix thermal foundation integration (support older versions)

This commit is contained in:
Justin Aquadro committed 2016-02-11 23:45:29 -05:00
1 parent 2cc1fc2c32
commit 6d8d2f5362
2 files changed
+17 -2

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-1.7.9"
version = "1.7.10-1.8.0"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -1,8 +1,13 @@
package com.jaquadro.minecraft.storagedrawers.integration;
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.core.ModItems;
import com.jaquadro.minecraft.storagedrawers.integration.thermalfoundation.CoFHSecurityProvider;
import com.mojang.authlib.GameProfile;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import java.lang.reflect.Method;
@@ -19,7 +24,12 @@ public class ThermalFoundation extends IntegrationModule
@Override
public void init () throws Throwable {
classRegistrySocial = Class.forName("cofh.core.RegistrySocial");
try {
classRegistrySocial = Class.forName("cofh.core.RegistrySocial");
}
catch (ClassNotFoundException e) {
classRegistrySocial = Class.forName("cofh.core.util.SocialRegistry");
}
methodPlayerHasAccess = classRegistrySocial.getDeclaredMethod("playerHasAccess", String.class, GameProfile.class);
}
@@ -27,6 +37,11 @@ public class ThermalFoundation extends IntegrationModule
@Override
public void postInit () {
StorageDrawers.securityRegistry.registerProvider(new CoFHSecurityProvider(this));
if (StorageDrawers.config.cache.enablePersonalUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.personalKey, 1, 1), "xxx", "xyx", "xxx",
'x', "nuggetSignalum", 'y', ModItems.personalKey));
}
}
public boolean playerHasAccess (String playerName, GameProfile owner) {