Refactoring & cleaning

This commit is contained in:
ProfessorProspector 2018-09-16 13:48:38 -07:00
parent 874559c21e
commit e5736669ca
200 changed files with 1382 additions and 1596 deletions

View file

@ -41,19 +41,17 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.PoweredItemCapabilityProvider;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.config.ConfigTechReborn;
import techreborn.init.TRItems;
import techreborn.items.armor.ItemTRArmour;
import techreborn.lib.ModInfo;
import techreborn.utils.TechRebornCreativeTab;
import javax.annotation.Nullable;
@RebornRegistry(modID = ModInfo.MOD_ID)
@RebornRegister(modID = TechReborn.MOD_ID)
public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo {
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in FE)")
@ -66,9 +64,7 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
// 40M FE capacity with 10k FE\t charge rate
public ItemCloakingDevice() {
super(Reference.CLOAKING_ARMOR, EntityEquipmentSlot.CHEST);
setTranslationKey("techreborn.cloakingdevice");
setMaxStackSize(1);
setCreativeTab(TechRebornCreativeTab.instance);
}
// Item

View file

@ -42,23 +42,20 @@ import reborncore.common.powerSystem.PoweredItemCapabilityProvider;
import reborncore.common.util.ItemUtils;
import techreborn.config.ConfigTechReborn;
import techreborn.init.TRItems;
import techreborn.utils.TechRebornCreativeTab;
import javax.annotation.Nullable;
public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
public class ItemLapotronicOrbpack extends ItemArmor implements IEnergyItemInfo {
// 400M FE maxCharge and 100k FE\t charge rate. Fully charged in 3 mins.
public static final int maxCharge = ConfigTechReborn.LapotronPackCharge;
public int transferLimit = 100_000;
public ItemLapotronPack() {
public ItemLapotronicOrbpack() {
super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST);
setCreativeTab(TechRebornCreativeTab.instance);
setTranslationKey("techreborn.lapotronpack");
setMaxStackSize(1);
}
// Item
@SideOnly(Side.CLIENT)
@Override
@ -66,17 +63,17 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
if (!isInCreativeTab(par2CreativeTabs)) {
return;
}
ItemStack uncharged = new ItemStack(TRItems.LAPOTRONIC_ORB_PACK);
// ItemStack charged = new ItemStack(ModItems.LAPOTRONIC_ORB_PACK);
// ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
// capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
ItemStack uncharged = new ItemStack(TRItems.LAPOTRONIC_ORBPACK);
// ItemStack charged = new ItemStack(ModItems.LAPOTRONIC_ORBPACK);
// ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
// capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
itemList.add(uncharged);
// itemList.add(charged);
// itemList.add(charged);
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
ItemLithiumBatpack.distributePowerToInventory(world, player, itemStack, (int) transferLimit);
ItemLithiumIonBatpack.distributePowerToInventory(world, player, itemStack, (int) transferLimit);
}
@Override
@ -96,7 +93,9 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
@Override
@Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable
NBTTagCompound nbt) {
return new PoweredItemCapabilityProvider(stack);
}
@ -120,5 +119,5 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
@Override
public int getMaxOutput() {
return transferLimit;
}
}
}

View file

@ -44,21 +44,18 @@ import reborncore.common.powerSystem.PoweredItemCapabilityProvider;
import reborncore.common.util.ItemUtils;
import techreborn.config.ConfigTechReborn;
import techreborn.init.TRItems;
import techreborn.utils.TechRebornCreativeTab;
import javax.annotation.Nullable;
public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
public class ItemLithiumIonBatpack extends ItemArmor implements IEnergyItemInfo {
// 8M FE maxCharge and 2k FE\t charge rate. Fully charged in 3 mins.
public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge;
public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge;
public int transferLimit = 2_000;
public ItemLithiumBatpack() {
public ItemLithiumIonBatpack() {
super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST);
setMaxStackSize(1);
setTranslationKey("techreborn.lithiumbatpack");
setCreativeTab(TechRebornCreativeTab.instance);
}
public static void distributePowerToInventory(World world, EntityPlayer player, ItemStack itemStack, int maxSend) {
@ -105,7 +102,9 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
@Override
@Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable
NBTTagCompound nbt) {
return new PoweredItemCapabilityProvider(stack);
}
@ -121,12 +120,12 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
if (!isInCreativeTab(par2CreativeTabs)) {
return;
}
ItemStack uncharged = new ItemStack(TRItems.LITHIUM_BATTERY_PACK);
// ItemStack charged = new ItemStack(ModItems.LITHIUM_BATTERY_PACK);
// ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
// capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
ItemStack uncharged = new ItemStack(TRItems.LITHIUM_ION_BATPACK);
// ItemStack charged = new ItemStack(ModItems.LITHIUM_ION_BATPACK);
// ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
// capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
itemList.add(uncharged);
// itemList.add(charged);
// itemList.add(charged);
}
// IEnergyItemInfo

View file

@ -29,7 +29,6 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import reborncore.common.util.ItemUtils;
import techreborn.events.TRRecipeHandler;
import techreborn.utils.TechRebornCreativeTab;
/**
* Created by modmuss50 on 26/02/2016.
@ -53,7 +52,6 @@ public class ItemTRArmour extends ItemArmor {
setTranslationKey(material.name().toLowerCase() + "Leggings");
if (slot == EntityEquipmentSlot.FEET)
setTranslationKey(material.name().toLowerCase() + "Boots");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}