/*
* This file is part of Project-Zed. Project-Zed is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version. Project-Zed 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 General Public License for more details. You should
* have received a copy of the GNU General Public License along with Project-Zed. If not, see <http://www.gnu
* .org/licenses/>
*/
package com.projectzed.mod.util;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/**
* Simple class for injecting mod metadata info into mcmod.info file.
*
* @author hockeyhurd
* @version 8/18/2015.
*/
public final class ProjectZedMetadata {
private boolean result = false;
/**
* @param event event to initialize data injection with.
*/
public ProjectZedMetadata(FMLPreInitializationEvent event) {
injectData(event.getModMetadata());
}
/**
* Attemps to inject data into mcmod.info such that it is correct and remains 'up to date'.
*
* @param metadata
*/
private void injectData(final ModMetadata metadata) {
metadata.autogenerated = false;
if (!metadata.authorList.isEmpty()) metadata.authorList.set(0, "hockeyhurd");
else metadata.authorList.add("hockeyhurd");
metadata.credits = "hockeyhurd";
metadata.modId = Reference.MOD_NAME;
metadata.version = Reference.VERSION;
metadata.name = Reference.MOD_NAME;
metadata.url = "http://goo.gl/nYTUfU";
metadata.logoFile = "";
metadata.description = "A tech mod set to be unique and progressive.";
result = true;
}
/**
* @return result of metadata injection.
*/
public boolean getResult() {
return result;
}
}