diff --git a/.gitignore b/.gitignore index 69953a0e9..8381c244b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,6 @@ java_pid2412.hprof /classes/ /gradle.properties /buildSrc/.gradle/ -/buildSrc/build/ \ No newline at end of file +/buildSrc/build/ +/src/main/resources/package-lock.json +/src/main/resources/node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index eec1d88a6..8c0c2804d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![](http://cf.way2muchnoise.eu/full_233564_downloads.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](http://cf.way2muchnoise.eu/packs/233564.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](http://cf.way2muchnoise.eu/versions/233564.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](https://img.shields.io/badge/Discord-TeamReborn-738bd7.svg)](https://discord.gg/teamreborn) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/techreborn/localized.svg)](https://translate.techreborn.ovh/project/techreborn) -# Tech Reborn for 1.13.1 (BUILD JOBS WILL NEED UPDATING) [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/) +# Tech Reborn for 1.14.4 [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/) *Tech Reborn is a completely standalone tech mod including tools and machines to gather resources, process materials, and progress through the mod.* @@ -21,12 +21,18 @@ Versions we determine are stable enough can always be found on our CurseForge pa If you're looking for the latest bleeding edge build, these are found on our Jenkins page. Use these with caution, and please do not put these in modpacks: +1.15 * - [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.15/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.15/) + +1.14.4 - [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.14/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.14/) + 1.12.2 - [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/) 1.11.2 - [![Build Status](https://jenkins.modmuss50.me/job/TeamReborn/job/TechReborn/job/TechReborn-1.11.2/badge/icon)](https://jenkins.modmuss50.me/job/TeamReborn/job/TechReborn/job/TechReborn-1.11.2/) 1.10.2 - [![Build Status](https://jenkins.modmuss50.me/job/TeamReborn/job/TechReborn/job/TechReborn-1.10.2/badge/icon)](https://jenkins.modmuss50.me/job/TeamReborn/job/TechReborn/job/TechReborn-1.10.2/) +* 1.15 versions are for snapshots, and may not always be upto date with the latest 1.15 snapshots. + # Issues and Suggestions To report an issue or make a suggestion, please head up to the `Issues` tab up above, and open a new issue. You will need a GitHub account for this (it's free!). **It is very important that you include the version of Tech Reborn you are using in your issue report.** diff --git a/build.gradle b/build.gradle index c2e64afb0..94a0f2846 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ repositories { } } -version = "3.0.13" +version = "3.0.14" configurations { shade @@ -56,9 +56,8 @@ configurations { } def ENV = System.getenv() -if (ENV.BUILD_NUMBER) { - version = version + "." + "${System.getenv().BUILD_NUMBER}" -} +def build_number = ENV.BUILD_NUMBER ?: "local" +version = "${version}+build.$build_number" license { header file('HEADER') @@ -89,13 +88,17 @@ dependencies { transitive = false } + compile 'org.checkerframework:checker-qual:2.10.0' compile 'org.spongepowered:configurate-hocon:3.6' + compile 'org.checkerframework:checker-qual:2.10.0' compileOnly "com.google.code.findbugs:jsr305:+" modCompileOnly ('com.github.Virtuoel:Towelette:519538e54b') { transitive = false } + + compile 'teamreborn:energy:0.0.7' } processResources { @@ -115,7 +118,7 @@ jar { exclude "**/*.psd" classifier = 'universal' - from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.lang"} : null} + from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.json"} : null} dependsOn 'renameCrowdin' } diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index 20b0e4f4c..d3e78ec2b 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -32,6 +32,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import reborncore.api.power.ItemPowerHolder; import reborncore.common.config.Configuration; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.Torus; @@ -61,6 +62,7 @@ public class TechReborn implements ModInitializer { INSTANCE = this; new Configuration(TechRebornConfig.class, "techreborn"); + ItemPowerHolder.setup(); // Done to force the class to load ModRecipes.GRINDER.getName(); diff --git a/src/main/java/techreborn/TechRebornClient.java b/src/main/java/techreborn/TechRebornClient.java index ade377127..404221ca0 100644 --- a/src/main/java/techreborn/TechRebornClient.java +++ b/src/main/java/techreborn/TechRebornClient.java @@ -102,7 +102,7 @@ public class TechRebornClient implements ClientModInitializer { @Override public BakedModel bake(ModelLoader modelLoader, Function function, ModelBakeSettings modelBakeSettings) { - return new DynamicBucketBakedModel(fluid); + return new DynamicBucketBakedModel(); } }; } diff --git a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java index 31459cd2f..3411d8b28 100644 --- a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java @@ -37,10 +37,13 @@ import net.minecraft.util.Tickable; import net.minecraft.util.math.Direction; import reborncore.api.IListInfoProvider; import reborncore.api.IToolDrop; -import reborncore.api.power.EnergyBlockEntity; -import reborncore.api.power.EnumPowerTier; +import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.StringUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyStorage; +import team.reborn.energy.EnergyTier; import techreborn.blocks.cable.BlockCable; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; @@ -54,7 +57,7 @@ import java.util.List; */ public class CableBlockEntity extends BlockEntity - implements Tickable, IListInfoProvider, IToolDrop, EnergyBlockEntity { + implements Tickable, IListInfoProvider, IToolDrop, EnergyStorage { private double energy = 0; private int transferRate = 0; @@ -124,21 +127,17 @@ public class CableBlockEntity extends BlockEntity ticksSinceLastChange = 0; } - ArrayList acceptors = new ArrayList(); + ArrayList acceptors = new ArrayList(); for (Direction face : Direction.values()) { BlockEntity blockEntity = world.getBlockEntity(pos.offset(face)); if (blockEntity == null) { continue; - } else if (blockEntity instanceof EnergyBlockEntity) { - EnergyBlockEntity acceptor = (EnergyBlockEntity) blockEntity; - if (blockEntity instanceof CableBlockEntity && energy <= acceptor.getEnergy()) { + } else if (Energy.valid(blockEntity)) { + if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(EnergySide.fromMinecraft(face)).getEnergy()) { continue; } - if (!acceptor.canAcceptEnergy(face.getOpposite())) { - continue; - } - acceptors.add(acceptor); + acceptors.add(blockEntity); if (!sendingFace.contains(face)) { sendingFace.add(face); } @@ -149,13 +148,9 @@ public class CableBlockEntity extends BlockEntity return; } Collections.shuffle(acceptors); - acceptors.forEach(blockEntity -> { - double drain = Math.min(energy, transferRate); - if (drain > 0 && blockEntity.addEnergy(drain, true) > 0) { - double move = blockEntity.addEnergy(drain, false); - useEnergy(move, false); - } - }); + acceptors.forEach(blockEntity -> Energy.of(this) + .into(Energy.of(blockEntity)) + .move()); } // IListInfoProvider @@ -176,52 +171,15 @@ public class CableBlockEntity extends BlockEntity return new ItemStack(getCableType().block); } - @Override + public double getEnergy() { - return energy; + return getStored(EnergySide.UNKNOWN); } - @Override public void setEnergy(double energy) { - this.energy = energy; + setStored(energy); } - @Override - public double getMaxPower() { - return transferRate * 4; - } - - @Override - public boolean canAddEnergy(double energyIn) { - return getEnergy() + energyIn <= getMaxPower(); - } - - @Override - public double addEnergy(double energy) { - return addEnergy(energy, false); - } - - @Override - public double addEnergy(double energyIn, boolean simulate) { - double energyReceived = Math.min(getMaxPower(), Math.min(getMaxPower() - getEnergy(), energyIn)); - - if (!simulate) { - setEnergy(getEnergy() + energyReceived); - } - return energyReceived; - } - - @Override - public boolean canUseEnergy(double energy) { - return this.energy >= energy; - } - - @Override - public double useEnergy(double energy) { - return useEnergy(energy, false); - } - - @Override public double useEnergy(double energyOut, boolean simulate) { if (energyOut > energy) { energyOut = energy; @@ -232,31 +190,40 @@ public class CableBlockEntity extends BlockEntity return energyOut; } - @Override public boolean canAcceptEnergy(Direction direction) { if (sendingFace.contains(direction)) { return false; } - return getMaxPower() != getEnergy(); + return getMaxStoredPower() != getEnergy(); } @Override - public boolean canProvideEnergy(Direction direction) { - return true; - } - - @Override - public double getMaxOutput() { + public double getMaxInput(EnergySide side) { return transferRate; } @Override - public double getMaxInput() { + public double getMaxOutput(EnergySide side) { return transferRate; } @Override - public EnumPowerTier getTier() { - return EnumPowerTier.getTier(cableType.transferRate); + public double getMaxStoredPower() { + return transferRate * 4; + } + + @Override + public EnergyTier getTier() { + return PowerAcceptorBlockEntity.getTier(cableType.transferRate); + } + + @Override + public double getStored(EnergySide face) { + return energy; + } + + @Override + public void setStored(double amount) { + this.energy = amount; } } diff --git a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java index 4b132b77b..8acf290a7 100644 --- a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java @@ -32,11 +32,11 @@ import org.apache.commons.lang3.Validate; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; import reborncore.common.blocks.BlockMachineBase; +import reborncore.common.fluid.container.FluidInstance; import reborncore.common.fluid.container.ItemFluidInfo; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.util.RebornInventory; import reborncore.common.util.Tank; -import io.github.prospector.silk.fluid.FluidInstance; import techreborn.api.generator.EFluidGenerator; import techreborn.api.generator.FluidGeneratorRecipe; import techreborn.api.generator.FluidGeneratorRecipeList; diff --git a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java index a94f89c5a..cd640ee42 100644 --- a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java @@ -24,24 +24,24 @@ package techreborn.blockentity.generator; -import net.minecraft.text.LiteralText; -import net.minecraft.util.Formatting; import net.minecraft.block.Block; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; +import net.minecraft.text.LiteralText; import net.minecraft.text.Text; +import net.minecraft.util.Formatting; import net.minecraft.util.math.Direction; import reborncore.api.IToolDrop; -import reborncore.api.power.EnumPowerTier; -import reborncore.common.powerSystem.PowerSystem; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; +import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.StringUtils; +import team.reborn.energy.EnergyTier; import techreborn.blocks.generator.BlockSolarPanel; +import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; import techreborn.init.TRContent.SolarPanels; -import techreborn.init.TRBlockEntities; import java.util.List; @@ -49,7 +49,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I boolean canSeeSky = false; boolean lastState = false; - SolarPanels panel; + private SolarPanels panel; public SolarPanelBlockEntity() { super(TRBlockEntities.SOLAR_PANEL); @@ -77,7 +77,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I if (world.isClient) { return; } - if (panel == TRContent.SolarPanels.CREATIVE) { + if (getPanel() == TRContent.SolarPanels.CREATIVE) { checkOverfill = false; setEnergy(Integer.MAX_VALUE); return; @@ -91,9 +91,9 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I } int powerToAdd; if (isSunOut()) { - powerToAdd = panel.generationRateD; + powerToAdd = getPanel().generationRateD; } else if (canSeeSky) { - powerToAdd = panel.generationRateN; + powerToAdd = getPanel().generationRateN; } else { powerToAdd = 0; } @@ -103,7 +103,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I @Override public double getBaseMaxPower() { - return panel.internalCapacity; + return getPanel().internalCapacity; } @Override @@ -118,7 +118,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I @Override public double getBaseMaxOutput() { - return panel.generationRateD; + return getPanel().generationRateD; } @Override @@ -127,8 +127,8 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I } @Override - public EnumPowerTier getTier() { - return panel.powerTier; + public EnergyTier getTier() { + return getPanel().powerTier; } @Override @@ -136,6 +136,13 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I // Nope } + public SolarPanels getPanel() { + if(panel == null){ + updatePanel(); + } + return panel; + } + @Override public void addInfo(List info, boolean isReal, boolean hasData) { info.add(new LiteralText(Formatting.GRAY + StringUtils.t("reborncore.tooltip.energy.maxEnergy") + ": " diff --git a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java index 9831d5ebd..0a68b0336 100644 --- a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java @@ -77,6 +77,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl if (world.isClient) { return; } + discharge(1); if (getEnergy() < getMaxPower()) { if (burnTime > 0) { burnTime--; @@ -85,6 +86,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl } } else { isBurning = false; + updateState(); } if (burnTime == 0) { @@ -113,8 +115,9 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl final BlockState BlockStateContainer = world.getBlockState(pos); if (BlockStateContainer.getBlock() instanceof BlockMachineBase) { final BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); - if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != burnTime > 0) { - blockMachineBase.setActive(burnTime > 0, world, pos); + boolean active = burnTime > 0 && getEnergy() < getMaxPower(); + if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != active) { + blockMachineBase.setActive(active, world, pos); } } } diff --git a/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java b/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java index 3804e04f0..36ddbea73 100644 --- a/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java +++ b/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java @@ -71,6 +71,10 @@ public class LampBlockEntity extends PowerAcceptorBlockEntity @Override public boolean canAcceptEnergy(final Direction direction) { + if (world == null) { + // Blame tooltip for this + return true; + } Direction me = BlockLamp.getFacing(world.getBlockState(pos)).getOpposite(); return direction == me; } diff --git a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java index e62c6972f..3198bb91e 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java @@ -132,7 +132,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity if (!currentRecipeOutput.isEmpty()) { boolean hasCrafted = false; if (inventory.getInvStack(outputSlot).isEmpty()) { - inventory.setInvStack(outputSlot, currentRecipeOutput); + inventory.setInvStack(outputSlot, currentRecipeOutput.copy()); tickTime = 0; hasCrafted = true; } else { diff --git a/src/main/java/techreborn/blockentity/storage/AdjustableSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/AdjustableSUBlockEntity.java index 8e88c9dd8..94f5ac745 100644 --- a/src/main/java/techreborn/blockentity/storage/AdjustableSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/AdjustableSUBlockEntity.java @@ -27,15 +27,16 @@ package techreborn.blockentity.storage; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; -import reborncore.api.power.EnumPowerTier; import reborncore.api.blockentity.IUpgrade; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; import reborncore.common.util.RebornInventory; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.config.TechRebornConfig; -import techreborn.init.TRContent; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider { @@ -44,7 +45,7 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements public int superconductors = 0; public AdjustableSUBlockEntity() { - super(TRBlockEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnumPowerTier.INSANE, TechRebornConfig.aesuMaxInput, TechRebornConfig.aesuMaxOutput, TechRebornConfig.aesuMaxEnergy); + super(TRBlockEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnergyTier.INSANE, TechRebornConfig.aesuMaxInput, TechRebornConfig.aesuMaxOutput, TechRebornConfig.aesuMaxEnergy); } @Override @@ -120,7 +121,7 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements } @Override - public double getMaxOutput() { + public double getMaxOutput(EnergySide side) { return OUTPUT; } diff --git a/src/main/java/techreborn/blockentity/storage/EnergyStorageBlockEntity.java b/src/main/java/techreborn/blockentity/storage/EnergyStorageBlockEntity.java index 78e6f7874..39bd9ffce 100644 --- a/src/main/java/techreborn/blockentity/storage/EnergyStorageBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/EnergyStorageBlockEntity.java @@ -30,11 +30,11 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; import reborncore.api.IToolDrop; -import reborncore.api.power.EnumPowerTier; import reborncore.api.blockentity.InventoryProvider; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.util.RebornInventory; +import team.reborn.energy.EnergyTier; import techreborn.blocks.storage.BlockEnergyStorage; /** @@ -46,12 +46,12 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity public RebornInventory inventory; public String name; public Block wrenchDrop; - public EnumPowerTier tier; + public EnergyTier tier; public int maxInput; public int maxOutput; public int maxStorage; - public EnergyStorageBlockEntity(BlockEntityType blockEntityType, String name, int invSize, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage) { + public EnergyStorageBlockEntity(BlockEntityType blockEntityType, String name, int invSize, Block wrenchDrop, EnergyTier tier, int maxInput, int maxOuput, int maxStorage) { super(blockEntityType); inventory = new RebornInventory<>(invSize, name + "BlockEntity", 64, this); this.wrenchDrop = wrenchDrop; @@ -90,7 +90,7 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity public boolean canAcceptEnergy(Direction direction) { return getFacing() != direction; } - + @Override public boolean canProvideEnergy(Direction direction) { return getFacing() == direction; @@ -114,6 +114,9 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity @Override public Direction getFacingEnum() { + if(world == null){ + return null; + } Block block = world.getBlockState(pos).getBlock(); if (block instanceof BlockEnergyStorage) { return ((BlockEnergyStorage) block).getFacing(world.getBlockState(pos)); diff --git a/src/main/java/techreborn/blockentity/storage/HighVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/HighVoltageSUBlockEntity.java index 6eff88238..bdfea3333 100644 --- a/src/main/java/techreborn/blockentity/storage/HighVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/HighVoltageSUBlockEntity.java @@ -25,12 +25,12 @@ package techreborn.blockentity.storage; import net.minecraft.entity.player.PlayerEntity; -import reborncore.api.power.EnumPowerTier; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 14/03/2016. @@ -42,7 +42,7 @@ public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implement * MFSU should store 40M FE with 2048 FE/t I/O */ public HighVoltageSUBlockEntity() { - super(TRBlockEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnumPowerTier.HIGH, 512, 512, 10_000_000); + super(TRBlockEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnergyTier.HIGH, 512, 512, 10_000_000); } @Override diff --git a/src/main/java/techreborn/blockentity/storage/LowVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/LowVoltageSUBlockEntity.java index 063f41549..e84a5a819 100644 --- a/src/main/java/techreborn/blockentity/storage/LowVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/LowVoltageSUBlockEntity.java @@ -25,12 +25,12 @@ package techreborn.blockentity.storage; import net.minecraft.entity.player.PlayerEntity; -import reborncore.api.power.EnumPowerTier; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 14/03/2016. @@ -38,7 +38,7 @@ import techreborn.init.TRBlockEntities; public class LowVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider { public LowVoltageSUBlockEntity() { - super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnumPowerTier.LOW, 32, 32, 40000); + super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnergyTier.LOW, 32, 32, 40000); } @Override diff --git a/src/main/java/techreborn/blockentity/storage/MediumVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/MediumVoltageSUBlockEntity.java index 6b9fe5d99..382846296 100644 --- a/src/main/java/techreborn/blockentity/storage/MediumVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/MediumVoltageSUBlockEntity.java @@ -25,12 +25,12 @@ package techreborn.blockentity.storage; import net.minecraft.entity.player.PlayerEntity; -import reborncore.api.power.EnumPowerTier; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 14/03/2016. @@ -42,7 +42,7 @@ public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity impleme * MFE should store 1.2M FE with 512 FE/t I/O */ public MediumVoltageSUBlockEntity() { - super(TRBlockEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnumPowerTier.MEDIUM, 128, 128, 300000); + super(TRBlockEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnergyTier.MEDIUM, 128, 128, 300000); } @Override diff --git a/src/main/java/techreborn/blockentity/storage/idsu/InterdimensionalSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/idsu/InterdimensionalSUBlockEntity.java index f4929ffd7..4b9154156 100644 --- a/src/main/java/techreborn/blockentity/storage/idsu/InterdimensionalSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/idsu/InterdimensionalSUBlockEntity.java @@ -27,14 +27,14 @@ package techreborn.blockentity.storage.idsu; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundTag; import org.apache.commons.lang3.StringUtils; -import reborncore.api.power.EnumPowerTier; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; -import techreborn.config.TechRebornConfig; -import techreborn.init.TRContent; -import techreborn.init.TRBlockEntities; +import team.reborn.energy.EnergyTier; import techreborn.blockentity.storage.EnergyStorageBlockEntity; +import techreborn.config.TechRebornConfig; +import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider { @@ -44,7 +44,7 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl private double clientEnergy; public InterdimensionalSUBlockEntity() { - super(TRBlockEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnumPowerTier.EXTREME, TechRebornConfig.idsuMaxInput, TechRebornConfig.idsuMaxOutput, TechRebornConfig.idsuMaxEnergy); + super(TRBlockEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnergyTier.EXTREME, TechRebornConfig.idsuMaxInput, TechRebornConfig.idsuMaxOutput, TechRebornConfig.idsuMaxEnergy); } @Override diff --git a/src/main/java/techreborn/blockentity/storage/lesu/LapotronicSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/lesu/LapotronicSUBlockEntity.java index 9002b1467..e5d059599 100644 --- a/src/main/java/techreborn/blockentity/storage/lesu/LapotronicSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/lesu/LapotronicSUBlockEntity.java @@ -29,10 +29,10 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import reborncore.api.power.EnumPowerTier; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; +import team.reborn.energy.EnergyTier; import techreborn.blockentity.storage.EnergyStorageBlockEntity; import techreborn.blocks.storage.BlockLapotronicSU; import techreborn.config.TechRebornConfig; @@ -47,7 +47,7 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements private ArrayList countedNetworks = new ArrayList<>(); public LapotronicSUBlockEntity() { - super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnumPowerTier.INSANE, 8192, TechRebornConfig.lesuBaseOutput, 1_000_000); + super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnergyTier.INSANE, 8192, TechRebornConfig.lesuBaseOutput, 1_000_000); checkOverfill = false; } diff --git a/src/main/java/techreborn/blockentity/transformers/EVTransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/EVTransformerBlockEntity.java index 65674da01..5c3ddf18c 100644 --- a/src/main/java/techreborn/blockentity/transformers/EVTransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/EVTransformerBlockEntity.java @@ -24,7 +24,7 @@ package techreborn.blockentity.transformers; -import reborncore.api.power.EnumPowerTier; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; @@ -34,7 +34,7 @@ import techreborn.init.TRContent; public class EVTransformerBlockEntity extends TransformerBlockEntity { public EVTransformerBlockEntity() { - super(TRBlockEntities.EV_TRANSFORMER, "EVTransformer", TRContent.Machine.EV_TRANSFORMER.block, EnumPowerTier.INSANE); + super(TRBlockEntities.EV_TRANSFORMER, "EVTransformer", TRContent.Machine.EV_TRANSFORMER.block, EnergyTier.INSANE); } } diff --git a/src/main/java/techreborn/blockentity/transformers/HVTransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/HVTransformerBlockEntity.java index e4c43ac7f..dd8ed63b8 100644 --- a/src/main/java/techreborn/blockentity/transformers/HVTransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/HVTransformerBlockEntity.java @@ -24,9 +24,9 @@ package techreborn.blockentity.transformers; -import reborncore.api.power.EnumPowerTier; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 16/03/2016. @@ -34,7 +34,7 @@ import techreborn.init.TRBlockEntities; public class HVTransformerBlockEntity extends TransformerBlockEntity { public HVTransformerBlockEntity() { - super(TRBlockEntities.HV_TRANSFORMER, "HVTransformer", TRContent.Machine.HV_TRANSFORMER.block, EnumPowerTier.EXTREME); + super(TRBlockEntities.HV_TRANSFORMER, "HVTransformer", TRContent.Machine.HV_TRANSFORMER.block, EnergyTier.EXTREME); } } diff --git a/src/main/java/techreborn/blockentity/transformers/LVTransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/LVTransformerBlockEntity.java index b187f0cd9..0693d9cfd 100644 --- a/src/main/java/techreborn/blockentity/transformers/LVTransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/LVTransformerBlockEntity.java @@ -24,9 +24,9 @@ package techreborn.blockentity.transformers; -import reborncore.api.power.EnumPowerTier; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 16/03/2016. @@ -34,7 +34,7 @@ import techreborn.init.TRBlockEntities; public class LVTransformerBlockEntity extends TransformerBlockEntity { public LVTransformerBlockEntity() { - super(TRBlockEntities.LV_TRANSFORMER, "LVTransformer", TRContent.Machine.LV_TRANSFORMER.block, EnumPowerTier.MEDIUM); + super(TRBlockEntities.LV_TRANSFORMER, "LVTransformer", TRContent.Machine.LV_TRANSFORMER.block, EnergyTier.MEDIUM); } } diff --git a/src/main/java/techreborn/blockentity/transformers/MVTransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/MVTransformerBlockEntity.java index b8e785d68..ffa0799be 100644 --- a/src/main/java/techreborn/blockentity/transformers/MVTransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/MVTransformerBlockEntity.java @@ -24,9 +24,9 @@ package techreborn.blockentity.transformers; -import reborncore.api.power.EnumPowerTier; -import techreborn.init.TRContent; +import team.reborn.energy.EnergyTier; import techreborn.init.TRBlockEntities; +import techreborn.init.TRContent; /** * Created by modmuss50 on 16/03/2016. @@ -34,6 +34,6 @@ import techreborn.init.TRBlockEntities; public class MVTransformerBlockEntity extends TransformerBlockEntity { public MVTransformerBlockEntity() { - super(TRBlockEntities.MV_TRANSFORMER, "MVTransformer", TRContent.Machine.MV_TRANSFORMER.block, EnumPowerTier.HIGH); + super(TRBlockEntities.MV_TRANSFORMER, "MVTransformer", TRContent.Machine.MV_TRANSFORMER.block, EnergyTier.HIGH); } } diff --git a/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java index f1e655c03..1226d3776 100644 --- a/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java @@ -24,20 +24,21 @@ package techreborn.blockentity.transformers; -import net.minecraft.text.LiteralText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; import net.minecraft.block.Block; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; +import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; import net.minecraft.util.math.Direction; import reborncore.api.IListInfoProvider; import reborncore.api.IToolDrop; -import reborncore.api.power.EnumPowerTier; -import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; +import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.StringUtils; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.blocks.transformers.BlockTransformer; import techreborn.config.TechRebornConfig; @@ -52,20 +53,20 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity public String name; public Block wrenchDrop; - public EnumPowerTier inputTier; - public EnumPowerTier ouputTier; + public EnergyTier inputTier; + public EnergyTier ouputTier; public int maxInput; public int maxOutput; public int maxStorage; - public TransformerBlockEntity(BlockEntityType blockEntityType, String name, Block wrenchDrop, EnumPowerTier tier) { + public TransformerBlockEntity(BlockEntityType blockEntityType, String name, Block wrenchDrop, EnergyTier tier) { super(blockEntityType); this.wrenchDrop = wrenchDrop; this.inputTier = tier; - if (tier != EnumPowerTier.MICRO) { - ouputTier = EnumPowerTier.values()[tier.ordinal() - 1]; + if (tier != EnergyTier.MICRO) { + ouputTier = EnergyTier.values()[tier.ordinal() - 1]; } else { - ouputTier = EnumPowerTier.MICRO; + ouputTier = EnergyTier.MICRO; } this.name = name; this.maxInput = tier.getMaxInput(); @@ -109,7 +110,7 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity } @Override - public EnumPowerTier getPushingTier() { + public EnergyTier getPushingTier() { return ouputTier; } @@ -137,9 +138,9 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity // IListInfoProvider @Override public void addInfo(List info, boolean isReal, boolean hasData) { - info.add(new LiteralText(Formatting.GRAY + "Input Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxInput()))); + info.add(new LiteralText(Formatting.GRAY + "Input Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxInput(EnergySide.UNKNOWN)))); info.add(new LiteralText(Formatting.GRAY + "Input Tier: " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(inputTier.toString()))); - info.add(new LiteralText(Formatting.GRAY + "Output Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxOutput()))); + info.add(new LiteralText(Formatting.GRAY + "Output Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxOutput(EnergySide.UNKNOWN)))); info.add(new LiteralText(Formatting.GRAY + "Output Tier: " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(ouputTier.toString()))); } diff --git a/src/main/java/techreborn/blocks/cable/BlockCable.java b/src/main/java/techreborn/blocks/cable/BlockCable.java index cb2823a6e..93b086287 100644 --- a/src/main/java/techreborn/blocks/cable/BlockCable.java +++ b/src/main/java/techreborn/blocks/cable/BlockCable.java @@ -46,13 +46,13 @@ import net.minecraft.world.BlockView; import net.minecraft.world.IWorld; import net.minecraft.world.World; import reborncore.api.ToolManager; -import reborncore.api.power.EnergyBlockEntity; import reborncore.common.blocks.BlockWrenchEventHandler; import reborncore.common.util.WrenchUtils; +import team.reborn.energy.Energy; +import techreborn.blockentity.cable.CableBlockEntity; import techreborn.config.TechRebornConfig; import techreborn.init.ModSounds; import techreborn.init.TRContent; -import techreborn.blockentity.cable.CableBlockEntity; import techreborn.utils.damageSources.ElectrialShockSource; import javax.annotation.Nullable; @@ -112,7 +112,7 @@ public class BlockCable extends BlockWithEntity { private Boolean canConnectTo(IWorld world, BlockPos pos, Direction facing) { BlockEntity blockEntity = world.getBlockEntity(pos); - if (blockEntity != null && (blockEntity instanceof EnergyBlockEntity || blockEntity instanceof CableBlockEntity)) { + if (blockEntity != null && (Energy.valid(blockEntity) || blockEntity instanceof CableBlockEntity)) { return Boolean.TRUE; } return Boolean.FALSE; diff --git a/src/main/java/techreborn/blocks/lighting/BlockLamp.java b/src/main/java/techreborn/blocks/lighting/BlockLamp.java index 7661a4075..bd561f2ba 100644 --- a/src/main/java/techreborn/blocks/lighting/BlockLamp.java +++ b/src/main/java/techreborn/blocks/lighting/BlockLamp.java @@ -24,11 +24,8 @@ package techreborn.blocks.lighting; -import net.minecraft.block.Block; -import net.minecraft.block.BlockRenderLayer; -import net.minecraft.block.BlockRenderType; -import net.minecraft.block.BlockState; -import net.minecraft.block.Material; +import net.fabricmc.fabric.api.block.FabricBlockSettings; +import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemPlacementContext; @@ -59,14 +56,13 @@ public class BlockLamp extends BaseBlockEntityProvider { protected final VoxelShape[] shape; private int cost; - private int brightness; + private static int brightness = 15; - public BlockLamp(int brightness, int cost, double depth, double width) { - super(Block.Settings.of(Material.REDSTONE_LAMP).strength(2f, 2f)); - this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); + public BlockLamp(int cost, double depth, double width) { + super(FabricBlockSettings.of(Material.REDSTONE_LAMP).strength(2f, 2f).lightLevel(brightness).build()); this.shape = GenCuboidShapes(depth, width); this.cost = cost; - this.brightness = brightness; + this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); BlockWrenchEventHandler.wrenableBlocks.add(this); } @@ -135,6 +131,7 @@ public class BlockLamp extends BaseBlockEntityProvider { return state.get(ACTIVE) ? brightness : 0; } + @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; diff --git a/src/main/java/techreborn/blocks/misc/BlockRubberLog.java b/src/main/java/techreborn/blocks/misc/BlockRubberLog.java index 171e92b01..f399719bc 100644 --- a/src/main/java/techreborn/blocks/misc/BlockRubberLog.java +++ b/src/main/java/techreborn/blocks/misc/BlockRubberLog.java @@ -43,15 +43,13 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.util.WorldUtils; +import team.reborn.energy.Energy; import techreborn.events.TRRecipeHandler; import techreborn.init.ModSounds; import techreborn.init.TRContent; import techreborn.items.tool.ItemTreeTap; -import techreborn.items.tool.basic.ItemElectricTreetap; - import java.util.Random; /** @@ -121,22 +119,16 @@ public class BlockRubberLog extends LogBlock { if (stack.isEmpty()) { return false; } - - //TODO: Should it be here?? - ItemPowerManager capEnergy = null; - if (stack.getItem() instanceof ItemElectricTreetap) { - capEnergy = new ItemPowerManager(stack); - } - if ((capEnergy != null && capEnergy.getEnergyStored() > 20) || stack.getItem() instanceof ItemTreeTap) { + + if ((Energy.valid(stack) && Energy.of(stack).getEnergy() > 20) || stack.getItem() instanceof ItemTreeTap) { if (state.get(HAS_SAP) && state.get(SAP_SIDE) == hitResult.getSide()) { worldIn.setBlockState(pos, state.with(HAS_SAP, false).with(SAP_SIDE, Direction.fromHorizontal(0))); worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.SAP_EXTRACT, SoundCategory.BLOCKS, 0.6F, 1F); if (!worldIn.isClient) { - if (capEnergy != null) { - capEnergy.useEnergy(20, false); - - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn); + if (Energy.valid(stack)) { + Energy.of(stack).use(20); + ExternalPowerSystems.requestEnergyFromArmor(stack, playerIn); } else { playerIn.getStackInHand(Hand.MAIN_HAND).damage(1, playerIn, playerEntity -> {}); } @@ -152,14 +144,4 @@ public class BlockRubberLog extends LogBlock { } return false; } - -// @Override -// public void getDrops(BlockState state, DefaultedList drops, World world, BlockPos pos, int fortune) { -// drops.add(new ItemStack(this)); -// if (state.get(HAS_SAP)) { -// if (new Random().nextInt(4) == 0) { -// drops.add(TRContent.Parts.SAP.getStack()); -// } -// } -// } } diff --git a/src/main/java/techreborn/client/gui/GuiQuantumTank.java b/src/main/java/techreborn/client/gui/GuiQuantumTank.java index 1b2afc9ba..173d8090f 100644 --- a/src/main/java/techreborn/client/gui/GuiQuantumTank.java +++ b/src/main/java/techreborn/client/gui/GuiQuantumTank.java @@ -24,11 +24,11 @@ package techreborn.client.gui; -import io.github.prospector.silk.fluid.FluidInstance; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.gui.builder.GuiBase; import reborncore.common.fluid.FluidUtil; +import reborncore.common.fluid.container.FluidInstance; import techreborn.blockentity.machine.tier3.QuantumTankBlockEntity; public class GuiQuantumTank extends GuiBase { diff --git a/src/main/java/techreborn/client/render/BaseDynamicFluidBakedModel.java b/src/main/java/techreborn/client/render/BaseDynamicFluidBakedModel.java new file mode 100644 index 000000000..4a13bc709 --- /dev/null +++ b/src/main/java/techreborn/client/render/BaseDynamicFluidBakedModel.java @@ -0,0 +1,113 @@ +package techreborn.client.render; + +import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler; +import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; +import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; +import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; +import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel; +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.fabricmc.indigo.renderer.helper.GeometryHelper; +import net.minecraft.block.BlockState; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.BakedModelManager; +import net.minecraft.client.render.model.BakedQuad; +import net.minecraft.client.render.model.json.ModelItemPropertyOverrideList; +import net.minecraft.client.render.model.json.ModelTransformation; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.util.ModelIdentifier; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockRenderView; +import reborncore.common.fluid.container.ItemFluidInfo; +import reborncore.common.util.Color; + +import javax.annotation.Nullable; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.function.Supplier; + +public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBakedModel { + + public abstract ModelIdentifier getBaseModel(); + public abstract ModelIdentifier getBackgroundModel(); + public abstract ModelIdentifier getFluidModel(); + + @Override + public void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { + Fluid fluid = Fluids.EMPTY; + if (stack.getItem() instanceof ItemFluidInfo) { + ItemFluidInfo fluidInfo = (ItemFluidInfo) stack.getItem(); + fluid = fluidInfo.getFluid(stack); + + } + BakedModelManager bakedModelManager = MinecraftClient.getInstance().getBakedModelManager(); + context.fallbackConsumer().accept(bakedModelManager.getModel(getBaseModel())); + context.fallbackConsumer().accept(bakedModelManager.getModel(getBackgroundModel())); + + if (fluid != Fluids.EMPTY) { + FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); + BakedModel fluidModel = bakedModelManager.getModel(getFluidModel()); + int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getBlockPos(), fluid.getDefaultState()); + Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0]; + int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor(); + context.pushTransform(quad -> { + quad.nominalFace(GeometryHelper.lightFace(quad)); + quad.spriteColor(0, color, color, color, color); + quad.spriteBake(0, fluidSprite, MutableQuadView.BAKE_LOCK_UV); + return true; + }); + final QuadEmitter emitter = context.getEmitter(); + fluidModel.getQuads(null, null, randomSupplier.get()).forEach(q -> { + emitter.fromVanilla(q.getVertexData(), 0, false); + emitter.emit(); + }); + context.popTransform(); + } + } + + @Override + public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier randomSupplier, RenderContext context) { + + } + + @Override + public List getQuads(@Nullable BlockState blockState, @Nullable Direction direction, Random random) { + return Collections.emptyList(); + } + + @Override + public boolean isVanillaAdapter() { + return false; + } + + @Override + public boolean useAmbientOcclusion() { + return true; + } + + @Override + public boolean hasDepthInGui() { + return false; + } + + @Override + public boolean isBuiltin() { + return false; + } + + @Override + public ModelTransformation getTransformation() { + return ModelHelper.DEFAULT_ITEM_TRANSFORMS; + } + + @Override + public ModelItemPropertyOverrideList getItemPropertyOverrides() { + return ModelItemPropertyOverrideList.EMPTY; + } + +} diff --git a/src/main/java/techreborn/client/render/DynamicBucketBakedModel.java b/src/main/java/techreborn/client/render/DynamicBucketBakedModel.java index 5cc58805c..75a736f81 100644 --- a/src/main/java/techreborn/client/render/DynamicBucketBakedModel.java +++ b/src/main/java/techreborn/client/render/DynamicBucketBakedModel.java @@ -24,126 +24,35 @@ package techreborn.client.render; -import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler; -import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; -import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; -import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; -import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel; -import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; -import net.fabricmc.indigo.renderer.helper.GeometryHelper; -import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.model.BakedModel; -import net.minecraft.client.render.model.BakedModelManager; -import net.minecraft.client.render.model.BakedQuad; -import net.minecraft.client.render.model.json.ModelItemPropertyOverrideList; -import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.ModelIdentifier; -import net.minecraft.fluid.Fluid; -import net.minecraft.fluid.Fluids; -import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockRenderView; -import reborncore.common.fluid.container.ItemFluidInfo; -import reborncore.common.util.Color; import techreborn.TechReborn; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import java.util.function.Supplier; - -public class DynamicBucketBakedModel implements BakedModel, FabricBakedModel { - - private final Fluid fluid; +public class DynamicBucketBakedModel extends BaseDynamicFluidBakedModel { private static final ModelIdentifier BUCKET_BASE = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_base"), "inventory"); private static final ModelIdentifier BUCKET_BACKGROUND = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_background"), "inventory"); private static final ModelIdentifier BUCKET_FLUID = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_fluid"), "inventory"); - public DynamicBucketBakedModel(Fluid fluid) { - this.fluid = fluid; - } - - @Override - public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier randomSupplier, RenderContext context) { - - } - - @Override - public void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { - Fluid fluid = Fluids.EMPTY; - if (stack.getItem() instanceof ItemFluidInfo) { - ItemFluidInfo fluidInfo = (ItemFluidInfo) stack.getItem(); - fluid = fluidInfo.getFluid(stack); - - } - BakedModelManager bakedModelManager = MinecraftClient.getInstance().getBakedModelManager(); - context.fallbackConsumer().accept(bakedModelManager.getModel(BUCKET_BASE)); - context.fallbackConsumer().accept(bakedModelManager.getModel(BUCKET_BACKGROUND)); - - if (fluid != Fluids.EMPTY) { - FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); - BakedModel fluidModel = bakedModelManager.getModel(BUCKET_FLUID); - int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getBlockPos(), fluid.getDefaultState()); - Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0]; - int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor(); - context.pushTransform(quad -> { - quad.nominalFace(GeometryHelper.lightFace(quad)); - quad.spriteColor(0, color, color, color, color); - quad.spriteBake(0, fluidSprite, MutableQuadView.BAKE_LOCK_UV); - return true; - }); - final QuadEmitter emitter = context.getEmitter(); - fluidModel.getQuads(null, null, randomSupplier.get()).forEach(q -> { - emitter.fromVanilla(q.getVertexData(), 0, false); - emitter.emit(); - }); - context.popTransform(); - } - } - - @Override - public List getQuads(@Nullable BlockState blockState, @Nullable Direction direction, Random random) { - return Collections.emptyList(); - } - - @Override - public boolean isVanillaAdapter() { - return false; - } - - @Override - public boolean useAmbientOcclusion() { - return true; - } - - @Override - public boolean hasDepthInGui() { - return false; - } - - @Override - public boolean isBuiltin() { - return false; - } - @Override public Sprite getSprite() { return MinecraftClient.getInstance().getSpriteAtlas().getSprite(new Identifier("minecraft:item/bucket")); } @Override - public ModelTransformation getTransformation() { - return ModelHelper.DEFAULT_ITEM_TRANSFORMS; + public ModelIdentifier getBaseModel() { + return BUCKET_BASE; } @Override - public ModelItemPropertyOverrideList getItemPropertyOverrides() { - return ModelItemPropertyOverrideList.EMPTY; + public ModelIdentifier getBackgroundModel() { + return BUCKET_BACKGROUND; + } + + @Override + public ModelIdentifier getFluidModel() { + return BUCKET_FLUID; } } diff --git a/src/main/java/techreborn/client/render/DynamicCellBakedModel.java b/src/main/java/techreborn/client/render/DynamicCellBakedModel.java index a7e1aa233..310c45601 100644 --- a/src/main/java/techreborn/client/render/DynamicCellBakedModel.java +++ b/src/main/java/techreborn/client/render/DynamicCellBakedModel.java @@ -24,123 +24,50 @@ package techreborn.client.render; -import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler; -import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; -import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; -import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; -import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel; import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; -import net.fabricmc.indigo.renderer.helper.GeometryHelper; -import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedModelManager; -import net.minecraft.client.render.model.BakedQuad; -import net.minecraft.client.render.model.json.ModelItemPropertyOverrideList; -import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.ModelIdentifier; -import net.minecraft.fluid.Fluid; -import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockRenderView; -import reborncore.common.fluid.container.ItemFluidInfo; -import reborncore.common.util.Color; import techreborn.TechReborn; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.List; import java.util.Random; import java.util.function.Supplier; -public class DynamicCellBakedModel implements BakedModel, FabricBakedModel { +public class DynamicCellBakedModel extends BaseDynamicFluidBakedModel { private static final ModelIdentifier CELL_BASE = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_base"), "inventory"); private static final ModelIdentifier CELL_BACKGROUND = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_background"), "inventory"); private static final ModelIdentifier CELL_FLUID = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_fluid"), "inventory"); private static final ModelIdentifier CELL_GLASS = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_glass"), "inventory"); - @Override - public void emitBlockQuads(BlockRenderView blockRenderView, BlockState blockState, BlockPos blockPos, Supplier supplier, RenderContext renderContext) { - - } - @Override public void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { - Fluid fluid = Fluids.EMPTY; - if (stack.getItem() instanceof ItemFluidInfo) { - ItemFluidInfo fluidInfo = (ItemFluidInfo) stack.getItem(); - fluid = fluidInfo.getFluid(stack); + super.emitItemQuads(stack, randomSupplier, context); - } BakedModelManager bakedModelManager = MinecraftClient.getInstance().getBakedModelManager(); - context.fallbackConsumer().accept(bakedModelManager.getModel(CELL_BASE)); - context.fallbackConsumer().accept(bakedModelManager.getModel(CELL_BACKGROUND)); - - if (fluid != Fluids.EMPTY) { - FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); - BakedModel fluidModel = bakedModelManager.getModel(CELL_FLUID); - int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getBlockPos(), fluid.getDefaultState()); - Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0]; - int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor(); - context.pushTransform(quad -> { - quad.nominalFace(GeometryHelper.lightFace(quad)); - quad.spriteColor(0, color, color, color, color); - quad.spriteBake(0, fluidSprite, MutableQuadView.BAKE_LOCK_UV); - return true; - }); - final QuadEmitter emitter = context.getEmitter(); - fluidModel.getQuads(null, null, randomSupplier.get()).forEach(q -> { - emitter.fromVanilla(q.getVertexData(), 0, false); - emitter.emit(); - }); - context.popTransform(); - } - context.fallbackConsumer().accept(bakedModelManager.getModel(CELL_GLASS)); } - @Override - public List getQuads(@Nullable BlockState blockState, @Nullable Direction direction, Random random) { - return Collections.emptyList(); - } - - @Override - public boolean isVanillaAdapter() { - return false; - } - - @Override - public boolean useAmbientOcclusion() { - return true; - } - - @Override - public boolean hasDepthInGui() { - return false; - } - - @Override - public boolean isBuiltin() { - return false; - } - @Override public Sprite getSprite() { return MinecraftClient.getInstance().getSpriteAtlas().getSprite(new Identifier("techreborn:item/cell_base")); } @Override - public ModelTransformation getTransformation() { - return ModelHelper.DEFAULT_ITEM_TRANSFORMS; + public ModelIdentifier getBaseModel() { + return CELL_BASE; } @Override - public ModelItemPropertyOverrideList getItemPropertyOverrides() { - return ModelItemPropertyOverrideList.EMPTY; + public ModelIdentifier getBackgroundModel() { + return CELL_BACKGROUND; + } + + @Override + public ModelIdentifier getFluidModel() { + return CELL_FLUID; } } diff --git a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java index 90639af23..b338daadb 100644 --- a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java +++ b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java @@ -38,6 +38,7 @@ import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; import reborncore.common.crafting.RebornRecipe; import reborncore.common.crafting.RebornRecipeType; +import reborncore.common.fluid.container.FluidInstance; import reborncore.common.util.StringUtils; import java.util.Collections; @@ -45,8 +46,6 @@ import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; -import io.github.prospector.silk.fluid.FluidInstance; - public class MachineRecipeCategory implements RecipeCategory> { private final RebornRecipeType rebornRecipeType; diff --git a/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java b/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java index f0958c011..2a497da98 100644 --- a/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java +++ b/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java @@ -28,6 +28,7 @@ import me.shedaniel.rei.api.RecipeDisplay; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; import reborncore.common.crafting.ingredient.RebornIngredient; +import reborncore.common.fluid.container.FluidInstance; import techreborn.api.recipe.recipes.BlastFurnaceRecipe; import reborncore.common.crafting.RebornFluidRecipe; import reborncore.common.crafting.RebornRecipe; @@ -36,8 +37,6 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import io.github.prospector.silk.fluid.FluidInstance; - public class MachineRecipeDisplay implements RecipeDisplay { private final R recipe; diff --git a/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeCategory.java b/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeCategory.java index 328111d84..7123b3ab9 100644 --- a/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeCategory.java +++ b/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeCategory.java @@ -4,7 +4,6 @@ import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; -import io.github.prospector.silk.fluid.FluidInstance; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.api.RecipeCategory; @@ -21,6 +20,7 @@ import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; import reborncore.common.crafting.RebornRecipeType; +import reborncore.common.fluid.container.FluidInstance; import reborncore.common.util.StringUtils; import techreborn.api.recipe.recipes.FluidReplicatorRecipe; import techreborn.compat.rei.ReiPlugin; diff --git a/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeDisplay.java b/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeDisplay.java index e247b9de1..bad1e672a 100644 --- a/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeDisplay.java +++ b/src/main/java/techreborn/compat/rei/fluidreplicator/FluidReplicatorRecipeDisplay.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import io.github.prospector.silk.fluid.FluidInstance; +import reborncore.common.fluid.container.FluidInstance; import me.shedaniel.rei.api.RecipeDisplay; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; diff --git a/src/main/java/techreborn/events/StackToolTipHandler.java b/src/main/java/techreborn/events/StackToolTipHandler.java index 7af2e6b9b..453aae789 100644 --- a/src/main/java/techreborn/events/StackToolTipHandler.java +++ b/src/main/java/techreborn/events/StackToolTipHandler.java @@ -40,10 +40,11 @@ import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.registry.Registry; import reborncore.api.IListInfoProvider; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.StringUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; import techreborn.TechReborn; import java.util.List; @@ -59,11 +60,10 @@ public class StackToolTipHandler implements ItemTooltipCallback { Item item = stack.getItem(); if (item instanceof IListInfoProvider) { ((IListInfoProvider) item).addInfo(components, false, false); - } else if (stack.getItem() instanceof IEnergyItemInfo) { - ItemPowerManager itemPowerManager = new ItemPowerManager(stack); - LiteralText line1 = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix(itemPowerManager.getEnergyStored())); + } else if (stack.getItem() instanceof EnergyHolder) { + LiteralText line1 = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix(Energy.of(stack).getEnergy())); line1.append("/"); - line1.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix(itemPowerManager.getMaxEnergyStored())); + line1.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix(Energy.of(stack).getMaxStored())); line1.append(" "); line1.append(PowerSystem.getDisplayPower().abbreviation); line1.formatted(Formatting.GOLD); @@ -71,11 +71,11 @@ public class StackToolTipHandler implements ItemTooltipCallback { components.add(1, line1); if (Screen.hasShiftDown()) { - int percentage = percentage(itemPowerManager.getMaxEnergyStored(), itemPowerManager.getEnergyStored()); + int percentage = percentage(Energy.of(stack).getMaxStored(), Energy.of(stack).getEnergy()); Formatting color = StringUtils.getPercentageColour(percentage); components.add(2, new LiteralText(color + "" + percentage + "%" + Formatting.GRAY + " Charged")); // TODO: show both input and output rates - components.add(3, new LiteralText(Formatting.GRAY + "I/O Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted(((IEnergyItemInfo) item).getMaxInput()))); + components.add(3, new LiteralText(Formatting.GRAY + "I/O Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted(((EnergyHolder) item).getMaxInput(EnergySide.UNKNOWN)))); } } else { try { @@ -105,4 +105,10 @@ public class StackToolTipHandler implements ItemTooltipCallback { return (int) ((CurrentValue * 100.0f) / MaxValue); } + public int percentage(double MaxValue, double CurrentValue) { + if (CurrentValue == 0) + return 0; + return (int) ((CurrentValue * 100.0f) / MaxValue); + } + } diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index c86773047..c7b386cb2 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -32,8 +32,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; import reborncore.api.blockentity.IUpgrade; -import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.blockentity.ChargeOMatBlockEntity; import techreborn.blockentity.DigitalChestBlockEntity; @@ -208,12 +209,12 @@ public class TRContent { public static Item PERIDOT_BOOTS; public enum SolarPanels implements ItemConvertible { - BASIC(EnumPowerTier.MICRO, TechRebornConfig.basicGenerationRateD, TechRebornConfig.basicGenerationRateN), - ADVANCED(EnumPowerTier.LOW, TechRebornConfig.advancedGenerationRateD, TechRebornConfig.advancedGenerationRateN), - INDUSTRIAL(EnumPowerTier.MEDIUM, TechRebornConfig.industrialGenerationRateD, TechRebornConfig.industrialGenerationRateN), - ULTIMATE(EnumPowerTier.HIGH, TechRebornConfig.ultimateGenerationRateD, TechRebornConfig.ultimateGenerationRateN), - QUANTUM(EnumPowerTier.EXTREME, TechRebornConfig.quantumGenerationRateD, TechRebornConfig.quantumGenerationRateN), - CREATIVE(EnumPowerTier.INFINITE, Integer.MAX_VALUE / 100, Integer.MAX_VALUE / 100); + BASIC(EnergyTier.MICRO, TechRebornConfig.basicGenerationRateD, TechRebornConfig.basicGenerationRateN), + ADVANCED(EnergyTier.LOW, TechRebornConfig.advancedGenerationRateD, TechRebornConfig.advancedGenerationRateN), + INDUSTRIAL(EnergyTier.MEDIUM, TechRebornConfig.industrialGenerationRateD, TechRebornConfig.industrialGenerationRateN), + ULTIMATE(EnergyTier.HIGH, TechRebornConfig.ultimateGenerationRateD, TechRebornConfig.ultimateGenerationRateN), + QUANTUM(EnergyTier.EXTREME, TechRebornConfig.quantumGenerationRateD, TechRebornConfig.quantumGenerationRateN), + CREATIVE(EnergyTier.INFINITE, Integer.MAX_VALUE / 100, Integer.MAX_VALUE / 100); public final String name; public final Block block; @@ -224,9 +225,9 @@ public class TRContent { public int generationRateN; // Internal EU storage of solar panel public int internalCapacity; - public final EnumPowerTier powerTier; + public final EnergyTier powerTier; - SolarPanels(EnumPowerTier tier, int generationRateD, int generationRateN) { + SolarPanels(EnergyTier tier, int generationRateD, int generationRateN) { name = this.toString().toLowerCase(Locale.ROOT); powerTier = tier; block = new BlockSolarPanel(this); @@ -245,15 +246,15 @@ public class TRContent { } public 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), - HV(2048, 12.0, true, EnumPowerTier.EXTREME), - GLASSFIBER(8192, 12.0, false, EnumPowerTier.INSANE), - INSULATED_COPPER(128, 10.0, false, EnumPowerTier.MEDIUM), - INSULATED_GOLD(512, 10.0, false, EnumPowerTier.HIGH), - INSULATED_HV(2048, 10.0, false, EnumPowerTier.EXTREME), - SUPERCONDUCTOR(Integer.MAX_VALUE / 4, 10.0, false, EnumPowerTier.INFINITE); + COPPER(128, 12.0, true, EnergyTier.MEDIUM), + TIN(32, 12.0, true, EnergyTier.LOW), + GOLD(512, 12.0, true, EnergyTier.HIGH), + HV(2048, 12.0, true, EnergyTier.EXTREME), + GLASSFIBER(8192, 12.0, false, EnergyTier.INSANE), + INSULATED_COPPER(128, 10.0, false, EnergyTier.MEDIUM), + INSULATED_GOLD(512, 10.0, false, EnergyTier.HIGH), + INSULATED_HV(2048, 10.0, false, EnergyTier.EXTREME), + SUPERCONDUCTOR(Integer.MAX_VALUE / 4, 10.0, false, EnergyTier.INFINITE); public final String name; @@ -264,10 +265,10 @@ public class TRContent { public double cableThickness; public boolean canKill; public boolean defaultCanKill; - public EnumPowerTier tier; + public EnergyTier tier; - Cables(int transferRate, double cableThickness, boolean canKill, EnumPowerTier tier) { + Cables(int transferRate, double cableThickness, boolean canKill, EnergyTier tier) { name = this.toString().toLowerCase(Locale.ROOT); this.transferRate = transferRate; this.defaultTransferRate = transferRate; @@ -444,8 +445,8 @@ public class TRContent { ALARM(new BlockAlarm()), CHUNK_LOADER(new GenericMachineBlock(EGui.CHUNK_LOADER, ChunkLoaderBlockEntity::new)), - LAMP_INCANDESCENT(new BlockLamp(14, 4, 10, 8)), - LAMP_LED(new BlockLamp(15, 1, 1, 12)), + LAMP_INCANDESCENT(new BlockLamp(4, 10, 8)), + LAMP_LED(new BlockLamp(1, 1, 12)), PLAYER_DETECTOR(new BlockPlayerDetector()); public final String name; @@ -718,7 +719,7 @@ public class TRContent { handler.addSpeedMulti(TechRebornConfig.overclockerSpeed); handler.addPowerMulti(TechRebornConfig.overclockerPower); if (powerAcceptor != null) { - powerAcceptor.extraPowerInput += powerAcceptor.getMaxInput(); + powerAcceptor.extraPowerInput += powerAcceptor.getMaxInput(EnergySide.UNKNOWN); powerAcceptor.extraPowerStorage += powerAcceptor.getBaseMaxPower(); } }), diff --git a/src/main/java/techreborn/items/armor/ItemCloakingDevice.java b/src/main/java/techreborn/items/armor/ItemCloakingDevice.java index b58a53d1f..59a076c82 100644 --- a/src/main/java/techreborn/items/armor/ItemCloakingDevice.java +++ b/src/main/java/techreborn/items/armor/ItemCloakingDevice.java @@ -34,16 +34,18 @@ import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.config.TechRebornConfig; import techreborn.init.TRArmorMaterial; import techreborn.init.TRContent; import techreborn.utils.InitUtils; -public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo { +public class ItemCloakingDevice extends ItemTRArmour implements EnergyHolder { public static int maxCharge = TechRebornConfig.cloakingDeviceCharge; public static int usage = TechRebornConfig.cloackingDeviceUsage; @@ -59,21 +61,18 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if (entityIn instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) entityIn; - ItemPowerManager capEnergy = new ItemPowerManager(stack); - if (capEnergy != null && capEnergy.getEnergyStored() >= usage) { - capEnergy.useEnergy(usage, false); - player.setInvisible(true); - } else { - if (!player.hasStatusEffect(StatusEffects.INVISIBILITY)) { - player.setInvisible(false); + + if (Energy.valid(stack)) { + if(Energy.of(stack).use(usage)){ + player.setInvisible(true); + } else { + if (!player.hasStatusEffect(StatusEffects.INVISIBILITY)) { + player.setInvisible(false); + } } } } } - - public void onArmorTick(World world, PlayerEntity player, ItemStack stack) { - - } @Environment(EnvType.CLIENT) @Override @@ -83,7 +82,7 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo } InitUtils.initPoweredItems(TRContent.CLOAKING_DEVICE, itemList); } - + @Override public double getDurability(ItemStack stack) { return 1 - ItemUtils.getPowerForDurabilityBar(stack); @@ -99,20 +98,24 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo return PowerSystem.getDisplayPower().colour; } - // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.HIGH; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } } diff --git a/src/main/java/techreborn/items/armor/ItemLapotronicOrbpack.java b/src/main/java/techreborn/items/armor/ItemLapotronicOrbpack.java index 1ce0b16ab..cf5470b5e 100644 --- a/src/main/java/techreborn/items/armor/ItemLapotronicOrbpack.java +++ b/src/main/java/techreborn/items/armor/ItemLapotronicOrbpack.java @@ -27,20 +27,24 @@ package techreborn.items.armor; import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.*; +import net.minecraft.item.ArmorItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.config.TechRebornConfig; import techreborn.init.TRArmorMaterial; import techreborn.init.TRContent; import techreborn.utils.InitUtils; -public class ItemLapotronicOrbpack extends ArmorItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemLapotronicOrbpack extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions { // 400M FE maxCharge and 100k FE\t charge rate. Fully charged in 3 mins. public static final int maxCharge = TechRebornConfig.lapotronPackCharge; @@ -62,8 +66,7 @@ public class ItemLapotronicOrbpack extends ArmorItem implements IEnergyItemInfo, @Override public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if (entityIn instanceof PlayerEntity) { - ItemLithiumIonBatpack.distributePowerToInventory(worldIn, (PlayerEntity) entityIn, stack, - (int) transferLimit); + ItemLithiumIonBatpack.distributePowerToInventory(worldIn, (PlayerEntity) entityIn, stack, transferLimit); } } @@ -84,17 +87,12 @@ public class ItemLapotronicOrbpack extends ArmorItem implements IEnergyItemInfo, // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { - return transferLimit; - } - - @Override - public int getMaxOutput() { - return transferLimit; + public EnergyTier getTier() { + return EnergyTier.EXTREME; } } diff --git a/src/main/java/techreborn/items/armor/ItemLithiumIonBatpack.java b/src/main/java/techreborn/items/armor/ItemLithiumIonBatpack.java index c954ac569..405a04661 100644 --- a/src/main/java/techreborn/items/armor/ItemLithiumIonBatpack.java +++ b/src/main/java/techreborn/items/armor/ItemLithiumIonBatpack.java @@ -29,22 +29,25 @@ import net.fabricmc.api.Environment; import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.*; +import net.minecraft.item.ArmorItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.config.TechRebornConfig; import techreborn.init.TRArmorMaterial; import techreborn.init.TRContent; import techreborn.utils.InitUtils; -public class ItemLithiumIonBatpack extends ArmorItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemLithiumIonBatpack extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions { // 8M FE maxCharge and 2k FE\t charge rate. Fully charged in 3 mins. public static final int maxCharge = TechRebornConfig.lithiumBatpackCharge; @@ -59,11 +62,9 @@ public class ItemLithiumIonBatpack extends ArmorItem implements IEnergyItemInfo, return; } - ItemPowerManager capEnergy = new ItemPowerManager(itemStack); - for (int i = 0; i < player.inventory.getInvSize(); i++) { if (!player.inventory.getInvStack(i).isEmpty()) { - ExternalPowerSystems.chargeItem(capEnergy, player.inventory.getInvStack(i)); + ExternalPowerSystems.chargeItem(itemStack, player.inventory.getInvStack(i)); } } } @@ -102,17 +103,13 @@ public class ItemLithiumIonBatpack extends ArmorItem implements IEnergyItemInfo, // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { - return transferLimit; + public EnergyTier getTier() { + return EnergyTier.HIGH; } - @Override - public int getMaxOutput() { - return transferLimit; - } } diff --git a/src/main/java/techreborn/items/battery/ItemBattery.java b/src/main/java/techreborn/items/battery/ItemBattery.java index 5d14c1223..73c07426e 100644 --- a/src/main/java/techreborn/items/battery/ItemBattery.java +++ b/src/main/java/techreborn/items/battery/ItemBattery.java @@ -32,29 +32,30 @@ import net.minecraft.item.ItemPropertyGetter; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import javax.annotation.Nullable; -public class ItemBattery extends Item implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemBattery extends Item implements EnergyHolder, ItemDurabilityExtensions { - int maxEnergy = 0; - int maxTransfer = 0; + private final int maxEnergy; + private final EnergyTier tier; - public ItemBattery(int maxEnergy, int maxTransfer) { + public ItemBattery(int maxEnergy, EnergyTier tier) { super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamageIfAbsent(1)); this.maxEnergy = maxEnergy; - this.maxTransfer = maxTransfer; + this.tier = tier; this.addPropertyGetter(new Identifier("techreborn:empty"), new ItemPropertyGetter() { @Override @Environment(EnvType.CLIENT) public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) { - if (!stack.isEmpty() && new ItemPowerManager(stack).getEnergyStored() == 0) { + if (!stack.isEmpty() && Energy.of(stack).getEnergy() == 0) { return 1.0F; } return 0.0F; @@ -80,17 +81,12 @@ public class ItemBattery extends Item implements IEnergyItemInfo, ItemDurability // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxEnergy; } @Override - public int getMaxInput() { - return maxTransfer; - } - - @Override - public int getMaxOutput() { - return maxTransfer; + public EnergyTier getTier() { + return tier; } } diff --git a/src/main/java/techreborn/items/battery/ItemEnergyCrystal.java b/src/main/java/techreborn/items/battery/ItemEnergyCrystal.java index c51b52b41..1b35417dd 100644 --- a/src/main/java/techreborn/items/battery/ItemEnergyCrystal.java +++ b/src/main/java/techreborn/items/battery/ItemEnergyCrystal.java @@ -29,6 +29,7 @@ import net.fabricmc.api.Environment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; +import team.reborn.energy.EnergyTier; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import techreborn.utils.InitUtils; @@ -37,7 +38,7 @@ public class ItemEnergyCrystal extends ItemBattery { // 4M FE storage with 1k charge rate public ItemEnergyCrystal() { - super(TechRebornConfig.energyCrystalMaxCharge, 1_000); + super(TechRebornConfig.energyCrystalMaxCharge, EnergyTier.HIGH); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/items/battery/ItemLapotronCrystal.java b/src/main/java/techreborn/items/battery/ItemLapotronCrystal.java index e5a875596..62b196d0f 100644 --- a/src/main/java/techreborn/items/battery/ItemLapotronCrystal.java +++ b/src/main/java/techreborn/items/battery/ItemLapotronCrystal.java @@ -29,6 +29,7 @@ import net.fabricmc.api.Environment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; +import team.reborn.energy.EnergyTier; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import techreborn.utils.InitUtils; @@ -37,7 +38,7 @@ public class ItemLapotronCrystal extends ItemBattery { // 40M FE capacity with 10k FE\t charge rate public ItemLapotronCrystal() { - super(TechRebornConfig.lapotronCrystalMaxCharge, 10_000); + super(TechRebornConfig.lapotronCrystalMaxCharge, EnergyTier.EXTREME); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/items/battery/ItemLapotronicOrb.java b/src/main/java/techreborn/items/battery/ItemLapotronicOrb.java index 07209083c..267e6042e 100644 --- a/src/main/java/techreborn/items/battery/ItemLapotronicOrb.java +++ b/src/main/java/techreborn/items/battery/ItemLapotronicOrb.java @@ -29,6 +29,7 @@ import net.fabricmc.api.Environment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; +import team.reborn.energy.EnergyTier; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import techreborn.utils.InitUtils; @@ -37,7 +38,7 @@ public class ItemLapotronicOrb extends ItemBattery { // 400M capacity with 100k FE\t charge rate public ItemLapotronicOrb() { - super(TechRebornConfig.lapotronicOrbMaxCharge, 100_000); + super(TechRebornConfig.lapotronicOrbMaxCharge, EnergyTier.EXTREME); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/items/battery/ItemLithiumIonBattery.java b/src/main/java/techreborn/items/battery/ItemLithiumIonBattery.java index 86ffd27cc..e4bffa26b 100644 --- a/src/main/java/techreborn/items/battery/ItemLithiumIonBattery.java +++ b/src/main/java/techreborn/items/battery/ItemLithiumIonBattery.java @@ -29,6 +29,7 @@ import net.fabricmc.api.Environment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; +import team.reborn.energy.EnergyTier; import techreborn.init.TRContent; import techreborn.utils.InitUtils; @@ -36,7 +37,7 @@ public class ItemLithiumIonBattery extends ItemBattery { // 400k FE with 1k FE\t charge rate public ItemLithiumIonBattery() { - super(400_000, 1_000); + super(400_000, EnergyTier.HIGH); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/items/battery/ItemRedCellBattery.java b/src/main/java/techreborn/items/battery/ItemRedCellBattery.java index 9c40f8d32..bb8a02e1b 100644 --- a/src/main/java/techreborn/items/battery/ItemRedCellBattery.java +++ b/src/main/java/techreborn/items/battery/ItemRedCellBattery.java @@ -29,6 +29,7 @@ import net.fabricmc.api.Environment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; +import team.reborn.energy.EnergyTier; import techreborn.init.TRContent; import techreborn.utils.InitUtils; @@ -36,7 +37,7 @@ public class ItemRedCellBattery extends ItemBattery { // 40k FE capacity with 100 FE\t charge rate public ItemRedCellBattery() { - super(40_000, 100); + super(40_000, EnergyTier.LOW); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/items/tool/ItemChainsaw.java b/src/main/java/techreborn/items/tool/ItemChainsaw.java index f521f0b8b..94a1e007e 100644 --- a/src/main/java/techreborn/items/tool/ItemChainsaw.java +++ b/src/main/java/techreborn/items/tool/ItemChainsaw.java @@ -35,18 +35,20 @@ import net.minecraft.item.*; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import javax.annotation.Nullable; import java.util.Random; -public class ItemChainsaw extends AxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemChainsaw extends AxeItem implements EnergyHolder, ItemDurabilityExtensions { public int maxCharge = 1; public int cost = 250; @@ -63,7 +65,7 @@ public class ItemChainsaw extends AxeItem implements IEnergyItemInfo, ItemDurabi @Override @Environment(EnvType.CLIENT) public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) { - if (!stack.isEmpty() && new ItemPowerManager(stack).getEnergyStored() >= cost + if (!stack.isEmpty() && Energy.of(stack).getEnergy() >= cost && entityIn != null && entityIn.getMainHandStack().equals(stack)) { return 1.0F; } @@ -75,7 +77,7 @@ public class ItemChainsaw extends AxeItem implements IEnergyItemInfo, ItemDurabi // ItemAxe @Override public float getMiningSpeed(ItemStack stack, BlockState state) { - if (new ItemPowerManager(stack).getEnergyStored() >= cost + if (Energy.of(stack).getEnergy() >= cost && (state.getMaterial() == Material.WOOD)) { return this.poweredSpeed; } else { @@ -88,10 +90,8 @@ public class ItemChainsaw extends AxeItem implements IEnergyItemInfo, ItemDurabi public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) { Random rand = new Random(); if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); + Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); } return true; } @@ -123,17 +123,22 @@ public class ItemChainsaw extends AxeItem implements IEnergyItemInfo, ItemDurabi // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.MEDIUM; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } diff --git a/src/main/java/techreborn/items/tool/ItemDebugTool.java b/src/main/java/techreborn/items/tool/ItemDebugTool.java index d5feb5d3e..fe845bb5b 100644 --- a/src/main/java/techreborn/items/tool/ItemDebugTool.java +++ b/src/main/java/techreborn/items/tool/ItemDebugTool.java @@ -36,8 +36,8 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; import net.minecraft.util.SystemUtil; import net.minecraft.util.registry.Registry; -import reborncore.api.power.EnergyBlockEntity; import reborncore.common.powerSystem.PowerSystem; +import team.reborn.energy.Energy; import techreborn.TechReborn; import java.util.Map.Entry; @@ -65,8 +65,8 @@ public class ItemDebugTool extends Item { BlockEntity blockEntity = context.getWorld().getBlockEntity(context.getBlockPos()); if (blockEntity != null) { sendMessage(context, new LiteralText(getBlockEntityType(blockEntity))); - if (blockEntity instanceof EnergyBlockEntity) { - sendMessage(context, new LiteralText(getRCPower((EnergyBlockEntity) blockEntity))); + if (Energy.valid(blockEntity)) { + sendMessage(context, new LiteralText(getRCPower(blockEntity))); } } return ActionResult.SUCCESS; @@ -109,13 +109,13 @@ public class ItemDebugTool extends Item { return s; } - private String getRCPower(EnergyBlockEntity blockEntity) { + private String getRCPower(BlockEntity blockEntity) { String s = "" + Formatting.GREEN; s += "Power: "; s += Formatting.BLUE; - s += PowerSystem.getLocaliszedPower(blockEntity.getEnergy()); + s += PowerSystem.getLocaliszedPower(Energy.of(blockEntity).getEnergy()); s += "/"; - s += PowerSystem.getLocaliszedPower(blockEntity.getMaxPower()); + s += PowerSystem.getLocaliszedPower(Energy.of(blockEntity).getMaxStored()); return s; } diff --git a/src/main/java/techreborn/items/tool/ItemDrill.java b/src/main/java/techreborn/items/tool/ItemDrill.java index 459901316..706a30140 100644 --- a/src/main/java/techreborn/items/tool/ItemDrill.java +++ b/src/main/java/techreborn/items/tool/ItemDrill.java @@ -31,17 +31,19 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.item.*; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import java.util.Random; -public class ItemDrill extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemDrill extends PickaxeItem implements EnergyHolder, ItemDurabilityExtensions { public int maxCharge = 1; public int cost = 250; @@ -57,7 +59,7 @@ public class ItemDrill extends PickaxeItem implements IEnergyItemInfo, ItemDurab // ItemPickaxe @Override public float getMiningSpeed(ItemStack stack, BlockState state) { - if (new ItemPowerManager(stack).getEnergyStored() < cost) { + if (Energy.of(stack).getEnergy() < cost) { return unpoweredSpeed; } if (Items.WOODEN_PICKAXE.getMiningSpeed(stack, state) > 1.0F @@ -73,10 +75,8 @@ public class ItemDrill extends PickaxeItem implements IEnergyItemInfo, ItemDurab public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) { Random rand = new Random(); if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); + Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); } return true; } @@ -109,17 +109,22 @@ public class ItemDrill extends PickaxeItem implements IEnergyItemInfo, ItemDurab // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.HIGH; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } } diff --git a/src/main/java/techreborn/items/tool/ItemJackhammer.java b/src/main/java/techreborn/items/tool/ItemJackhammer.java index ace9d5c26..b948a28c2 100644 --- a/src/main/java/techreborn/items/tool/ItemJackhammer.java +++ b/src/main/java/techreborn/items/tool/ItemJackhammer.java @@ -35,16 +35,19 @@ import net.minecraft.item.PickaxeItem; import net.minecraft.item.ToolMaterials; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; + import java.util.Random; -public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemJackhammer extends PickaxeItem implements EnergyHolder, ItemDurabilityExtensions { public int maxCharge = 1; public int cost = 250; @@ -58,7 +61,7 @@ public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, Item // ItemPickaxe @Override public float getMiningSpeed(ItemStack stack, BlockState state) { - if (Block.isNaturalStone(state.getBlock()) && new ItemPowerManager(stack).getEnergyStored() >= cost) { + if (Block.isNaturalStone(state.getBlock()) && Energy.of(stack).getEnergy() >= cost) { return miningSpeed; } else { return 0.5F; @@ -70,10 +73,8 @@ public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, Item public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) { Random rand = new Random(); if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); + Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); } return true; } @@ -107,17 +108,22 @@ public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, Item // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.MEDIUM; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } } diff --git a/src/main/java/techreborn/items/tool/advanced/ItemRockCutter.java b/src/main/java/techreborn/items/tool/advanced/ItemRockCutter.java index 071b7475f..f2666f79a 100644 --- a/src/main/java/techreborn/items/tool/advanced/ItemRockCutter.java +++ b/src/main/java/techreborn/items/tool/advanced/ItemRockCutter.java @@ -35,19 +35,21 @@ import net.minecraft.item.*; import net.minecraft.util.DefaultedList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import java.util.Random; -public class ItemRockCutter extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemRockCutter extends PickaxeItem implements EnergyHolder, ItemDurabilityExtensions { public static final int maxCharge = TechRebornConfig.rockCutterCharge; public int transferLimit = 1_000; @@ -69,7 +71,7 @@ public class ItemRockCutter extends PickaxeItem implements IEnergyItemInfo, Item @Override public float getMiningSpeed(ItemStack stack, BlockState state) { - if (new ItemPowerManager(stack).getEnergyStored() < cost) { + if (Energy.of(stack).getEnergy() < cost) { return 2F; } else { return Items.DIAMOND_PICKAXE.getMiningSpeed(stack, state); @@ -81,10 +83,8 @@ public class ItemRockCutter extends PickaxeItem implements IEnergyItemInfo, Item public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) { Random rand = new Random(); if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); + Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); } return true; } @@ -135,8 +135,7 @@ public class ItemRockCutter extends PickaxeItem implements IEnergyItemInfo, Item uncharged.addEnchantment(Enchantments.SILK_TOUCH, 1); ItemStack charged = new ItemStack(TRContent.ROCK_CUTTER); charged.addEnchantment(Enchantments.SILK_TOUCH, 1); - ItemPowerManager capEnergy = new ItemPowerManager(charged); - capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored()); + Energy.of(charged).set(Energy.of(charged).getMaxStored()); itemList.add(uncharged); itemList.add(charged); @@ -144,17 +143,22 @@ public class ItemRockCutter extends PickaxeItem implements IEnergyItemInfo, Item // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.HIGH; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } } diff --git a/src/main/java/techreborn/items/tool/basic/ItemElectricTreetap.java b/src/main/java/techreborn/items/tool/basic/ItemElectricTreetap.java index 370fd02cf..7a6b82fd0 100644 --- a/src/main/java/techreborn/items/tool/basic/ItemElectricTreetap.java +++ b/src/main/java/techreborn/items/tool/basic/ItemElectricTreetap.java @@ -30,19 +30,19 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.DefaultedList; -import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; - import techreborn.init.TRContent; import techreborn.utils.InitUtils; /** * Created by modmuss50 on 05/11/2016. */ -public class ItemElectricTreetap extends Item implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemElectricTreetap extends Item implements EnergyHolder, ItemDurabilityExtensions { public static final int maxCharge = 10_000; public int cost = 20; @@ -77,17 +77,12 @@ public class ItemElectricTreetap extends Item implements IEnergyItemInfo, ItemDu // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { - return 200; - } - - @Override - public int getMaxOutput() { - return 0; + public EnergyTier getTier() { + return EnergyTier.MEDIUM; } } diff --git a/src/main/java/techreborn/items/tool/industrial/ItemIndustrialChainsaw.java b/src/main/java/techreborn/items/tool/industrial/ItemIndustrialChainsaw.java index 59ac4e3fd..b97a9a0c7 100644 --- a/src/main/java/techreborn/items/tool/industrial/ItemIndustrialChainsaw.java +++ b/src/main/java/techreborn/items/tool/industrial/ItemIndustrialChainsaw.java @@ -44,10 +44,10 @@ import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.util.ChatUtils; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import techreborn.items.tool.ItemChainsaw; @@ -117,7 +117,7 @@ public class ItemIndustrialChainsaw extends ItemChainsaw { public TypedActionResult use(final World world, final PlayerEntity player, final Hand hand) { final ItemStack stack = player.getStackInHand(hand); if (player.isSneaking()) { - if (new ItemPowerManager(stack).getEnergyStored() < cost) { + if (Energy.of(stack).getEnergy() < cost) { ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyErrorTo") + " " + Formatting.GOLD + StringUtils.t("techreborn.message.nanosaberActivate"))); @@ -148,7 +148,7 @@ public class ItemIndustrialChainsaw extends ItemChainsaw { @Override public void usageTick(World world, LivingEntity entity, ItemStack stack, int i) { - if (ItemUtils.isActive(stack) && new ItemPowerManager(stack).getEnergyStored() < cost) { + if (ItemUtils.isActive(stack) && Energy.of(stack).getEnergy() < cost) { if(entity.world.isClient){ ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyError") + " " @@ -178,24 +178,21 @@ public class ItemIndustrialChainsaw extends ItemChainsaw { return; } - ItemPowerManager capEnergy = new ItemPowerManager(stack); - if (capEnergy.getEnergyStored() < cost) { - return; + if(Energy.of(stack).use(cost)){ + BlockState blockState = world.getBlockState(pos); + if (blockState.getHardness(world, pos) == -1.0F) { + return; + } + if(!(entityLiving instanceof PlayerEntity)){ + return; + } + + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); + + blockState.getBlock().afterBreak(world, (PlayerEntity) entityLiving, pos, blockState, world.getBlockEntity(pos), stack); + world.setBlockState(pos, Blocks.AIR.getDefaultState()); + world.removeBlockEntity(pos); } - BlockState blockState = world.getBlockState(pos); - if (blockState.getHardness(world, pos) == -1.0F) { - return; - } - if(!(entityLiving instanceof PlayerEntity)){ - return; - } - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); - - blockState.getBlock().afterBreak(world, (PlayerEntity) entityLiving, pos, blockState, world.getBlockEntity(pos), stack); - world.setBlockState(pos, Blocks.AIR.getDefaultState()); - world.removeBlockEntity(pos); } } diff --git a/src/main/java/techreborn/items/tool/industrial/ItemIndustrialDrill.java b/src/main/java/techreborn/items/tool/industrial/ItemIndustrialDrill.java index 53ec6878f..4b083468b 100644 --- a/src/main/java/techreborn/items/tool/industrial/ItemIndustrialDrill.java +++ b/src/main/java/techreborn/items/tool/industrial/ItemIndustrialDrill.java @@ -47,10 +47,10 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.RayTraceContext; import net.minecraft.world.World; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.util.ChatUtils; import reborncore.common.util.ItemUtils; +import team.reborn.energy.Energy; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; import techreborn.items.tool.ItemDrill; @@ -121,11 +121,8 @@ public class ItemIndustrialDrill extends ItemDrill { private void breakBlock(BlockPos pos, World world, PlayerEntity playerIn, ItemStack drill) { BlockState blockState = world.getBlockState(pos); - ItemPowerManager capEnergy = new ItemPowerManager(drill); - - if(capEnergy.getEnergyStored() > cost){ - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn); + if(Energy.of(drill).use(cost)){ + ExternalPowerSystems.requestEnergyFromArmor(drill, playerIn); blockState.getBlock().onBlockRemoved(blockState, world, pos, blockState, true); blockState.getBlock().afterBreak(world, playerIn, pos, blockState, world.getBlockEntity(pos), drill); @@ -176,7 +173,7 @@ public class ItemIndustrialDrill extends ItemDrill { public TypedActionResult use(final World world, final PlayerEntity player, final Hand hand) { final ItemStack stack = player.getStackInHand(hand); if (player.isSneaking()) { - if (new ItemPowerManager(stack).getEnergyStored() < cost) { + if (Energy.of(stack).getEnergy() < cost) { ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyErrorTo") + " " + Formatting.GOLD + StringUtils.t("techreborn.message.nanosaberActivate"))); @@ -207,7 +204,7 @@ public class ItemIndustrialDrill extends ItemDrill { @Override public void usageTick(World world, LivingEntity entity, ItemStack stack, int i) { - if (ItemUtils.isActive(stack) && new ItemPowerManager(stack).getEnergyStored() < cost) { + if (ItemUtils.isActive(stack) && Energy.of(stack).getEnergy() < cost) { if(entity.world.isClient){ ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyError") + " " diff --git a/src/main/java/techreborn/items/tool/industrial/ItemNanosaber.java b/src/main/java/techreborn/items/tool/industrial/ItemNanosaber.java index 53dcdd850..e63549f5b 100644 --- a/src/main/java/techreborn/items/tool/industrial/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tool/industrial/ItemNanosaber.java @@ -28,13 +28,11 @@ import com.google.common.collect.Multimap; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttributeModifier; import net.minecraft.entity.attribute.EntityAttributes; -import reborncore.api.items.ItemStackModifiers; -import reborncore.common.util.StringUtils; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; import net.minecraft.nbt.CompoundTag; @@ -43,13 +41,17 @@ import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.*; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; +import reborncore.api.items.ItemStackModifiers; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ChatUtils; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; +import reborncore.common.util.StringUtils; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; @@ -58,7 +60,7 @@ import techreborn.utils.MessageIDs; import javax.annotation.Nullable; import java.util.List; -public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDurabilityExtensions, ItemStackModifiers { +public class ItemNanosaber extends SwordItem implements EnergyHolder, ItemDurabilityExtensions, ItemStackModifiers { public static final int maxCharge = TechRebornConfig.nanoSaberCharge; public int transferLimit = 1_000; public int cost = 250; @@ -75,8 +77,7 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur @Nullable LivingEntity entityIn) { if (ItemUtils.isActive(stack)) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - if (capEnergy.getMaxEnergyStored() - capEnergy.getEnergyStored() >= 0.9 * capEnergy.getMaxEnergyStored()) { + if (Energy.of(stack).getMaxStored() - Energy.of(stack).getEnergy() >= 0.9 * Energy.of(stack).getMaxStored()) { return 0.5F; } return 1.0F; @@ -89,14 +90,9 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur // ItemSword @Override public boolean postHit(ItemStack stack, LivingEntity entityHit, LivingEntity entityHitter) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - if (capEnergy.getEnergyStored() >= cost) { - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityHitter); - - return true; - } - return false; + boolean used = Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityHitter); + return used; } @Override @@ -114,7 +110,7 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur public TypedActionResult use(final World world, final PlayerEntity player, final Hand hand) { final ItemStack stack = player.getStackInHand(hand); if (player.isSneaking()) { - if (new ItemPowerManager(stack).getEnergyStored() < cost) { + if (Energy.of(stack).getEnergy() < cost) { ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyErrorTo") + " " + Formatting.GOLD + StringUtils.t("techreborn.message.nanosaberActivate"))); @@ -145,7 +141,7 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur @Override public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { - if (ItemUtils.isActive(stack) && new ItemPowerManager(stack).getEnergyStored() < cost) { + if (ItemUtils.isActive(stack) && Energy.of(stack).getEnergy() < cost) { if(worldIn.isClient){ ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new LiteralText( Formatting.GRAY + StringUtils.t("techreborn.message.nanosaberEnergyError") + " " @@ -189,14 +185,12 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER); inactiveCharged.setTag(new CompoundTag()); inactiveCharged.getTag().putBoolean("isActive", false); - ItemPowerManager capEnergy = new ItemPowerManager(inactiveCharged); - capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored()); + Energy.of(inactiveCharged).set(Energy.of(inactiveCharged).getMaxStored()); ItemStack activeCharged = new ItemStack(TRContent.NANOSABER); activeCharged.setTag(new CompoundTag()); activeCharged.getTag().putBoolean("isActive", true); - ItemPowerManager capEnergy2 = new ItemPowerManager(activeCharged); - capEnergy2.setEnergyStored(capEnergy2.getMaxEnergyStored()); + Energy.of(activeCharged).set(Energy.of(activeCharged).getMaxStored()); itemList.add(inactiveUncharged); itemList.add(inactiveCharged); @@ -215,17 +209,22 @@ public class ItemNanosaber extends SwordItem implements IEnergyItemInfo, ItemDur // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public EnergyTier getTier() { + return EnergyTier.HIGH; + } + + @Override + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } } diff --git a/src/main/java/techreborn/items/tool/industrial/ItemOmniTool.java b/src/main/java/techreborn/items/tool/industrial/ItemOmniTool.java index 63cc32038..7cc7ba414 100644 --- a/src/main/java/techreborn/items/tool/industrial/ItemOmniTool.java +++ b/src/main/java/techreborn/items/tool/industrial/ItemOmniTool.java @@ -26,26 +26,28 @@ package techreborn.items.tool.industrial; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.text.LiteralText; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; import net.minecraft.block.BlockState; import net.minecraft.client.item.TooltipContext; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; +import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.DefaultedList; +import net.minecraft.util.Formatting; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import reborncore.api.power.IEnergyItemInfo; -import reborncore.api.power.ItemPowerManager; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemUtils; import reborncore.common.util.TorchHelper; +import team.reborn.energy.Energy; +import team.reborn.energy.EnergyHolder; +import team.reborn.energy.EnergySide; +import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.config.TechRebornConfig; import techreborn.init.TRContent; @@ -54,7 +56,7 @@ import techreborn.utils.InitUtils; import javax.annotation.Nullable; import java.util.List; -public class ItemOmniTool extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { +public class ItemOmniTool extends PickaxeItem implements EnergyHolder, ItemDurabilityExtensions { public static final int maxCharge = TechRebornConfig.omniToolCharge; public int transferLimit = 1_000; @@ -77,11 +79,8 @@ public class ItemOmniTool extends PickaxeItem implements IEnergyItemInfo, ItemDu // ItemTool @Override public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - - capEnergy.useEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityLiving); - + Energy.of(stack).use(cost); + ExternalPowerSystems.requestEnergyFromArmor(stack, entityLiving); return true; } @@ -108,13 +107,10 @@ public class ItemOmniTool extends PickaxeItem implements IEnergyItemInfo, ItemDu @Override public boolean postHit(ItemStack stack, LivingEntity entityliving, LivingEntity attacker) { - ItemPowerManager capEnergy = new ItemPowerManager(stack); - if (capEnergy.getEnergyStored() >= hitCost) { - capEnergy.useEnergy(hitCost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, entityliving); - + if(Energy.of(stack).use(hitCost)) { entityliving.damage(DamageSource.player((PlayerEntity) attacker), 8F); } + ExternalPowerSystems.requestEnergyFromArmor(stack, entityliving); return false; } @@ -163,17 +159,22 @@ public class ItemOmniTool extends PickaxeItem implements IEnergyItemInfo, ItemDu // IEnergyItemInfo @Override - public int getCapacity() { + public double getMaxStoredPower() { return maxCharge; } @Override - public int getMaxInput() { + public double getMaxInput(EnergySide side) { return transferLimit; } @Override - public int getMaxOutput() { + public double getMaxOutput(EnergySide side) { return 0; } + + @Override + public EnergyTier getTier() { + return EnergyTier.HIGH; + } } diff --git a/src/main/java/techreborn/utils/FluidUtils.java b/src/main/java/techreborn/utils/FluidUtils.java index e6312f82b..4a359fd0f 100644 --- a/src/main/java/techreborn/utils/FluidUtils.java +++ b/src/main/java/techreborn/utils/FluidUtils.java @@ -24,7 +24,7 @@ package techreborn.utils; -import io.github.prospector.silk.fluid.FluidInstance; +import reborncore.common.fluid.container.FluidInstance; import net.minecraft.block.Block; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluids; @@ -66,7 +66,7 @@ public class FluidUtils { FluidInstance targetFluidInstance = target.getFluidInstance(null); Fluid currentFluid = targetFluidInstance.getFluid(); - if(currentFluid == Fluids.EMPTY || currentFluid == itemFluidInfo.getFluid(inputStack)) { + if(targetFluidInstance.isEmpty() || currentFluid == itemFluidInfo.getFluid(inputStack)) { int freeSpace = target.getCapacity(null) - targetFluidInstance.getAmount(); if(!outputStack.isEmpty()){ diff --git a/src/main/java/techreborn/utils/InitUtils.java b/src/main/java/techreborn/utils/InitUtils.java index b21811de3..a72081c11 100644 --- a/src/main/java/techreborn/utils/InitUtils.java +++ b/src/main/java/techreborn/utils/InitUtils.java @@ -37,7 +37,7 @@ import net.minecraft.util.DefaultedList; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; import reborncore.RebornRegistry; -import reborncore.api.power.ItemPowerManager; +import team.reborn.energy.Energy; import techreborn.TechReborn; public class InitUtils { @@ -59,8 +59,8 @@ public class InitUtils { public static void initPoweredItems(Item item, DefaultedList itemList) { ItemStack uncharged = new ItemStack(item); ItemStack charged = new ItemStack(item); - ItemPowerManager capEnergy = new ItemPowerManager(charged); - capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored()); + + Energy.of(charged).set(Energy.of(charged).getMaxStored()); itemList.add(uncharged); itemList.add(charged); diff --git a/src/main/resources/assets/techreborn/models/block/storage/osmium_storage_block.json b/src/main/resources/assets/techreborn/models/block/storage/osmium_storage_block.json deleted file mode 100644 index 3d6725527..000000000 --- a/src/main/resources/assets/techreborn/models/block/storage/osmium_storage_block.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "techreborn:block/storage/osmium_storage_block" - } -} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/aluminum_block.json b/src/main/resources/data/c/tags/blocks/aluminum_block.json new file mode 100644 index 000000000..449832b31 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/aluminum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:aluminum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/bauxite_ore.json b/src/main/resources/data/c/tags/blocks/bauxite_ore.json new file mode 100644 index 000000000..7b8000f39 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/bauxite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:bauxite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/brass_block.json b/src/main/resources/data/c/tags/blocks/brass_block.json new file mode 100644 index 000000000..50b2de6ef --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/brass_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:brass_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/bronze_block.json b/src/main/resources/data/c/tags/blocks/bronze_block.json new file mode 100644 index 000000000..d7117560e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/bronze_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:bronze_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/chrome_block.json b/src/main/resources/data/c/tags/blocks/chrome_block.json new file mode 100644 index 000000000..3a37bbb02 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/chrome_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:chrome_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/cinnabar_ore.json b/src/main/resources/data/c/tags/blocks/cinnabar_ore.json new file mode 100644 index 000000000..75f0e0608 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/cinnabar_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:cinnabar_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/copper_block.json b/src/main/resources/data/c/tags/blocks/copper_block.json new file mode 100644 index 000000000..19d864718 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/copper_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:copper_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/copper_ore.json b/src/main/resources/data/c/tags/blocks/copper_ore.json new file mode 100644 index 000000000..947537264 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/copper_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:copper_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/electrum_block.json b/src/main/resources/data/c/tags/blocks/electrum_block.json new file mode 100644 index 000000000..0b9414c3e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/electrum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:electrum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/galena_ore.json b/src/main/resources/data/c/tags/blocks/galena_ore.json new file mode 100644 index 000000000..ee7aa2aa1 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/galena_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:galena_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/invar_block.json b/src/main/resources/data/c/tags/blocks/invar_block.json new file mode 100644 index 000000000..cbcb2d3c5 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/invar_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:invar_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/iridium_block.json b/src/main/resources/data/c/tags/blocks/iridium_block.json new file mode 100644 index 000000000..38cb4dc6d --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/iridium_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/iridium_ore.json b/src/main/resources/data/c/tags/blocks/iridium_ore.json new file mode 100644 index 000000000..d46a6e770 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/iridium_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/iridium_reinforced_stone_block.json b/src/main/resources/data/c/tags/blocks/iridium_reinforced_stone_block.json new file mode 100644 index 000000000..d0c64df9e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/iridium_reinforced_stone_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_reinforced_stone_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/iridium_reinforced_tungstensteel_block.json b/src/main/resources/data/c/tags/blocks/iridium_reinforced_tungstensteel_block.json new file mode 100644 index 000000000..4067f5cde --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/iridium_reinforced_tungstensteel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_reinforced_tungstensteel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/lead_block.json b/src/main/resources/data/c/tags/blocks/lead_block.json new file mode 100644 index 000000000..43bcc2965 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/lead_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:lead_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/lead_ore.json b/src/main/resources/data/c/tags/blocks/lead_ore.json new file mode 100644 index 000000000..098615a14 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/lead_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:lead_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/nickel_block.json b/src/main/resources/data/c/tags/blocks/nickel_block.json new file mode 100644 index 000000000..ff6901259 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/nickel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:nickel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/peridot_block.json b/src/main/resources/data/c/tags/blocks/peridot_block.json new file mode 100644 index 000000000..7cc8c5f79 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/peridot_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:peridot_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/peridot_ore.json b/src/main/resources/data/c/tags/blocks/peridot_ore.json new file mode 100644 index 000000000..3dc64d7c6 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/peridot_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:peridot_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/platinum_block.json b/src/main/resources/data/c/tags/blocks/platinum_block.json new file mode 100644 index 000000000..0c5b03294 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/platinum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:platinum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/pyrite_ore.json b/src/main/resources/data/c/tags/blocks/pyrite_ore.json new file mode 100644 index 000000000..4247fed2d --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/pyrite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:pyrite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/red_garnet_block.json b/src/main/resources/data/c/tags/blocks/red_garnet_block.json new file mode 100644 index 000000000..69e14f62e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/red_garnet_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:red_garnet_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/refined_iron_block.json b/src/main/resources/data/c/tags/blocks/refined_iron_block.json new file mode 100644 index 000000000..94698438a --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/refined_iron_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:refined_iron_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/ruby_block.json b/src/main/resources/data/c/tags/blocks/ruby_block.json new file mode 100644 index 000000000..12818a73b --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/ruby_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:ruby_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/ruby_ore.json b/src/main/resources/data/c/tags/blocks/ruby_ore.json new file mode 100644 index 000000000..1798d4a00 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/ruby_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:ruby_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/sapphire_block.json b/src/main/resources/data/c/tags/blocks/sapphire_block.json new file mode 100644 index 000000000..645ee26e0 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/sapphire_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sapphire_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/sapphire_ore.json b/src/main/resources/data/c/tags/blocks/sapphire_ore.json new file mode 100644 index 000000000..eec276cd7 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/sapphire_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sapphire_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/sheldonite_ore.json b/src/main/resources/data/c/tags/blocks/sheldonite_ore.json new file mode 100644 index 000000000..5a7a16772 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/sheldonite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sheldonite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/silver_block.json b/src/main/resources/data/c/tags/blocks/silver_block.json new file mode 100644 index 000000000..f511c918e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/silver_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:silver_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/silver_ore.json b/src/main/resources/data/c/tags/blocks/silver_ore.json new file mode 100644 index 000000000..f59b8347e --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/silver_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:silver_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/sodalite_ore.json b/src/main/resources/data/c/tags/blocks/sodalite_ore.json new file mode 100644 index 000000000..b39714c89 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/sodalite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sodalite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/sphalerite_ore.json b/src/main/resources/data/c/tags/blocks/sphalerite_ore.json new file mode 100644 index 000000000..b52b7ff93 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/sphalerite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sphalerite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/steel_block.json b/src/main/resources/data/c/tags/blocks/steel_block.json new file mode 100644 index 000000000..bfcc01bcb --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/steel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:steel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/tin_block.json b/src/main/resources/data/c/tags/blocks/tin_block.json new file mode 100644 index 000000000..fc959f5c6 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/tin_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tin_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/tin_ore.json b/src/main/resources/data/c/tags/blocks/tin_ore.json new file mode 100644 index 000000000..d2a0b1bc8 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/tin_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tin_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/titanium_block.json b/src/main/resources/data/c/tags/blocks/titanium_block.json new file mode 100644 index 000000000..1c5a1c3a6 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/titanium_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:titanium_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/tungsten_block.json b/src/main/resources/data/c/tags/blocks/tungsten_block.json new file mode 100644 index 000000000..7ba6e0cf1 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/tungsten_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tungsten_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/tungsten_ore.json b/src/main/resources/data/c/tags/blocks/tungsten_ore.json new file mode 100644 index 000000000..3c38ceb77 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/tungsten_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tungsten_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/tungstensteel_block.json b/src/main/resources/data/c/tags/blocks/tungstensteel_block.json new file mode 100644 index 000000000..a5dea5fae --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/tungstensteel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tungstensteel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/yellow_garnet_block.json b/src/main/resources/data/c/tags/blocks/yellow_garnet_block.json new file mode 100644 index 000000000..f35631c3f --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/yellow_garnet_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:yellow_garnet_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/zinc_block.json b/src/main/resources/data/c/tags/blocks/zinc_block.json new file mode 100644 index 000000000..f64d8a7ff --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/zinc_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:zinc_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/aluminum_block.json b/src/main/resources/data/c/tags/items/aluminum_block.json new file mode 100644 index 000000000..449832b31 --- /dev/null +++ b/src/main/resources/data/c/tags/items/aluminum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:aluminum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/bauxite_ore.json b/src/main/resources/data/c/tags/items/bauxite_ore.json new file mode 100644 index 000000000..7b8000f39 --- /dev/null +++ b/src/main/resources/data/c/tags/items/bauxite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:bauxite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/brass_block.json b/src/main/resources/data/c/tags/items/brass_block.json new file mode 100644 index 000000000..50b2de6ef --- /dev/null +++ b/src/main/resources/data/c/tags/items/brass_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:brass_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/bronze_block.json b/src/main/resources/data/c/tags/items/bronze_block.json new file mode 100644 index 000000000..d7117560e --- /dev/null +++ b/src/main/resources/data/c/tags/items/bronze_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:bronze_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/chrome_block.json b/src/main/resources/data/c/tags/items/chrome_block.json new file mode 100644 index 000000000..3a37bbb02 --- /dev/null +++ b/src/main/resources/data/c/tags/items/chrome_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:chrome_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/cinnabar_ore.json b/src/main/resources/data/c/tags/items/cinnabar_ore.json new file mode 100644 index 000000000..75f0e0608 --- /dev/null +++ b/src/main/resources/data/c/tags/items/cinnabar_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:cinnabar_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/copper_block.json b/src/main/resources/data/c/tags/items/copper_block.json new file mode 100644 index 000000000..19d864718 --- /dev/null +++ b/src/main/resources/data/c/tags/items/copper_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:copper_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/copper_ore.json b/src/main/resources/data/c/tags/items/copper_ore.json index f797c5715..947537264 100644 --- a/src/main/resources/data/c/tags/items/copper_ore.json +++ b/src/main/resources/data/c/tags/items/copper_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:copper_ore" - ] + "replace": false, + "values": [ + "techreborn:copper_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/electrum_block.json b/src/main/resources/data/c/tags/items/electrum_block.json new file mode 100644 index 000000000..0b9414c3e --- /dev/null +++ b/src/main/resources/data/c/tags/items/electrum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:electrum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/galena_ore.json b/src/main/resources/data/c/tags/items/galena_ore.json new file mode 100644 index 000000000..ee7aa2aa1 --- /dev/null +++ b/src/main/resources/data/c/tags/items/galena_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:galena_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/invar_block.json b/src/main/resources/data/c/tags/items/invar_block.json new file mode 100644 index 000000000..cbcb2d3c5 --- /dev/null +++ b/src/main/resources/data/c/tags/items/invar_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:invar_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/iridium_block.json b/src/main/resources/data/c/tags/items/iridium_block.json new file mode 100644 index 000000000..38cb4dc6d --- /dev/null +++ b/src/main/resources/data/c/tags/items/iridium_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/iridium_ore.json b/src/main/resources/data/c/tags/items/iridium_ore.json index e42cfa5ea..d46a6e770 100644 --- a/src/main/resources/data/c/tags/items/iridium_ore.json +++ b/src/main/resources/data/c/tags/items/iridium_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:iridium_ore" - ] + "replace": false, + "values": [ + "techreborn:iridium_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/iridium_reinforced_stone_block.json b/src/main/resources/data/c/tags/items/iridium_reinforced_stone_block.json new file mode 100644 index 000000000..d0c64df9e --- /dev/null +++ b/src/main/resources/data/c/tags/items/iridium_reinforced_stone_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_reinforced_stone_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/iridium_reinforced_tungstensteel_block.json b/src/main/resources/data/c/tags/items/iridium_reinforced_tungstensteel_block.json new file mode 100644 index 000000000..4067f5cde --- /dev/null +++ b/src/main/resources/data/c/tags/items/iridium_reinforced_tungstensteel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:iridium_reinforced_tungstensteel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/lead_block.json b/src/main/resources/data/c/tags/items/lead_block.json new file mode 100644 index 000000000..43bcc2965 --- /dev/null +++ b/src/main/resources/data/c/tags/items/lead_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:lead_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/lead_ore.json b/src/main/resources/data/c/tags/items/lead_ore.json index 0c78c4936..098615a14 100644 --- a/src/main/resources/data/c/tags/items/lead_ore.json +++ b/src/main/resources/data/c/tags/items/lead_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:lead_ore" - ] + "replace": false, + "values": [ + "techreborn:lead_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/nickel_block.json b/src/main/resources/data/c/tags/items/nickel_block.json new file mode 100644 index 000000000..ff6901259 --- /dev/null +++ b/src/main/resources/data/c/tags/items/nickel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:nickel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/peridot_block.json b/src/main/resources/data/c/tags/items/peridot_block.json new file mode 100644 index 000000000..7cc8c5f79 --- /dev/null +++ b/src/main/resources/data/c/tags/items/peridot_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:peridot_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/peridot_ore.json b/src/main/resources/data/c/tags/items/peridot_ore.json index d9f4ff5ec..3dc64d7c6 100644 --- a/src/main/resources/data/c/tags/items/peridot_ore.json +++ b/src/main/resources/data/c/tags/items/peridot_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:peridot_ore" - ] + "replace": false, + "values": [ + "techreborn:peridot_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/platinum_block.json b/src/main/resources/data/c/tags/items/platinum_block.json new file mode 100644 index 000000000..0c5b03294 --- /dev/null +++ b/src/main/resources/data/c/tags/items/platinum_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:platinum_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/pyrite_ore.json b/src/main/resources/data/c/tags/items/pyrite_ore.json new file mode 100644 index 000000000..4247fed2d --- /dev/null +++ b/src/main/resources/data/c/tags/items/pyrite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:pyrite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/red_garnet_block.json b/src/main/resources/data/c/tags/items/red_garnet_block.json new file mode 100644 index 000000000..69e14f62e --- /dev/null +++ b/src/main/resources/data/c/tags/items/red_garnet_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:red_garnet_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/refined_iron_block.json b/src/main/resources/data/c/tags/items/refined_iron_block.json new file mode 100644 index 000000000..94698438a --- /dev/null +++ b/src/main/resources/data/c/tags/items/refined_iron_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:refined_iron_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/ruby_block.json b/src/main/resources/data/c/tags/items/ruby_block.json new file mode 100644 index 000000000..12818a73b --- /dev/null +++ b/src/main/resources/data/c/tags/items/ruby_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:ruby_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/ruby_ore.json b/src/main/resources/data/c/tags/items/ruby_ore.json index 662e8a4c1..1798d4a00 100644 --- a/src/main/resources/data/c/tags/items/ruby_ore.json +++ b/src/main/resources/data/c/tags/items/ruby_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:ruby_ore" - ] + "replace": false, + "values": [ + "techreborn:ruby_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/sapphire_block.json b/src/main/resources/data/c/tags/items/sapphire_block.json new file mode 100644 index 000000000..645ee26e0 --- /dev/null +++ b/src/main/resources/data/c/tags/items/sapphire_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sapphire_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/sapphire_ore.json b/src/main/resources/data/c/tags/items/sapphire_ore.json index 3cc6f8429..eec276cd7 100644 --- a/src/main/resources/data/c/tags/items/sapphire_ore.json +++ b/src/main/resources/data/c/tags/items/sapphire_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:sapphire_ore" - ] + "replace": false, + "values": [ + "techreborn:sapphire_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/sheldonite_ore.json b/src/main/resources/data/c/tags/items/sheldonite_ore.json new file mode 100644 index 000000000..5a7a16772 --- /dev/null +++ b/src/main/resources/data/c/tags/items/sheldonite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sheldonite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/silver_block.json b/src/main/resources/data/c/tags/items/silver_block.json new file mode 100644 index 000000000..f511c918e --- /dev/null +++ b/src/main/resources/data/c/tags/items/silver_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:silver_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/silver_ore.json b/src/main/resources/data/c/tags/items/silver_ore.json index 44223ff8d..f59b8347e 100644 --- a/src/main/resources/data/c/tags/items/silver_ore.json +++ b/src/main/resources/data/c/tags/items/silver_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:silver_ore" - ] + "replace": false, + "values": [ + "techreborn:silver_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/sodalite_ore.json b/src/main/resources/data/c/tags/items/sodalite_ore.json new file mode 100644 index 000000000..b39714c89 --- /dev/null +++ b/src/main/resources/data/c/tags/items/sodalite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sodalite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/sphalerite_ore.json b/src/main/resources/data/c/tags/items/sphalerite_ore.json new file mode 100644 index 000000000..b52b7ff93 --- /dev/null +++ b/src/main/resources/data/c/tags/items/sphalerite_ore.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:sphalerite_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/steel_block.json b/src/main/resources/data/c/tags/items/steel_block.json new file mode 100644 index 000000000..bfcc01bcb --- /dev/null +++ b/src/main/resources/data/c/tags/items/steel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:steel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/tin_block.json b/src/main/resources/data/c/tags/items/tin_block.json new file mode 100644 index 000000000..fc959f5c6 --- /dev/null +++ b/src/main/resources/data/c/tags/items/tin_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tin_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/tin_ore.json b/src/main/resources/data/c/tags/items/tin_ore.json index 0601ba01e..d2a0b1bc8 100644 --- a/src/main/resources/data/c/tags/items/tin_ore.json +++ b/src/main/resources/data/c/tags/items/tin_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:tin_ore" - ] + "replace": false, + "values": [ + "techreborn:tin_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/titanium_block.json b/src/main/resources/data/c/tags/items/titanium_block.json new file mode 100644 index 000000000..1c5a1c3a6 --- /dev/null +++ b/src/main/resources/data/c/tags/items/titanium_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:titanium_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/tungsten_block.json b/src/main/resources/data/c/tags/items/tungsten_block.json new file mode 100644 index 000000000..7ba6e0cf1 --- /dev/null +++ b/src/main/resources/data/c/tags/items/tungsten_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tungsten_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/tungsten_ore.json b/src/main/resources/data/c/tags/items/tungsten_ore.json index 8e0be5f13..3c38ceb77 100644 --- a/src/main/resources/data/c/tags/items/tungsten_ore.json +++ b/src/main/resources/data/c/tags/items/tungsten_ore.json @@ -1,6 +1,6 @@ { - "replace": false, - "values": [ - "techreborn:tungsten_ore" - ] + "replace": false, + "values": [ + "techreborn:tungsten_ore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/tungstensteel_block.json b/src/main/resources/data/c/tags/items/tungstensteel_block.json new file mode 100644 index 000000000..a5dea5fae --- /dev/null +++ b/src/main/resources/data/c/tags/items/tungstensteel_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:tungstensteel_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/yellow_garnet_block.json b/src/main/resources/data/c/tags/items/yellow_garnet_block.json new file mode 100644 index 000000000..f35631c3f --- /dev/null +++ b/src/main/resources/data/c/tags/items/yellow_garnet_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:yellow_garnet_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/zinc_block.json b/src/main/resources/data/c/tags/items/zinc_block.json new file mode 100644 index 000000000..f64d8a7ff --- /dev/null +++ b/src/main/resources/data/c/tags/items/zinc_block.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "techreborn:zinc_storage_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/assembling_machine/advanced_circuit.json b/src/main/resources/data/techreborn/recipes/assembling_machine/advanced_circuit.json new file mode 100644 index 000000000..2bd39aea4 --- /dev/null +++ b/src/main/resources/data/techreborn/recipes/assembling_machine/advanced_circuit.json @@ -0,0 +1,19 @@ +{ + "type": "techreborn:assembling_machine", + "power": 20, + "time": 200, + "ingredients": [ + { + "item": "techreborn:silicon_plate" + }, + { + "item": "techreborn:insulated_gold_cable", + "count": 2 + } + ], + "results": [ + { + "item": "techreborn:advanced_circuit" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/assembling_machine/electronic_circuit.json b/src/main/resources/data/techreborn/recipes/assembling_machine/electronic_circuit.json new file mode 100644 index 000000000..ce3d16db7 --- /dev/null +++ b/src/main/resources/data/techreborn/recipes/assembling_machine/electronic_circuit.json @@ -0,0 +1,19 @@ +{ + "type": "techreborn:assembling_machine", + "power": 20, + "time": 200, + "ingredients": [ + { + "item": "techreborn:silicon_plate" + }, + { + "item": "techreborn:insulated_copper_cable", + "count": 2 + } + ], + "results": [ + { + "item": "techreborn:electronic_circuit" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/assembling_machine/lithium_ion_battery.json b/src/main/resources/data/techreborn/recipes/assembling_machine/lithium_ion_battery.json new file mode 100644 index 000000000..5c87f3b52 --- /dev/null +++ b/src/main/resources/data/techreborn/recipes/assembling_machine/lithium_ion_battery.json @@ -0,0 +1,23 @@ +{ + "type": "techreborn:assembling_machine", + "power": 20, + "time": 200, + "ingredients": [ + { + "count": 2, + "tag": "c:aluminum_plate" + }, + { + "item": "techreborn:cell", + "count": 2, + "nbt": { + "fluid": "techreborn:lithium" + } + } + ], + "results": [ + { + "item": "techreborn:lithium_ion_battery" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/blast_furnace/refined_iron_ingot_from_pyrite_ore.json b/src/main/resources/data/techreborn/recipes/blast_furnace/refined_iron_ingot_from_pyrite_ore.json index ab1734df9..c2767ae6e 100644 --- a/src/main/resources/data/techreborn/recipes/blast_furnace/refined_iron_ingot_from_pyrite_ore.json +++ b/src/main/resources/data/techreborn/recipes/blast_furnace/refined_iron_ingot_from_pyrite_ore.json @@ -1,24 +1,24 @@ -{ - "type": "techreborn:blast_furnace", - "power": 128, - "time": 100, - "heat": 1500, - "ingredients": [ - { - "item": "techreborn:pyrite_ore" - }, - { - "fluid": "techreborn:calcium_carbonate", - "holder": "techreborn:cell" - } - ], - "results": [ - { - "item": "techreborn:refined_iron_ingot", - "count": 2 - }, - { - "item": "techreborn:cell" - } - ] -} +{ + "type": "techreborn:blast_furnace", + "power": 128, + "time": 100, + "heat": 1500, + "ingredients": [ + { + "tag": "c:pyrite_ore" + }, + { + "fluid": "techreborn:calcium_carbonate", + "holder": "techreborn:cell" + } + ], + "results": [ + { + "item": "techreborn:refined_iron_ingot", + "count": 2 + }, + { + "item": "techreborn:cell" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/aluminum_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/aluminum_plate_from_block.json index e8e6d1736..cbda58d4a 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/aluminum_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/aluminum_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:aluminum_storage_block" - } - ], - "results": [ - { - "item": "techreborn:aluminum_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:aluminum_block" + } + ], + "results": [ + { + "item": "techreborn:aluminum_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/brass_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/brass_plate_from_block.json index f592d5aaa..1ff57bfb0 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/brass_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/brass_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:brass_storage_block" - } - ], - "results": [ - { - "item": "techreborn:brass_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:brass_block" + } + ], + "results": [ + { + "item": "techreborn:brass_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/bronze_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/bronze_plate_from_block.json index dc1adcf34..441fbbfd3 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/bronze_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/bronze_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:bronze_storage_block" - } - ], - "results": [ - { - "item": "techreborn:bronze_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:bronze_block" + } + ], + "results": [ + { + "item": "techreborn:bronze_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/chrome_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/chrome_plate_from_block.json index d126f8d2f..b669b5343 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/chrome_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/chrome_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:chrome_storage_block" - } - ], - "results": [ - { - "item": "techreborn:chrome_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:chrome_block" + } + ], + "results": [ + { + "item": "techreborn:chrome_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/copper_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/copper_plate_from_block.json index 74eae2060..f50ca11d3 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/copper_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/copper_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:copper_storage_block" - } - ], - "results": [ - { - "item": "techreborn:copper_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:copper_block" + } + ], + "results": [ + { + "item": "techreborn:copper_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/electrum_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/electrum_plate_from_block.json index 5eaabc841..6b43dba49 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/electrum_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/electrum_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:electrum_storage_block" - } - ], - "results": [ - { - "item": "techreborn:electrum_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:electrum_block" + } + ], + "results": [ + { + "item": "techreborn:electrum_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/invar_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/invar_plate_from_block.json index 3c6536cbf..c2324bc0c 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/invar_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/invar_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:invar_storage_block" - } - ], - "results": [ - { - "item": "techreborn:invar_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:invar_block" + } + ], + "results": [ + { + "item": "techreborn:invar_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/iridium_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/iridium_plate_from_block.json index 1d908f61f..22d2ccd49 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/iridium_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/iridium_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:iridium_storage_block" - } - ], - "results": [ - { - "item": "techreborn:iridium_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:iridium_block" + } + ], + "results": [ + { + "item": "techreborn:iridium_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/lead_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/lead_plate_from_block.json index 9072092f5..9b24612d1 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/lead_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/lead_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:lead_storage_block" - } - ], - "results": [ - { - "item": "techreborn:lead_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:lead_block" + } + ], + "results": [ + { + "item": "techreborn:lead_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/nickel_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/nickel_plate_from_block.json index b6f2f942d..aaa79039e 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/nickel_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/nickel_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:nickel_storage_block" - } - ], - "results": [ - { - "item": "techreborn:nickel_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:nickel_block" + } + ], + "results": [ + { + "item": "techreborn:nickel_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/peridot_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/peridot_plate_from_block.json index c66ad0e2e..ebd1a96c7 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/peridot_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/peridot_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:peridot_storage_block" - } - ], - "results": [ - { - "item": "techreborn:peridot_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:peridot_block" + } + ], + "results": [ + { + "item": "techreborn:peridot_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/platinum_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/platinum_plate_from_block.json index 41dcee95e..47f0dce78 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/platinum_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/platinum_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:platinum_storage_block" - } - ], - "results": [ - { - "item": "techreborn:platinum_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:platinum_block" + } + ], + "results": [ + { + "item": "techreborn:platinum_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/red_garnet_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/red_garnet_plate_from_block.json index 923404e94..c76c73d21 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/red_garnet_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/red_garnet_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:red_garnet_storage_block" - } - ], - "results": [ - { - "item": "techreborn:red_garnet_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:red_garnet_block" + } + ], + "results": [ + { + "item": "techreborn:red_garnet_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/refined_iron_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/refined_iron_plate_from_block.json index a12819709..adef3bf8d 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/refined_iron_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/refined_iron_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:refined_iron_storage_block" - } - ], - "results": [ - { - "item": "techreborn:refined_iron_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:refined_iron_block" + } + ], + "results": [ + { + "item": "techreborn:refined_iron_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/ruby_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/ruby_plate_from_block.json index 2e0a852af..1eeb451c9 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/ruby_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/ruby_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:ruby_storage_block" - } - ], - "results": [ - { - "item": "techreborn:ruby_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:ruby_block" + } + ], + "results": [ + { + "item": "techreborn:ruby_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/sapphire_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/sapphire_plate_from_block.json index e2f6c6311..006f7b16a 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/sapphire_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/sapphire_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:sapphire_storage_block" - } - ], - "results": [ - { - "item": "techreborn:sapphire_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:sapphire_block" + } + ], + "results": [ + { + "item": "techreborn:sapphire_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/silver_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/silver_plate_from_block.json index a2b8a1880..6fdf0058e 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/silver_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/silver_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:silver_storage_block" - } - ], - "results": [ - { - "item": "techreborn:silver_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:silver_block" + } + ], + "results": [ + { + "item": "techreborn:silver_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/steel_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/steel_plate_from_block.json index dfabbbc8d..05256bd14 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/steel_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/steel_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:steel_storage_block" - } - ], - "results": [ - { - "item": "techreborn:steel_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:steel_block" + } + ], + "results": [ + { + "item": "techreborn:steel_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/tin_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/tin_plate_from_block.json index 8fb7a1963..d7b6f64d8 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/tin_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/tin_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:tin_storage_block" - } - ], - "results": [ - { - "item": "techreborn:tin_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:tin_block" + } + ], + "results": [ + { + "item": "techreborn:tin_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/titanium_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/titanium_plate_from_block.json index 644e422bc..ee817a296 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/titanium_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/titanium_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:titanium_storage_block" - } - ], - "results": [ - { - "item": "techreborn:titanium_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:titanium_block" + } + ], + "results": [ + { + "item": "techreborn:titanium_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/tungsten_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/tungsten_plate_from_block.json index a51fc62a1..6742c13ba 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/tungsten_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/tungsten_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:tungsten_storage_block" - } - ], - "results": [ - { - "item": "techreborn:tungsten_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:tungsten_block" + } + ], + "results": [ + { + "item": "techreborn:tungsten_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/tungstensteel_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/tungstensteel_plate_from_block.json index 4b8665268..53ab5f7d0 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/tungstensteel_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/tungstensteel_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:tungstensteel_storage_block" - } - ], - "results": [ - { - "item": "techreborn:tungstensteel_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:tungstensteel_block" + } + ], + "results": [ + { + "item": "techreborn:tungstensteel_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/yellow_garnet_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/yellow_garnet_plate_from_block.json index 6cc8b39f8..de39ba96c 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/yellow_garnet_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/yellow_garnet_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:yellow_garnet_storage_block" - } - ], - "results": [ - { - "item": "techreborn:yellow_garnet_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:yellow_garnet_block" + } + ], + "results": [ + { + "item": "techreborn:yellow_garnet_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/compressor/zinc_plate_from_block.json b/src/main/resources/data/techreborn/recipes/compressor/zinc_plate_from_block.json index 21209caa9..d03e4e457 100644 --- a/src/main/resources/data/techreborn/recipes/compressor/zinc_plate_from_block.json +++ b/src/main/resources/data/techreborn/recipes/compressor/zinc_plate_from_block.json @@ -1,16 +1,16 @@ { - "type": "techreborn:compressor", - "power": 10, - "time": 300, - "ingredients": [ - { - "item": "techreborn:zinc_storage_block" - } - ], - "results": [ - { - "item": "techreborn:zinc_plate", - "count": 9 - } - ] + "type": "techreborn:compressor", + "power": 10, + "time": 300, + "ingredients": [ + { + "tag": "c:zinc_block" + } + ], + "results": [ + { + "item": "techreborn:zinc_plate", + "count": 9 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/battery/lithium_ion_battery.json b/src/main/resources/data/techreborn/recipes/crafting_table/battery/lithium_ion_battery.json deleted file mode 100644 index 8c7960eed..000000000 --- a/src/main/resources/data/techreborn/recipes/crafting_table/battery/lithium_ion_battery.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " C ", - "PFP", - "PFP" - ], - "key": { - "C": { - "item": "techreborn:insulated_gold_cable" - }, - "P": { - "tag": "c:aluminum_plate" - }, - "F": { - "item": "techreborn:cell" - } - }, - "result": { - "item": "techreborn:lithium_ion_battery" - } -} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/gem/peridot_gem_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/gem/peridot_gem_from_storage_block.json index 85cbf4dd8..0b2401a8e 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/gem/peridot_gem_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/gem/peridot_gem_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:peridot_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:peridot_block" + } + ], + "result": { + "item": "techreborn:peridot_gem", + "count": 9 } - ], - "result": { - "item": "techreborn:peridot_gem", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/gem/red_garnet_gem_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/gem/red_garnet_gem_from_storage_block.json index e605a77cf..0a73798cc 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/gem/red_garnet_gem_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/gem/red_garnet_gem_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:red_garnet_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:red_garnet_block" + } + ], + "result": { + "item": "techreborn:red_garnet_gem", + "count": 9 } - ], - "result": { - "item": "techreborn:red_garnet_gem", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/gem/ruby_gem_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/gem/ruby_gem_from_storage_block.json index d1b70226b..41acea7fc 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/gem/ruby_gem_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/gem/ruby_gem_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:ruby_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:ruby_block" + } + ], + "result": { + "item": "techreborn:ruby_gem", + "count": 9 } - ], - "result": { - "item": "techreborn:ruby_gem", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/gem/sapphire_gem_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/gem/sapphire_gem_from_storage_block.json index bb9c67db6..137f6967d 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/gem/sapphire_gem_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/gem/sapphire_gem_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:sapphire_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:sapphire_block" + } + ], + "result": { + "item": "techreborn:sapphire_gem", + "count": 9 } - ], - "result": { - "item": "techreborn:sapphire_gem", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/gem/yellow_garnet_gem_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/gem/yellow_garnet_gem_from_storage_block.json index d155fae1b..4acc24a88 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/gem/yellow_garnet_gem_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/gem/yellow_garnet_gem_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:yellow_garnet_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:yellow_garnet_block" + } + ], + "result": { + "item": "techreborn:yellow_garnet_gem", + "count": 9 } - ], - "result": { - "item": "techreborn:yellow_garnet_gem", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/aluminum_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/aluminum_ingot_from_block.json index 8e7eab708..9923d70e3 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/aluminum_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/aluminum_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:aluminum_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:aluminum_block" + } + ], + "result": { + "item": "techreborn:aluminum_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:aluminum_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/brass_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/brass_ingot_from_block.json index 2d976917d..8ca31ecb7 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/brass_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/brass_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:brass_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:brass_block" + } + ], + "result": { + "item": "techreborn:brass_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:brass_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/bronze_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/bronze_ingot_from_block.json index 72112e25b..569f2e314 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/bronze_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/bronze_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:bronze_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:bronze_block" + } + ], + "result": { + "item": "techreborn:bronze_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:bronze_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/chrome_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/chrome_ingot_from_block.json index a3f4a1359..45dc6a1b9 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/chrome_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/chrome_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:chrome_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:chrome_block" + } + ], + "result": { + "item": "techreborn:chrome_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:chrome_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/copper_ingot_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/copper_ingot_from_storage_block.json index ecba5f487..46255d785 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/copper_ingot_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/copper_ingot_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:copper_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:copper_block" + } + ], + "result": { + "item": "techreborn:copper_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:copper_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/electrum_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/electrum_ingot_from_block.json index e49b9378c..800bd1eba 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/electrum_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/electrum_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:electrum_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:electrum_block" + } + ], + "result": { + "item": "techreborn:electrum_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:electrum_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/invar_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/invar_ingot_from_block.json index 7d217c944..bb643fdbe 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/invar_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/invar_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:invar_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:invar_block" + } + ], + "result": { + "item": "techreborn:invar_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:invar_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/iridium_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/iridium_ingot_from_block.json index cf9aa5e62..2bb783eea 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/iridium_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/iridium_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:iridium_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:iridium_block" + } + ], + "result": { + "item": "techreborn:iridium_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:iridium_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/lead_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/lead_ingot_from_block.json index 5366f1a9c..29afad203 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/lead_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/lead_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:lead_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:lead_block" + } + ], + "result": { + "item": "techreborn:lead_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:lead_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/nickel_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/nickel_ingot_from_block.json index aa41d8cac..b83d139e4 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/nickel_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/nickel_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:nickel_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:nickel_block" + } + ], + "result": { + "item": "techreborn:nickel_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:nickel_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/platinum_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/platinum_ingot_from_block.json index 03ed58e89..642a00240 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/platinum_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/platinum_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:platinum_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:platinum_block" + } + ], + "result": { + "item": "techreborn:platinum_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:platinum_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/refined_iron_ingot_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/refined_iron_ingot_from_storage_block.json index 684c5752a..572b31c5e 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/refined_iron_ingot_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/refined_iron_ingot_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:refined_iron_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:refined_iron_block" + } + ], + "result": { + "item": "techreborn:refined_iron_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:refined_iron_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/silver_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/silver_ingot_from_block.json index 970d80ec2..5860d1e13 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/silver_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/silver_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:silver_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:silver_block" + } + ], + "result": { + "item": "techreborn:silver_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:silver_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/steel_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/steel_ingot_from_block.json index 79aad7f77..2fb222eb3 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/steel_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/steel_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:steel_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:steel_block" + } + ], + "result": { + "item": "techreborn:steel_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:steel_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tin_ingot_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tin_ingot_from_storage_block.json index db7c22818..4eec004a1 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tin_ingot_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tin_ingot_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:tin_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:tin_block" + } + ], + "result": { + "item": "techreborn:tin_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:tin_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/titanium_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/titanium_ingot_from_block.json index c89f6c96a..21c2666e1 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/titanium_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/titanium_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:titanium_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:titanium_block" + } + ], + "result": { + "item": "techreborn:titanium_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:titanium_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungsten_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungsten_ingot_from_block.json index 5aed064cf..b20e106db 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungsten_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungsten_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:tungsten_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:tungsten_block" + } + ], + "result": { + "item": "techreborn:tungsten_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:tungsten_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungstensteel_ingot_from_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungstensteel_ingot_from_storage_block.json index 6a06b039d..b5095cf53 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungstensteel_ingot_from_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/tungstensteel_ingot_from_storage_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:tungstensteel_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:tungstensteel_block" + } + ], + "result": { + "item": "techreborn:tungstensteel_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:tungstensteel_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/zinc_ingot_from_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/zinc_ingot_from_block.json index ab042ab35..56013e02f 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/ingot/zinc_ingot_from_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/ingot/zinc_ingot_from_block.json @@ -1,12 +1,12 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:zinc_storage_block" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:zinc_block" + } + ], + "result": { + "item": "techreborn:zinc_ingot", + "count": 9 } - ], - "result": { - "item": "techreborn:zinc_ingot", - "count": 9 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/machine/assembling_machine.json b/src/main/resources/data/techreborn/recipes/crafting_table/machine/assembling_machine.json new file mode 100644 index 000000000..575f1ad19 --- /dev/null +++ b/src/main/resources/data/techreborn/recipes/crafting_table/machine/assembling_machine.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EDE", + "CFC", + "EPE" + ], + "key": { + "C": { + "item": "techreborn:advanced_circuit" + }, + "F": { + "item": "techreborn:advanced_machine_frame" + }, + "E": { + "tag": "c:electrum_plate" + }, + "P": { + "item": "minecraft:piston" + }, + "D": { + "item": "techreborn:digital_display" + } + }, + "result": { + "item": "techreborn:assembly_machine" + } +} diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/parts/data_storage_core.json b/src/main/resources/data/techreborn/recipes/crafting_table/parts/data_storage_core.json index b99307462..f1c9d4cef 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/parts/data_storage_core.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/parts/data_storage_core.json @@ -13,7 +13,7 @@ "item": "techreborn:electronic_circuit" }, "E": { - "item": "techreborn:emerald_plate" + "tag": "c:peridot_plate" }, "G": { "item": "minecraft:glowstone_dust" diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/parts/digital_display.json b/src/main/resources/data/techreborn/recipes/crafting_table/parts/digital_display.json index 91d24b9cb..cd164999a 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/parts/digital_display.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/parts/digital_display.json @@ -7,7 +7,7 @@ ], "key": { "A": { - "tag": "c:aluminum_ingot" + "tag": "c:aluminum_plate" }, "D": { "item": "minecraft:ink_sac" diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/parts/tungsten_grinding_head.json b/src/main/resources/data/techreborn/recipes/crafting_table/parts/tungsten_grinding_head.json index 12a121aad..6060b40f5 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/parts/tungsten_grinding_head.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/parts/tungsten_grinding_head.json @@ -1,23 +1,23 @@ { - "type": "minecraft:crafting_shaped", - "pattern": [ - "TST", - "SBS", - "TST" - ], - "key": { - "B": { - "item": "techreborn:steel_storage_block" + "type": "minecraft:crafting_shaped", + "pattern": [ + "TST", + "SBS", + "TST" + ], + "key": { + "B": { + "tag": "c:steel_block" + }, + "S": { + "tag": "c:steel_ingot" + }, + "T": { + "tag": "c:tungsten_ingot" + } }, - "S": { - "tag": "c:steel_ingot" - }, - "T": { - "tag": "c:tungsten_ingot" + "result": { + "item": "techreborn:tungsten_grinding_head", + "count": 2 } - }, - "result": { - "item": "techreborn:tungsten_grinding_head", - "count": 2 - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block.json b/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block.json index 2f2ae36a1..4eb2c5344 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block.json @@ -1,14 +1,14 @@ { - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:tungstensteel_storage_block" - }, - { - "tag": "c:iridium_plate" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:tungstensteel_block" + }, + { + "tag": "c:iridium_plate" + } + ], + "result": { + "item": "techreborn:iridium_reinforced_tungstensteel_storage_block" } - ], - "result": { - "item": "techreborn:iridium_reinforced_tungstensteel_storage_block" - } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block_alt.json b/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block_alt.json index 973b98030..ed40c03d4 100644 --- a/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block_alt.json +++ b/src/main/resources/data/techreborn/recipes/crafting_table/storage_block/iridium_reinforced_tungstensteel_storage_block_alt.json @@ -1,14 +1,14 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "techreborn:iridium_reinforced_stone_storage_block" - }, - { - "item": "techreborn:tungstensteel_ingot" - } - ], - "result": { - "item": "techreborn:iridium_reinforced_tungstensteel_storage_block" - } +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "c:iridium_reinforced_stone_block" + }, + { + "item": "techreborn:tungstensteel_ingot" + } + ], + "result": { + "item": "techreborn:iridium_reinforced_tungstensteel_storage_block" + } } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/bauxite_dust.json b/src/main/resources/data/techreborn/recipes/grinder/bauxite_dust.json index d29300569..a3c524ac7 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/bauxite_dust.json +++ b/src/main/resources/data/techreborn/recipes/grinder/bauxite_dust.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 4, - "time": 270, - "ingredients": [ - { - "item": "techreborn:bauxite_ore" - } - ], - "results": [ - { - "item": "techreborn:bauxite_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 4, + "time": 270, + "ingredients": [ + { + "tag": "c:bauxite_ore" + } + ], + "results": [ + { + "item": "techreborn:bauxite_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/cinnabar_dust_from_ore.json b/src/main/resources/data/techreborn/recipes/grinder/cinnabar_dust_from_ore.json index 5b5e7cdbe..232b10526 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/cinnabar_dust_from_ore.json +++ b/src/main/resources/data/techreborn/recipes/grinder/cinnabar_dust_from_ore.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 2, - "time": 270, - "ingredients": [ - { - "item": "techreborn:cinnabar_ore" - } - ], - "results": [ - { - "item": "techreborn:cinnabar_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 2, + "time": 270, + "ingredients": [ + { + "tag": "c:cinnabar_ore" + } + ], + "results": [ + { + "item": "techreborn:cinnabar_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/galena_dust.json b/src/main/resources/data/techreborn/recipes/grinder/galena_dust.json index 6b9418a0b..d73b4adf4 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/galena_dust.json +++ b/src/main/resources/data/techreborn/recipes/grinder/galena_dust.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 2, - "time": 270, - "ingredients": [ - { - "item": "techreborn:galena_ore" - } - ], - "results": [ - { - "item": "techreborn:galena_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 2, + "time": 270, + "ingredients": [ + { + "tag": "c:galena_ore" + } + ], + "results": [ + { + "item": "techreborn:galena_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/pyrite_dust_from_ore.json b/src/main/resources/data/techreborn/recipes/grinder/pyrite_dust_from_ore.json index c5743a779..f73037116 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/pyrite_dust_from_ore.json +++ b/src/main/resources/data/techreborn/recipes/grinder/pyrite_dust_from_ore.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 4, - "time": 270, - "ingredients": [ - { - "item": "techreborn:pyrite_ore" - } - ], - "results": [ - { - "item": "techreborn:pyrite_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 4, + "time": 270, + "ingredients": [ + { + "tag": "c:pyrite_ore" + } + ], + "results": [ + { + "item": "techreborn:pyrite_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/sodalite_dust_from_ore.json b/src/main/resources/data/techreborn/recipes/grinder/sodalite_dust_from_ore.json index d1adad7d6..da8334570 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/sodalite_dust_from_ore.json +++ b/src/main/resources/data/techreborn/recipes/grinder/sodalite_dust_from_ore.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 4, - "time": 220, - "ingredients": [ - { - "item": "techreborn:sodalite_ore" - } - ], - "results": [ - { - "item": "techreborn:sodalite_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 4, + "time": 220, + "ingredients": [ + { + "tag": "c:sodalite_ore" + } + ], + "results": [ + { + "item": "techreborn:sodalite_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/grinder/sphalerite_dust_from_ore.json b/src/main/resources/data/techreborn/recipes/grinder/sphalerite_dust_from_ore.json index dcc28dffb..beeeda70b 100644 --- a/src/main/resources/data/techreborn/recipes/grinder/sphalerite_dust_from_ore.json +++ b/src/main/resources/data/techreborn/recipes/grinder/sphalerite_dust_from_ore.json @@ -1,16 +1,16 @@ { - "type": "techreborn:grinder", - "power": 2, - "time": 220, - "ingredients": [ - { - "item": "techreborn:sphalerite_ore" - } - ], - "results": [ - { - "item": "techreborn:sphalerite_dust", - "count": 2 - } - ] + "type": "techreborn:grinder", + "power": 2, + "time": 220, + "ingredients": [ + { + "tag": "c:sphalerite_ore" + } + ], + "results": [ + { + "item": "techreborn:sphalerite_dust", + "count": 2 + } + ] } \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/bauxite_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/bauxite_ore_with_water.json index c397984b0..aed1c547f 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/bauxite_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/bauxite_ore_with_water.json @@ -1,23 +1,23 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:bauxite_ore" - } - ], - "results": [ - { - "item": "techreborn:bauxite_dust", - "count": 4 - }, - { - "item": "techreborn:aluminum_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:bauxite_ore" + } + ], + "results": [ + { + "item": "techreborn:bauxite_dust", + "count": 4 + }, + { + "item": "techreborn:aluminum_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/cinnabar_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/cinnabar_ore_with_water.json index b1d48c50e..7f58401aa 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/cinnabar_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/cinnabar_ore_with_water.json @@ -1,27 +1,27 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:cinnabar_ore" - } - ], - "results": [ - { - "item": "techreborn:cinnabar_dust", - "count": 5 - }, - { - "item": "techreborn:redstone_small_dust", - "count": 2 - }, - { - "item": "techreborn:glowstone_small_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:cinnabar_ore" + } + ], + "results": [ + { + "item": "techreborn:cinnabar_dust", + "count": 5 + }, + { + "item": "techreborn:redstone_small_dust", + "count": 2 + }, + { + "item": "techreborn:glowstone_small_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_mercury.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_mercury.json index 7fde89df6..271ba285c 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_mercury.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_mercury.json @@ -1,26 +1,26 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "techreborn:mercury", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:galena_ore" - } - ], - "results": [ - { - "item": "techreborn:galena_dust", - "count": 2 - }, - { - "item": "techreborn:sulfur_dust" - }, - { - "item": "techreborn:silver_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "techreborn:mercury", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:galena_ore" + } + ], + "results": [ + { + "item": "techreborn:galena_dust", + "count": 2 + }, + { + "item": "techreborn:sulfur_dust" + }, + { + "item": "techreborn:silver_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_water.json index 1b445aefd..b79ffdc7c 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/galena_ore_with_water.json @@ -1,23 +1,23 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:galena_ore" - } - ], - "results": [ - { - "item": "techreborn:galena_dust", - "count": 2 - }, - { - "item": "techreborn:sulfur_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:galena_ore" + } + ], + "results": [ + { + "item": "techreborn:galena_dust", + "count": 2 + }, + { + "item": "techreborn:sulfur_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/pyrite_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/pyrite_ore_with_water.json index c9ced9669..4d1c2521e 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/pyrite_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/pyrite_ore_with_water.json @@ -1,24 +1,24 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:pyrite_ore" - } - ], - "results": [ - { - "item": "techreborn:pyrite_dust", - "count": 5 - }, - { - "item": "techreborn:sulfur_dust", - "count": 2 - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:pyrite_ore" + } + ], + "results": [ + { + "item": "techreborn:pyrite_dust", + "count": 5 + }, + { + "item": "techreborn:sulfur_dust", + "count": 2 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_mercury.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_mercury.json index 60efab1be..10871d966 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_mercury.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_mercury.json @@ -1,27 +1,27 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "techreborn:mercury", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:sheldonite_ore" - } - ], - "results": [ - { - "item": "techreborn:platinum_dust", - "count": 3 - }, - { - "item": "techreborn:nickel_dust" - }, - { - "item": "techreborn:iridium_nugget", - "count": 2 - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "techreborn:mercury", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:sheldonite_ore" + } + ], + "results": [ + { + "item": "techreborn:platinum_dust", + "count": 3 + }, + { + "item": "techreborn:nickel_dust" + }, + { + "item": "techreborn:iridium_nugget", + "count": 2 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_water.json index d556cf1cc..9c4b77d22 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/sheldonite_ore_with_water.json @@ -1,27 +1,27 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:sheldonite_ore" - } - ], - "results": [ - { - "item": "techreborn:platinum_dust", - "count": 2 - }, - { - "item": "techreborn:nickel_dust" - }, - { - "item": "techreborn:iridium_nugget", - "count": 2 - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:sheldonite_ore" + } + ], + "results": [ + { + "item": "techreborn:platinum_dust", + "count": 2 + }, + { + "item": "techreborn:nickel_dust" + }, + { + "item": "techreborn:iridium_nugget", + "count": 2 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/sodalite_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/sodalite_ore_with_water.json index 32f8286da..dd6ce323f 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/sodalite_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/sodalite_ore_with_water.json @@ -1,24 +1,24 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:sodalite_ore" - } - ], - "results": [ - { - "item": "techreborn:sodalite_dust", - "count": 12 - }, - { - "item": "techreborn:aluminum_dust", - "count": 3 - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:sodalite_ore" + } + ], + "results": [ + { + "item": "techreborn:sodalite_dust", + "count": 12 + }, + { + "item": "techreborn:aluminum_dust", + "count": 3 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_sodiumpersulfate.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_sodiumpersulfate.json index 55c7c2032..433ed0286 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_sodiumpersulfate.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_sodiumpersulfate.json @@ -1,27 +1,27 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "techreborn:sodium_persulfate", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:sphalerite_ore" - } - ], - "results": [ - { - "item": "techreborn:sphalerite_dust", - "count": 5 - }, - { - "item": "techreborn:zinc_dust", - "count": 3 - }, - { - "item": "techreborn:yellow_garnet_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "techreborn:sodium_persulfate", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:sphalerite_ore" + } + ], + "results": [ + { + "item": "techreborn:sphalerite_dust", + "count": 5 + }, + { + "item": "techreborn:zinc_dust", + "count": 3 + }, + { + "item": "techreborn:yellow_garnet_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_water.json b/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_water.json index c1299df08..d9f3fd90b 100644 --- a/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_water.json +++ b/src/main/resources/data/techreborn/recipes/industrial_grinder/sphalerite_ore_with_water.json @@ -1,26 +1,26 @@ { - "type": "techreborn:industrial_grinder", - "power": 64, - "time": 100, - "tank": { - "fluid": "minecraft:water", - "amount": 1000 - }, - "ingredients": [ - { - "item": "techreborn:sphalerite_ore" - } - ], - "results": [ - { - "item": "techreborn:sphalerite_dust", - "count": 5 - }, - { - "item": "techreborn:zinc_dust" - }, - { - "item": "techreborn:yellow_garnet_small_dust" - } - ] -} + "type": "techreborn:industrial_grinder", + "power": 64, + "time": 100, + "tank": { + "fluid": "minecraft:water", + "amount": 1000 + }, + "ingredients": [ + { + "tag": "c:sphalerite_ore" + } + ], + "results": [ + { + "item": "techreborn:sphalerite_dust", + "count": 5 + }, + { + "item": "techreborn:zinc_dust" + }, + { + "item": "techreborn:yellow_garnet_small_dust" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/techreborn/recipes/smelting/platinum_ingot.json b/src/main/resources/data/techreborn/recipes/smelting/platinum_ingot.json index e185bbabd..398361666 100644 --- a/src/main/resources/data/techreborn/recipes/smelting/platinum_ingot.json +++ b/src/main/resources/data/techreborn/recipes/smelting/platinum_ingot.json @@ -1,9 +1,9 @@ -{ - "type": "minecraft:smelting", - "ingredient": { - "item": "techreborn:sheldonite_ore" - }, - "result": "techreborn:platinum_ingot", - "experience": 0.5, - "cookingtime": 200 -} +{ + "type": "minecraft:smelting", + "ingredient": { + "tag": "c:sheldonite_ore" + }, + "result": "techreborn:platinum_ingot", + "experience": 0.5, + "cookingtime": 200 +} \ No newline at end of file diff --git a/src/main/resources/makeTags.js b/src/main/resources/makeTags.js new file mode 100644 index 000000000..831c0d675 --- /dev/null +++ b/src/main/resources/makeTags.js @@ -0,0 +1,120 @@ +/* +This is some awful script I made to convert none tagged items to use tags in recipes. +Its awful but works, I dont know JS so its cobbled togeather from stackoverflow posts :P (It would be even if I knew js tho :P) + +npm install file +node makeTags.js + +*/ + +const path = require('path'); +const fs = require('fs'); +const file = require("file") + +//Enable to actaully fix recipes +const fixRecipes = true; + +console.log("generating tags") + +function generate(tags){ + console.log("Found " + tags.length + " tags") + + tags.forEach(tag => { + + var fileName = tag.replace("_storage", "") + ".json" + var tagJson = { + "replace": false, + "values": [ + "techreborn:" + tag + ] + } + + var jsonStr = JSON.stringify(tagJson, null, 4); + fs.writeFileSync('data/c/tags/blocks/' + fileName, jsonStr, 'utf8', err => {}); + fs.writeFileSync('data/c/tags/items/' + fileName, jsonStr, 'utf8', err => {}); + + + replaceInRecipes(tag) + }) +} + +function replaceInRecipes(tag){ + file.walkSync("data/techreborn/recipes", (dirPath, dirs, files) => { + + files.forEach(f => { + try { + replaceInRecipe(tag, dirPath + "\\" + f) + } catch(err) { + console.error("Failed to read " + dirPath + "\\" + f); + throw err + } + + }) + }) +} + +function replaceInRecipe(tag, f){ + var item = "techreborn:" + tag; + var tag = "c:" + tag.replace("_storage", ""); + + let fileContents = fs.readFileSync(f); + let recipe = JSON.parse(fileContents); + + var changed = false; + + var checkEntries = (entries, parent) => { + entries.forEach(entry => { + if (typeof entry[1] === 'string'){ + if(entry[1] === item){ + if(entry[0] === "item"){ + console.log(entry[0] + " = " + entry[1]) + + parent.tag = tag + delete parent.item + + changed = true; + } + } + + } else if (typeof entry[1] === 'object') { + var key = entry[0]; + if(key === 'results' || key === 'result' || key === 'tank'){ + //Dont repalce tags here + } else { + checkEntries(Object.entries(entry[1]), entry[1]) + } + + } + }) + } + + const entries = Object.entries(recipe) + checkEntries(entries, recipe); + + if (changed && fixRecipes) { + var jsonStr = JSON.stringify(recipe, null, 4); + //console.log(jsonStr + " -> " + f) + fs.writeFileSync(f, jsonStr, err => { + if (err){ + console.log("error") + throw err; + } + }); + + } +} + +var dirs = ['assets/techreborn/models/block/ore/', 'assets/techreborn/models/block/storage/'] +var tags = [] + +dirs.forEach(dir => { + file.walkSync(dir, (dirPath, dirs, files) => { + console.log(dirPath) + files.forEach(f => { + tags.push(f.substring(0, f.length - 5)) + }) + }) +}) + +console.log(tags) +generate(tags) \ No newline at end of file