finished baseline custom json recipes

This commit is contained in:
MachineMuse 2013-11-04 19:47:43 -07:00
parent bedef357e0
commit de5a68cb90
3 changed files with 18 additions and 7 deletions

View file

@ -1,10 +1,8 @@
package net.machinemuse.general.recipe;
import com.google.gson.Gson;
import cpw.mods.fml.common.registry.GameRegistry;
import ic2.api.recipe.Recipes;
import net.machinemuse.numina.general.MuseLogger;
import net.machinemuse.numina.recipe.CustomShapedOreRecipe;
import net.machinemuse.powersuits.common.ModCompatability;
import net.machinemuse.powersuits.common.ModularPowersuits;
import net.machinemuse.powersuits.item.ItemComponent;
@ -45,8 +43,6 @@ public class RecipeManager {
if (ModCompatability.vanillaRecipesEnabled()) {
//CustomShapedOreRecipe arecipe = new CustomShapedOreRecipe(new String[] {"II", "CI", "II", "C", "componentWiring", "I", "ingotIron"}, ItemComponent.basicPlating);
Gson gson = new Gson();
CustomShapedOreRecipe.getJson();
//arecipe.register();
GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.basicPlating, "II", "CI", "II", 'C', "componentWiring", 'I', "ingotIron"));

View file

@ -10,6 +10,7 @@ import net.machinemuse.general.sound.SoundLoader;
import net.machinemuse.numina.general.MuseLogger;
import net.machinemuse.numina.network.MusePacket;
import net.machinemuse.numina.network.MusePacketHandler;
import net.machinemuse.numina.network.MusePacketModeChangeRequest;
import net.machinemuse.numina.render.RenderGameOverlayEventHandler;
import net.machinemuse.powersuits.block.TileEntityLuxCapacitor;
import net.machinemuse.powersuits.block.TileEntityTinkerTable;
@ -29,7 +30,6 @@ import net.machinemuse.powersuits.entity.EntityLuxCapacitor;
import net.machinemuse.powersuits.entity.EntityPlasmaBolt;
import net.machinemuse.powersuits.entity.EntitySpinningBlade;
import net.machinemuse.powersuits.event.RenderEventHandler;
import net.machinemuse.numina.network.MusePacketModeChangeRequest;
import net.machinemuse.powersuits.tick.ClientTickHandler;
import net.machinemuse.powersuits.tick.PlayerTickHandler;
import net.machinemuse.powersuits.tick.RenderTickHandler;
@ -93,6 +93,8 @@ public class ClientProxy extends CommonProxy {
URL otherResource = ClientProxy.class.getResource(Config.RESOURCE_PREFIX + "models/armor2.xml");
ModelSpecXMLReader.parseFile(otherResource);
// ModelSpecJSONWriter.writeRegistry("modelspec.json");
try {
MuseShaders.hBlurProgram().program();
Config.canUseShaders = true;

View file

@ -1,5 +1,8 @@
package net.machinemuse.powersuits.client.render.modelspec
import com.google.gson.Gson
import java.io.{File, PrintWriter, FileOutputStream}
/**
* Author: MachineMuse (Claire Semple)
@ -22,6 +25,16 @@ object ModelSpecXMLWriter {
}
def concatList(list: Seq[String]): String = list mkString ","
}
object ModelSpecJSONWriter {
def writeRegistry(file: String) {
val gson = new Gson()
import scala.collection.JavaConverters._
val registry = ModelRegistry.apply.asJava
val jsonwrite = gson.toJson(registry)
val w = new PrintWriter(new FileOutputStream(new File(file)))
w.print(jsonwrite)
w.close()
}
}