diff --git a/build.gradle b/build.gradle index cc5732c62..5cb5aba8d 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ minecraft { version = "${config.mc_version}-${config.forge_version}" runDir = "eclipse/assets" - mappings = "snapshot_20160518" + mappings = "snapshot_20160718" //This, does the token replacement. //Though, I reccomend this to be replaced with a token such as @VERSION@ replace 'GRADLE:BUILD', config.build_number @@ -67,7 +67,7 @@ dependencies { compile files( 'Baubles-deobf.jar' ) - deobfCompile "mezz.jei:jei_1.9.4:3.6.7.216" + deobfCompile "mezz.jei:jei_1.10.2:3.7.8.234" //and a bit more for SCP sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29" @@ -119,9 +119,7 @@ task incrementBuildNumber(dependsOn: 'reobfJar') << { // todo make this flexibile - collection of supported mc versions file('web/versions.ini').append("\n${version}=${minecraft.version}") - file('web/versions.ini').append("\n${version}=1.10.2") file("${config.dir_repo}/version/${minecraft.version}.txt").write("${version}") - file("${config.dir_repo}/version/1.10.2.txt").write("${version}") def updateJsonFile = file('version/update.json') def updateJson = new JsonSlurper().parse(updateJsonFile) as Map @@ -130,14 +128,10 @@ task incrementBuildNumber(dependsOn: 'reobfJar') << { // Add to version section updateJson."${minecraft.version}"."${version}" = "See https://github.com/williewillus/Botania/releases/${version}" - updateJson."1.10.2"."${version}" = "See https://github.com/williewillus/Botania/releases/${version}" // Update promos updateJson.promos."${minecraft.version}-latest" = "${version}" updateJson.promos."${minecraft.version}-recommended" = "${version}" - updateJson.promos."1.10.2-latest" = "${version}" - updateJson.promos."1.10.2-recommended" = "${version}" - updateJsonFile.write(JsonOutput.prettyPrint(JsonOutput.toJson(updateJson))) } @@ -247,8 +241,7 @@ curseforge { See https://github.com/williewillus/Botania/releases/tag/${version} """ releaseType = "release" - addGameVersion '1.9.4' - addGameVersion '1.10.2' + addGameVersion "${minecraft.version}" relations { requiredLibrary 'baubles' } diff --git a/build.properties b/build.properties index 06df2b19c..d9f32acbf 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ version=r1.8 dir_output=../Build Output/Botania/ dir_repo=./ -mc_version=1.9.4 -forge_version=12.17.0.1965 +mc_version=1.10.2 +forge_version=12.18.1.2014 build_number=314 mod_name=Botania diff --git a/src/api/java/buildcraft/api/core/EnumPipePart.java b/src/api/java/buildcraft/api/core/EnumPipePart.java index f3ea8d6fb..f515ff92b 100644 --- a/src/api/java/buildcraft/api/core/EnumPipePart.java +++ b/src/api/java/buildcraft/api/core/EnumPipePart.java @@ -6,7 +6,7 @@ import java.util.Map; import com.google.common.collect.Maps; import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTBase.NBTPrimitive; +import net.minecraft.nbt.NBTPrimitive; import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java index 76a539734..12e3c993f 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java @@ -85,17 +85,12 @@ public class MultiblockBlockAccess implements IBlockAccess { @Nonnull @Override - public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { + public Biome getBiome(@Nonnull BlockPos pos) { if(hasBlockAccess) - return originalBlockAccess.getBiomeGenForCoords(pos); + return originalBlockAccess.getBiome(pos); return null; } - @Override - public boolean extendedLevelsInChunkCache() { - return hasBlockAccess && originalBlockAccess.extendedLevelsInChunkCache(); - } - @Override public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) { if(hasBlockAccess) diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index 089a7020e..b36b10528 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -26,7 +26,6 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraft.world.WorldSettings.GameType; import net.minecraftforge.client.model.animation.AnimationTESR; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.registry.ClientRegistry; @@ -337,7 +336,7 @@ public class ClientProxy extends CommonProxy { BotaniaPlayerController controller = new BotaniaPlayerController(mc, net); boolean isFlying = player.capabilities.isFlying; boolean allowFlying = player.capabilities.allowFlying; - Botania.crossVersionProxy.copyGameType(mc.playerController, controller); + controller.setGameType(mc.playerController.getCurrentGameType()); player.capabilities.isFlying = isFlying; player.capabilities.allowFlying = allowFlying; mc.playerController = controller; diff --git a/src/main/java/vazkii/botania/client/model/PlatformModel.java b/src/main/java/vazkii/botania/client/model/PlatformModel.java index 9264ea595..5ae521951 100644 --- a/src/main/java/vazkii/botania/client/model/PlatformModel.java +++ b/src/main/java/vazkii/botania/client/model/PlatformModel.java @@ -146,13 +146,8 @@ public class PlatformModel implements IBakedModel { @Nonnull @Override - public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { - return compose.getBiomeGenForCoords(pos); - } - - @Override - public boolean extendedLevelsInChunkCache() { - return compose.extendedLevelsInChunkCache(); + public Biome getBiome(@Nonnull BlockPos pos) { + return compose.getBiome(pos); } @Override diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java index 10ab76a25..a0761b115 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java @@ -20,6 +20,7 @@ import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.SkeletonType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.EnumFacing; @@ -62,7 +63,7 @@ public class RenderTileGaiaHead extends TileEntitySkullRenderer { profile = ((EntityPlayer) mc.getRenderViewEntity()).getGameProfile(); } else if (view instanceof EntitySkeleton) { skullType = 0; - if(Botania.crossVersionProxy.getSkeletonTypeInt((EntitySkeleton) view) == 1) + if (((EntitySkeleton) view).getSkeletonType() == SkeletonType.WITHER) skullType = 1; } else if(view instanceof EntityWither) skullType = 1; diff --git a/src/main/java/vazkii/botania/common/Botania.java b/src/main/java/vazkii/botania/common/Botania.java index d662eb974..0570304d0 100644 --- a/src/main/java/vazkii/botania/common/Botania.java +++ b/src/main/java/vazkii/botania/common/Botania.java @@ -10,15 +10,11 @@ */ package vazkii.botania.common; -import com.google.common.collect.ImmutableMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.event.ClickEvent; -import net.minecraft.util.text.event.HoverEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; @@ -40,11 +36,8 @@ import org.apache.logging.log4j.Logger; import vazkii.botania.common.core.handler.IMCHandler; import vazkii.botania.common.core.handler.ManaNetworkHandler; import vazkii.botania.common.core.proxy.CommonProxy; -import vazkii.botania.common.core.proxy.ICrossVersionProxy; import vazkii.botania.common.lib.LibMisc; -import java.util.Map; - @Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES, guiFactory = LibMisc.GUI_FACTORY, acceptedMinecraftVersions = LibMisc.MC_VERSIONS, updateJSON = LibMisc.UPDATE_JSON) public class Botania { @@ -66,33 +59,10 @@ public class Botania { @SidedProxy(serverSide = LibMisc.PROXY_COMMON, clientSide = LibMisc.PROXY_CLIENT) public static CommonProxy proxy; - public static ICrossVersionProxy crossVersionProxy; - public static final Logger LOGGER = LogManager.getLogger(LibMisc.MOD_ID); - private static final Map PROXY_MAP = ImmutableMap.of( - "1.9.4", "vazkii.botania.common.core.proxy.CrossVersionProxy_19", - "1.10", "vazkii.botania.common.core.proxy.CrossVersionProxy_110", - "1.10.2", "vazkii.botania.common.core.proxy.CrossVersionProxy_110" - ); - @EventHandler public void preInit(FMLPreInitializationEvent event) { - try { - // The constant is inlined at compile time, we want the real value. - String mcVersion = (String) Loader.class.getDeclaredField("MC_VERSION").get(null); - - if(!PROXY_MAP.containsKey(mcVersion)) - throw new IllegalStateException("Botania couldn't find a cross version proxy!"); - - Class clazz = Class.forName(PROXY_MAP.get(mcVersion)); - crossVersionProxy = (ICrossVersionProxy) clazz.newInstance(); - - Botania.LOGGER.info("Enabling proxy for Minecraft {}", mcVersion); - } catch (NoSuchFieldException | ClassNotFoundException | InstantiationException | IllegalAccessException ex) { - throw new IllegalStateException("Botania couldn't find a cross version proxy!", ex); - } - gardenOfGlassLoaded = Loader.isModLoaded("GardenOfGlass"); thaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java index baa411ee5..ae2334e13 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java @@ -75,7 +75,7 @@ public class SubTileMarimorphosis extends SubTileFunctional { } public ItemStack getStoneToPut(BlockPos coords) { - List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiomeGenForCoords(coords))); + List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiome(coords))); TIntArrayList values = new TIntArrayList(); for(int i = 0; i < 8; i++) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java index ed783f822..d3118f373 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java @@ -59,7 +59,7 @@ public class SubTileDaybloom extends SubTilePassiveGenerating { @Override public boolean canGeneratePassively() { - boolean rain = supertile.getWorld().getBiomeGenForCoords(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); + boolean rain = supertile.getWorld().getBiome(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); return supertile.getWorld().isDaytime() && !rain && supertile.getWorld().canBlockSeeSky(supertile.getPos().up()); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index f2ab181bd..69aae6dc6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -180,7 +180,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { @Override public int getDelayBetweenPassiveGeneration() { - boolean rain = supertile.getWorld().getBiomeGenForCoords(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); + boolean rain = supertile.getWorld().getBiome(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); return rain ? 1 : 2; } diff --git a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java index 537534b15..b1760de21 100644 --- a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java @@ -34,8 +34,8 @@ public class BiomeDecorationHandler { boolean flowers = true; if(event.getWorld().provider instanceof IFlowerlessWorld) flowers = ((IFlowerlessWorld) event.getWorld().provider).generateFlowers(event.getWorld()); - else if(event.getWorld().getBiomeGenForCoords(event.getPos()) instanceof IFlowerlessBiome) - flowers = ((IFlowerlessBiome) event.getWorld().getBiomeGenForCoords(event.getPos())).canGenerateFlowers(event.getWorld(), event.getPos().getX(), event.getPos().getZ()); + else if(event.getWorld().getBiome(event.getPos()) instanceof IFlowerlessBiome) + flowers = ((IFlowerlessBiome) event.getWorld().getBiome(event.getPos())).canGenerateFlowers(event.getWorld(), event.getPos().getX(), event.getPos().getZ()); if(!flowers) return; diff --git a/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_110.java b/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_110.java deleted file mode 100644 index bf0c8ccde..000000000 --- a/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_110.java +++ /dev/null @@ -1,82 +0,0 @@ -package vazkii.botania.common.core.proxy; - -import net.minecraft.client.multiplayer.PlayerControllerMP; -import net.minecraft.entity.monster.EntitySkeleton; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.management.PlayerInteractionManager; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.ReflectionHelper; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import vazkii.botania.client.core.handler.BotaniaPlayerController; -import vazkii.botania.common.Botania; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class CrossVersionProxy_110 implements ICrossVersionProxy { - @Override - public TileEntity createTeFromCompound(World world, NBTTagCompound compound) { - 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, compound); - } catch (IllegalAccessException | InvocationTargetException e) { - Botania.LOGGER.error("Couldn't create TE in 1.10 crossversion proxy"); - return null; - } - } - - @SideOnly(Side.CLIENT) - @Override - public void copyGameType(PlayerControllerMP from, BotaniaPlayerController to) { - try { - Class gameTypeClazz = Class.forName("net.minecraft.world.GameType"); - Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "getCurrentGameType", "func_178889_l", "l" }); - Object gameType = m.invoke(from); - m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz); - m.invoke(to, gameType); - } catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) { - Botania.LOGGER.error("Couldn't copy gametype in 1.10 crossversion proxy"); - } - } - - @Override - public int getSkeletonTypeInt(EntitySkeleton skeleton) { - try { - Method m = ReflectionHelper.findMethod(EntitySkeleton.class, null, new String[] { "func_189771_df", "df" }); - Enum e = (Enum) m.invoke(skeleton); - return e.ordinal(); - } catch (IllegalAccessException | InvocationTargetException e1) { - Botania.LOGGER.error("Couldn't get skeleton type in 1.10 crossversion proxy"); - return 0; - } - } - - @Override - public void setSkeletonTypeInt(EntitySkeleton skeleton, int type) { - try { - Class skeletonTypeClazz = Class.forName("net.minecraft.entity.monster.SkeletonType"); - Object typeToSet = skeletonTypeClazz.getEnumConstants()[type]; - Method m = ReflectionHelper.findMethod(EntitySkeleton.class, null, new String[] { "func_189768_a", "a" }, skeletonTypeClazz); - m.invoke(skeleton, typeToSet); - } catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { - Botania.LOGGER.error("Couldn't set skeleton type in 1.10 crossversion proxy"); - } - } - - @Override - public boolean isSurvivalOrAdventure(EntityPlayerMP playerMP) { - try { - Class gameTypeClazz = Class.forName("net.minecraft.world.GameType"); - Method m = ReflectionHelper.findMethod(PlayerInteractionManager.class, null, new String[] { "getGameType", "func_73081_b", "b" }); - Object gameType = m.invoke(playerMP.interactionManager); - m = ReflectionHelper.findMethod(gameTypeClazz, null, new String[] { "isSurvivalOrAdventure", "func_77144_e", "e" }); - return (Boolean) m.invoke(gameType); - } catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) { - Botania.LOGGER.error("Couldn't determine survival or adventure in 1.10 crossversion proxy"); - return true; - } - } -} diff --git a/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_19.java b/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_19.java deleted file mode 100644 index 2b6005a26..000000000 --- a/src/main/java/vazkii/botania/common/core/proxy/CrossVersionProxy_19.java +++ /dev/null @@ -1,79 +0,0 @@ -package vazkii.botania.common.core.proxy; - -import net.minecraft.client.multiplayer.PlayerControllerMP; -import net.minecraft.entity.monster.EntitySkeleton; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.management.PlayerInteractionManager; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.ReflectionHelper; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import vazkii.botania.client.core.handler.BotaniaPlayerController; -import vazkii.botania.common.Botania; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class CrossVersionProxy_19 implements ICrossVersionProxy { - @Override - public TileEntity createTeFromCompound(World world, NBTTagCompound compound) { - Method m = ReflectionHelper.findMethod(TileEntity.class, null, new String[] { "create", "func_189514_c", "c" }, NBTTagCompound.class); - try { - return (TileEntity) m.invoke(null, compound); - } catch (IllegalAccessException | InvocationTargetException e) { - Botania.LOGGER.error("Couldn't create TE in 1.9 crossversion proxy"); - return null; - } - } - - @SideOnly(Side.CLIENT) - @Override - public void copyGameType(PlayerControllerMP from, BotaniaPlayerController to) { - try { - Class gameTypeClazz = Class.forName("net.minecraft.world.WorldSettings$GameType"); - Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "getCurrentGameType", "func_178889_l", "l" }); - Object gameType = m.invoke(from); - m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz); - m.invoke(to, gameType); - } catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) { - Botania.LOGGER.error("Couldn't copy game type in 1.9 crossversion proxy"); - } - } - - @Override - public int getSkeletonTypeInt(EntitySkeleton skeleton) { - try { - Method m = ReflectionHelper.findMethod(EntitySkeleton.class, null, new String[]{ "getSkeletonType", "func_82202_m", "db" }); - return (int) m.invoke(skeleton); - } catch (IllegalAccessException | InvocationTargetException e) { - Botania.LOGGER.error("Couldn't get skeleton type in 1.9 crossversion proxy"); - return 0; - } - } - - @Override - public void setSkeletonTypeInt(EntitySkeleton skeleton, int type) { - try { - Method m = ReflectionHelper.findMethod(EntitySkeleton.class, null, new String[]{ "setSkeletonType", "func_82201_a", "a" }, int.class); - m.invoke(skeleton, type); - } catch (IllegalAccessException | InvocationTargetException e) { - Botania.LOGGER.error("Couldn't set skeleton type in 1.9 crossversion proxy"); - } - } - - @Override - public boolean isSurvivalOrAdventure(EntityPlayerMP playerMP) { - try { - Class gameTypeClazz = Class.forName("net.minecraft.world.WorldSettings$GameType"); - Method m = ReflectionHelper.findMethod(PlayerInteractionManager.class, null, new String[] { "getGameType", "func_73081_b", "b" }); - Object gameType = m.invoke(playerMP.interactionManager); - m = ReflectionHelper.findMethod(gameTypeClazz, null, new String[] { "isSurvivalOrAdventure", "func_77144_e", "e" }); - return (Boolean) m.invoke(gameType); - } catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) { - Botania.LOGGER.error("Couldn't determine survival or adventure in 1.9 crossversion proxy"); - return true; - } - } -} diff --git a/src/main/java/vazkii/botania/common/core/proxy/ICrossVersionProxy.java b/src/main/java/vazkii/botania/common/core/proxy/ICrossVersionProxy.java deleted file mode 100644 index ccd24d540..000000000 --- a/src/main/java/vazkii/botania/common/core/proxy/ICrossVersionProxy.java +++ /dev/null @@ -1,28 +0,0 @@ -package vazkii.botania.common.core.proxy; - -import net.minecraft.client.multiplayer.PlayerControllerMP; -import net.minecraft.entity.monster.EntitySkeleton; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import vazkii.botania.client.core.handler.BotaniaPlayerController; - -// horrible hax to try to run 1.9/10 from the same jar :D -// Taking this as an example is heavily discouraged -public interface ICrossVersionProxy { - - TileEntity createTeFromCompound(World world, NBTTagCompound compound); - - @SideOnly(Side.CLIENT) - void copyGameType(PlayerControllerMP from, BotaniaPlayerController to); - - int getSkeletonTypeInt(EntitySkeleton skeleton); - - void setSkeletonTypeInt(EntitySkeleton skeleton, int type); - - boolean isSurvivalOrAdventure(EntityPlayerMP playerMP); - -} diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index d4b3d61ed..bdccd1c8f 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -27,6 +27,7 @@ import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntityWitch; import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.SkeletonType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; @@ -669,7 +670,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBoss { entity = new EntitySkeleton(worldObj); entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); if(worldObj.rand.nextInt(8) == 0) { - Botania.crossVersionProxy.setSkeletonTypeInt((EntitySkeleton) entity, 1); + ((EntitySkeleton) entity).setSkeletonType(SkeletonType.WITHER); entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(hard ? ModItems.elementiumSword : Items.STONE_SWORD)); } break; diff --git a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java index 221647f70..c83d74c73 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java +++ b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java @@ -251,7 +251,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet TileEntity tile = null; NBTTagCompound tilecmp = ItemNBTHelper.getCompound(lens, TAG_TILE, false); if(tilecmp.hasKey("id")) - tile = Botania.crossVersionProxy.createTeFromCompound(entity.worldObj, tilecmp); + tile = TileEntity.create(entity.worldObj, tilecmp); entity.worldObj.setBlockState(pos, block.getStateFromMeta(meta), 1 | 2); entity.worldObj.playEvent(2001, pos, Block.getStateId(block.getStateFromMeta(meta))); diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java index dac5b2c5b..5ca7c91e7 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java @@ -195,7 +195,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem { void onFire(ItemStack bow, EntityLivingBase living, boolean infinity, EntityArrow arrow) { if(living instanceof EntityPlayerMP) { ToolCommons.damageItem(bow, 1, living, MANA_PER_DAMAGE); - if(Botania.crossVersionProxy.isSurvivalOrAdventure((EntityPlayerMP) living)) + if(((EntityPlayerMP) living).interactionManager.getGameType().isSurvivalOrAdventure()) PlayerHelper.consumeAmmo(((EntityPlayerMP) living), AMMO_FUNC); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java index a8480a843..f4ee342b4 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java @@ -42,7 +42,7 @@ public class ItemElementiumAxe extends ItemManasteelAxe { int looting = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, weapon); if(event.getEntityLiving() instanceof EntitySkeleton && rand.nextInt(26) <= 3 + looting) - addDrop(event, new ItemStack(Items.SKULL, 1, Botania.crossVersionProxy.getSkeletonTypeInt((EntitySkeleton) event.getEntityLiving()))); + addDrop(event, new ItemStack(Items.SKULL, 1, ((EntitySkeleton) event.getEntityLiving()).getSkeletonType().ordinal())); else if(event.getEntityLiving() instanceof EntityZombie && !(event.getEntityLiving() instanceof EntityPigZombie) && rand.nextInt(26) <= 2 + 2 * looting) addDrop(event, new ItemStack(Items.SKULL, 1, 2)); else if(event.getEntityLiving() instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting) diff --git a/src/main/java/vazkii/botania/common/lib/LibMisc.java b/src/main/java/vazkii/botania/common/lib/LibMisc.java index ecf6a3c61..242ee221b 100644 --- a/src/main/java/vazkii/botania/common/lib/LibMisc.java +++ b/src/main/java/vazkii/botania/common/lib/LibMisc.java @@ -17,8 +17,8 @@ public final class LibMisc { public static final String MOD_NAME = MOD_ID; public static final String BUILD = "GRADLE:BUILD"; public static final String VERSION = "GRADLE:VERSION-" + BUILD; - public static final String DEPENDENCIES = "required-after:Forge@[12.17.0.1965,];required-after:Baubles;after:Thaumcraft"; - public static final String MC_VERSIONS = "[1.9.4,1.10.2]"; + public static final String DEPENDENCIES = "required-after:Forge@[12.18.1.2014,];required-after:Baubles;after:Thaumcraft"; + public static final String MC_VERSIONS = "[1.10.2]"; public static final String UPDATE_JSON = "https://raw.githubusercontent.com/williewillus/Botania/HEAD/version/update.json"; // Network Contants