2013-03-08 00:25:48 +00:00
|
|
|
/*
|
2016-06-23 03:49:47 +00:00
|
|
|
* Minecraft Forge
|
2018-07-01 21:17:28 +00:00
|
|
|
* Copyright (c) 2016-2018.
|
2013-11-10 16:49:06 +00:00
|
|
|
*
|
2016-06-23 03:49:47 +00:00
|
|
|
* 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 version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2013-03-08 00:25:48 +00:00
|
|
|
*/
|
|
|
|
|
2014-09-23 05:01:24 +00:00
|
|
|
package net.minecraftforge.fml.common;
|
2012-10-02 05:29:46 +00:00
|
|
|
|
2018-05-13 05:39:42 +00:00
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
|
|
|
import net.minecraftforge.fml.client.GuiWrongMinecraft;
|
|
|
|
import net.minecraftforge.fml.client.IDisplayableError;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
2018-06-15 19:03:35 +00:00
|
|
|
import net.minecraftforge.fml.ModContainer;
|
2018-05-13 05:39:42 +00:00
|
|
|
|
|
|
|
public class WrongMinecraftVersionException extends EnhancedRuntimeException implements IDisplayableError
|
2012-10-02 05:29:46 +00:00
|
|
|
{
|
2013-11-10 16:49:06 +00:00
|
|
|
private static final long serialVersionUID = 1L;
|
2012-10-02 05:29:46 +00:00
|
|
|
public ModContainer mod;
|
2016-01-10 19:07:12 +00:00
|
|
|
private String mcVersion;
|
2012-10-02 05:29:46 +00:00
|
|
|
|
2016-01-10 19:07:12 +00:00
|
|
|
public WrongMinecraftVersionException(ModContainer mod, String mcver)
|
2012-10-02 05:29:46 +00:00
|
|
|
{
|
2014-11-28 18:37:55 +00:00
|
|
|
super(String.format("Wrong Minecraft version for %s", mod.getModId()));
|
2012-10-02 05:29:46 +00:00
|
|
|
this.mod = mod;
|
2016-01-10 19:07:12 +00:00
|
|
|
this.mcVersion = mcver;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void printStackTrace(WrappedPrintStream stream) {
|
|
|
|
stream.println("Wrong Minecraft Versions!");
|
|
|
|
stream.println("Mod: " + mod.getModId());
|
|
|
|
stream.println("Location: " + mod.getSource().toString());
|
|
|
|
stream.println("Expected: " + mod.acceptableMinecraftVersionRange().toString());
|
|
|
|
stream.println("Current: " + mcVersion);
|
|
|
|
stream.println("");
|
2012-10-02 05:29:46 +00:00
|
|
|
}
|
|
|
|
|
2018-05-13 05:39:42 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public GuiScreen createGui()
|
|
|
|
{
|
|
|
|
return new GuiWrongMinecraft(this);
|
|
|
|
}
|
2012-10-02 05:29:46 +00:00
|
|
|
}
|