diff --git a/build.gradle b/build.gradle index fafe77aa..4ab8cbfd 100644 --- a/build.gradle +++ b/build.gradle @@ -45,27 +45,14 @@ if (new File(projectDir, '.git').exists()) repositories { maven { url "http://dvs1.progwml6.com/files/maven" } - maven { url "http://mobiusstrip.eu/maven" } maven { url "http://tehnut.info/maven" } - - ivy { - name "Thaumcraft" - artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-[revision]-deobf.[ext]" - } - ivy { - name "Baubles" - artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-1.8.9-[revision]-deobf.[ext]" - } } dependencies { deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}" - deobfCompile "mcp.mobius.waila:Waila:${waila_version}_${mc_version}:dev" + deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_${mc_version}" deobfCompile "info.amerifrance.guideapi:Guide-API:${mc_version}-${guideapi_version}" deobfCompile "info.tehnut.buttons:Buttons:${buttons_version}:api" - -// compile name: "Thaumcraft", version: "${mc_version}-${thaumcraft_version}", ext: "jar" -// compile name: 'Baubles', version: "${baubles_version}", ext: 'jar' } minecraft { @@ -205,6 +192,8 @@ String getChangelogText() { def curseRelations = { optionalLibrary 'just-enough-items-jei' optionalLibrary 'waila' + optionalLibrary 'hwyla' + optionalLibrary 'buttonz' requiredLibrary 'guide-api' } @@ -218,8 +207,6 @@ curseforge { releaseType = 'beta' relations curseRelations - addGameVersion '1.10' - addGameVersion '1.10.2' addArtifact javadocJar addArtifact sourceJar diff --git a/gradle.properties b/gradle.properties index 2fd30a99..cf4b78a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,13 @@ mod_name=BloodMagic package_group=com.wayoftime.bloodmagic mod_version=2.1.0 -mc_version=1.9.4 -forge_version=12.17.0.1957 +mc_version=1.10.2 +forge_version=12.18.3.2221 curse_id=224791 -mappings_version=snapshot_20160518 +mappings_version=stable_29 -jei_version=3.6.8.225 -waila_version=1.7.0-B3 -thaumcraft_version=5.1.5 -baubles_version=1.1.3.0 -guideapi_version=2.0.0-37 +jei_version=3.14.4.404 +waila_version=1.8.9-B23 +guideapi_version=2.0.2-45 buttons_version=1.10.2-0.0.3-3 \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java index 776ab881..7e0dbe25 100644 --- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/BloodMagic.java @@ -1,7 +1,6 @@ package WayofTime.bloodmagic; import java.io.File; -import java.util.Map; import WayofTime.bloodmagic.meteor.MeteorConfigHandler; import lombok.Getter; @@ -9,7 +8,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.launchwrapper.Launch; import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -25,7 +23,6 @@ import WayofTime.bloodmagic.api.util.helper.LogHelper; import WayofTime.bloodmagic.client.gui.GuiHandler; import WayofTime.bloodmagic.command.CommandBloodMagic; import WayofTime.bloodmagic.compat.ICompatibility; -import WayofTime.bloodmagic.compat.minecraft.ICrossVersionProxy; import WayofTime.bloodmagic.network.BloodMagicPacketHandler; import WayofTime.bloodmagic.proxy.CommonProxy; import WayofTime.bloodmagic.registry.ModArmourTrackers; @@ -42,8 +39,6 @@ import WayofTime.bloodmagic.structures.ModDungeons; import WayofTime.bloodmagic.util.Utils; import WayofTime.bloodmagic.util.handler.IMCHandler; -import com.google.common.collect.ImmutableMap; - @Mod(modid = Constants.Mod.MODID, name = Constants.Mod.NAME, version = Constants.Mod.VERSION, dependencies = Constants.Mod.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory") @Getter public class BloodMagic @@ -76,34 +71,13 @@ public class BloodMagic { return true; } - }; + }.setNoTitle().setBackgroundImageName("upgrade_tomes.png"); @Getter private static boolean isDev = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); - @Getter - private static ICrossVersionProxy crossVersionProxy; - private static final Map PROXY_MAP = ImmutableMap.of("1.9.4", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy19", "1.10", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110", "1.10.2", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110"); - static { - try - { - String mcVersion = (String) Loader.class.getDeclaredField("MC_VERSION").get(null); - - if (!PROXY_MAP.containsKey(mcVersion)) - throw new IllegalStateException("Blood Magic couldn't find a cross version proxy!"); - - Class proxyClass = Class.forName(PROXY_MAP.get(mcVersion)); - crossVersionProxy = (ICrossVersionProxy) proxyClass.newInstance(); - } - catch (Exception e) - { - throw new IllegalArgumentException("Blood Magic could not find a cross version proxy!", e); - } - - tabUpgradeTome.setNoTitle().setBackgroundImageName("upgrade_tomes.png"); - FluidRegistry.enableUniversalBucket(); } diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java index a1d62f6a..77a857e2 100644 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java +++ b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java @@ -27,6 +27,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeModContainer; import org.apache.commons.lang3.ArrayUtils; import WayofTime.bloodmagic.BloodMagic; @@ -368,7 +369,7 @@ public class BlockEnumStairs & IStringSerializable> extends Bl @Override public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) { - if (BloodMagic.getCrossVersionProxy().disableStairSlabCulling()) + if (ForgeModContainer.disableStairSlabCulling) return super.doesSideBlockRendering(state, world, pos, face); if (state.isOpaqueCube()) diff --git a/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy110.java b/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy110.java deleted file mode 100644 index 937fbcde..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy110.java +++ /dev/null @@ -1,39 +0,0 @@ -package WayofTime.bloodmagic.compat.minecraft; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeModContainer; -import net.minecraftforge.fml.relauncher.ReflectionHelper; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -public class CrossVersionProxy110 implements ICrossVersionProxy { - - @Override - public TileEntity createTileFromData(World world, NBTTagCompound tagCompound) - { - Method m = ReflectionHelper.findMethod(TileEntity.class, null, new String[] { "create", "func_190200_a", "a" }, World.class, NBTTagCompound.class); - try - { - return (TileEntity) m.invoke(null, world, tagCompound); - } catch (Exception e) - { - return null; - } - } - - @Override - public boolean disableStairSlabCulling() - { - Field disableStairSlabCulling = ReflectionHelper.findField(ForgeModContainer.class, "disableStairSlabCulling"); - try - { - return (Boolean) disableStairSlabCulling.get(null); - } catch (Exception e) - { - return false; - } - } -} diff --git a/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy19.java b/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy19.java deleted file mode 100644 index 8c1253bb..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/minecraft/CrossVersionProxy19.java +++ /dev/null @@ -1,31 +0,0 @@ -package WayofTime.bloodmagic.compat.minecraft; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.ReflectionHelper; - -import java.lang.reflect.Method; - -public class CrossVersionProxy19 implements ICrossVersionProxy -{ - - @Override - public TileEntity createTileFromData(World world, NBTTagCompound tagCompound) - { - Method m = ReflectionHelper.findMethod(TileEntity.class, null, new String[] { "create", "func_189514_c", "c" }, NBTTagCompound.class); - try - { - return (TileEntity) m.invoke(null, tagCompound); - } catch (Exception e) - { - return null; - } - } - - @Override - public boolean disableStairSlabCulling() - { - return false; - } -} diff --git a/src/main/java/WayofTime/bloodmagic/compat/minecraft/ICrossVersionProxy.java b/src/main/java/WayofTime/bloodmagic/compat/minecraft/ICrossVersionProxy.java deleted file mode 100644 index f8bd12de..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/minecraft/ICrossVersionProxy.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.bloodmagic.compat.minecraft; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -/** - * Allows for Blood Magic to support multiple MC versions that have only slight changes. - * - * Implementation copied from Botania. - */ -public interface ICrossVersionProxy -{ - TileEntity createTileFromData(World world, NBTTagCompound tagCompound); - - boolean disableStairSlabCulling(); -} diff --git a/src/main/java/WayofTime/bloodmagic/util/Utils.java b/src/main/java/WayofTime/bloodmagic/util/Utils.java index 5d3e89d6..57154001 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Utils.java +++ b/src/main/java/WayofTime/bloodmagic/util/Utils.java @@ -1094,7 +1094,7 @@ public class Utils if (initialTile != null) { - TileEntity newTileInitial = BloodMagic.getCrossVersionProxy().createTileFromData(finalWorld, initialTag); + TileEntity newTileInitial = TileEntity.create(finalWorld, initialTag); finalWorld.setTileEntity(finalPos, newTileInitial); newTileInitial.setPos(finalPos); @@ -1105,7 +1105,7 @@ public class Utils if (finalTile != null) { - TileEntity newTileFinal = BloodMagic.getCrossVersionProxy().createTileFromData(initialWorld, finalTag); + TileEntity newTileFinal = TileEntity.create(initialWorld, finalTag); initialWorld.setTileEntity(initialPos, newTileFinal); newTileFinal.setPos(initialPos);