Gems are flattened
This commit is contained in:
parent
2939ee02a3
commit
aadc7150f3
16 changed files with 188 additions and 116 deletions
83
src/main/java/techreborn/init/ModGems.java
Normal file
83
src/main/java/techreborn/init/ModGems.java
Normal file
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* 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 java.util.Arrays;
|
||||
|
||||
import com.google.common.base.CaseFormat;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.RebornRegistry;
|
||||
import techreborn.items.ItemGems;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public enum ModGems implements IStringSerializable {
|
||||
PERIDOT, RED_GARNET, RUBY, SAPPHIRE, YELLOW_GARNET;
|
||||
|
||||
public final String name;
|
||||
public final Item item;
|
||||
|
||||
private ModGems() {
|
||||
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "GEM_" + this.toString());
|
||||
item = new ItemGems();
|
||||
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
|
||||
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
Arrays.stream(ModGems.values()).forEach(gem -> RebornRegistry.registerItem(gem.item));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerModel() {
|
||||
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/gems");
|
||||
Arrays.stream(ModGems.values()).forEach(gem -> ModelLoader.setCustomModelResourceLocation(gem.item, 0,
|
||||
new ModelResourceLocation(blockstateJson, "type=" + gem.name)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
|
@ -45,7 +45,6 @@ import javax.annotation.Nullable;
|
|||
|
||||
public class ModItems {
|
||||
|
||||
public static Item GEMS;
|
||||
public static Item INGOTS;
|
||||
|
||||
public static Item DUSTS;
|
||||
|
@ -156,8 +155,6 @@ public class ModItems {
|
|||
public static DynamicCell CELL;
|
||||
|
||||
public static void init() {
|
||||
GEMS = new ItemGems();
|
||||
registerItem(GEMS, "gem");
|
||||
INGOTS = new ItemIngots();
|
||||
registerItem(INGOTS, "ingot");
|
||||
DUSTS = new ItemDusts();
|
||||
|
@ -165,6 +162,7 @@ public class ModItems {
|
|||
SMALL_DUSTS = new ItemDustsSmall();
|
||||
registerItem(SMALL_DUSTS, "smallDust");
|
||||
|
||||
ModGems.register();
|
||||
ModPlates.register();
|
||||
ModNuggets.register();
|
||||
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
/**
|
||||
*
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
@ -40,6 +60,10 @@ public enum ModNuggets implements IStringSerializable {
|
|||
public ItemStack getStack() {
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
Arrays.stream(ModNuggets.values()).forEach(nugget -> RebornRegistry.registerItem(nugget.item));
|
||||
|
|
|
@ -63,6 +63,10 @@ public enum ModPlates implements IStringSerializable {
|
|||
public ItemStack getStack() {
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
Arrays.stream(ModPlates.values()).forEach(plate -> RebornRegistry.registerItem(plate.item));
|
||||
|
|
|
@ -84,15 +84,16 @@ public class OreDict {
|
|||
OreUtil.registerOre("pulpWood", ItemDusts.getDustByName("saw_dust"));
|
||||
OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
|
||||
|
||||
for (String type : ItemGems.types) {
|
||||
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
|
||||
boolean ignoreIt = false;
|
||||
for (String ignore : plateGenIgnores)
|
||||
if (type.startsWith(ignore))
|
||||
ignoreIt = true;
|
||||
// if (!ignoreIt)
|
||||
// ItemPlates.registerType(type);
|
||||
}
|
||||
// TODO: fix recipe
|
||||
// for (String type : ItemGems.types) {
|
||||
// OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
|
||||
// boolean ignoreIt = false;
|
||||
// for (String ignore : plateGenIgnores)
|
||||
// if (type.startsWith(ignore))
|
||||
// ignoreIt = true;
|
||||
// if (!ignoreIt)
|
||||
// ItemPlates.registerType(type);
|
||||
// }
|
||||
|
||||
for (String type : ItemIngots.types) {
|
||||
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type));
|
||||
|
|
|
@ -66,12 +66,16 @@ public class SubItemRetriever implements ISubItemRetriever {
|
|||
|
||||
@Override
|
||||
public ItemStack getGemByName(String name) {
|
||||
return ItemGems.getGemByName(name);
|
||||
// TODO: Fix recipe
|
||||
//return ItemGems.getGemByName(name);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getGemByName(String name, int count) {
|
||||
return ItemGems.getGemByName(name, count);
|
||||
// TODO: Fix recipe
|
||||
//return ItemGems.getGemByName(name, count);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -38,15 +38,15 @@ import java.security.InvalidParameterException;
|
|||
*/
|
||||
public class ImplosionCompressorRecipes extends RecipeMethods {
|
||||
public static void init() {
|
||||
// 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);
|
||||
register(getOre("dustSapphire", 4), getMaterial("sapphire", 3, Type.GEM), 12);
|
||||
register(getOre("dustPeridot", 4), getMaterial("peridot", 3, Type.GEM), 12);
|
||||
register(getOre("dustRedGarnet", 4), getMaterial("red_garnet", 3, Type.GEM), 8);
|
||||
register(getOre("dustYellowGarnet", 4), getMaterial("yellow_garnet", 3, Type.GEM), 8);
|
||||
// TODO: fix recipe
|
||||
// register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4);
|
||||
// register(getOre("dustRuby", 4), getMaterial("ruby", 3, Type.GEM), 12);
|
||||
// register(getOre("dustSapphire", 4), getMaterial("sapphire", 3, Type.GEM), 12);
|
||||
// register(getOre("dustPeridot", 4), getMaterial("peridot", 3, Type.GEM), 12);
|
||||
// register(getOre("dustRedGarnet", 4), getMaterial("red_garnet", 3, Type.GEM), 8);
|
||||
// register(getOre("dustYellowGarnet", 4), getMaterial("yellow_garnet", 3, Type.GEM), 8);
|
||||
if (oresExist("dustApatite", "gemApatite")) {
|
||||
register(getOre("dustApatite", 4), getOre("gemApatite", 3), 12);
|
||||
}
|
||||
|
|
|
@ -100,9 +100,7 @@ public class IndustrialGrinderRecipes extends RecipeMethods {
|
|||
register(getOre("orePitchblende"), WATER, 100, 64, getOre("uran238", 8), getOre("smallUran235", 2));
|
||||
}
|
||||
|
||||
register(getOre("oreRuby"), WATER, 100, 64, getMaterial("ruby", Type.GEM), getMaterial("ruby", 6, Type.SMALL_DUST), getMaterial("red_garnet", 2, Type.SMALL_DUST));
|
||||
|
||||
register(getOre("oreSapphire"), WATER, 100, 64, getMaterial("sapphire", Type.GEM), getMaterial("sapphire", 6, Type.SMALL_DUST), getMaterial("peridot", 2, Type.SMALL_DUST));
|
||||
|
||||
|
||||
register(getOre("oreQuartz"), WATER, 100, 64, getStack(Items.QUARTZ, 2), getMaterial("sulfur", 2, Type.SMALL_DUST));
|
||||
|
||||
|
@ -118,8 +116,9 @@ public class IndustrialGrinderRecipes extends RecipeMethods {
|
|||
// TODO: Fix recipe
|
||||
// register(getOre("oreSheldonite"), WATER, 100, 64, getMaterial("platinum", 2, Type.DUST), getMaterial("nickel", Type.DUST), getMaterial("iridium", 2, Type.NUGGET));
|
||||
// register(getOre("oreSheldonite"), MERCURY, 100, 64, getMaterial("platinum", 3, Type.DUST), getMaterial("nickel", Type.DUST), getMaterial("iridium", 2, Type.NUGGET));
|
||||
|
||||
register(getOre("orePeridot"), WATER, 100, 64, getMaterial("peridot", Type.GEM), getMaterial("peridot", 6, Type.SMALL_DUST), getMaterial("emerald", 2, Type.SMALL_DUST));
|
||||
// register(getOre("orePeridot"), WATER, 100, 64, getMaterial("peridot", Type.GEM), getMaterial("peridot", 6, Type.SMALL_DUST), getMaterial("emerald", 2, Type.SMALL_DUST));
|
||||
// register(getOre("oreRuby"), WATER, 100, 64, getMaterial("ruby", Type.GEM), getMaterial("ruby", 6, Type.SMALL_DUST), getMaterial("red_garnet", 2, Type.SMALL_DUST));
|
||||
// register(getOre("oreSapphire"), WATER, 100, 64, getMaterial("sapphire", Type.GEM), getMaterial("sapphire", 6, Type.SMALL_DUST), getMaterial("peridot", 2, Type.SMALL_DUST));
|
||||
|
||||
register(getOre("oreSodalite"), WATER, 100, 64, getMaterial("sodalite", 12, Type.DUST), getMaterial("aluminum", 3, Type.DUST));
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ public abstract class RecipeMethods {
|
|||
return ItemDustsSmall.getSmallDustByName(name, count);
|
||||
} else if (type == Type.INGOT) {
|
||||
return ItemIngots.getIngotByName(name, count);
|
||||
} else if (type == Type.GEM) {
|
||||
return ItemGems.getGemByName(name, count);
|
||||
// } else if (type == Type.GEM) {
|
||||
// return ItemGems.getGemByName(name, count);
|
||||
// TODO: fix recipe
|
||||
// } else if (type == Type.PLATE) {
|
||||
// return ItemPlates.getPlateByName(name, count);
|
||||
|
|
|
@ -35,7 +35,6 @@ import techreborn.api.recipe.machines.ScrapboxRecipe;
|
|||
import techreborn.init.ModBlocks;
|
||||
import techreborn.items.DynamicCell;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemGems;
|
||||
import techreborn.utils.StackWIPHandler;
|
||||
|
||||
/**
|
||||
|
@ -196,10 +195,10 @@ public class ScrapboxRecipes extends RecipeMethods {
|
|||
// for (String i : ItemNuggets.types) {
|
||||
// register(ItemNuggets.getNuggetByName(i));
|
||||
// }
|
||||
|
||||
for (String i : ItemGems.types) {
|
||||
register(ItemGems.getGemByName(i));
|
||||
}
|
||||
//
|
||||
// for (String i : ItemGems.types) {
|
||||
// register(ItemGems.getGemByName(i));
|
||||
// }
|
||||
|
||||
registerDyable(Items.DYE);
|
||||
registerDyable(Blocks.WOOL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue