Gems are flattened
This commit is contained in:
parent
2939ee02a3
commit
aadc7150f3
16 changed files with 188 additions and 116 deletions
|
@ -50,8 +50,8 @@ import reborncore.common.util.OreDrop;
|
||||||
import reborncore.common.util.StringUtils;
|
import reborncore.common.util.StringUtils;
|
||||||
import techreborn.events.TRRecipeHandler;
|
import techreborn.events.TRRecipeHandler;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
|
import techreborn.init.ModGems;
|
||||||
import techreborn.items.ItemDusts;
|
import techreborn.items.ItemDusts;
|
||||||
import techreborn.items.ItemGems;
|
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
import techreborn.utils.TechRebornCreativeTab;
|
import techreborn.utils.TechRebornCreativeTab;
|
||||||
import techreborn.world.config.IOreNameProvider;
|
import techreborn.world.config.IOreNameProvider;
|
||||||
|
@ -143,10 +143,10 @@ public class BlockOre extends Block implements IOreNameProvider {
|
||||||
|
|
||||||
// Secondary drop, like peridot from sapphire ore added via event handler.
|
// Secondary drop, like peridot from sapphire ore added via event handler.
|
||||||
if (variant.equalsIgnoreCase("Ruby")) {
|
if (variant.equalsIgnoreCase("Ruby")) {
|
||||||
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby", rubyMinQuatity), rubyMaxQuantity);
|
OreDrop ruby = new OreDrop(ModGems.RUBY.getStack(rubyMinQuatity), rubyMaxQuantity);
|
||||||
drops.add(ruby.getDrops(fortune, random));
|
drops.add(ruby.getDrops(fortune, random));
|
||||||
} else if (variant.equalsIgnoreCase("Sapphire")) {
|
} else if (variant.equalsIgnoreCase("Sapphire")) {
|
||||||
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire", sapphireMinQuantity), sapphireMaxQuantity);
|
OreDrop sapphire = new OreDrop(ModGems.SAPPHIRE.getStack(sapphireMinQuantity), sapphireMaxQuantity);
|
||||||
drops.add(sapphire.getDrops(fortune, random));
|
drops.add(sapphire.getDrops(fortune, random));
|
||||||
} else if (variant.equalsIgnoreCase("Pyrite")) {
|
} else if (variant.equalsIgnoreCase("Pyrite")) {
|
||||||
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite", pyriteMinQuatity), pyriteMaxQuantity);
|
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite", pyriteMinQuatity), pyriteMaxQuantity);
|
||||||
|
|
|
@ -37,6 +37,7 @@ import techreborn.blocks.cable.BlockCable;
|
||||||
import techreborn.blocks.cable.EnumCableType;
|
import techreborn.blocks.cable.EnumCableType;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
|
import techreborn.init.ModGems;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.init.ModNuggets;
|
import techreborn.init.ModNuggets;
|
||||||
import techreborn.init.ModPlates;
|
import techreborn.init.ModPlates;
|
||||||
|
@ -128,12 +129,8 @@ public class RegisterItemJsons {
|
||||||
for (int i = 0; i < ItemIngots.types.length; ++i) {
|
for (int i = 0; i < ItemIngots.types.length; ++i) {
|
||||||
registerBlockstate(ModItems.INGOTS, i, name[i], "items/materials/");
|
registerBlockstate(ModItems.INGOTS, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
name = ItemGems.types.clone();
|
ModGems.registerModel();
|
||||||
for (int i = 0; i < ItemGems.types.length; ++i) {
|
|
||||||
registerBlockstate(ModItems.GEMS, i, name[i], "items/materials/");
|
|
||||||
}
|
|
||||||
|
|
||||||
ModPlates.registerModel();
|
ModPlates.registerModel();
|
||||||
ModNuggets.registerModel();
|
ModNuggets.registerModel();
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import reborncore.common.registration.RebornRegistry;
|
import reborncore.common.registration.RebornRegistry;
|
||||||
import reborncore.common.registration.impl.ConfigRegistry;
|
import reborncore.common.registration.impl.ConfigRegistry;
|
||||||
import reborncore.common.util.OreDrop;
|
import reborncore.common.util.OreDrop;
|
||||||
|
import techreborn.init.ModGems;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.items.ItemDusts;
|
import techreborn.items.ItemDusts;
|
||||||
import techreborn.items.ItemGems;
|
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
import techreborn.utils.OreDictUtils;
|
import techreborn.utils.OreDictUtils;
|
||||||
|
|
||||||
|
@ -68,11 +68,11 @@ public class BlockBreakHandler {
|
||||||
List<ItemStack> drops = event.getDrops();
|
List<ItemStack> drops = event.getDrops();
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
if (OreDictUtils.isOre(state, "oreRuby")) {
|
if (OreDictUtils.isOre(state, "oreRuby")) {
|
||||||
OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("red_garnet"), redGarnetDropChance, 1);
|
OreDrop redGarnet = new OreDrop(ModGems.RED_GARNET.getStack(), redGarnetDropChance, 1);
|
||||||
drops.add(redGarnet.getDrops(event.getFortuneLevel(), random));
|
drops.add(redGarnet.getDrops(event.getFortuneLevel(), random));
|
||||||
}
|
}
|
||||||
else if (OreDictUtils.isOre(state, "oreSapphire")) {
|
else if (OreDictUtils.isOre(state, "oreSapphire")) {
|
||||||
OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), peridotDropChance, 1);
|
OreDrop peridot = new OreDrop(ModGems.PERIDOT.getStack(), peridotDropChance, 1);
|
||||||
drops.add(peridot.getDrops(event.getFortuneLevel(), random));
|
drops.add(peridot.getDrops(event.getFortuneLevel(), random));
|
||||||
}
|
}
|
||||||
else if (OreDictUtils.isOre(state, "oreSodalite")) {
|
else if (OreDictUtils.isOre(state, "oreSodalite")) {
|
||||||
|
@ -84,7 +84,7 @@ public class BlockBreakHandler {
|
||||||
drops.add(redstone.getDrops(event.getFortuneLevel(), random));
|
drops.add(redstone.getDrops(event.getFortuneLevel(), random));
|
||||||
}
|
}
|
||||||
else if (OreDictUtils.isOre(state, "oreSphalerite")) {
|
else if (OreDictUtils.isOre(state, "oreSphalerite")) {
|
||||||
OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), yellowGarnetDropChance, 1);
|
OreDrop yellowGarnet = new OreDrop(ModGems.YELLOW_GARNET.getStack(), yellowGarnetDropChance, 1);
|
||||||
drops.add(yellowGarnet.getDrops(event.getFortuneLevel(), random));
|
drops.add(yellowGarnet.getDrops(event.getFortuneLevel(), random));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
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 class ModItems {
|
||||||
|
|
||||||
public static Item GEMS;
|
|
||||||
public static Item INGOTS;
|
public static Item INGOTS;
|
||||||
|
|
||||||
public static Item DUSTS;
|
public static Item DUSTS;
|
||||||
|
@ -156,8 +155,6 @@ public class ModItems {
|
||||||
public static DynamicCell CELL;
|
public static DynamicCell CELL;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
GEMS = new ItemGems();
|
|
||||||
registerItem(GEMS, "gem");
|
|
||||||
INGOTS = new ItemIngots();
|
INGOTS = new ItemIngots();
|
||||||
registerItem(INGOTS, "ingot");
|
registerItem(INGOTS, "ingot");
|
||||||
DUSTS = new ItemDusts();
|
DUSTS = new ItemDusts();
|
||||||
|
@ -165,6 +162,7 @@ public class ModItems {
|
||||||
SMALL_DUSTS = new ItemDustsSmall();
|
SMALL_DUSTS = new ItemDustsSmall();
|
||||||
registerItem(SMALL_DUSTS, "smallDust");
|
registerItem(SMALL_DUSTS, "smallDust");
|
||||||
|
|
||||||
|
ModGems.register();
|
||||||
ModPlates.register();
|
ModPlates.register();
|
||||||
ModNuggets.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;
|
package techreborn.init;
|
||||||
|
|
||||||
|
@ -40,6 +60,10 @@ public enum ModNuggets implements IStringSerializable {
|
||||||
public ItemStack getStack() {
|
public ItemStack getStack() {
|
||||||
return new ItemStack(item);
|
return new ItemStack(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack getStack(int amount) {
|
||||||
|
return new ItemStack(item, amount);
|
||||||
|
}
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Arrays.stream(ModNuggets.values()).forEach(nugget -> RebornRegistry.registerItem(nugget.item));
|
Arrays.stream(ModNuggets.values()).forEach(nugget -> RebornRegistry.registerItem(nugget.item));
|
||||||
|
|
|
@ -63,6 +63,10 @@ public enum ModPlates implements IStringSerializable {
|
||||||
public ItemStack getStack() {
|
public ItemStack getStack() {
|
||||||
return new ItemStack(item);
|
return new ItemStack(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack getStack(int amount) {
|
||||||
|
return new ItemStack(item, amount);
|
||||||
|
}
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Arrays.stream(ModPlates.values()).forEach(plate -> RebornRegistry.registerItem(plate.item));
|
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("pulpWood", ItemDusts.getDustByName("saw_dust"));
|
||||||
OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
|
OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
|
||||||
|
|
||||||
for (String type : ItemGems.types) {
|
// TODO: fix recipe
|
||||||
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
|
// for (String type : ItemGems.types) {
|
||||||
boolean ignoreIt = false;
|
// OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
|
||||||
for (String ignore : plateGenIgnores)
|
// boolean ignoreIt = false;
|
||||||
if (type.startsWith(ignore))
|
// for (String ignore : plateGenIgnores)
|
||||||
ignoreIt = true;
|
// if (type.startsWith(ignore))
|
||||||
// if (!ignoreIt)
|
// ignoreIt = true;
|
||||||
// ItemPlates.registerType(type);
|
// if (!ignoreIt)
|
||||||
}
|
// ItemPlates.registerType(type);
|
||||||
|
// }
|
||||||
|
|
||||||
for (String type : ItemIngots.types) {
|
for (String type : ItemIngots.types) {
|
||||||
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type));
|
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type));
|
||||||
|
|
|
@ -66,12 +66,16 @@ public class SubItemRetriever implements ISubItemRetriever {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getGemByName(String name) {
|
public ItemStack getGemByName(String name) {
|
||||||
return ItemGems.getGemByName(name);
|
// TODO: Fix recipe
|
||||||
|
//return ItemGems.getGemByName(name);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getGemByName(String name, int count) {
|
public ItemStack getGemByName(String name, int count) {
|
||||||
return ItemGems.getGemByName(name, count);
|
// TODO: Fix recipe
|
||||||
|
//return ItemGems.getGemByName(name, count);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,15 +38,15 @@ import java.security.InvalidParameterException;
|
||||||
*/
|
*/
|
||||||
public class ImplosionCompressorRecipes extends RecipeMethods {
|
public class ImplosionCompressorRecipes extends RecipeMethods {
|
||||||
public static void init() {
|
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("dustDiamond", 4), getStack(Items.DIAMOND, 3), 16);
|
||||||
register(getOre("dustEmerald", 4), getStack(Items.EMERALD, 3), 12);
|
register(getOre("dustEmerald", 4), getStack(Items.EMERALD, 3), 12);
|
||||||
register(getOre("dustRuby", 4), getMaterial("ruby", 3, Type.GEM), 12);
|
// TODO: fix recipe
|
||||||
register(getOre("dustSapphire", 4), getMaterial("sapphire", 3, Type.GEM), 12);
|
// register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4);
|
||||||
register(getOre("dustPeridot", 4), getMaterial("peridot", 3, Type.GEM), 12);
|
// register(getOre("dustRuby", 4), getMaterial("ruby", 3, Type.GEM), 12);
|
||||||
register(getOre("dustRedGarnet", 4), getMaterial("red_garnet", 3, Type.GEM), 8);
|
// register(getOre("dustSapphire", 4), getMaterial("sapphire", 3, Type.GEM), 12);
|
||||||
register(getOre("dustYellowGarnet", 4), getMaterial("yellow_garnet", 3, Type.GEM), 8);
|
// 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")) {
|
if (oresExist("dustApatite", "gemApatite")) {
|
||||||
register(getOre("dustApatite", 4), getOre("gemApatite", 3), 12);
|
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("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));
|
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
|
// 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"), 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("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));
|
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);
|
return ItemDustsSmall.getSmallDustByName(name, count);
|
||||||
} else if (type == Type.INGOT) {
|
} else if (type == Type.INGOT) {
|
||||||
return ItemIngots.getIngotByName(name, count);
|
return ItemIngots.getIngotByName(name, count);
|
||||||
} else if (type == Type.GEM) {
|
// } else if (type == Type.GEM) {
|
||||||
return ItemGems.getGemByName(name, count);
|
// return ItemGems.getGemByName(name, count);
|
||||||
// TODO: fix recipe
|
// TODO: fix recipe
|
||||||
// } else if (type == Type.PLATE) {
|
// } else if (type == Type.PLATE) {
|
||||||
// return ItemPlates.getPlateByName(name, count);
|
// return ItemPlates.getPlateByName(name, count);
|
||||||
|
|
|
@ -35,7 +35,6 @@ import techreborn.api.recipe.machines.ScrapboxRecipe;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.items.DynamicCell;
|
import techreborn.items.DynamicCell;
|
||||||
import techreborn.items.ItemDusts;
|
import techreborn.items.ItemDusts;
|
||||||
import techreborn.items.ItemGems;
|
|
||||||
import techreborn.utils.StackWIPHandler;
|
import techreborn.utils.StackWIPHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -196,10 +195,10 @@ public class ScrapboxRecipes extends RecipeMethods {
|
||||||
// for (String i : ItemNuggets.types) {
|
// for (String i : ItemNuggets.types) {
|
||||||
// register(ItemNuggets.getNuggetByName(i));
|
// register(ItemNuggets.getNuggetByName(i));
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
for (String i : ItemGems.types) {
|
// for (String i : ItemGems.types) {
|
||||||
register(ItemGems.getGemByName(i));
|
// register(ItemGems.getGemByName(i));
|
||||||
}
|
// }
|
||||||
|
|
||||||
registerDyable(Items.DYE);
|
registerDyable(Items.DYE);
|
||||||
registerDyable(Blocks.WOOL);
|
registerDyable(Blocks.WOOL);
|
||||||
|
|
|
@ -24,61 +24,26 @@
|
||||||
|
|
||||||
package techreborn.items;
|
package techreborn.items;
|
||||||
|
|
||||||
import com.google.common.base.CaseFormat;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.NonNullList;
|
|
||||||
import techreborn.events.TRRecipeHandler;
|
import techreborn.events.TRRecipeHandler;
|
||||||
import techreborn.init.ModItems;
|
|
||||||
import techreborn.utils.TechRebornCreativeTab;
|
|
||||||
|
|
||||||
import java.security.InvalidParameterException;
|
|
||||||
|
|
||||||
public class ItemGems extends ItemTR {
|
public class ItemGems extends ItemTR {
|
||||||
|
|
||||||
public static final String[] types = new String[] { "ruby", "sapphire", "peridot", "red_garnet", "yellow_garnet" };
|
|
||||||
|
|
||||||
public ItemGems() {
|
public ItemGems() {
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
|
||||||
setTranslationKey("techreborn.gem");
|
|
||||||
setHasSubtypes(true);
|
|
||||||
TRRecipeHandler.hideEntry(this);
|
TRRecipeHandler.hideEntry(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getGemByName(String name, int count) {
|
// public static ItemStack getGemByName(String name, int count) {
|
||||||
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
|
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
|
||||||
for (int i = 0; i < types.length; i++) {
|
// for (int i = 0; i < types.length; i++) {
|
||||||
if (types[i].equalsIgnoreCase(name)) {
|
// if (types[i].equalsIgnoreCase(name)) {
|
||||||
return new ItemStack(ModItems.GEMS, count, i);
|
// return new ItemStack(ModItems.GEMS, count, i);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
throw new InvalidParameterException("The gem " + name + " could not be found.");
|
// throw new InvalidParameterException("The gem " + name + " could not be found.");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public static ItemStack getGemByName(String name) {
|
// public static ItemStack getGemByName(String name) {
|
||||||
return getGemByName(name, 1);
|
// return getGemByName(name, 1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
|
||||||
// gets Unlocalized Name depending on meta data
|
|
||||||
public String getTranslationKey(ItemStack itemStack) {
|
|
||||||
int meta = itemStack.getItemDamage();
|
|
||||||
if (meta < 0 || meta >= types.length) {
|
|
||||||
meta = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.getTranslationKey() + "." + types[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adds Dusts SubItems To Creative Tab
|
|
||||||
@Override
|
|
||||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
|
||||||
if (!isInCreativeTab(creativeTabs)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (int meta = 0; meta < types.length; ++meta) {
|
|
||||||
list.add(new ItemStack(this, 1, meta));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,27 +6,27 @@
|
||||||
},
|
},
|
||||||
"variants": {
|
"variants": {
|
||||||
"type": {
|
"type": {
|
||||||
"ruby": {
|
"gemperidot": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/gem/peridot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gemredgarnet": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/gem/red_garnet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gemruby": {
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "techreborn:items/gem/ruby"
|
"layer0": "techreborn:items/gem/ruby"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sapphire": {
|
"gemsapphire": {
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "techreborn:items/gem/sapphire"
|
"layer0": "techreborn:items/gem/sapphire"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"peridot": {
|
"gemyellowgarnet": {
|
||||||
"textures": {
|
|
||||||
"layer0": "techreborn:items/gem/peridot"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"red_garnet": {
|
|
||||||
"textures": {
|
|
||||||
"layer0": "techreborn:items/gem/red_garnet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"yellow_garnet": {
|
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "techreborn:items/gem/yellow_garnet"
|
"layer0": "techreborn:items/gem/yellow_garnet"
|
||||||
}
|
}
|
|
@ -364,11 +364,11 @@ item.techreborn.dustsmall.diorite.name=Small Pile of Diorite Dust
|
||||||
item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust
|
item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust
|
||||||
|
|
||||||
#Gems
|
#Gems
|
||||||
item.techreborn.gem.ruby.name=Ruby
|
item.techreborn.gemPeridot.name=Peridot
|
||||||
item.techreborn.gem.sapphire.name=Sapphire
|
item.techreborn.gemRedGarnet.name=Red Garnet
|
||||||
item.techreborn.gem.peridot.name=Peridot
|
item.techreborn.gemRuby.name=Ruby
|
||||||
item.techreborn.gem.red_garnet.name=Red Garnet
|
item.techreborn.gemSapphire.name=Sapphire
|
||||||
item.techreborn.gem.yellow_garnet.name=Yellow Garnet
|
item.techreborn.gemYellowGarnet.name=Yellow Garnet
|
||||||
|
|
||||||
#Ingots
|
#Ingots
|
||||||
item.techreborn.ingot.aluminum.name=Aluminium Ingot
|
item.techreborn.ingot.aluminum.name=Aluminium Ingot
|
||||||
|
@ -418,8 +418,6 @@ item.techreborn.nuggetTungsten.name=Tungsten Nugget
|
||||||
item.techreborn.nuggetTungstensteel.name=Tungstensteel Nugget
|
item.techreborn.nuggetTungstensteel.name=Tungstensteel Nugget
|
||||||
item.techreborn.nuggetZinc.name=Zinc Nugget
|
item.techreborn.nuggetZinc.name=Zinc Nugget
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Plates
|
#Plates
|
||||||
item.techreborn.plateAdvancedAlloy.name=Advanced Alloy Plate
|
item.techreborn.plateAdvancedAlloy.name=Advanced Alloy Plate
|
||||||
item.techreborn.plateAluminum.name=Aluminium Plate
|
item.techreborn.plateAluminum.name=Aluminium Plate
|
||||||
|
|
Loading…
Reference in a new issue