start on new power api
This commit is contained in:
parent
ea23ef7038
commit
4f80a8c651
35 changed files with 275 additions and 250 deletions
|
@ -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.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;
|
||||
|
@ -102,17 +104,22 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
|
|||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,22 +29,26 @@ 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;
|
||||
|
@ -102,17 +106,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,24 +32,25 @@ 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.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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.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;
|
||||
|
@ -123,17 +125,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.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;
|
||||
|
@ -109,17 +111,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.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;
|
||||
|
@ -107,17 +110,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.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;
|
||||
|
@ -144,17 +146,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.items.ItemStackModifiers;
|
||||
import reborncore.api.power.ItemPowerManager;
|
||||
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.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;
|
||||
|
@ -215,17 +217,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.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;
|
||||
|
@ -163,17 +165,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue