mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Remove internal update mechanism because the pack is updated by GTNH team
This commit is contained in:
1 parent
ade0ef263b
commit
accc2ecbb5
11 files changed
+1
-344
No files matched your search
@@ -31,7 +31,6 @@ import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
import vazkii.botania.api.subtile.signature.SubTileSignature;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.item.material.ItemManaResource;
|
||||
@@ -192,7 +191,6 @@ public final class ContributorFancinessHandler {
|
||||
FMLLog.info("[Botania] Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~");
|
||||
e.printStackTrace();
|
||||
}
|
||||
VersionChecker.doneChecking = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -157,8 +157,6 @@ import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.core.version.AdaptorNotifier;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
import vazkii.botania.common.entity.EntityBabylonWeapon;
|
||||
import vazkii.botania.common.entity.EntityCorporeaSpark;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
@@ -222,11 +220,6 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new SkyblockRenderEvents());
|
||||
FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler());
|
||||
|
||||
if(ConfigHandler.useAdaptativeConfig)
|
||||
FMLCommonHandler.instance().bus().register(new AdaptorNotifier());
|
||||
if(ConfigHandler.versionCheckEnabled)
|
||||
new VersionChecker().init();
|
||||
|
||||
if(ConfigHandler.enableSeasonalFeatures) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@@ -422,19 +415,6 @@ public class ClientProxy extends CommonProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastVersion() {
|
||||
String s = PersistentVariableHelper.lastBotaniaVersion;
|
||||
|
||||
if(s == null)
|
||||
return "N/A";
|
||||
|
||||
if(s.indexOf("-") > 0)
|
||||
return s.split("-")[1];
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playRecordClientSided(World world, int x, int y, int z, ItemRecord record) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [May 31, 2014, 11:43:13 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import vazkii.botania.common.core.version.ThreadDownloadMod;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
|
||||
public class CommandDownloadLatest extends CommandBase {
|
||||
|
||||
private static final boolean ENABLED = true;
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "botania-download-latest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender var1) {
|
||||
return "/botania-download-latest <version>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender var1, String[] var2) {
|
||||
if(!ENABLED)
|
||||
var1.addChatMessage(new ChatComponentTranslation("botania.versioning.disabled").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
|
||||
else if(var2.length == 1)
|
||||
if(VersionChecker.downloadedFile)
|
||||
var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadedAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
else if(VersionChecker.startedDownload)
|
||||
var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadingAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
else new ThreadDownloadMod("Botania " + var2[0] + ".jar");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,8 +41,6 @@ public final class ConfigHandler {
|
||||
|
||||
public static int hardcorePassiveGeneration = 72000;
|
||||
|
||||
public static boolean useAdaptativeConfig = true;
|
||||
|
||||
public static boolean useShaders = true;
|
||||
public static boolean lexiconRotatingItems = true;
|
||||
public static boolean lexiconJustifiedText = false;
|
||||
@@ -74,7 +72,6 @@ public final class ConfigHandler {
|
||||
public static boolean matrixMode = false;
|
||||
public static boolean referencesEnabled = true;
|
||||
|
||||
public static boolean versionCheckEnabled = true;
|
||||
public static int spreaderPositionShift = 1;
|
||||
public static boolean flowerForceCheck = true;
|
||||
public static boolean enderPickpocketEnabled = true;
|
||||
@@ -122,10 +119,6 @@ public final class ConfigHandler {
|
||||
public static void load() {
|
||||
String desc;
|
||||
|
||||
desc = "Set this to false to disable the Adaptative Config. Adaptative Config changes any default config values from old versions to the new defaults to make sure you aren't missing out on changes because of old configs. It will not touch any values that were changed manually.";
|
||||
useAdaptativeConfig = loadPropBool("adaptativeConfig.enabled", desc, useAdaptativeConfig);
|
||||
adaptor = new ConfigAdaptor(useAdaptativeConfig);
|
||||
|
||||
desc = "Set this to false to disable the use of shaders for some of the mod's renders.";
|
||||
useShaders = loadPropBool("shaders.enabled", desc, useShaders);
|
||||
|
||||
@@ -210,9 +203,6 @@ public final class ConfigHandler {
|
||||
desc = "Set this to false to disable the references in the flower tooltips. (You monster D:)";
|
||||
referencesEnabled = loadPropBool("references.enabled", desc, referencesEnabled);
|
||||
|
||||
desc = "Set this to false to disable checking and alerting when new Botania versions come out. (keywords for noobs: update notification message)";
|
||||
versionCheckEnabled = loadPropBool("versionChecking.enabled", desc, versionCheckEnabled);
|
||||
|
||||
desc = "Do not ever touch this value if not asked to. Possible symptoms of doing so include your head turning backwards, the appearance of Titans near the walls or you being trapped in a game of Sword Art Online.";
|
||||
spreaderPositionShift = loadPropInt("spreader.posShift", desc, spreaderPositionShift);
|
||||
|
||||
@@ -358,22 +348,12 @@ public final class ConfigHandler {
|
||||
public static class ConfigAdaptor {
|
||||
|
||||
private boolean enabled;
|
||||
private int lastBuild;
|
||||
private int currentBuild;
|
||||
|
||||
private Map<String, List<AdaptableValue>> adaptableValues = new HashMap();
|
||||
private List<String> changes = new ArrayList();
|
||||
|
||||
public ConfigAdaptor(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
|
||||
String lastVersion = Botania.proxy.getLastVersion();
|
||||
try {
|
||||
lastBuild = Integer.parseInt(lastVersion);
|
||||
currentBuild = Integer.parseInt(LibMisc.BUILD);
|
||||
} catch(NumberFormatException e) {
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void adaptProperty(Property prop, T val) {
|
||||
@@ -387,9 +367,6 @@ public final class ConfigHandler {
|
||||
|
||||
AdaptableValue<T> bestValue = null;
|
||||
for(AdaptableValue<T> value : adaptableValues.get(name)) {
|
||||
if(value.version >= lastBuild) // If version is newer than what we last used we don't care about it
|
||||
continue;
|
||||
|
||||
if(bestValue == null || value.version > bestValue.version)
|
||||
bestValue = value;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ import vazkii.botania.common.block.tile.TileLightRelay.EntityPlayerMover;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
import vazkii.botania.common.brew.ModPotions;
|
||||
import vazkii.botania.common.core.command.CommandDownloadLatest;
|
||||
import vazkii.botania.common.core.command.CommandOpen;
|
||||
import vazkii.botania.common.core.command.CommandShare;
|
||||
import vazkii.botania.common.core.command.CommandSkyblockSpread;
|
||||
@@ -79,7 +78,6 @@ import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
|
||||
import vazkii.botania.common.integration.etfuturum.ModBanners;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.GuiHandler;
|
||||
import vazkii.botania.common.world.SkyblockWorldEvents;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
@@ -218,7 +216,6 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandDownloadLatest());
|
||||
event.registerServerCommand(new CommandShare());
|
||||
event.registerServerCommand(new CommandOpen());
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
@@ -249,10 +246,6 @@ public class CommonProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getLastVersion() {
|
||||
return LibMisc.BUILD;
|
||||
}
|
||||
|
||||
public void setExtraReach(EntityLivingBase entity, float reach) {
|
||||
if(entity instanceof EntityPlayerMP)
|
||||
((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(Math.max(5, ((EntityPlayerMP) entity).theItemInWorldManager.getBlockReachDistance() + reach));
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [05/12/2015, 15:31:51 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.version;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
|
||||
public final class AdaptorNotifier {
|
||||
|
||||
boolean triedToWarnPlayer;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(ClientTickEvent event) {
|
||||
if(!triedToWarnPlayer && Minecraft.getMinecraft().thePlayer != null) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
ConfigHandler.adaptor.tellChanges(player);
|
||||
|
||||
triedToWarnPlayer = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [May 31, 2014, 10:22:44 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.version;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ThreadDownloadMod extends Thread {
|
||||
|
||||
String fileName;
|
||||
|
||||
byte[] buffer = new byte[10240];
|
||||
|
||||
int totalBytesDownloaded;
|
||||
int bytesJustDownloaded;
|
||||
|
||||
InputStream webReader;
|
||||
|
||||
public ThreadDownloadMod(String fileName) {
|
||||
setName("Botania Download File Thread");
|
||||
this.fileName = fileName;
|
||||
|
||||
setDaemon(true);
|
||||
start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
IChatComponent component = IChatComponent.Serializer.func_150699_a(String.format(StatCollector.translateToLocal("botania.versioning.startingDownload"), fileName));
|
||||
if(Minecraft.getMinecraft().thePlayer != null)
|
||||
Minecraft.getMinecraft().thePlayer.addChatMessage(component);
|
||||
|
||||
VersionChecker.startedDownload = true;
|
||||
|
||||
String base = "http://botaniamod.net/";
|
||||
String file = fileName.replaceAll(" ", "%20");
|
||||
URL url = new URL(base + "dl.php?file=" + file);
|
||||
|
||||
try {
|
||||
url.openStream().close(); // Add to DL Counter
|
||||
} catch(IOException e) { }
|
||||
|
||||
url = new URL(base + "files/" + file);
|
||||
webReader = url.openStream();
|
||||
|
||||
File dir = new File(".", "mods");
|
||||
File f = new File(dir, fileName + ".dl");
|
||||
f.createNewFile();
|
||||
|
||||
FileOutputStream outputStream = new FileOutputStream(f.getAbsolutePath());
|
||||
|
||||
while((bytesJustDownloaded = webReader.read(buffer)) > 0) {
|
||||
outputStream.write(buffer, 0, bytesJustDownloaded);
|
||||
buffer = new byte[10240];
|
||||
totalBytesDownloaded += bytesJustDownloaded;
|
||||
}
|
||||
outputStream.close();
|
||||
webReader.close();
|
||||
|
||||
File f1 = new File(dir, fileName);
|
||||
if(!f1.exists())
|
||||
f.renameTo(f1);
|
||||
|
||||
if(Minecraft.getMinecraft().thePlayer != null)
|
||||
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
|
||||
Desktop.getDesktop().open(dir);
|
||||
VersionChecker.downloadedFile = true;
|
||||
|
||||
finalize();
|
||||
} catch(Throwable e) {
|
||||
e.printStackTrace();
|
||||
sendError();
|
||||
try {
|
||||
finalize();
|
||||
} catch(Throwable e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sendError() {
|
||||
if(Minecraft.getMinecraft().thePlayer != null)
|
||||
Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [May 31, 2014, 10:31:46 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.version;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ThreadVersionChecker extends Thread {
|
||||
|
||||
public ThreadVersionChecker() {
|
||||
setName("Botania Version Checker Thread");
|
||||
setDaemon(true);
|
||||
start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
URL url = new URL("https://raw.githubusercontent.com/Vazkii/Botania/master/version/" + MinecraftForge.MC_VERSION + ".txt");
|
||||
BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
VersionChecker.onlineVersion = r.readLine();
|
||||
r.close();
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
VersionChecker.doneChecking = true;
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [May 31, 2014, 9:58:26 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.version;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public final class VersionChecker {
|
||||
|
||||
private static final int FLAVOUR_MESSAGES = 65;
|
||||
|
||||
public static boolean doneChecking = false;
|
||||
public static String onlineVersion = "";
|
||||
public static boolean triedToWarnPlayer = false;
|
||||
|
||||
public static boolean startedDownload = false;
|
||||
public static boolean downloadedFile = false;
|
||||
|
||||
public void init() {
|
||||
new ThreadVersionChecker();
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(ClientTickEvent event) {
|
||||
if(doneChecking && event.phase == Phase.END && Minecraft.getMinecraft().thePlayer != null && !triedToWarnPlayer) {
|
||||
if(!onlineVersion.isEmpty()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]);
|
||||
int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MAX_VALUE : Integer.parseInt(LibMisc.BUILD);
|
||||
if(onlineBuild > clientBuild) {
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild));
|
||||
|
||||
IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion));
|
||||
player.addChatComponentMessage(component);
|
||||
}
|
||||
}
|
||||
|
||||
triedToWarnPlayer = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,9 +120,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
}
|
||||
|
||||
public static String getEdition() {
|
||||
String version = LibMisc.BUILD;
|
||||
int build = version.contains("GRADLE") ? 0 : Integer.parseInt(version);
|
||||
return build == 0 ? StatCollector.translateToLocal("botaniamisc.devEdition") : MathHelper.numberToOrdinal(build);
|
||||
return "GTNH";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,6 @@ public final class LibMisc {
|
||||
// Mod Constants
|
||||
public static final String MOD_ID = "Botania";
|
||||
public static final String MOD_NAME = MOD_ID;
|
||||
public static final String BUILD = "GRADLE:BUILD"; // TODO REMOVE
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final String DEPENDENCIES = "required-after:Baubles;after:Thaumcraft";
|
||||
|
||||
|
||||
Reference in new issue
Block a user