Merged all ingredients into single class

This commit is contained in:
drcrazy 2018-09-03 14:49:59 +03:00
parent 0b1733b733
commit 33b9f697dc
40 changed files with 258 additions and 1072 deletions

View file

@ -24,12 +24,10 @@
package techreborn.api.fluidreplicator;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.tiles.multiblock.TileFluidReplicator;
import javax.annotation.Nonnull;
@ -99,7 +97,7 @@ public class FluidReplicatorRecipe implements Cloneable {
public List<Object> getInputs() {
ArrayList<Object> inputs = new ArrayList<>();
inputs.add(ModParts.UU_MATTER.getStack(input));
inputs.add(TRIngredients.Parts.UU_MATTER.getStack(input));
return inputs;
}

View file

@ -32,8 +32,7 @@ import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Inventory;
import reborncore.common.util.Tank;
import techreborn.api.Reference;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.tiles.multiblock.TileFluidReplicator;
/**
@ -65,7 +64,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
return false;
}
ItemStack inputStack = inventory.getStackInSlot(inputSlots[0]);
if (!inputStack.isItemEqual(ModParts.UU_MATTER.getStack())) {
if (!inputStack.isItemEqual(TRIngredients.Parts.UU_MATTER.getStack())) {
return false;
}
if (inputStack.getCount() < recipe.getInput()) {

View file

@ -50,8 +50,7 @@ import reborncore.common.util.OreDrop;
import reborncore.common.util.StringUtils;
import techreborn.events.TRRecipeHandler;
import techreborn.init.ModBlocks;
import techreborn.init.ModDusts;
import techreborn.init.ModGems;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
import techreborn.utils.TechRebornCreativeTab;
import techreborn.world.config.IOreNameProvider;
@ -143,22 +142,22 @@ public class BlockOre extends Block implements IOreNameProvider {
// Secondary drop, like peridot from sapphire ore added via event handler.
if (variant.equalsIgnoreCase("Ruby")) {
OreDrop ruby = new OreDrop(ModGems.RUBY.getStack(rubyMinQuatity), rubyMaxQuantity);
OreDrop ruby = new OreDrop(TRIngredients.Gems.RUBY.getStack(rubyMinQuatity), rubyMaxQuantity);
drops.add(ruby.getDrops(fortune, random));
} else if (variant.equalsIgnoreCase("Sapphire")) {
OreDrop sapphire = new OreDrop(ModGems.SAPPHIRE.getStack(sapphireMinQuantity), sapphireMaxQuantity);
OreDrop sapphire = new OreDrop(TRIngredients.Gems.SAPPHIRE.getStack(sapphireMinQuantity), sapphireMaxQuantity);
drops.add(sapphire.getDrops(fortune, random));
} else if (variant.equalsIgnoreCase("Pyrite")) {
OreDrop pyriteDust = new OreDrop(ModDusts.PYRITE.getStack(pyriteMinQuatity), pyriteMaxQuantity);
OreDrop pyriteDust = new OreDrop(TRIngredients.Dusts.PYRITE.getStack(pyriteMinQuatity), pyriteMaxQuantity);
drops.add(pyriteDust.getDrops(fortune, random));
} else if (variant.equalsIgnoreCase("Sodalite")) {
OreDrop sodalite = new OreDrop(ModDusts.SODALITE.getStack(sodaliteMinQuatity), sodaliteMaxQuantity);
OreDrop sodalite = new OreDrop(TRIngredients.Dusts.SODALITE.getStack(sodaliteMinQuatity), sodaliteMaxQuantity);
drops.add(sodalite.getDrops(fortune, random));
} else if (variant.equalsIgnoreCase("Cinnabar")) {
OreDrop cinnabar = new OreDrop(ModDusts.CINNABAR.getStack(cinnabarMinQuatity), cinnabarMaxQuantity);
OreDrop cinnabar = new OreDrop(TRIngredients.Dusts.CINNABAR.getStack(cinnabarMinQuatity), cinnabarMaxQuantity);
drops.add(cinnabar.getDrops(fortune, random));
} else if (variant.equalsIgnoreCase("Sphalerite")) {
OreDrop sphalerite = new OreDrop(ModDusts.SPHALERITE.getStack(sphaleriteMinQuatity), sphaleriteMaxQuantity);
OreDrop sphalerite = new OreDrop(TRIngredients.Dusts.SPHALERITE.getStack(sphaleriteMinQuatity), sphaleriteMaxQuantity);
drops.add(sphalerite.getDrops(fortune, random));
} else {
drops.add(new ItemStack(Item.getItemFromBlock(this), 1, meta));

View file

@ -47,8 +47,8 @@ import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry;
import reborncore.common.util.WorldUtils;
import techreborn.events.TRRecipeHandler;
import techreborn.init.ModParts;
import techreborn.init.ModSounds;
import techreborn.init.TRIngredients;
import techreborn.items.tools.ItemElectricTreetap;
import techreborn.items.tools.ItemTreeTap;
import techreborn.lib.ModInfo;
@ -186,8 +186,8 @@ public class BlockRubberLog extends Block {
} else {
playerIn.getHeldItem(EnumHand.MAIN_HAND).damageItem(1, playerIn);
}
if (!playerIn.inventory.addItemStackToInventory(ModParts.SAP.getStack())) {
WorldUtils.dropItem(ModParts.SAP.getStack(), worldIn, pos.offset(side));
if (!playerIn.inventory.addItemStackToInventory(TRIngredients.Parts.SAP.getStack())) {
WorldUtils.dropItem(TRIngredients.Parts.SAP.getStack(), worldIn, pos.offset(side));
}
if (playerIn instanceof EntityPlayerMP) {
TRRecipeHandler.unlockTRRecipes((EntityPlayerMP) playerIn);
@ -210,7 +210,7 @@ public class BlockRubberLog extends Block {
drops.add(new ItemStack(this));
if (state.getValue(HAS_SAP)) {
if (new Random().nextInt(4) == 0) {
drops.add(ModParts.SAP.getStack());
drops.add(TRIngredients.Parts.SAP.getStack());
}
}
return drops;

View file

@ -37,14 +37,8 @@ import techreborn.blocks.cable.BlockCable;
import techreborn.blocks.cable.EnumCableType;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.init.ModDusts;
import techreborn.init.ModDustsSmall;
import techreborn.init.ModGems;
import techreborn.init.ModIngots;
import techreborn.init.ModItems;
import techreborn.init.ModNuggets;
import techreborn.init.ModParts;
import techreborn.init.ModPlates;
import techreborn.init.TRIngredients;
import techreborn.items.*;
import techreborn.lib.ModInfo;
@ -128,14 +122,7 @@ public class RegisterItemJsons {
registerBlockstateMultiItem(ModItems.BRONZE_HOE, "bronze_hoe", "items/tool/tool");
}
ModDusts.registerModel();
ModDustsSmall.registerModel();
ModGems.registerModel();
ModIngots.registerModel();
ModNuggets.registerModel();
ModParts.registerModel();
ModPlates.registerModel();
TRIngredients.registerModel();
String[] name = ItemUpgrades.types.clone();
for (int i = 0; i < ItemUpgrades.types.length; ++i) {

View file

@ -30,8 +30,7 @@ import reborncore.client.gui.slots.BaseSlot;
import reborncore.client.gui.slots.SlotFilteredVoid;
import reborncore.common.container.RebornContainer;
import reborncore.common.util.Inventory;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
public class ContainerDestructoPack extends RebornContainer {
@ -52,7 +51,7 @@ public class ContainerDestructoPack extends RebornContainer {
private void buildContainer() {
this.addSlotToContainer(
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { ModParts.MACHINE_PARTS.getStack() }));
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { TRIngredients.Parts.MACHINE_PARTS.getStack() }));
int i;
for (i = 0; i < 3; ++i) {

View file

@ -36,9 +36,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.OreDrop;
import techreborn.init.ModDusts;
import techreborn.init.ModGems;
import techreborn.init.ModItems;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
import techreborn.utils.OreDictUtils;
@ -68,15 +67,15 @@ public class BlockBreakHandler {
List<ItemStack> drops = event.getDrops();
Random random = new Random();
if (OreDictUtils.isOre(state, "oreRuby")) {
OreDrop redGarnet = new OreDrop(ModGems.RED_GARNET.getStack(), redGarnetDropChance, 1);
OreDrop redGarnet = new OreDrop(TRIngredients.Gems.RED_GARNET.getStack(), redGarnetDropChance, 1);
drops.add(redGarnet.getDrops(event.getFortuneLevel(), random));
}
else if (OreDictUtils.isOre(state, "oreSapphire")) {
OreDrop peridot = new OreDrop(ModGems.PERIDOT.getStack(), peridotDropChance, 1);
OreDrop peridot = new OreDrop(TRIngredients.Gems.PERIDOT.getStack(), peridotDropChance, 1);
drops.add(peridot.getDrops(event.getFortuneLevel(), random));
}
else if (OreDictUtils.isOre(state, "oreSodalite")) {
OreDrop aluminium = new OreDrop(ModDusts.ALUMINUM.getStack(), aluminiumDropChance, 1);
OreDrop aluminium = new OreDrop(TRIngredients.Dusts.ALUMINUM.getStack(), aluminiumDropChance, 1);
drops.add(aluminium.getDrops(event.getFortuneLevel(), random));
}
else if (OreDictUtils.isOre(state, "oreCinnabar")) {
@ -84,7 +83,7 @@ public class BlockBreakHandler {
drops.add(redstone.getDrops(event.getFortuneLevel(), random));
}
else if (OreDictUtils.isOre(state, "oreSphalerite")) {
OreDrop yellowGarnet = new OreDrop(ModGems.YELLOW_GARNET.getStack(), yellowGarnetDropChance, 1);
OreDrop yellowGarnet = new OreDrop(TRIngredients.Gems.YELLOW_GARNET.getStack(), yellowGarnetDropChance, 1);
drops.add(yellowGarnet.getDrops(event.getFortuneLevel(), random));
}
}

View file

@ -25,7 +25,6 @@
package techreborn.events;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
@ -35,7 +34,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.registries.IForgeRegistryEntry;
import reborncore.common.util.ItemUtils;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
@ -92,7 +91,7 @@ public class TRRecipeHandler {
}
//Hide uu recipes
for (Ingredient ingredient : recipe.getIngredients()) {
if (ingredient.apply(ModParts.UU_MATTER.getStack())) {
if (ingredient.apply(TRIngredients.Parts.UU_MATTER.getStack())) {
return false;
}
}

View file

@ -1,88 +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;
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.ItemDusts;
import techreborn.lib.ModInfo;
/**
* @author drcrazy
*
*/
public enum ModDusts implements IStringSerializable {
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
FLINT, GALENA, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE, NETHERRACK,
NICKEL, OBSIDIAN, OLIVINE, PERIDOT, PHOSPHOROUS, PLATINUM, PYRITE, PYROPE, RED_GARNET, RUBY, SALTPETER, SAPPHIRE,
SAW, SILVER, SODALITE, SPESSARTINE, SPHALERITE, STEEL, SULFUR, TIN, TITANIUM, TUNGSTEN, UVAROVITE,
YELLOW_GARNET, ZINC;
public final String name;
public final Item item;
private ModDusts() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "DUST_" + this.toString());
item = new ItemDusts();
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(ModDusts.values()).forEach(dust -> RebornRegistry.registerItem(dust.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/dusts");
Arrays.stream(ModDusts.values()).forEach(dust -> ModelLoader.setCustomModelResourceLocation(dust.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + dust.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -1,89 +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;
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.ItemDusts;
import techreborn.lib.ModInfo;
/**
* @author drcrazy
*
*/
public enum ModDustsSmall implements IStringSerializable {
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
FLINT, GALENA, GLOWSTONE, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE,
NETHERRACK, NICKEL, OBSIDIAN, OLIVINE, PERIDOT, PHOSPHOROUS, PLATINUM, PYRITE, PYROPE, REDSTONE, RED_GARNET, RUBY,
SALTPETER, SAPPHIRE, SAW, SILVER, SODALITE, SPESSARTINE, SPHALERITE, STEEL, SULFUR, TIN, TITANIUM, TUNGSTEN,
UVAROVITE, YELLOW_GARNET, ZINC;
public final String name;
public final Item item;
private ModDustsSmall() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "DUST_SMALL_" + this.toString());
item = new ItemDusts();
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(ModDustsSmall.values()).forEach(dustSmall -> RebornRegistry.registerItem(dustSmall.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/dustssmall");
Arrays.stream(ModDustsSmall.values())
.forEach(dustSmall -> ModelLoader.setCustomModelResourceLocation(dustSmall.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + dustSmall.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -1,83 +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;
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;
}
}

View file

@ -1,84 +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;
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.ItemIngots;
import techreborn.lib.ModInfo;
/**
* @author drcrazy
*
*/
public enum ModIngots implements IStringSerializable {
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CHROME, COPPER, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM_ALLOY, IRIDIUM,
LEAD, MIXED_METAL, NICKEL, PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
public final String name;
public final Item item;
private ModIngots() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "INGOT_" + this.toString());
item = new ItemIngots();
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(ModIngots.values()).forEach(ingot -> RebornRegistry.registerItem(ingot.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/ingots");
Arrays.stream(ModIngots.values()).forEach(ingot -> ModelLoader.setCustomModelResourceLocation(ingot.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + ingot.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -30,7 +30,6 @@ import net.minecraftforge.common.MinecraftForge;
import reborncore.RebornRegistry;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.util.BucketHandler;
import reborncore.common.util.OreUtil;
import techreborn.Core;
import techreborn.api.Reference;
import techreborn.blocks.BlockMachineFrames;
@ -149,14 +148,7 @@ public class ModItems {
public static void init() {
ModDusts.register();
ModDustsSmall.register();
ModGems.register();
ModIngots.register();
ModNuggets.register();
ModParts.register();
ModPlates.register();
TRIngredients.register();
ROCK_CUTTER = new ItemRockCutter();
registerItem(ROCK_CUTTER, "rockCutter");

View file

@ -1,84 +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;
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.ItemNuggets;
import techreborn.lib.ModInfo;
/**
* @author drcrazy
*
*/
public enum ModNuggets implements IStringSerializable {
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, DIAMOND, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM, LEAD, NICKEL,
PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
public final String name;
public final Item item;
private ModNuggets() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "NUGGET_" + this.toString());
item = new ItemNuggets();
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(ModNuggets.values()).forEach(nugget -> RebornRegistry.registerItem(nugget.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/nuggets");
Arrays.stream(ModNuggets.values()).forEach(nugget -> ModelLoader.setCustomModelResourceLocation(nugget.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + nugget.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -1,90 +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;
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.ItemParts;
import techreborn.lib.ModInfo;
/**
* @author drcrazy
*
*/
public enum ModParts implements IStringSerializable {
CARBON_FIBER, CARBON_MESH, CIRCUIT_ADVANCED, CIRCUIT_BASIC, CIRCUIT_ELITE, COMPUTER_MONITOR, COOLANT_SIMPLE, COOLANT_SIX, COOLANT_TRIPLE,
CUPRONICKEL_HEATING_COIL, DATA_ORB, DATA_STORAGE_CIRCUIT, DEPLETED_CELL,
DIAMOND_GRINDING_HEAD, DIAMOND_SAW_BLADE, DOUBLE_DEPLETED_CELL, DOUBLE_PLUTONIUM_CELL, DOUBLE_THORIUM_CELL,
DOUBLE_URANIUM_CELL, ENERGY_FLOW_CIRCUIT, HELIUM_COOLANT_SIMPLE, HELIUM_COOLANT_SIX,
HELIUM_COOLANT_TRIPLE, IRIDIUM_NEUTRON_REFLECTOR, KANTHAL_HEATING_COIL, MACHINE_PARTS, NAK_COOLANT_SIMPLE,
NAK_COOLANT_SIX, NAK_COOLANT_TRIPLE, NEUTRON_REFLECTOR, NICHROME_HEATING_COIL, PLUTONIUM_CELL, QUAD_DEPLETED_CELL,
QUAD_PLUTONIUM_CELL, QUAD_THORIUM_CELL, QUAD_URANIUM_CELL, RUBBER, SAP, SCRAP, SUPER_CONDUCTOR,
THICK_NEUTRON_REFLECTOR, THORIUM_CELL, TUNGSTEN_GRINDING_HEAD, URANIUM_CELL, UU_MATTER;
public final String name;
public final Item item;
private ModParts() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, this.toString());
item = new ItemParts();
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(ModParts.values()).forEach(part -> RebornRegistry.registerItem(part.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/parts");
Arrays.stream(ModParts.values()).forEach(part -> ModelLoader.setCustomModelResourceLocation(part.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + part.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -1,86 +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;
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.lib.ModInfo;
import techreborn.items.ItemPlates;
/**
* @author drcrazy
*
*/
public enum ModPlates implements IStringSerializable {
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CARBON, COAL, COPPER, DIAMOND, ELECTRUM, EMERALD, GOLD, INVAR,
IRIDIUM_ALLOY, IRIDIUM, IRON, LAPIS, LAZURITE, LEAD, MAGNALIUM, NICKEL, OBSIDIAN, PERIDOT, PLATINUM, RED_GARNET,
REDSTONE, REFINED_IRON, RUBY, SAPPHIRE, SILICON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, WOOD,
YELLOW_GARNET, ZINC;
public final String name;
public final Item item;
private ModPlates() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "PLATE_" + this.toString());
item = new ItemPlates();
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(ModPlates.values()).forEach(plate -> RebornRegistry.registerItem(plate.item));
}
@SideOnly(Side.CLIENT)
public static void registerModel() {
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/plates");
Arrays.stream(ModPlates.values()).forEach(plate -> ModelLoader.setCustomModelResourceLocation(plate.item, 0,
new ModelResourceLocation(blockstateJson, "type=" + plate.name)));
}
@Override
public String getName() {
return name;
}
}

View file

@ -38,17 +38,13 @@ import reborncore.common.util.ItemUtils;
import reborncore.common.util.OreUtil;
import techreborn.Core;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
import techreborn.blocks.BlockOre;
import techreborn.config.ConfigTechReborn;
import techreborn.init.recipes.*;
import techreborn.items.*;
import techreborn.lib.ModInfo;
import java.security.InvalidParameterException;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

View file

@ -24,7 +24,6 @@
package techreborn.init;
import com.google.common.base.CaseFormat;
import com.google.common.collect.ImmutableList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@ -32,7 +31,6 @@ import net.minecraft.item.ItemStack;
import reborncore.common.util.OreUtil;
import techreborn.blocks.BlockMachineFrames;
import techreborn.blocks.cable.BlockCable;
import techreborn.items.*;
public class OreDict {
@ -49,17 +47,17 @@ public class OreDict {
OreUtil.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS);
// Parts
OreUtil.registerOre("circuitBasic", ModParts.CIRCUIT_BASIC.getStack());
OreUtil.registerOre("circuitAdvanced", ModParts.CIRCUIT_ADVANCED.getStack());
OreUtil.registerOre("circuitElite", ModParts.CIRCUIT_ELITE.getStack());
OreUtil.registerOre("circuitStorage", ModParts.DATA_STORAGE_CIRCUIT.getStack());
OreUtil.registerOre("circuitMaster", ModParts.ENERGY_FLOW_CIRCUIT.getStack());
OreUtil.registerOre("craftingDiamondGrinder", ModParts.DIAMOND_GRINDING_HEAD.getStack());
OreUtil.registerOre("craftingTungstenGrinder", ModParts.TUNGSTEN_GRINDING_HEAD.getStack());
OreUtil.registerOre("craftingSuperconductor", ModParts.SUPER_CONDUCTOR.getStack());
OreUtil.registerOre("materialResin", ModParts.SAP.getStack());
OreUtil.registerOre("materialRubber", ModParts.RUBBER.getStack());
OreUtil.registerOre("itemRubber", ModParts.RUBBER.getStack());
OreUtil.registerOre("circuitBasic", TRIngredients.Parts.CIRCUIT_BASIC.getStack());
OreUtil.registerOre("circuitAdvanced", TRIngredients.Parts.CIRCUIT_ADVANCED.getStack());
OreUtil.registerOre("circuitElite", TRIngredients.Parts.CIRCUIT_ELITE.getStack());
OreUtil.registerOre("circuitStorage", TRIngredients.Parts.DATA_STORAGE_CIRCUIT.getStack());
OreUtil.registerOre("circuitMaster", TRIngredients.Parts.ENERGY_FLOW_CIRCUIT.getStack());
OreUtil.registerOre("craftingDiamondGrinder", TRIngredients.Parts.DIAMOND_GRINDING_HEAD.getStack());
OreUtil.registerOre("craftingTungstenGrinder", TRIngredients.Parts.TUNGSTEN_GRINDING_HEAD.getStack());
OreUtil.registerOre("craftingSuperconductor", TRIngredients.Parts.SUPER_CONDUCTOR.getStack());
OreUtil.registerOre("materialResin", TRIngredients.Parts.SAP.getStack());
OreUtil.registerOre("materialRubber", TRIngredients.Parts.RUBBER.getStack());
OreUtil.registerOre("itemRubber", TRIngredients.Parts.RUBBER.getStack());
// Frames
OreUtil.registerOre("machineBlockBasic", BlockMachineFrames.getFrameByName("machine", 1));
@ -78,7 +76,7 @@ public class OreDict {
OreUtil.registerOre("craftingIndustrialDiamond", Items.DIAMOND);
OreUtil.registerOre("insulatedGoldCableItem", BlockCable.getCableByName("insulatedgold"));
OreUtil.registerOre("fertilizer", new ItemStack(Items.DYE, 1, 15));
OreUtil.registerOre("pulpWood", ModDusts.SAW.getStack());
OreUtil.registerOre("pulpWood", TRIngredients.Dusts.SAW.getStack());
//OreUtil.registerOre("uran235", nothing);
//OreUtil.registerOre("uran238", nothing);

View file

@ -49,6 +49,11 @@ public class TRIngredients {
public static void register() {
Arrays.stream(Dusts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(DustsSmall.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Gems.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Ingots.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Nuggets.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Parts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Plates.values()).forEach(value -> RebornRegistry.registerItem(value.item));
}
@SideOnly(Side.CLIENT)
@ -61,6 +66,25 @@ public class TRIngredients {
Arrays.stream(DustsSmall.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(dustsSmallRL, "type=" + value.name)));
ResourceLocation gemsRL = new ResourceLocation(ModInfo.MOD_ID, "items/materials/gems");
Arrays.stream(Gems.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(gemsRL, "type=" + value.name)));
ResourceLocation ingotsRL = new ResourceLocation(ModInfo.MOD_ID, "items/materials/ingots");
Arrays.stream(Ingots.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(ingotsRL, "type=" + value.name)));
ResourceLocation nuggetsRL = new ResourceLocation(ModInfo.MOD_ID, "items/materials/nuggets");
Arrays.stream(Nuggets.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(nuggetsRL, "type=" + value.name)));
ResourceLocation partsRL = new ResourceLocation(ModInfo.MOD_ID, "items/materials/parts");
Arrays.stream(Parts.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(partsRL, "type=" + value.name)));
ResourceLocation platesRL = new ResourceLocation(ModInfo.MOD_ID, "items/materials/plates");
Arrays.stream(Plates.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
new ModelResourceLocation(platesRL, "type=" + value.name)));
}
public static enum Dusts implements IStringSerializable {
@ -96,7 +120,7 @@ public class TRIngredients {
}
}
public enum DustsSmall implements IStringSerializable {
public static enum DustsSmall implements IStringSerializable {
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
FLINT, GALENA, GLOWSTONE, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE,
@ -128,5 +152,156 @@ public class TRIngredients {
return name;
}
}
public static enum Gems implements IStringSerializable {
PERIDOT, RED_GARNET, RUBY, SAPPHIRE, YELLOW_GARNET;
public final String name;
public final Item item;
private Gems() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "GEM_" + this.toString());
item = new ItemTR();
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
TRRecipeHandler.hideEntry(item);
}
public ItemStack getStack() {
return new ItemStack(item);
}
public ItemStack getStack(int amount) {
return new ItemStack(item, amount);
}
@Override
public String getName() {
return name;
}
}
public static enum Ingots implements IStringSerializable {
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CHROME, COPPER, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM_ALLOY, IRIDIUM,
LEAD, MIXED_METAL, NICKEL, PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
public final String name;
public final Item item;
private Ingots() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "INGOT_" + this.toString());
item = new ItemTR();
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
TRRecipeHandler.hideEntry(item);
}
public ItemStack getStack() {
return new ItemStack(item);
}
public ItemStack getStack(int amount) {
return new ItemStack(item, amount);
}
@Override
public String getName() {
return name;
}
}
public static enum Nuggets implements IStringSerializable {
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, DIAMOND, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM, LEAD, NICKEL,
PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
public final String name;
public final Item item;
private Nuggets() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "NUGGET_" + this.toString());
item = new ItemTR();
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
TRRecipeHandler.hideEntry(item);
}
public ItemStack getStack() {
return new ItemStack(item);
}
public ItemStack getStack(int amount) {
return new ItemStack(item, amount);
}
@Override
public String getName() {
return name;
}
}
public static enum Parts implements IStringSerializable {
CARBON_FIBER, CARBON_MESH, CIRCUIT_ADVANCED, CIRCUIT_BASIC, CIRCUIT_ELITE, COMPUTER_MONITOR, COOLANT_SIMPLE, COOLANT_SIX, COOLANT_TRIPLE,
CUPRONICKEL_HEATING_COIL, DATA_ORB, DATA_STORAGE_CIRCUIT, DEPLETED_CELL,
DIAMOND_GRINDING_HEAD, DIAMOND_SAW_BLADE, DOUBLE_DEPLETED_CELL, DOUBLE_PLUTONIUM_CELL, DOUBLE_THORIUM_CELL,
DOUBLE_URANIUM_CELL, ENERGY_FLOW_CIRCUIT, HELIUM_COOLANT_SIMPLE, HELIUM_COOLANT_SIX,
HELIUM_COOLANT_TRIPLE, IRIDIUM_NEUTRON_REFLECTOR, KANTHAL_HEATING_COIL, MACHINE_PARTS, NAK_COOLANT_SIMPLE,
NAK_COOLANT_SIX, NAK_COOLANT_TRIPLE, NEUTRON_REFLECTOR, NICHROME_HEATING_COIL, PLUTONIUM_CELL, QUAD_DEPLETED_CELL,
QUAD_PLUTONIUM_CELL, QUAD_THORIUM_CELL, QUAD_URANIUM_CELL, RUBBER, SAP, SCRAP, SUPER_CONDUCTOR,
THICK_NEUTRON_REFLECTOR, THORIUM_CELL, TUNGSTEN_GRINDING_HEAD, URANIUM_CELL, UU_MATTER;
public final String name;
public final Item item;
private Parts() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, this.toString());
item = new ItemTR();
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
TRRecipeHandler.hideEntry(item);
}
public ItemStack getStack() {
return new ItemStack(item);
}
public ItemStack getStack(int amount) {
return new ItemStack(item, amount);
}
@Override
public String getName() {
return name;
}
}
public static enum Plates implements IStringSerializable {
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CARBON, COAL, COPPER, DIAMOND, ELECTRUM, EMERALD, GOLD, INVAR,
IRIDIUM_ALLOY, IRIDIUM, IRON, LAPIS, LAZURITE, LEAD, MAGNALIUM, NICKEL, OBSIDIAN, PERIDOT, PLATINUM, RED_GARNET,
REDSTONE, REFINED_IRON, RUBY, SAPPHIRE, SILICON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, WOOD,
YELLOW_GARNET, ZINC;
public final String name;
public final Item item;
private Plates() {
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "PLATE_" + this.toString());
item = new ItemTR();
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
TRRecipeHandler.hideEntry(item);
}
public ItemStack getStack() {
return new ItemStack(item);
}
public ItemStack getStack(int amount) {
return new ItemStack(item, amount);
}
@Override
public String getName() {
return name;
}
}
}

View file

@ -31,8 +31,6 @@ import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.OreUtil;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.items.ItemDusts;
import techreborn.items.ItemIngots;
/**
* @author drcrazy

View file

@ -24,15 +24,12 @@
package techreborn.init.recipes;
import com.google.common.base.CaseFormat;
import net.minecraft.init.Blocks;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import reborncore.common.util.OreUtil;
import reborncore.common.util.RebornCraftingHelper;
import reborncore.common.util.StringUtils;
import techreborn.Core;
import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockStorage2;
@ -40,7 +37,7 @@ import techreborn.blocks.cable.EnumCableType;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.items.*;
/**
@ -87,7 +84,7 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond");
registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic");
registerShaped(getStack(ModItems.LAPOTRONIC_ORB), "LLL", "LPL", "LLL", 'L', "lapotronCrystal", 'P', "plateIridiumAlloy");
registerShaped(getStack(ModItems.SCRAP_BOX), "SSS", "SSS", "SSS", 'S', ModParts.SCRAP.getStack());
registerShaped(getStack(ModItems.SCRAP_BOX), "SSS", "SSS", "SSS", 'S', TRIngredients.Parts.SCRAP.getStack());
registerShapeless(getStack(ModItems.FREQUENCY_TRANSMITTER), EnumCableType.ICOPPER.getStack(), "circuitBasic");
if (ConfigTechReborn.enableGemArmorAndTools) {
@ -99,9 +96,9 @@ public class CraftingTableRecipes extends RecipeMethods {
//Upgrades
registerShaped(ItemUpgrades.getUpgradeByName("energy_storage"), "PPP", "WBW", "PCP", 'P', "plankWood", 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic", 'B', "reBattery");
registerShaped(ItemUpgrades.getUpgradeByName("overclock"), "TTT", "WCW", 'T', ModParts.COOLANT_SIMPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', ModParts.HELIUM_COOLANT_TRIPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', ModParts.NAK_COOLANT_SIMPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("overclock"), "TTT", "WCW", 'T', TRIngredients.Parts.COOLANT_SIMPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', TRIngredients.Parts.HELIUM_COOLANT_TRIPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', TRIngredients.Parts.NAK_COOLANT_SIMPLE.getStack(), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
registerShaped(ItemUpgrades.getUpgradeByName("transformer"), "GGG", "WTW", "GCG", 'G', "blockGlass", 'W', EnumCableType.IGOLD.getStack(), 'C', "circuitBasic", 'T', getStack(ModBlocks.MV_TRANSFORMER));
//Machines
@ -121,7 +118,7 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), "RER", "CFC", "RER", 'R', "plateIron", 'E', getStack(ModBlocks.EXTRACTOR), 'C', "circuitAdvanced", 'F', "machineBlockAdvanced");
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "ingotRefinedIron", 'E', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "plateAluminum", 'E', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
registerShaped(getStack(ModBlocks.INDUSTRIAL_SAWMILL), "PAP", "SSS", "ACA", 'P', "ingotRefinedIron", 'A', "circuitAdvanced", 'S', ModParts.DIAMOND_SAW_BLADE.getStack(), 'C', "machineBlockAdvanced");
registerShaped(getStack(ModBlocks.INDUSTRIAL_SAWMILL), "PAP", "SSS", "ACA", 'P', "ingotRefinedIron", 'A', "circuitAdvanced", 'S', TRIngredients.Parts.DIAMOND_SAW_BLADE.getStack(), 'C', "machineBlockAdvanced");
registerShaped(getStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), "CHC", "HBH", "FHF", 'H', getMaterial("cupronickelHeatingCoil", Type.PART), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'F', getStack(ModBlocks.ELECTRIC_FURNACE));
registerShaped(getStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'H', "craftingDiamondGrinder", 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'G', getStack(ModBlocks.GRINDER));
// registerShaped(getStack(ModBlocks.IMPLOSION_COMPRESSOR), "ABA", "CPC", "ABA", 'A', getMaterialObject("advancedAlloy", Type.INGOT), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'P', getStack(ModBlocks.COMPRESSOR));
@ -139,10 +136,10 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getStack(ModBlocks.SCRAPBOXINATOR), "ICI", "DSD", "ICI", 'S', getStack(ModItems.SCRAP_BOX), 'C', "circuitBasic", 'I', "plateIron", 'D', "dirt");
registerShaped(getStack(ModBlocks.FUSION_CONTROL_COMPUTER), "CCC", "PTP", "CCC", 'P', "energyCrystal", 'T', getStack(ModBlocks.FUSION_COIL), 'C', "circuitMaster");
registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', getMaterial("iridiumNeutronReflector", Type.PART));
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateAluminum", 'D', ModParts.DATA_ORB.getStack(), 'C', ModParts.COMPUTER_MONITOR.getStack());
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateSteel", 'D', ModParts.DATA_ORB.getStack(), 'C', ModParts.COMPUTER_MONITOR.getStack());
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateAluminum", 'D', TRIngredients.Parts.DATA_ORB.getStack(), 'C', TRIngredients.Parts.COMPUTER_MONITOR.getStack());
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateSteel", 'D', TRIngredients.Parts.DATA_ORB.getStack(), 'C', TRIngredients.Parts.COMPUTER_MONITOR.getStack());
registerShaped(getStack(ModBlocks.MATTER_FABRICATOR), "ETE", "AOA", "ETE", 'E', "circuitMaster", 'T', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockElite", 'O', getStack(ModItems.LAPOTRONIC_ORB));
registerShaped(getStack(ModBlocks.COMPUTER_CUBE), "OMC", "MFM", "CMO", 'O', ModParts.DATA_ORB.getStack(), 'M', ModParts.COMPUTER_MONITOR.getStack(), 'C', "circuitMaster", 'F', "machineBlockAdvanced");
registerShaped(getStack(ModBlocks.COMPUTER_CUBE), "OMC", "MFM", "CMO", 'O', TRIngredients.Parts.DATA_ORB.getStack(), 'M', TRIngredients.Parts.COMPUTER_MONITOR.getStack(), 'C', "circuitMaster", 'F', "machineBlockAdvanced");
registerShaped(getStack(ModBlocks.PLAYER_DETECTOR, true), " D ", "CFC", " D ", 'D', "circuitStorage", 'C', "circuitAdvanced", 'F', getStack(ModBlocks.COMPUTER_CUBE));
registerShaped(getStack(ModBlocks.DRAGON_EGG_SYPHON), "CTC", "PSP", "CBC", 'C', "circuitMaster", 'T', getStack(ModBlocks.MEDIUM_VOLTAGE_SU), 'P', "plateIridiumAlloy", 'S', "craftingSuperconductor", 'B', getStack(ModItems.LAPOTRONIC_ORB));
registerShaped(getStack(ModBlocks.PLASMA_GENERATOR), "PPP", "PTP", "CGC", 'P', "plateTungstensteel", 'T', getStack(ModBlocks.HV_TRANSFORMER), 'C', "circuitMaster", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
@ -170,9 +167,9 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getStack(ModBlocks.IRON_FURNACE), " I ", "I I", "IFI", 'I', "ingotIron", 'F', getStack(Blocks.FURNACE));
registerShaped(getStack(ModBlocks.EXTRACTOR), "TMT", "TCT", " ", 'T', getStack(ModItems.TREE_TAP, true), 'M', "machineBlockBasic", 'C', "circuitBasic");
registerShaped(getStack(ModBlocks.GRINDER), "FFF", "SMS", " C ", 'F', Items.FLINT, 'S', getStack(Blocks.COBBLESTONE), 'M', "machineBlockBasic", 'C', "circuitBasic");
registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', ModParts.DATA_ORB.getStack(), 'C', ModParts.COMPUTER_MONITOR.getStack(), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(ModBlocks.COMPRESSOR));
registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', TRIngredients.Parts.DATA_ORB.getStack(), 'C', TRIngredients.Parts.COMPUTER_MONITOR.getStack(), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(ModBlocks.COMPRESSOR));
registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST));
registerShaped(getStack(ModBlocks.LAMP_INCANDESCENT), "GGG", "TCT", "GGG", 'G', "paneGlass", 'T', getMaterial("copper", Type.CABLE), 'C', ModParts.CARBON_FIBER.getStack());
registerShaped(getStack(ModBlocks.LAMP_INCANDESCENT), "GGG", "TCT", "GGG", 'G', "paneGlass", 'T', getMaterial("copper", Type.CABLE), 'C', TRIngredients.Parts.CARBON_FIBER.getStack());
registerShaped(getStack(ModBlocks.LAMP_LED), "GGG", "TLT", "GGG", 'G', "paneGlass", 'T', getMaterial("tin", Type.CABLE), 'L', "dustGlowstone");
@ -243,7 +240,7 @@ public class CraftingTableRecipes extends RecipeMethods {
//UU-Matter
ItemStack uuStack = ModParts.UU_MATTER.getStack();
ItemStack uuStack = TRIngredients.Parts.UU_MATTER.getStack();
registerShaped(getStack(Blocks.LOG, 8), " U ", " ", " ", 'U', uuStack);
registerShaped(getStack(Blocks.STONE, 16), " ", " U ", " ", 'U', uuStack);
registerShaped(getStack(Blocks.SNOW, 16), "U U", " ", " ", 'U', uuStack);

View file

@ -32,7 +32,6 @@ import net.minecraftforge.fluids.FluidRegistry;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.init.ModBlocks;
import techreborn.items.DynamicCell;
/**

View file

@ -27,27 +27,22 @@ package techreborn.init.recipes;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.blocks.BlockOre;
import techreborn.init.TRIngredients;
import techreborn.items.ItemCells;
import techreborn.items.ItemDusts;
/**
* @author drcrazy
*
*/
public class FusionReactorRecipes extends RecipeMethods {
public static void init(){
FusionReactorRecipeHelper.registerRecipe(
new FusionReactorRecipe(ItemCells.getCellByName("helium3"), ItemCells.getCellByName("deuterium"),
ItemCells.getCellByName("heliumplasma"), 40000000, 32768, 1024));
FusionReactorRecipeHelper.registerRecipe(
new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"),
ItemCells.getCellByName("helium3"), 60000000, 16384, 2048));
// TODO: Fix Recipe
// FusionReactorRecipeHelper.registerRecipe(
// new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("Berylium"),
// ItemDusts.getDustByName("platinum"), 80000000, -2048, 1024));
FusionReactorRecipeHelper.registerRecipe(
new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("lithium"),
BlockOre.getOreByName("iridium"), 90000000, -2048, 1024));
public static void init() {
FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("helium3"),
ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("heliumplasma"), 40000000, 32768, 1024));
FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"),
ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium3"), 60000000, 16384, 2048));
FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"),
ItemCells.getCellByName("Berylium"), TRIngredients.Dusts.PLATINUM.getStack(), 80000000, -2048, 1024));
FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"),
ItemCells.getCellByName("lithium"), BlockOre.getOreByName("iridium"), 90000000, -2048, 1024));
}
}

View file

@ -25,7 +25,6 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;

View file

@ -30,7 +30,6 @@ import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.CentrifugeRecipe;
import techreborn.init.ModBlocks;
import techreborn.items.DynamicCell;
import java.security.InvalidParameterException;

View file

@ -24,7 +24,6 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
@ -32,7 +31,6 @@ import net.minecraftforge.fluids.FluidStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
import techreborn.blocks.BlockOre;
import techreborn.init.ModFluids;
import java.security.InvalidParameterException;

View file

@ -40,7 +40,7 @@ import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.ItemUtils;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.init.ModDusts;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
import javax.annotation.Nonnull;
@ -116,7 +116,7 @@ public class IndustrialSawmillRecipes extends RecipeMethods {
public static void addRecipe(ItemStack log, ItemStack plank) {
plank.setCount(plankCount);
register(log, WATER, 100, 128, plank, ModDusts.SAW.getStack(3), getStack(Items.PAPER, 1));
register(log, WATER, 100, 128, plank, TRIngredients.Dusts.SAW.getStack(3), getStack(Items.PAPER, 1));
}
static void register(ItemStack input1, FluidStack fluid, int ticks, int euPerTick, ItemStack... outputs) {

View file

@ -34,7 +34,6 @@ import techreborn.api.Reference;
import techreborn.api.recipe.machines.ScrapboxRecipe;
import techreborn.init.ModBlocks;
import techreborn.items.DynamicCell;
import techreborn.items.ItemDusts;
import techreborn.utils.StackWIPHandler;
/**

View file

@ -29,7 +29,7 @@ import net.minecraft.item.ItemStack;
import reborncore.common.util.RebornCraftingHelper;
import techreborn.blocks.BlockOre;
import techreborn.blocks.BlockOre2;
import techreborn.items.ItemIngots;
import techreborn.init.TRIngredients;
/**
* Created by Prospector
@ -37,15 +37,16 @@ import techreborn.items.ItemIngots;
public class SmeltingRecipes extends RecipeMethods {
public static void init() {
// register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART));
register(getStack(Items.IRON_INGOT), TRIngredients.Ingots.REFINED_IRON.getStack());
register(TRIngredients.Parts.SAP.getStack(), TRIngredients.Parts.RUBBER.getStack());
register(TRIngredients.Ingots.MIXED_METAL.getStack(), TRIngredients.Ingots.ADVANCED_ALLOY.getStack());
register(BlockOre.getOreByName("silver"), TRIngredients.Ingots.SILVER.getStack());
register(BlockOre2.getOreByName("tin"), TRIngredients.Ingots.TIN.getStack());
// TODO: Fix recipe
// register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT));
// register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT));
// register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT));
// register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT));
// register(BlockOre.getOreByName("lead"), getMaterial("lead", Type.INGOT));
// register(BlockOre.getOreByName("sheldonite"), getMaterial("platinum", Type.INGOT));
// register(ItemIngots.getIngotByName("mixed_metal"), getMaterial("advanced_alloy", Type.INGOT));
// Dust smelting
// register(getMaterial("iron", Type.DUST), getStack(Items.IRON_INGOT));

View file

@ -1,68 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemDusts extends ItemTR {
public ItemDusts() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getDustByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.DUSTS, count, i);
// }
// }
//
// if (name.equalsIgnoreCase("glowstone")) {
// return new ItemStack(Items.GLOWSTONE_DUST, count);
// }
// if (name.equalsIgnoreCase("redstone")) {
// return new ItemStack(Items.REDSTONE, count);
// }
// if (name.equalsIgnoreCase("gunpowder")) {
// return new ItemStack(Items.GUNPOWDER, count);
// }
// throw new InvalidParameterException("The dust " + name + " could not be found.");
// }
//
// public static ItemStack getDustByName(String name) {
// return getDustByName(name, 1);
// }
//
// public static boolean hasDust(String name){
// for(String type : types){
// if(type.equals(name)){
// return true;
// }
// }
// return false;
// }
}

View file

@ -1,49 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemDustsSmall extends ItemTR {
public ItemDustsSmall() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getSmallDustByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.SMALL_DUSTS, count, i);
// }
// }
// throw new InvalidParameterException("The small dust " + name + " could not be found.");
// }
//
// public static ItemStack getSmallDustByName(String name) {
// return getSmallDustByName(name, 1);
// }
}

View file

@ -1,49 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemGems extends ItemTR {
public ItemGems() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getGemByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.GEMS, count, i);
// }
// }
// throw new InvalidParameterException("The gem " + name + " could not be found.");
// }
//
// public static ItemStack getGemByName(String name) {
// return getGemByName(name, 1);
// }
}

View file

@ -1,55 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemIngots extends ItemTR {
public ItemIngots() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getIngotByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.INGOTS, count, i);
// }
// }
// if (name.equalsIgnoreCase("iron")) {
// return new ItemStack(Items.IRON_INGOT);
// }
// if (name.equalsIgnoreCase("gold")) {
// return new ItemStack(Items.GOLD_INGOT);
// }
// throw new InvalidParameterException("The ingot " + name + " could not be found.");
// }
//
// public static ItemStack getIngotByName(String name) {
// return getIngotByName(name, 1);
// }
}

View file

@ -1,49 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemNuggets extends ItemTR {
public ItemNuggets() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getNuggetByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.NUGGETS, count, i);
// }
// }
// throw new InvalidParameterException("The nugget " + name + " could not be found.");
// }
//
// public static ItemStack getNuggetByName(String name) {
// return getNuggetByName(name, 1);
// }
}

View file

@ -1,62 +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.items;
import techreborn.events.TRRecipeHandler;
public class ItemPlates extends ItemTR {
public ItemPlates() {
TRRecipeHandler.hideEntry(this);
}
// public static ItemStack getPlateByName(String name, int count) {
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
// for (int i = 0; i < types.length; i++) {
// if (types[i].equalsIgnoreCase(name)) {
// return new ItemStack(ModItems.PLATES, count, i);
// }
// }
// throw new InvalidParameterException("The plate " + name + " could not be found.");
// }
//
// public static ItemStack getPlateByName(String name) {
// return getPlateByName(name, 1);
// }
//
// public static void registerType(String plateType) {
// for (String type : types) {
// if (type.equals(plateType))
// return;
// }
// int plateIndex = types.length;
// String[] newTypes = new String[plateIndex + 1];
// System.arraycopy(types, 0, newTypes, 0, types.length);
// types = newTypes;
// newTypes[plateIndex] = plateType;
// String oreName = "plate" + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, plateType);
// OreUtil.registerOre(oreName, new ItemStack(ModItems.PLATES, 1, plateIndex));
// }
}

View file

@ -30,9 +30,6 @@ import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket;
import techreborn.tiles.tier1.TileAutoCraftingTable;
import techreborn.tiles.tier1.TileRollingMachine;
import java.io.IOException;
public class PacketAutoCraftingTableLock implements INetworkPacket {

View file

@ -39,7 +39,7 @@ import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
@ -73,7 +73,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
private boolean spaceForOutput(int slot) {
return inventory.getStackInSlot(slot).isEmpty()
|| ItemUtils.isItemEqual(inventory.getStackInSlot(slot), ModParts.UU_MATTER.getStack(), true, true)
|| ItemUtils.isItemEqual(inventory.getStackInSlot(slot), TRIngredients.Parts.UU_MATTER.getStack(), true, true)
&& inventory.getStackInSlot(slot).getCount() < 64;
}
@ -88,9 +88,9 @@ public class TileMatterFabricator extends TilePowerAcceptor
private void addOutputProducts(int slot) {
if (inventory.getStackInSlot(slot).isEmpty()) {
inventory.setInventorySlotContents(slot, ModParts.UU_MATTER.getStack());
inventory.setInventorySlotContents(slot, TRIngredients.Parts.UU_MATTER.getStack());
}
else if (ItemUtils.isItemEqual(this.inventory.getStackInSlot(slot), ModParts.UU_MATTER.getStack(), true, true)) {
else if (ItemUtils.isItemEqual(this.inventory.getStackInSlot(slot), TRIngredients.Parts.UU_MATTER.getStack(), true, true)) {
inventory.getStackInSlot(slot).setCount((Math.min(64, 1 + inventory.getStackInSlot(slot).getCount())));
}
}
@ -110,7 +110,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
}
public int getValue(ItemStack itemStack) {
if (itemStack.isItemEqual(ModParts.SCRAP.getStack())) {
if (itemStack.isItemEqual(TRIngredients.Parts.SCRAP.getStack())) {
return 200;
} else if (itemStack.getItem() == ModItems.SCRAP_BOX) {
return 2000;

View file

@ -42,8 +42,7 @@ import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileGenericMachine;
@ -145,7 +144,7 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
@Override
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
if (slotIndex == 0) {
if (itemStack.isItemEqual(ModParts.UU_MATTER.getStack())) {
if (itemStack.isItemEqual(TRIngredients.Parts.UU_MATTER.getStack())) {
return true;
} else {
return false;
@ -158,7 +157,7 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
@Override
public BuiltContainer createContainer(EntityPlayer player) {
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqual(ModParts.UU_MATTER.getStack()))
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqual(TRIngredients.Parts.UU_MATTER.getStack()))
.outputSlot(2, 124, 55).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
.create(this);
}

View file

@ -39,7 +39,7 @@ import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
@ -75,7 +75,7 @@ public class TileRecycler extends TilePowerAcceptor
}
public void recycleItems() {
final ItemStack itemstack = ModParts.SCRAP.getStack();
final ItemStack itemstack = TRIngredients.Parts.SCRAP.getStack();
final int randomchance = this.world.rand.nextInt(chance);
if (randomchance == 1) {

View file

@ -26,7 +26,7 @@ package techreborn.utils;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import techreborn.init.ModParts;
import techreborn.init.TRIngredients;
public class TechRebornCreativeTab extends CreativeTabs {
@ -38,6 +38,6 @@ public class TechRebornCreativeTab extends CreativeTabs {
@Override
public ItemStack createIcon() {
return ModParts.MACHINE_PARTS.getStack();
return TRIngredients.Parts.MACHINE_PARTS.getStack();
}
}