1147 - Initial auto mappings pass

This commit is contained in:
modmuss50 2019-05-26 12:37:59 +01:00
parent 48198dbcb3
commit 4e03ac893c
291 changed files with 3335 additions and 3504 deletions

View file

@ -24,8 +24,8 @@
package techreborn.init;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraft.util.Identifier;
import techreborn.blocks.fluid.BlockFluidTechReborn;
public enum ModFluids {
BERYLLIUM,
@ -69,7 +69,7 @@ public enum ModFluids {
ModFluids() {
this.name = this.name().replace("_", "").toLowerCase(); //Is this ok?
fluid = new Fluid(name, new ResourceLocation("techreborn", "fixme"), new ResourceLocation("techrebonr", "alsofixme"));
fluid = new Fluid(name, new Identifier("techreborn", "fixme"), new Identifier("techrebonr", "alsofixme"));
}
public Fluid getFluid() {

View file

@ -24,11 +24,15 @@
package techreborn.init;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Identifier;
import net.minecraft.world.loot.LootPool;
import net.minecraft.world.loot.LootTables;
import net.minecraft.world.loot.UniformLootTableRange;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootTableEntry;
import net.minecraft.world.storage.loot.*;
import net.minecraft.world.storage.loot.conditions.LootCondition;
import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import techreborn.TechReborn;
import techreborn.config.ConfigTechReborn;
@ -37,30 +41,30 @@ import java.util.List;
public class ModLoot {
public static List<ResourceLocation> lootTables = new ArrayList<ResourceLocation>();
public static List<Identifier> lootTables = new ArrayList<Identifier>();
public static void init() {
if (ConfigTechReborn.enableOverworldLoot) {
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/abandoned_mineshaft"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/desert_pyramid"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/igloo_chest"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/jungle_temple"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/simple_dungeon"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/stronghold_corridor"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/stronghold_crossing"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/stronghold_library"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/village_blacksmith"));
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/woodland_mansion"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/abandoned_mineshaft"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/desert_pyramid"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/igloo_chest"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/jungle_temple"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/simple_dungeon"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/stronghold_corridor"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/stronghold_crossing"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/stronghold_library"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/village_blacksmith"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/woodland_mansion"));
}
if (ConfigTechReborn.enableNetherLoot) {
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/nether_bridge"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/nether_bridge"));
}
if (ConfigTechReborn.enableEndLoot) {
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/end_city_treasure"));
lootTables.add(new Identifier(TechReborn.MOD_ID, "chests/end_city_treasure"));
}
for (ResourceLocation lootTable : lootTables) {
LootTableList.register(lootTable);
for (Identifier lootTable : lootTables) {
LootTables.registerLootTable(lootTable);
}
}
@ -69,7 +73,7 @@ public class ModLoot {
if (!event.getName().getNamespace().equals("minecraft")) {
return;
}
for (ResourceLocation lootTable : lootTables) {
for (Identifier lootTable : lootTables) {
if (event.getName().getNamespace().equals(lootTable.getPath())) {
event.getTable().addPool(getLootPool(lootTable));
TechReborn.LOGGER.debug("Loot pool injected into " + lootTable.getPath());
@ -83,9 +87,9 @@ public class ModLoot {
* @param lootTable ResourceLocation Loot table to inject
* @return LootPool Loot pool to inject
*/
private LootPool getLootPool(ResourceLocation lootTable) {
LootEntry entry = new LootEntryTable(lootTable, 1, 0, new LootCondition[0], "lootEntry_" + lootTable.toString());
LootPool pool = new LootPool(new LootEntry[] { entry }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "lootPool_" + lootTable.toString());
private LootPool getLootPool(Identifier lootTable) {
LootEntry entry = new LootTableEntry(lootTable, 1, 0, new LootCondition[0], "lootEntry_" + lootTable.toString());
LootPool pool = new LootPool(new LootEntry[] { entry }, new LootCondition[0], new UniformLootTableRange(1), new UniformLootTableRange(0, 1), "lootPool_" + lootTable.toString());
return pool;
}
}

View file

@ -25,10 +25,10 @@
package techreborn.init;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeManager;
import reborncore.common.crafting.RecipeType;
@ -42,23 +42,23 @@ import techreborn.api.recipe.recipes.IndustrialSawmillRecipe;
public class ModRecipes {
public static final RecipeType<Recipe> ALLOY_SMELTER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:alloy_smelter"));
public static final RecipeType<Recipe> ASSEMBLING_MACHINE = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:assembling_machine"));
public static final RecipeType<BlastFurnaceRecipe> BLAST_FURNACE = RecipeManager.newRecipeType(BlastFurnaceRecipe.class, new ResourceLocation("techreborn:blast_furnace"));
public static final RecipeType<Recipe> CENTRIFUGE = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:centrifuge"));
public static final RecipeType<Recipe> CHEMICAL_REACTOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:chemical_reactor"));
public static final RecipeType<Recipe> COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:compressor"));
public static final RecipeType<Recipe> DISTILLATION_TOWER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:distillation_tower"));
public static final RecipeType<Recipe> EXTRACTOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:extractor"));
public static final RecipeType<Recipe> GRINDER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:grinder"));
public static final RecipeType<Recipe> IMPLOSION_COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:implosion_compressor"));
public static final RecipeType<Recipe> INDUSTRIAL_ELECTROLYZER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:industrial_electrolyzer"));
public static final RecipeType<IndustrialGrinderRecipe> INDUSTRIAL_GRINDER = RecipeManager.newRecipeType(IndustrialGrinderRecipe.class, new ResourceLocation("techreborn:industrial_grinder"));
public static final RecipeType<IndustrialSawmillRecipe> INDUSTRIAL_SAWMILL = RecipeManager.newRecipeType(IndustrialSawmillRecipe.class, new ResourceLocation("techreborn:industrial_sawmill"));
public static final RecipeType<Recipe> RECYCLER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:recycler"));
public static final RecipeType<Recipe> SCRAPBOX = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:scrapbox"));
public static final RecipeType<Recipe> VACUUM_FREEZER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:vacuum_freezer"));
public static final RecipeType<Recipe> FLUID_REPLICATOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:fluid_replicator"));
public static final RecipeType<Recipe> ALLOY_SMELTER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:alloy_smelter"));
public static final RecipeType<Recipe> ASSEMBLING_MACHINE = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:assembling_machine"));
public static final RecipeType<BlastFurnaceRecipe> BLAST_FURNACE = RecipeManager.newRecipeType(BlastFurnaceRecipe.class, new Identifier("techreborn:blast_furnace"));
public static final RecipeType<Recipe> CENTRIFUGE = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:centrifuge"));
public static final RecipeType<Recipe> CHEMICAL_REACTOR = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:chemical_reactor"));
public static final RecipeType<Recipe> COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:compressor"));
public static final RecipeType<Recipe> EnvTypeILLATION_TOWER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:EnvTypeillation_tower"));
public static final RecipeType<Recipe> EXTRACTOR = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:extractor"));
public static final RecipeType<Recipe> GRINDER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:grinder"));
public static final RecipeType<Recipe> IMPLOSION_COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:implosion_compressor"));
public static final RecipeType<Recipe> INDUSTRIAL_ELECTROLYZER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:industrial_electrolyzer"));
public static final RecipeType<IndustrialGrinderRecipe> INDUSTRIAL_GRINDER = RecipeManager.newRecipeType(IndustrialGrinderRecipe.class, new Identifier("techreborn:industrial_grinder"));
public static final RecipeType<IndustrialSawmillRecipe> INDUSTRIAL_SAWMILL = RecipeManager.newRecipeType(IndustrialSawmillRecipe.class, new Identifier("techreborn:industrial_sawmill"));
public static final RecipeType<Recipe> RECYCLER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:recycler"));
public static final RecipeType<Recipe> SCRAPBOX = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:scrapbox"));
public static final RecipeType<Recipe> VACUUM_FREEZER = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:vacuum_freezer"));
public static final RecipeType<Recipe> FLUID_REPLICATOR = RecipeManager.newRecipeType(Recipe.class, new Identifier("techreborn:fluid_replicator"));
@ -80,7 +80,7 @@ public class ModRecipes {
ScrapboxRecipes.init();
ChemicalReactorRecipes.init();
FusionReactorRecipes.init();
DistillationTowerRecipes.init();
EnvTypeillationTowerRecipes.init();
AlloySmelterRecipes.init();
FluidReplicatorRecipes.init();

View file

@ -24,11 +24,11 @@
package techreborn.init;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.registries.GameData;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import reborncore.common.recipes.ICrafterSoundHanlder;
import reborncore.common.recipes.RecipeCrafter;
@ -62,7 +62,7 @@ public class ModSounds {
}
private static SoundEvent getSound(String str) {
ResourceLocation resourceLocation = new ResourceLocation("techreborn", str);
Identifier resourceLocation = new Identifier("techreborn", str);
SoundEvent soundEvent = new SoundEvent(resourceLocation);
soundEvent.setRegistryName(resourceLocation);
return GameData.register_impl(soundEvent);
@ -71,7 +71,7 @@ public class ModSounds {
public static class SoundHandler implements ICrafterSoundHanlder {
@Override
public void playSound(boolean firstRun, TileEntity tileEntity) {
public void playSound(boolean firstRun, BlockEntity tileEntity) {
tileEntity.getWorld().playSound(null, tileEntity.getPos().getX(), tileEntity.getPos().getY(),
tileEntity.getPos().getZ(), ModSounds.MACHINE_RUN,
SoundCategory.BLOCKS, 0.1F, 1F);

View file

@ -25,16 +25,16 @@
package techreborn.init;
import net.minecraft.block.Block;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.Tag;
import net.minecraft.util.ResourceLocation;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier;
public class ModTags {
public static Tag<Block> FENCE_IRON = get("fence_iron");
private static <T> Tag<T> get(String name) {
return (Tag<T>) new BlockTags.Wrapper(new ResourceLocation("techreborn", name));
return (Tag<T>) new BlockTags.CachingTag(new Identifier("techreborn", name));
}
}

View file

@ -25,29 +25,28 @@
package techreborn.init;
import java.util.function.Supplier;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.IArmorMaterial;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.LazyLoadBase;
import net.minecraft.util.SoundEvent;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;
import techreborn.TechReborn;
public enum TRArmorMaterial implements IArmorMaterial {
public enum TRArmorMaterial implements ArmorMaterial {
BRONZE(17, new int[] { 3, 6, 5, 2 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F, () -> {
return Ingredient.fromItems(TRContent.Ingots.BRONZE.asItem());
return Ingredient.ofItems(TRContent.Ingots.BRONZE.asItem());
}),
RUBY(16, new int[] { 2, 7, 5, 2 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0F, () -> {
return Ingredient.fromItems(TRContent.Gems.RUBY.asItem());
return Ingredient.ofItems(TRContent.Gems.RUBY.asItem());
}),
SAPPHIRE(19, new int[] { 4, 4, 4, 4 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0F, () -> {
return Ingredient.fromItems(TRContent.Gems.SAPPHIRE.asItem());
return Ingredient.ofItems(TRContent.Gems.SAPPHIRE.asItem());
}),
PERIDOT(17, new int[] { 3, 8, 3, 2 }, 16, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0F, () -> {
return Ingredient.fromItems(TRContent.Gems.PERIDOT.asItem());
return Ingredient.ofItems(TRContent.Gems.PERIDOT.asItem());
}),
CLOAKING(5, new int[] { 1, 2, 3, 1 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0F, null);
@ -57,7 +56,7 @@ public enum TRArmorMaterial implements IArmorMaterial {
private final int enchantability;
private final SoundEvent soundEvent;
private final float toughness;
private final LazyLoadBase<Ingredient> repairMaterial;
private final Lazy<Ingredient> repairMaterial;
private TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterialIn) {
@ -66,17 +65,17 @@ public enum TRArmorMaterial implements IArmorMaterial {
this.enchantability = enchantability;
this.soundEvent = soundEvent;
this.toughness = toughness;
this.repairMaterial = new LazyLoadBase<>(repairMaterialIn);
this.repairMaterial = new Lazy<>(repairMaterialIn);
}
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * maxDamageFactor;
public int getDurability(EquipmentSlot slotIn) {
return MAX_DAMAGE_ARRAY[slotIn.getEntitySlotId()] * maxDamageFactor;
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReductionAmountArray[slotIn.getIndex()];
public int getProtectionAmount(EquipmentSlot slotIn) {
return damageReductionAmountArray[slotIn.getEntitySlotId()];
}
@Override
@ -85,14 +84,14 @@ public enum TRArmorMaterial implements IArmorMaterial {
}
@Override
public SoundEvent getSoundEvent() {
public SoundEvent getEquipSound() {
return soundEvent;
}
@Override
public Ingredient getRepairMaterial() {
public Ingredient getRepairIngredient() {
if (repairMaterial != null) {
return repairMaterial.getValue();
return repairMaterial.get();
}
return null;
}

View file

@ -27,8 +27,8 @@ package techreborn.init;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IItemProvider;
import reborncore.api.power.EnumPowerTier;
import reborncore.api.tile.IUpgrade;
import reborncore.common.powerSystem.TilePowerAcceptor;
@ -217,7 +217,7 @@ public class TRContent {
}
}
public static enum Cables implements IItemProvider {
public static enum Cables implements ItemConvertible {
COPPER(128, 12.0, true, EnumPowerTier.MEDIUM),
TIN(32, 12.0, true, EnumPowerTier.LOW),
GOLD(512, 12.0, true, EnumPowerTier.HIGH),
@ -262,7 +262,7 @@ public class TRContent {
}
}
public static enum Ores implements IItemProvider {
public static enum Ores implements ItemConvertible {
BAUXITE, CINNABAR, COPPER, GALENA, IRIDIUM, LEAD, PERIDOT, PYRITE, RUBY, SAPPHIRE, SHELDONITE, SILVER, SODALITE,
SPHALERITE, TIN, TUNGSTEN;
@ -281,7 +281,7 @@ public class TRContent {
}
}
public static enum StorageBlocks implements IItemProvider {
public static enum StorageBlocks implements ItemConvertible {
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, ELECTRUM, INVAR, IRIDIUM, IRIDIUM_REINFORCED_STONE,
IRIDIUM_REINFORCED_TUNGSTENSTEEL, LEAD, NICKEL, OSMIUM, PERIDOT, PLATINUM, RED_GARNET, REFINED_IRON, RUBY,
SAPPHIRE, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, YELLOW_GARNET, ZINC;
@ -328,13 +328,13 @@ public class TRContent {
}
public static enum Machine implements IItemProvider {
public static enum Machine implements ItemConvertible {
ALLOY_SMELTER(new BlockAlloySmelter()),
ASSEMBLY_MACHINE(new BlockAssemblingMachine()),
AUTO_CRAFTING_TABLE(new BlockAutoCraftingTable()),
CHEMICAL_REACTOR(new BlockChemicalReactor()),
COMPRESSOR(new BlockCompressor()),
DISTILLATION_TOWER(new BlockDistillationTower()),
EnvTypeILLATION_TOWER(new BlockEnvTypeillationTower()),
EXTRACTOR(new BlockExtractor()),
FLUID_REPLICATOR(new BlockFluidReplicator()),
GRINDER(new BlockGrinder()),
@ -411,7 +411,7 @@ public class TRContent {
}
}
public static enum Dusts implements IItemProvider {
public static enum Dusts implements ItemConvertible {
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,
@ -424,7 +424,7 @@ public class TRContent {
private Dusts() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_dust");
}
@ -442,7 +442,7 @@ public class TRContent {
}
}
public static enum SmallDusts implements IItemProvider {
public static enum SmallDusts implements ItemConvertible {
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,
@ -455,7 +455,7 @@ public class TRContent {
private SmallDusts() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_small_dust");
}
@ -473,7 +473,7 @@ public class TRContent {
}
}
public static enum Gems implements IItemProvider {
public static enum Gems implements ItemConvertible {
PERIDOT, RED_GARNET, RUBY, SAPPHIRE, YELLOW_GARNET;
public final String name;
@ -481,7 +481,7 @@ public class TRContent {
private Gems() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_gem");
}
@ -499,7 +499,7 @@ public class TRContent {
}
}
public static enum Ingots implements IItemProvider {
public static enum Ingots implements ItemConvertible {
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;
@ -508,7 +508,7 @@ public class TRContent {
private Ingots() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_ingot");
}
@ -526,7 +526,7 @@ public class TRContent {
}
}
public static enum Nuggets implements IItemProvider {
public static enum Nuggets implements ItemConvertible {
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, DIAMOND, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM, LEAD, NICKEL,
PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
@ -535,7 +535,7 @@ public class TRContent {
private Nuggets() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_nugget");
}
@ -553,7 +553,7 @@ public class TRContent {
}
}
public static enum Parts implements IItemProvider {
public static enum Parts implements ItemConvertible {
CARBON_FIBER,
CARBON_MESH,
@ -602,7 +602,7 @@ public class TRContent {
private Parts() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name);
}
@ -620,7 +620,7 @@ public class TRContent {
}
}
public static enum Plates implements IItemProvider {
public static enum Plates implements ItemConvertible {
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,
@ -631,7 +631,7 @@ public class TRContent {
private Plates() {
name = this.toString().toLowerCase();
item = new Item(new Item.Properties().group(TechReborn.ITEMGROUP));
item = new Item(new Item.Settings().itemGroup(TechReborn.ITEMGROUP));
InitUtils.setup(item, name + "_plate");
}
@ -658,7 +658,7 @@ public class TRContent {
@ConfigRegistry(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage behavior extra power")
public static double energyStoragePower = 40_000;
public static enum Upgrades implements IItemProvider {
public static enum Upgrades implements ItemConvertible {
OVERCLOCKER((tile, handler, stack) -> {
TilePowerAcceptor powerAcceptor = null;
if (tile instanceof TilePowerAcceptor) {

View file

@ -24,9 +24,6 @@
package techreborn.init;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
import reborncore.common.tile.TileMachineBase;
import techreborn.TechReborn;
import techreborn.tiles.*;
@ -63,74 +60,77 @@ import techreborn.tiles.transformers.TileMVTransformer;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.Identifier;
public class TRTileEntities {
public static List<TileEntityType<?>> TYPES = new ArrayList<>();
public static List<BlockEntityType<?>> TYPES = new ArrayList<>();
public static final TileEntityType<TileThermalGenerator> THERMAL_GEN = register(TileThermalGenerator.class, "thermal_generator");
public static final TileEntityType<TileQuantumTank> QUANTUM_TANK = register(TileQuantumTank.class, "quantum_tank");
public static final TileEntityType<TileQuantumChest> QUANTUM_CHEST = register(TileQuantumChest.class, "quantum_chest");
public static final TileEntityType<TileDigitalChest> DIGITAL_CHEST = register(TileDigitalChest.class, "digital_chest");
public static final TileEntityType<TileIndustrialCentrifuge> INDUSTRIAL_CENTRIFUGE = register(TileIndustrialCentrifuge.class, "industrial_centrifuge");
public static final TileEntityType<TileRollingMachine> ROLLING_MACHINE = register(TileRollingMachine.class, "rolling_machine");
public static final TileEntityType<TileIndustrialBlastFurnace> INDUSTRIAL_BLAST_FURNACE = register(TileIndustrialBlastFurnace.class, "industrial_blast_furnace");
public static final TileEntityType<TileAlloySmelter> ALLOY_SMELTER = register(TileAlloySmelter.class, "alloy_smelter");
public static final TileEntityType<TileIndustrialGrinder> INDUSTRIAL_GRINDER = register(TileIndustrialGrinder.class, "industrial_grinder");
public static final TileEntityType<TileImplosionCompressor> IMPLOSION_COMPRESSOR = register(TileImplosionCompressor.class, "implosion_compressor");
public static final TileEntityType<TileMatterFabricator> MATTER_FABRICATOR = register(TileMatterFabricator.class, "matter_fabricator");
public static final TileEntityType<TileChunkLoader> CHUNK_LOADER = register(TileChunkLoader.class, "chunk_loader");
public static final TileEntityType<TileChargeOMat> CHARGE_O_MAT = register(TileChargeOMat.class, "charge_o_mat");
public static final TileEntityType<TilePlayerDectector> PLAYER_DETECTOR = register(TilePlayerDectector.class, "player_detector");
public static final TileEntityType<TileCable> CABLE = register(TileCable.class, "cable");
public static final TileEntityType<TileMachineCasing> MACHINE_CASINGS = register(TileMachineCasing.class, "machine_casing");
public static final TileEntityType<TileDragonEggSyphon> DRAGON_EGG_SYPHON = register(TileDragonEggSyphon.class, "dragon_egg_syphon");
public static final TileEntityType<TileAssemblingMachine> ASSEMBLY_MACHINE = register(TileAssemblingMachine.class, "assembly_machine");
public static final TileEntityType<TileDieselGenerator> DIESEL_GENERATOR = register(TileDieselGenerator.class, "diesel_generator");
public static final TileEntityType<TileIndustrialElectrolyzer> INDUSTRIAL_ELECTROLYZER = register(TileIndustrialElectrolyzer.class, "industrial_electrolyzer");
public static final TileEntityType<TileSemiFluidGenerator> SEMI_FLUID_GENERATOR = register(TileSemiFluidGenerator.class, "semi_fluid_generator");
public static final TileEntityType<TileGasTurbine> GAS_TURBINE = register(TileGasTurbine.class, "gas_turbine");
public static final TileEntityType<TileIronAlloyFurnace> IRON_ALLOY_FURNACE = register(TileIronAlloyFurnace.class, "iron_alloy_furnace");
public static final TileEntityType<TileChemicalReactor> CHEMICAL_REACTOR = register(TileChemicalReactor.class, "chemical_reactor");
public static final TileEntityType<TileInterdimensionalSU> INTERDIMENSIONAL_SU = register(TileInterdimensionalSU.class, "interdimensional_su");
public static final TileEntityType<TileAdjustableSU> ADJUSTABLE_SU = register(TileAdjustableSU.class, "adjustable_su");
public static final TileEntityType<TileLapotronicSU> LAPOTRONIC_SU = register(TileLapotronicSU.class, "lapotronic_su");
public static final TileEntityType<TileLSUStorage> LSU_STORAGE = register(TileLSUStorage.class, "lsu_storage");
public static final TileEntityType<TileDistillationTower> DISTILLATION_TOWER = register(TileDistillationTower.class, "distillation_tower");
public static final TileEntityType<TileVacuumFreezer> VACUUM_FREEZER = register(TileVacuumFreezer.class, "vacuum_freezer");
public static final TileEntityType<TileFusionControlComputer> FUSION_CONTROL_COMPUTER = register(TileFusionControlComputer.class, "fusion_control_computer");
public static final TileEntityType<TileLightningRod> LIGHTNING_ROD = register(TileLightningRod.class, "lightning_rod");
public static final TileEntityType<TileIndustrialSawmill> INDUSTRIAL_SAWMILL = register(TileIndustrialSawmill.class, "industrial_sawmill");
public static final TileEntityType<TileGrinder> GRINDER = register(TileGrinder.class, "grinder");
public static final TileEntityType<TileSolidFuelGenerator> SOLID_FUEL_GENEREATOR = register(TileSolidFuelGenerator.class, "solid_fuel_generator");
public static final TileEntityType<TileExtractor> EXTRACTOR = register(TileExtractor.class, "extractor");
public static final TileEntityType<TileCompressor> COMPRESSOR = register(TileCompressor.class, "compressor");
public static final TileEntityType<TileElectricFurnace> ELECTRIC_FURNACE = register(TileElectricFurnace.class, "electric_furnace");
public static final TileEntityType<TileSolarPanel> SOLAR_PANEL = register(TileSolarPanel.class, "solar_panel");
public static final TileEntityType<TileCreativeQuantumTank> CREATIVE_QUANTUM_TANK = register(TileCreativeQuantumTank.class, "creative_quantum_tank");
public static final TileEntityType<TileCreativeQuantumChest> CREATIVE_QUANTUM_CHEST = register(TileCreativeQuantumChest.class, "creative_quantum_chest");
public static final TileEntityType<TileWaterMill> WATER_MILL = register(TileWaterMill.class, "water_mill");
public static final TileEntityType<TileWindMill> WIND_MILL = register(TileWindMill.class, "wind_mill");
public static final TileEntityType<TileMachineBase> MACHINE_BASE = register(TileMachineBase.class, "machine_base");
public static final TileEntityType<TileRecycler> RECYCLER = register(TileRecycler.class, "recycler");
public static final TileEntityType<TileLowVoltageSU> LOW_VOLTAGE_SU = register(TileLowVoltageSU.class, "low_voltage_su");
public static final TileEntityType<TileMediumVoltageSU> MEDIUM_VOLTAGE_SU = register(TileMediumVoltageSU.class, "medium_voltage_su");
public static final TileEntityType<TileHighVoltageSU> HIGH_VOLTAGE_SU = register(TileHighVoltageSU.class, "high_voltage_su");
public static final TileEntityType<TileLVTransformer> LV_TRANSFORMER = register(TileLVTransformer.class, "lv_transformer");
public static final TileEntityType<TileMVTransformer> MV_TRANSFORMER = register(TileMVTransformer.class, "mv_transformer");
public static final TileEntityType<TileHVTransformer> HV_TRANSFORMER = register(TileHVTransformer.class, "hv_transformer");
public static final TileEntityType<TileAutoCraftingTable> AUTO_CRAFTING_TABLE = register(TileAutoCraftingTable.class, "auto_crafting_table");
public static final TileEntityType<TileIronFurnace> IRON_FURNACE = register(TileIronFurnace.class, "iron_furnace");
public static final TileEntityType<TileScrapboxinator> SCRAPBOXINATOR = register(TileScrapboxinator.class, "scrapboxinator");
public static final TileEntityType<TilePlasmaGenerator> PLASMA_GENERATOR = register(TilePlasmaGenerator.class, "plasma_generator");
public static final TileEntityType<TileLamp> LAMP = register(TileLamp.class, "lamp");
public static final TileEntityType<TileAlarm> ALARM = register(TileAlarm.class, "alarm");
public static final TileEntityType<TileFluidReplicator> FLUID_REPLICATOR = register(TileFluidReplicator.class, "fluid_replicator");
public static final BlockEntityType<TileThermalGenerator> THERMAL_GEN = register(TileThermalGenerator.class, "thermal_generator");
public static final BlockEntityType<TileQuantumTank> QUANTUM_TANK = register(TileQuantumTank.class, "quantum_tank");
public static final BlockEntityType<TileQuantumChest> QUANTUM_CHEST = register(TileQuantumChest.class, "quantum_chest");
public static final BlockEntityType<TileDigitalChest> DIGITAL_CHEST = register(TileDigitalChest.class, "digital_chest");
public static final BlockEntityType<TileIndustrialCentrifuge> INDUSTRIAL_CENTRIFUGE = register(TileIndustrialCentrifuge.class, "industrial_centrifuge");
public static final BlockEntityType<TileRollingMachine> ROLLING_MACHINE = register(TileRollingMachine.class, "rolling_machine");
public static final BlockEntityType<TileIndustrialBlastFurnace> INDUSTRIAL_BLAST_FURNACE = register(TileIndustrialBlastFurnace.class, "industrial_blast_furnace");
public static final BlockEntityType<TileAlloySmelter> ALLOY_SMELTER = register(TileAlloySmelter.class, "alloy_smelter");
public static final BlockEntityType<TileIndustrialGrinder> INDUSTRIAL_GRINDER = register(TileIndustrialGrinder.class, "industrial_grinder");
public static final BlockEntityType<TileImplosionCompressor> IMPLOSION_COMPRESSOR = register(TileImplosionCompressor.class, "implosion_compressor");
public static final BlockEntityType<TileMatterFabricator> MATTER_FABRICATOR = register(TileMatterFabricator.class, "matter_fabricator");
public static final BlockEntityType<TileChunkLoader> CHUNK_LOADER = register(TileChunkLoader.class, "chunk_loader");
public static final BlockEntityType<TileChargeOMat> CHARGE_O_MAT = register(TileChargeOMat.class, "charge_o_mat");
public static final BlockEntityType<TilePlayerDectector> PLAYER_DETECTOR = register(TilePlayerDectector.class, "player_detector");
public static final BlockEntityType<TileCable> CABLE = register(TileCable.class, "cable");
public static final BlockEntityType<TileMachineCasing> MACHINE_CASINGS = register(TileMachineCasing.class, "machine_casing");
public static final BlockEntityType<TileDragonEggSyphon> DRAGON_EGG_SYPHON = register(TileDragonEggSyphon.class, "dragon_egg_syphon");
public static final BlockEntityType<TileAssemblingMachine> ASSEMBLY_MACHINE = register(TileAssemblingMachine.class, "assembly_machine");
public static final BlockEntityType<TileDieselGenerator> DIESEL_GENERATOR = register(TileDieselGenerator.class, "diesel_generator");
public static final BlockEntityType<TileIndustrialElectrolyzer> INDUSTRIAL_ELECTROLYZER = register(TileIndustrialElectrolyzer.class, "industrial_electrolyzer");
public static final BlockEntityType<TileSemiFluidGenerator> SEMI_FLUID_GENERATOR = register(TileSemiFluidGenerator.class, "semi_fluid_generator");
public static final BlockEntityType<TileGasTurbine> GAS_TURBINE = register(TileGasTurbine.class, "gas_turbine");
public static final BlockEntityType<TileIronAlloyFurnace> IRON_ALLOY_FURNACE = register(TileIronAlloyFurnace.class, "iron_alloy_furnace");
public static final BlockEntityType<TileChemicalReactor> CHEMICAL_REACTOR = register(TileChemicalReactor.class, "chemical_reactor");
public static final BlockEntityType<TileInterdimensionalSU> INTERDIMENSIONAL_SU = register(TileInterdimensionalSU.class, "interdimensional_su");
public static final BlockEntityType<TileAdjustableSU> ADJUSTABLE_SU = register(TileAdjustableSU.class, "adjustable_su");
public static final BlockEntityType<TileLapotronicSU> LAPOTRONIC_SU = register(TileLapotronicSU.class, "lapotronic_su");
public static final BlockEntityType<TileLSUStorage> LSU_STORAGE = register(TileLSUStorage.class, "lsu_storage");
public static final BlockEntityType<TileEnvTypeillationTower> EnvTypeILLATION_TOWER = register(TileEnvTypeillationTower.class, "EnvTypeillation_tower");
public static final BlockEntityType<TileVacuumFreezer> VACUUM_FREEZER = register(TileVacuumFreezer.class, "vacuum_freezer");
public static final BlockEntityType<TileFusionControlComputer> FUSION_CONTROL_COMPUTER = register(TileFusionControlComputer.class, "fusion_control_computer");
public static final BlockEntityType<TileLightningRod> LIGHTNING_ROD = register(TileLightningRod.class, "lightning_rod");
public static final BlockEntityType<TileIndustrialSawmill> INDUSTRIAL_SAWMILL = register(TileIndustrialSawmill.class, "industrial_sawmill");
public static final BlockEntityType<TileGrinder> GRINDER = register(TileGrinder.class, "grinder");
public static final BlockEntityType<TileSolidFuelGenerator> SOLID_FUEL_GENEREATOR = register(TileSolidFuelGenerator.class, "solid_fuel_generator");
public static final BlockEntityType<TileExtractor> EXTRACTOR = register(TileExtractor.class, "extractor");
public static final BlockEntityType<TileCompressor> COMPRESSOR = register(TileCompressor.class, "compressor");
public static final BlockEntityType<TileElectricFurnace> ELECTRIC_FURNACE = register(TileElectricFurnace.class, "electric_furnace");
public static final BlockEntityType<TileSolarPanel> SOLAR_PANEL = register(TileSolarPanel.class, "solar_panel");
public static final BlockEntityType<TileCreativeQuantumTank> CREATIVE_QUANTUM_TANK = register(TileCreativeQuantumTank.class, "creative_quantum_tank");
public static final BlockEntityType<TileCreativeQuantumChest> CREATIVE_QUANTUM_CHEST = register(TileCreativeQuantumChest.class, "creative_quantum_chest");
public static final BlockEntityType<TileWaterMill> WATER_MILL = register(TileWaterMill.class, "water_mill");
public static final BlockEntityType<TileWindMill> WIND_MILL = register(TileWindMill.class, "wind_mill");
public static final BlockEntityType<TileMachineBase> MACHINE_BASE = register(TileMachineBase.class, "machine_base");
public static final BlockEntityType<TileRecycler> RECYCLER = register(TileRecycler.class, "recycler");
public static final BlockEntityType<TileLowVoltageSU> LOW_VOLTAGE_SU = register(TileLowVoltageSU.class, "low_voltage_su");
public static final BlockEntityType<TileMediumVoltageSU> MEDIUM_VOLTAGE_SU = register(TileMediumVoltageSU.class, "medium_voltage_su");
public static final BlockEntityType<TileHighVoltageSU> HIGH_VOLTAGE_SU = register(TileHighVoltageSU.class, "high_voltage_su");
public static final BlockEntityType<TileLVTransformer> LV_TRANSFORMER = register(TileLVTransformer.class, "lv_transformer");
public static final BlockEntityType<TileMVTransformer> MV_TRANSFORMER = register(TileMVTransformer.class, "mv_transformer");
public static final BlockEntityType<TileHVTransformer> HV_TRANSFORMER = register(TileHVTransformer.class, "hv_transformer");
public static final BlockEntityType<TileAutoCraftingTable> AUTO_CRAFTING_TABLE = register(TileAutoCraftingTable.class, "auto_crafting_table");
public static final BlockEntityType<TileIronFurnace> IRON_FURNACE = register(TileIronFurnace.class, "iron_furnace");
public static final BlockEntityType<TileScrapboxinator> SCRAPBOXINATOR = register(TileScrapboxinator.class, "scrapboxinator");
public static final BlockEntityType<TilePlasmaGenerator> PLASMA_GENERATOR = register(TilePlasmaGenerator.class, "plasma_generator");
public static final BlockEntityType<TileLamp> LAMP = register(TileLamp.class, "lamp");
public static final BlockEntityType<TileAlarm> ALARM = register(TileAlarm.class, "alarm");
public static final BlockEntityType<TileFluidReplicator> FLUID_REPLICATOR = register(TileFluidReplicator.class, "fluid_replicator");
public static <T extends TileEntity> TileEntityType<T> register(Class<T> tClass, String name) {
return register(new ResourceLocation(TechReborn.MOD_ID, name).toString(), TileEntityType.Builder.create(() -> {
public static <T extends BlockEntity> BlockEntityType<T> register(Class<T> tClass, String name) {
return register(new Identifier(TechReborn.MOD_ID, name).toString(), BlockEntityType.Builder.create(() -> {
//TODO clean this up
try {
return tClass.newInstance();
@ -140,9 +140,9 @@ public class TRTileEntities {
}));
}
public static <T extends TileEntity> TileEntityType<T> register(String id, TileEntityType.Builder<T> builder) {
TileEntityType<T> tileEntityType = builder.build(null);
tileEntityType.setRegistryName(new ResourceLocation(id));
public static <T extends BlockEntity> BlockEntityType<T> register(String id, BlockEntityType.Builder<T> builder) {
BlockEntityType<T> tileEntityType = builder.build(null);
tileEntityType.setRegistryName(new Identifier(id));
TRTileEntities.TYPES.add(tileEntityType);
return tileEntityType;
}

View file

@ -25,21 +25,20 @@
package techreborn.init;
import java.util.function.Supplier;
import net.minecraft.item.IItemTier;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.LazyLoadBase;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;
//TODO: Use tags
public enum TRToolTier implements IItemTier {
public enum TRToolTier implements ToolMaterial {
BRONZE(2, 375, 6.0f, 2.25f, 8, () -> {
return Ingredient.fromItems(TRContent.Ingots.BRONZE.asItem());
return Ingredient.ofItems(TRContent.Ingots.BRONZE.asItem());
}), RUBY(2, 320, 6.2F, 2.7F, 10, () -> {
return Ingredient.fromItems(TRContent.Gems.RUBY.asItem());
return Ingredient.ofItems(TRContent.Gems.RUBY.asItem());
}), SAPPHIRE(3, 620, 5.0F, 2F, 8, () -> {
return Ingredient.fromItems(TRContent.Gems.SAPPHIRE.asItem());
return Ingredient.ofItems(TRContent.Gems.SAPPHIRE.asItem());
}), PERIDOT(2, 400, 7.0F, 2.4F, 16, () -> {
return Ingredient.fromItems(TRContent.Gems.PERIDOT.asItem());
return Ingredient.ofItems(TRContent.Gems.PERIDOT.asItem());
});
/**
@ -61,7 +60,7 @@ public enum TRToolTier implements IItemTier {
private final float attackDamage;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private final LazyLoadBase<Ingredient> repairMaterial;
private final Lazy<Ingredient> repairMaterial;
private TRToolTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn,
int enchantabilityIn, Supplier<Ingredient> repairMaterialIn) {
@ -70,16 +69,16 @@ public enum TRToolTier implements IItemTier {
this.efficiency = efficiencyIn;
this.attackDamage = attackDamageIn;
this.enchantability = enchantabilityIn;
this.repairMaterial = new LazyLoadBase<>(repairMaterialIn);
this.repairMaterial = new Lazy<>(repairMaterialIn);
}
@Override
public int getMaxUses() {
public int getDurability() {
return maxUses;
}
@Override
public float getEfficiency() {
public float getBlockBreakingSpeed() {
return efficiency;
}
@ -89,7 +88,7 @@ public enum TRToolTier implements IItemTier {
}
@Override
public int getHarvestLevel() {
public int getMiningLevel() {
return harvestLevel;
}
@ -99,7 +98,7 @@ public enum TRToolTier implements IItemTier {
}
@Override
public Ingredient getRepairMaterial() {
return repairMaterial.getValue();
public Ingredient getRepairIngredient() {
return repairMaterial.get();
}
}

View file

@ -24,9 +24,9 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
/**
* @author drcrazy

View file

@ -109,7 +109,7 @@ public class CraftingTableRecipes extends RecipeMethods {
// registerShaped(getStack(TRContent.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', getStack(TRContent.INDUSTRIAL_ELECTROLYZER), 'H', "craftingDiamondGrinder", 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'G', getStack(TRContent.GRINDER));
// registerShaped(getStack(ModBlocks.IMPLOSION_COMPRESSOR), "ABA", "CPC", "ABA", 'A', getMaterialObject("advancedAlloy", Type.INGOT), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'P', getStack(ModBlocks.COMPRESSOR));
// registerShaped(getStack(TRContent.VACUUM_FREEZER), "SPS", "CGC", "SPS", 'S', "plateSteel", 'C', "circuitAdvanced", 'G', "glassReinforced", 'P', getStack(TRContent.EXTRACTOR));
// registerShaped(getStack(TRContent.DISTILLATION_TOWER), "CMC", "PBP", "EME", 'E', getStack(TRContent.INDUSTRIAL_ELECTROLYZER), 'M', "circuitMaster", 'B', "machineBlockElite", 'C', getStack(TRContent.INDUSTRIAL_CENTRIFUGE), 'P', getStack(TRContent.EXTRACTOR));
// registerShaped(getStack(TRContent.EnvTypeILLATION_TOWER), "CMC", "PBP", "EME", 'E', getStack(TRContent.INDUSTRIAL_ELECTROLYZER), 'M', "circuitMaster", 'B', "machineBlockElite", 'C', getStack(TRContent.INDUSTRIAL_CENTRIFUGE), 'P', getStack(TRContent.EXTRACTOR));
// registerShaped(getStack(TRContent.CHEMICAL_REACTOR), "IMI", "CPC", "IEI", 'I', "plateInvar", 'C', "circuitAdvanced", 'M', getStack(TRContent.EXTRACTOR), 'P', getStack(TRContent.COMPRESSOR), 'E', getStack(TRContent.EXTRACTOR));
// registerShaped(getStack(TRContent.ROLLING_MACHINE), "PCP", "MBM", "PCP", 'P', getStack(Blocks.PISTON), 'C', "circuitAdvanced", 'M', getStack(TRContent.COMPRESSOR), 'B', "machineBlockBasic");
// registerShaped(getStack(TRContent.AUTO_CRAFTING_TABLE), "MPM", "PCP", "MPM", 'M', "circuitAdvanced", 'C', "workbench", 'P', "plateIron");

View file

@ -34,7 +34,7 @@ import java.security.InvalidParameterException;
* @author drcrazy
*
*/
public class DistillationTowerRecipes extends RecipeMethods {
public class EnvTypeillationTowerRecipes extends RecipeMethods {
public static void init() {
register(ItemCells.getCellByName("oil", 16), 1400, 13, getMaterial("diesel", 16, Type.CELL), getMaterial("sulfuricAcid", 16, Type.CELL), getMaterial("glyceryl", Type.CELL));
@ -61,18 +61,18 @@ public class DistillationTowerRecipes extends RecipeMethods {
output3 = outputs[2];
output4 = outputs[3];
} else {
throw new InvalidParameterException("Invalid number of distillation tower outputs: " + outputs);
throw new InvalidParameterException("Invalid number of EnvTypeillation tower outputs: " + outputs);
}
int cellCount = 0;
for (ItemStack stack : outputs) {
if (stack.getItem() instanceof DynamicCell) {
cellCount += stack.getCount();
cellCount += stack.getAmount();
}
}
if (input.getItem() instanceof DynamicCell) {
int inputCount = input.getCount();
int inputCount = input.getAmount();
if (cellCount < inputCount) {
if (output2 == null) {
output2 = DynamicCell.getEmptyCell(inputCount - cellCount);
@ -90,11 +90,11 @@ public class DistillationTowerRecipes extends RecipeMethods {
ItemStack cells = null;
if (cellCount > 0) {
if (cellCount > 64) {
throw new InvalidParameterException("Invalid distillation tower outputs: " + outputs + "(Recipe requires > 64 cells)");
throw new InvalidParameterException("Invalid EnvTypeillation tower outputs: " + outputs + "(Recipe requires > 64 cells)");
}
cells = DynamicCell.getEmptyCell(cellCount);
}
// RecipeHandler.addRecipe(Reference.DISTILLATION_TOWER_RECIPE, new DistillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
// RecipeHandler.addRecipe(Reference.EnvTypeILLATION_TOWER_RECIPE, new EnvTypeillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
}
static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) {

View file

@ -24,7 +24,7 @@
package techreborn.init.recipes;
import net.minecraftforge.fluids.Fluid;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.init.ModFluids;

View file

@ -24,7 +24,6 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import java.security.InvalidParameterException;

View file

@ -24,9 +24,9 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import techreborn.items.DynamicCell;
import java.security.InvalidParameterException;
@ -139,14 +139,14 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods {
int cellCount = 0;
for (ItemStack stack : outputs) {
if (stack.getItem() instanceof DynamicCell) {
cellCount += stack.getCount();
cellCount += stack.getAmount();
}
}
if (input instanceof ItemStack) {
if (((ItemStack) input).getItem() instanceof DynamicCell) {
int inputCount = ((ItemStack) input).getCount();
int inputCount = ((ItemStack) input).getAmount();
if (cellCount < inputCount) {
if (output2 == null) {
output2 = DynamicCell.getEmptyCell(inputCount - cellCount);

View file

@ -27,7 +27,7 @@ package techreborn.init.recipes;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.recipe.Ingredient;
import reborncore.common.util.StringUtils;
import techreborn.items.ItemCells;

View file

@ -24,10 +24,10 @@
package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import techreborn.TechReborn;
import techreborn.init.TRContent;
@ -36,29 +36,29 @@ import techreborn.init.TRContent;
*/
public class RollingMachineRecipes extends RecipeMethods {
public static void init() {
register(new ResourceLocation(TechReborn.MOD_ID, "cupronickel_heating_coil"), TRContent.Parts.CUPRONICKEL_HEATING_COIL.getStack(3), "NCN", "C C", "NCN", 'N', "ingotNickel", 'C', "ingotCopper");
register(new ResourceLocation(TechReborn.MOD_ID, "nichrome_heating_coil"), TRContent.Parts.NICHROME_HEATING_COIL.getStack(2), " N ", "NCN", " N ", 'N', "ingotNickel", 'C', "ingotChrome");
register(new Identifier(TechReborn.MOD_ID, "cupronickel_heating_coil"), TRContent.Parts.CUPRONICKEL_HEATING_COIL.getStack(3), "NCN", "C C", "NCN", 'N', "ingotNickel", 'C', "ingotCopper");
register(new Identifier(TechReborn.MOD_ID, "nichrome_heating_coil"), TRContent.Parts.NICHROME_HEATING_COIL.getStack(2), " N ", "NCN", " N ", 'N', "ingotNickel", 'C', "ingotChrome");
if (oresExist("ingotAluminum")) {
register(new ResourceLocation(TechReborn.MOD_ID, "kanthal_heating_coil"), TRContent.Parts.KANTHAL_HEATING_COIL.getStack(3), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminum");
register(new Identifier(TechReborn.MOD_ID, "kanthal_heating_coil"), TRContent.Parts.KANTHAL_HEATING_COIL.getStack(3), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminum");
}
if (oresExist("ingotAluminium")) {
register(new ResourceLocation(TechReborn.MOD_ID, "kanthal_heating_coil"), TRContent.Parts.KANTHAL_HEATING_COIL.getStack(3), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium");
register(new Identifier(TechReborn.MOD_ID, "kanthal_heating_coil"), TRContent.Parts.KANTHAL_HEATING_COIL.getStack(3), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium");
}
register(new ResourceLocation(TechReborn.MOD_ID, "plateMagnalium"), TRContent.Plates.MAGNALIUM.getStack(3), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium");
register(new ResourceLocation(TechReborn.MOD_ID, "rail"), getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood");
register(new ResourceLocation(TechReborn.MOD_ID, "gold_rail"), getStack(Blocks.POWERED_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone");
register(new ResourceLocation(TechReborn.MOD_ID, "detector_rail"), getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone");
register(new ResourceLocation(TechReborn.MOD_ID, "activator_rail"), getStack(Blocks.ACTIVATOR_RAIL, 8), "ISI", "IRI", "ISI", 'I', "ingotIron", 'S', "stickWood", 'R', getStack(Blocks.REDSTONE_TORCH));
register(new ResourceLocation(TechReborn.MOD_ID, "iron_bars"), getStack(Blocks.IRON_BARS, 24), "III", "III", 'I', "ingotIron");
register(new ResourceLocation(TechReborn.MOD_ID, "iron_door"), getStack(Blocks.IRON_DOOR, 4), "II ", "II ", "II ", 'I', "ingotIron");
register(new ResourceLocation(TechReborn.MOD_ID, "minecart"), getStack(Items.MINECART, 2), "I I", "III", 'I', "ingotIron");
register(new ResourceLocation(TechReborn.MOD_ID, "bucket"), getStack(Items.BUCKET, 2), "I I", "I I", " I ", 'I', "ingotIron");
register(new ResourceLocation(TechReborn.MOD_ID, "tripwire_hook"), getStack(Blocks.TRIPWIRE_HOOK, 4), " I ", " S ", " W ", 'I', "ingotIron", 'S', "stickWood", 'W', "plankWood");
register(new ResourceLocation(TechReborn.MOD_ID, "heavy_pressure_plate"), getStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, 2), "II ", 'I', "ingotIron");
register(new ResourceLocation(TechReborn.MOD_ID, "light_pressure_plate"), getStack(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, 2), "GG ", 'G', "ingotGold");
register(new Identifier(TechReborn.MOD_ID, "plateMagnalium"), TRContent.Plates.MAGNALIUM.getStack(3), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium");
register(new Identifier(TechReborn.MOD_ID, "rail"), getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood");
register(new Identifier(TechReborn.MOD_ID, "gold_rail"), getStack(Blocks.POWERED_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone");
register(new Identifier(TechReborn.MOD_ID, "detector_rail"), getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone");
register(new Identifier(TechReborn.MOD_ID, "activator_rail"), getStack(Blocks.ACTIVATOR_RAIL, 8), "ISI", "IRI", "ISI", 'I', "ingotIron", 'S', "stickWood", 'R', getStack(Blocks.REDSTONE_TORCH));
register(new Identifier(TechReborn.MOD_ID, "iron_bars"), getStack(Blocks.IRON_BARS, 24), "III", "III", 'I', "ingotIron");
register(new Identifier(TechReborn.MOD_ID, "iron_door"), getStack(Blocks.IRON_DOOR, 4), "II ", "II ", "II ", 'I', "ingotIron");
register(new Identifier(TechReborn.MOD_ID, "minecart"), getStack(Items.MINECART, 2), "I I", "III", 'I', "ingotIron");
register(new Identifier(TechReborn.MOD_ID, "bucket"), getStack(Items.BUCKET, 2), "I I", "I I", " I ", 'I', "ingotIron");
register(new Identifier(TechReborn.MOD_ID, "tripwire_hook"), getStack(Blocks.TRIPWIRE_HOOK, 4), " I ", " S ", " W ", 'I', "ingotIron", 'S', "stickWood", 'W', "plankWood");
register(new Identifier(TechReborn.MOD_ID, "heavy_pressure_plate"), getStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, 2), "II ", 'I', "ingotIron");
register(new Identifier(TechReborn.MOD_ID, "light_pressure_plate"), getStack(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, 2), "GG ", 'G', "ingotGold");
}
static void register(ResourceLocation resourceLocation, ItemStack output, Object... componentsObjects) {
static void register(Identifier resourceLocation, ItemStack output, Object... componentsObjects) {
}
}

View file

@ -25,9 +25,9 @@
package techreborn.init.recipes;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import techreborn.init.TRContent;
import techreborn.items.DynamicCell;
import techreborn.utils.StackWIPHandler;

View file

@ -24,8 +24,8 @@
package techreborn.init.recipes;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import techreborn.init.TRContent;
/**