more recipes

This commit is contained in:
modmuss50 2019-08-06 21:12:56 +01:00
parent 83483ce8d3
commit 4cc8ab9d68
31 changed files with 966 additions and 153 deletions

View file

@ -41,6 +41,8 @@ import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
import techreborn.client.GuiHandler;
import techreborn.events.ModRegistry;
import techreborn.init.*;
import techreborn.init.recipes.FluidGeneratorRecipes;
import techreborn.init.recipes.FusionReactorRecipes;
import techreborn.packets.ClientboundPackets;
import techreborn.packets.ServerboundPackets;
import techreborn.utils.BehaviorDispenseScrapbox;
@ -71,28 +73,11 @@ public class TechReborn implements ModInitializer {
ModRegistry.setupShit();
RecipeCrafter.soundHanlder = new ModSounds.SoundHandler();
ModLoot.init();
// WorldGen
WorldGenerator.initBiomeFeatures();
// WorldGen
// GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0);
// Register Gui Handler
// Event busses
// MinecraftForge.EVENT_BUS.register(new BlockBreakHandler());
// MinecraftForge.EVENT_BUS.register(new TRRecipeHandler());
// MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
// MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
// MinecraftForge.EVENT_BUS.register(new TRTickHandler());
GuiHandler.register();
FluidGeneratorRecipes.init();
FusionReactorRecipes.init();
// Village stuff
// if (ConfigTechReborn.enableRubberTreePlantation) {
// VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler());
// //MapGenStructureIO.registerStructureComponent(VillageComponentRubberPlantaion.class, new ResourceLocation(MOD_ID, "rubberplantation").toString());
// ModLootTables.CHESTS_RUBBER_PLANTATION.toString(); //Done to make it load, then it will be read from disk
// }
// Scrapbox
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {

View file

@ -26,6 +26,7 @@ package techreborn.init;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.mojang.datafixers.Dynamic;
import com.mojang.datafixers.types.JsonOps;
@ -39,6 +40,7 @@ import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.text.LiteralText;
@ -264,8 +266,13 @@ public class RecipeTemplate {
jsonObject.addProperty("count", stack.getCount());
}
if(stack.getItem() instanceof ItemDynamicCell){
//Force it to be an empty cell
jsonObject.addProperty("nbt", "null");
if(((ItemDynamicCell) stack.getItem()).getFluid(stack) == Fluids.EMPTY){
jsonObject.addProperty("nbt", "empty");
} else {
JsonElement jsonElement = Dynamic.convert(NbtOps.INSTANCE, JsonOps.INSTANCE, stack.getTag());
jsonObject.add("nbt", jsonElement);
}
}
}
return jsonObject;

View file

@ -1,132 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.init.recipes;
/**
* Created by Prospector
*/
public class IndustrialElectrolyzerRecipes extends RecipeMethods {
/* TODO 1.13 :D
public static void init() {
// register(getOre("dustCoal"), 40, 50, getMaterial("carbon", 2, Type.CELL));
// register(getOre("dustCharcoal"), 20, 50, getMaterial("carbon", Type.CELL));
// register(getOre("dustEnderPearl", 16), 1300, 50, getMaterial("nitrogen", 5, Type.CELL), getMaterial("berylium", 1, Type.CELL), getMaterial("potassium", 4, Type.CELL), getMaterial("chlorite", 6, Type.CELL));
// register(getOre("dustLazurite", 29), 1460, 100, getMaterial("aluminum", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("calcium", 3, Type.CELL), getMaterial("sodium", 4, Type.CELL));
// register(getOre("dustPyrite", 3), 120, 128, getMaterial("iron", Type.DUST), getMaterial("sulfur", 2, Type.DUST));
// register(getOre("dustCalcite", 10), 700, 80, getMaterial("calcium", 2, Type.CELL), getMaterial("carbon", 2, Type.CELL), getMaterial("compressedair", 3, Type.CELL));
// register(getOre("dustSodalite", 23), 1340, 90, getMaterial("sodium", 4, Type.CELL), getMaterial("aluminum", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("chlorite", Type.CELL));
// register(getOre("dustFlint", 8), 1000, 5, getMaterial("silicon", Type.CELL), getMaterial("compressedair", Type.CELL));
// register(getOre("dustSaltpeter", 10), 40, 110, getMaterial("potassium", 2, Type.CELL), getMaterial("nitrogen", 2, Type.CELL), getMaterial("compressedair", 3, Type.CELL));
// register(getOre("dustCinnabar", 2), 100, 128, getMaterial("mercury", Type.CELL), getMaterial("sulfur", Type.DUST));
// register(getOre("dustSphalerite", 2), 140, 100, getMaterial("zinc", Type.DUST), getMaterial("sulfur", Type.DUST));
// register(getOre("dustBauxite", 12), 2000, 128, getMaterial("aluminum", 8, Type.DUST), getMaterial("titanium", 2, Type.SMALL_DUST), getMaterial("hydrogen", 5, Type.CELL), getMaterial("compressedair", 3, Type.CELL));
// register(getOre("dustTungsten"), 20, 50, getMaterial("wolframium", Type.CELL));
// register(getOre("dustRuby", 9), 500, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("chrome", Type.DUST), getMaterial("compressedair", 3, Type.CELL));
// register(getOre("dustSapphire", 8), 400, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("compressedair", 3, Type.CELL));
// register(getOre("dustEmerald", 29), 600, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("berylium", 3, Type.CELL), getMaterial("silicon", 6, Type.CELL), getMaterial("compressedair", 9, Type.CELL));
// register(getOre("dustPeridot", 9), 600, 60, getMaterial("magnesium", 2, Type.DUST), getMaterial("iron", 2, Type.DUST), getMaterial("silicon", Type.CELL), getMaterial("compressedair", 2, Type.CELL));
// register(getOre("dustGalena", 2), 1000, 120, getMaterial("silver", 3, Type.SMALL_DUST), getMaterial("lead", 3, Type.SMALL_DUST), getMaterial("sulfur", 2, Type.SMALL_DUST));
// register(getOre("dustObsidian", 4), 500, 5, getMaterial("magnesium", 2, Type.SMALL_DUST), getMaterial("iron", 2, Type.SMALL_DUST), getMaterial("silicon", Type.CELL), getMaterial("compressedair", 2, Type.CELL));
// register(getOre("dustPyrope", 20), 1780, 50, getMaterial("magnesium", 3, Type.DUST), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustAlmandine", 20), 1640, 50, getMaterial("iron", 3, Type.DUST), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustSpessartine", 20), 1800, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("manganese", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustAndradite", 20), 1280, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("iron", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustGrossular", 20), 204, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustUvarovite", 20), 2200, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("chrome", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL));
// register(getOre("dustAshes", 2), 20, 50, getMaterial("carbonfiber", Type.CELL));
register(ItemCells.getCellByName("methane", 5), 140, 50, getMaterial("hydrogen", 4, Type.CELL), getMaterial("carbon", Type.CELL));
register(ItemCells.getCellByName("sulfuricacid", 7), 40, 100, getMaterial("hydrogen", 2, Type.CELL), getMaterial("sulfur", Type.CELL), getMaterial("compressedair", 2, Type.CELL));
}
static void register(ItemStack input, int ticks, int euPerTick, boolean oreDict, ItemStack... outputs) {
ItemStack output1;
ItemStack output2 = null;
ItemStack output3 = null;
ItemStack output4 = null;
if (outputs.length == 3) {
output1 = outputs[0];
output2 = outputs[1];
output3 = outputs[2];
} else if (outputs.length == 2) {
output1 = outputs[0];
output2 = outputs[1];
} else if (outputs.length == 1) {
output1 = outputs[0];
} else if (outputs.length == 4) {
output1 = outputs[0];
output2 = outputs[1];
output3 = outputs[2];
output4 = outputs[3];
} else {
throw new InvalidParameterException("Invalid industrial electrolyzer outputs: " + outputs);
}
int cellCount = 0;
for (ItemStack stack : outputs) {
if (stack.getItem() instanceof DynamicCell) {
cellCount += stack.getCount();
}
}
if (input.getItem() instanceof DynamicCell) {
int inputCount = input.getCount();
if (cellCount < inputCount) {
if (output2 == null) {
output2 = DynamicCell.getEmptyCell(inputCount - cellCount);
} else if (output3 == null) {
output3 = DynamicCell.getEmptyCell(inputCount - cellCount);
} else if (output4 == null) {
output4 = DynamicCell.getEmptyCell(inputCount - cellCount);
}
}
cellCount -= inputCount;
}
if (cellCount < 0) {
cellCount = 0;
}
ItemStack cells = null;
if (cellCount > 0) {
if (cellCount > 64) {
throw new InvalidParameterException("Invalid industrial electrolyzer outputs: " + outputs + "(Recipe requires > 64 cells)");
}
cells = DynamicCell.getEmptyCell(cellCount);
}
RecipeHandler.addRecipe(Reference.INDUSTRIAL_ELECTROLYZER_RECIPE, new IndustrialElectrolyzerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
}
static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) {
register(input, ticks, euPerTick, true, outputs);
}
*/
}