use of com.builtbroken.mc.lib.world.edit.PlacementData in project Engine by VoltzEngine-Project.
the class HeatedBlockRegistry method init.
public static void init(Configuration config) {
config.setCategoryComment("Block_Heat_Conversions", "Conversion of one block into another when a lot of heat is added. \'Air\' as an entry means the block turned into dust");
//Vanilla block handling
//---------------------------------------------------------------------
//Heating values
addNewHeatingConversion(Blocks.ice, Blocks.water, (int) TemperatureUnit.Fahrenheit.conversion.toKelvin(32));
addNewHeatingConversion(Blocks.obsidian, Blocks.lava, 1293);
//Made up conversion
addNewHeatingConversion(Blocks.grass, Blocks.dirt, 600);
//Cooling values
addNewCoolingConversion(Blocks.water, Blocks.ice, 273);
//made up value
addNewCoolingConversion(Blocks.lava, Blocks.obsidian, 1200);
//Everything else not registered, init with default data to make life simple
if (Block.blockRegistry instanceof FMLControlledNamespacedRegistry) {
FMLControlledNamespacedRegistry reg = ((FMLControlledNamespacedRegistry) Block.blockRegistry);
for (Object obj : reg.typeSafeIterable()) {
if (obj instanceof Block) {
String name = reg.getNameForObject(obj);
Material mat = ((Block) obj).getMaterial();
Block blockToConvertTo = Blocks.air;
int temp = 0;
if (mat.getCanBurn()) {
temp = 600;
} else if (mat == Material.rock) {
temp = 1293;
blockToConvertTo = Blocks.lava;
}
if (temp > 0) {
String conversion = config.getString(name, "Heat_Conversions", reg.getNameForObject(blockToConvertTo), "");
if (reg.getObject(conversion) != null) {
Object c_obj = reg.getObject(conversion);
if (c_obj instanceof Block) {
if (!warm_up_conversion.containsKey(obj)) {
if (blockToConvertTo == Blocks.lava) {
addNewHeatingConversion((Block) obj, new PlacementData(Blocks.cobblestone, 0), temp);
} else {
addNewHeatingConversion((Block) obj, (Block) c_obj, temp);
}
}
} else {
Engine.instance.logger().error("Error c_obj is not an instance of a block");
}
} else {
Engine.instance.logger().error("Config entry for heat conversion " + name + " has an invalid conversion of " + conversion);
}
}
}
}
}
}
use of com.builtbroken.mc.lib.world.edit.PlacementData in project Engine by VoltzEngine-Project.
the class Engine method init.
@EventHandler
public void init(FMLInitializationEvent evt) {
Engine.metadata.modId = References.NAME;
Engine.metadata.name = References.NAME;
Engine.metadata.description = References.NAME + " is a content creation toolkit";
Engine.metadata.url = "http://www.builtbroken.com";
Engine.metadata.version = References.VERSION;
Engine.metadata.authorList = Arrays.asList("DarkCow");
Engine.metadata.autogenerated = false;
//Late registration of content
if ((getConfig().hasKey("Content", "LoadOres") || metallicOresRequested) && getConfig().getBoolean("LoadOres", "Content", metallicOresRequested, "Loads up ore blocks and generators. Ore Generation can be disable separate if you want to keep the block for legacy purposes.")) {
ore = contentRegistry.newBlock("veStoneOre", new BlockOre("stone"), ItemBlockOre.class);
MetallicOres.registerSet(ore, getConfig());
}
if ((getConfig().hasKey("Content", "LoadGemOres") || gemOresRequested) && getConfig().getBoolean("LoadGemOres", "Content", gemOresRequested, "Loads up Gem Ores.")) {
gemOre = contentRegistry.newBlock("veGemOre", new BlockGemOre("stone"), ItemBlockGemOre.class);
GemOres.registerSet(gemOre, getConfig());
for (GemTypes types : GemTypes.values()) {
if (types.isRequested()) {
types.item = new ItemGem(types);
contentRegistry.newItem("Gem" + LanguageUtility.capitalizeFirst(types.name) + "Item", types.item);
for (Gems gem : Gems.values()) {
if (gem != Gems.UNKNOWN) {
OreDictionary.registerOre(types.oreDict + gem.getOreName(), types.stack(gem));
}
}
}
}
}
if (multiBlockRequested) {
multiBlock = new BlockMultiblock();
GameRegistry.registerBlock(multiBlock, ItemBlockMulti.class, "veMultiBlock");
NEIProxy.hideItem(multiBlock);
EnumMultiblock.register();
}
boolean forceLoadSheetMetal = (sheetMetalRequested || getConfig().hasKey("SheetMetalContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SheetMetalContent", true, "Forces the sheet metal items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadSimpleTools = (simpleToolsRequested || getConfig().hasKey("SimpleToolsContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SimpleToolsContent", true, "Forces the simple tools items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadCircuits = (circuitsRequested || getConfig().hasKey("Content", "LoadCircuits")) && getConfig().getBoolean("LoadCircuits", "Content", true, "Forces the circuit items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadCraftingParts = (craftingPartsRequested || getConfig().hasKey("Content", "LoadCraftingParts")) && getConfig().getBoolean("LoadCraftingParts", "Content", true, "Forces the crafting items(Motors, coils, simple electrical parts) to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
if (sheetMetalRequested || forceLoadSheetMetal) {
itemSheetMetalTools = getManager().newItem("veSheetMetalTools", ItemSheetMetalTools.class);
itemSheetMetal = getManager().newItem("veSheetMetal", ItemSheetMetal.class);
}
if (circuitsRequested || forceLoadCircuits) {
itemCircuits = getManager().newItem("veCircuits", ItemCircuits.class);
}
if (craftingPartsRequested || forceLoadCraftingParts) {
itemCraftingParts = getManager().newItem("veCraftingParts", ItemCraftingParts.class);
}
if (simpleToolsRequested || forceLoadSimpleTools) {
itemSimpleCraftingTools = getManager().newItem("veSimpleTools", ItemSimpleCraftingTool.class);
}
if (getConfig().getBoolean("LoadHeatedRocks", "Content", heatedRockRequested, "Loads up heated rocks which are used to give explosions an extra short term effect on stone.")) {
heatedStone = contentRegistry.newBlock("VEHeatedRock", BlockHeatedStone.class, ItemBlockMetadata.class);
NEIProxy.hideItem(heatedStone);
if (enabledHeatMap) {
HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.stone)), 600);
HeatedBlockRegistry.addNewHeatingConversion(Blocks.cobblestone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.cobblestone)), 600);
}
} else {
HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementData(Blocks.cobblestone, 1), 600);
}
logger.info("Starting resource generator");
long start = System.nanoTime();
for (DefinedGenItems genItem : DefinedGenItems.values()) {
if ((getConfig().hasKey("ForceLoadContent", genItem.name) || genItem.isRequested()) && getConfig().getBoolean(genItem.name, "ForceLoadContent", genItem.isRequested(), "Forces the items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.") || genItem.isRequested()) {
logger.info("\tGenerating " + genItem.name);
genItem.item = getManager().newItem("ve" + LanguageUtility.capitalizeFirst(genItem.name), new ItemGenMaterial(genItem));
for (GenMaterial mat : GenMaterial.values()) {
if (mat == GenMaterial.UNKNOWN || genItem.ignoreMaterials.contains(mat)) {
NEIProxy.hideItem(new ItemStack(genItem.item, 1, mat.ordinal()));
} else {
OreDictionary.registerOre(genItem.oreDict + LanguageUtility.capitalizeFirst(mat.name().toLowerCase()), genItem.stack(mat));
}
}
if (genItem == DefinedGenItems.INGOT && getConfig().getBoolean("EnableCheapSteelRecipe", "Content", true, "Enables iron ingot to steel ingot smelting recipe. Only disable if another recipe for steel exists or most items will be uncraftable.")) {
//TODO check to make sure doesn't conflict
GameRegistry.addSmelting(Items.iron_ingot, genItem.stack(GenMaterial.STEEL), 0f);
}
}
}
if (metallicOresRequested) {
//Register alt ore names
OreDictionary.registerOre("oreBauxite", MetallicOres.BAUXITE.stack());
OreDictionary.registerOre("oreMagnesite", MetallicOres.MAGNESITE.stack());
}
logger.info("Done... Took " + StringHelpers.formatTimeDifference(start, System.nanoTime()));
loader.init();
getManager().fireInit();
}
Aggregations