Some flattening attempt for plates

This commit is contained in:
drcrazy 2018-08-07 13:50:46 +03:00
parent 53b450acea
commit 2e4c3ebf1a
31 changed files with 439 additions and 205 deletions

View file

@ -80,8 +80,8 @@ public class ModItems {
public static Item ENERGY_CRYSTAL;
public static Item SCRAP_BOX;
public static Item FREQUENCY_TRANSMITTER;
public static @Nullable
Item BRONZE_SWORD;
@Nullable
public static Item BRONZE_SWORD;
@Nullable
public static Item BRONZE_PICKAXE;
@Nullable
@ -165,8 +165,8 @@ public class ModItems {
registerItem(DUSTS, "dust");
SMALL_DUSTS = new ItemDustsSmall();
registerItem(SMALL_DUSTS, "smallDust");
PLATES = new ItemPlates();
registerItem(PLATES, "plates");
// PLATES = new ItemPlates();
// registerItem(PLATES, "plates");
NUGGETS = new ItemNuggets();
registerItem(NUGGETS, "nuggets");
// purifiedCrushedOre = new ItemPurifiedCrushedOre();

View file

@ -0,0 +1,65 @@
/*
* 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;
import net.minecraft.util.ResourceLocation;
import techreborn.lib.ModInfo;
import techreborn.items.ItemPlates;
/**
* @author drcrazy
*
*/
public enum ModPlates {
ADVANCED_ALLOY_PLATE("plateAdvancedAlloy"),
ALUMINUM_PLATE("plateAluminum"),
BRASS_PLATE("plateBrass"),
BRONZE_PLATE("plateBronze"),
CARBON_PLATE("plateCarbon"),
COAL_PLATE("plateCoal"),
COPPER_PLATE("plateCopper"),
DIAMOND_PLATE("plateDiamond"),
IRON_PLATE("plateIron"),
GOLD_PLATE("plateGold"),
WOOD_PLATE("plateWood"),
REDSTONE_PLATE("plateRedstone"),
EMERALD_PLATE("plateEmerald"),
OBSIDIAN_PLATE("plateObsidian"),
LAZURITE_PLATE("plateLazurite");
public ResourceLocation name;
public ItemPlates item;
ModPlates(String name) {
this.name = new ResourceLocation(ModInfo.MOD_ID, name);
this.item = new ItemPlates();
this.item.setRegistryName(this.name);
}
}

View file

@ -108,59 +108,59 @@ public class ModRecipes {
}
private static void addCompressorRecipes() {
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"),
ItemPlates.getPlateByName("advanced_alloy"), 400, 20));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemParts.getPartByName("carbon_mesh"),
ItemPlates.getPlateByName("carbon"), 400, 2));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1),
OreUtil.getStackFromName("plateWood", 1), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1),
ItemPlates.getPlateByName("lazurite", 1), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("obsidian", 1),
ItemPlates.getPlateByName("obsidian", 9), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustObsidian", 1),
ItemPlates.getPlateByName("obsidian", 1), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustYellowGarnet", 1),
ItemPlates.getPlateByName("YellowGarnet"), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockYellowGarnet", 1),
ItemPlates.getPlateByName("YellowGarnet", 9), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustRedGarnet", 1),
ItemPlates.getPlateByName("RedGarnet"), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1),
ItemPlates.getPlateByName("RedGarnet", 9), 300, 4));
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("ingotRefinedIron", 1),
ItemPlates.getPlateByName("RefinedIron"), 300, 4));
ItemStack plate;
for (String ore : OreUtil.oreNames) {
if (ore.equals("iridium")) {
continue;
}
if (OreUtil.hasPlate(ore)) {
try {
plate = ItemPlates.getPlateByName(ore, 1);
} catch (InvalidParameterException e) {
plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1);
}
if (plate.isEmpty()) {
continue;
}
if (OreUtil.hasIngot(ore)) {
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
}
if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) {
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
}
if (OreUtil.hasBlock(ore)) {
ItemStack morePlates = plate.copy();
morePlates.setCount(9);
RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4));
}
}
}
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"),
// ItemPlates.getPlateByName("advanced_alloy"), 400, 20));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemParts.getPartByName("carbon_mesh"),
// ItemPlates.getPlateByName("carbon"), 400, 2));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1),
// OreUtil.getStackFromName("plateWood", 1), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1),
// ItemPlates.getPlateByName("lazurite", 1), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("obsidian", 1),
// ItemPlates.getPlateByName("obsidian", 9), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustObsidian", 1),
// ItemPlates.getPlateByName("obsidian", 1), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustYellowGarnet", 1),
// ItemPlates.getPlateByName("YellowGarnet"), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockYellowGarnet", 1),
// ItemPlates.getPlateByName("YellowGarnet", 9), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustRedGarnet", 1),
// ItemPlates.getPlateByName("RedGarnet"), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1),
// ItemPlates.getPlateByName("RedGarnet", 9), 300, 4));
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("ingotRefinedIron", 1),
// ItemPlates.getPlateByName("RefinedIron"), 300, 4));
//
// ItemStack plate;
// for (String ore : OreUtil.oreNames) {
// if (ore.equals("iridium")) {
// continue;
// }
// if (OreUtil.hasPlate(ore)) {
// try {
// plate = ItemPlates.getPlateByName(ore, 1);
// } catch (InvalidParameterException e) {
// plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1);
// }
// if (plate.isEmpty()) {
// continue;
// }
// if (OreUtil.hasIngot(ore)) {
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
// OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
// }
// if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) {
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
// OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
// }
// if (OreUtil.hasBlock(ore)) {
// ItemStack morePlates = plate.copy();
// morePlates.setCount(9);
// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(
// OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4));
// }
// }
// }
}
static void addGrinderRecipes() {

View file

@ -90,8 +90,8 @@ public class OreDict {
for (String ignore : plateGenIgnores)
if (type.startsWith(ignore))
ignoreIt = true;
if (!ignoreIt)
ItemPlates.registerType(type);
// if (!ignoreIt)
// ItemPlates.registerType(type);
}
for (String type : ItemIngots.types) {
@ -100,19 +100,21 @@ public class OreDict {
for (String ignore : plateGenIgnores)
if (type.startsWith(ignore))
ignoreIt = true;
if (!ignoreIt)
ItemPlates.registerType(type);
// if (!ignoreIt)
// ItemPlates.registerType(type);
}
for (String type : ItemPlates.types) {
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type));
// TODO: fix recipe
// OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type));
}
//Late registration of additional plates to keep meta
ItemPlates.registerType("magnalium");
OreUtil.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium"));
ItemPlates.registerType("iridium_alloy");
OreUtil.registerOre("plateIridiumAlloy", ItemPlates.getPlateByName("iridiumAlloy"));
// ItemPlates.registerType("magnalium");
// OreUtil.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium"));
// TODO: Fix recipe
// ItemPlates.registerType("iridium_alloy");
// OreUtil.registerOre("plateIridiumAlloy", ItemPlates.getPlateByName("iridiumAlloy"));
for (String type : ItemDusts.types) {

View file

@ -104,15 +104,15 @@ public class SubItemRetriever implements ISubItemRetriever {
return ItemParts.getPartByName(name, count);
}
@Override
public ItemStack getPlateByName(String name) {
return ItemPlates.getPlateByName(name);
}
// @Override
// public ItemStack getPlateByName(String name) {
// return ItemPlates.getPlateByName(name);
// }
@Override
public ItemStack getPlateByName(String name, int count) {
return ItemPlates.getPlateByName(name, count);
}
// @Override
// public ItemStack getPlateByName(String name, int count) {
// return ItemPlates.getPlateByName(name, count);
// }
@Override
public ItemStack getUpgradeByName(String name) {
@ -143,4 +143,16 @@ public class SubItemRetriever implements ISubItemRetriever {
public ItemStack getStorageBlockByName(String name, int count) {
return BlockStorage.getStorageBlockByName(name, count);
}
@Override
public ItemStack getPlateByName(String name) {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack getPlateByName(String name, int count) {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -38,7 +38,8 @@ import java.security.InvalidParameterException;
*/
public class ImplosionCompressorRecipes extends RecipeMethods {
public static void init() {
register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4);
// TODO: fix recipe
// register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4);
register(getOre("dustDiamond", 4), getStack(Items.DIAMOND, 3), 16);
register(getOre("dustEmerald", 4), getStack(Items.EMERALD, 3), 12);
register(getOre("dustRuby", 4), getMaterial("ruby", 3, Type.GEM), 12);

View file

@ -50,8 +50,8 @@ public abstract class RecipeMethods {
return ItemIngots.getIngotByName(name, count);
} else if (type == Type.GEM) {
return ItemGems.getGemByName(name, count);
} else if (type == Type.PLATE) {
return ItemPlates.getPlateByName(name, count);
// } else if (type == Type.PLATE) {
// return ItemPlates.getPlateByName(name, count);
} else if (type == Type.NUGGET) {
return ItemNuggets.getNuggetByName(name, count);
} else if (type == Type.CELL) {

View file

@ -44,7 +44,8 @@ public class RollingMachineRecipes extends RecipeMethods {
if (oresExist("ingotAluminium")) {
register(new ResourceLocation(ModInfo.MOD_ID, "kanthal_heating_coil2"), getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium");
}
register(new ResourceLocation(ModInfo.MOD_ID, "plateMagnalium"), getMaterial("magnalium", 3, Type.PLATE), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium");
// TODO: fix recipe
// register(new ResourceLocation(ModInfo.MOD_ID, "plateMagnalium"), getMaterial("magnalium", 3, Type.PLATE), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium");
register(new ResourceLocation(ModInfo.MOD_ID, "rail"), getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood");
register(new ResourceLocation(ModInfo.MOD_ID, "gold_rail"), getStack(Blocks.GOLDEN_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone");
register(new ResourceLocation(ModInfo.MOD_ID, "detector_rail"), getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone");