1147 - Initial auto mappings pass
This commit is contained in:
parent
48198dbcb3
commit
4e03ac893c
291 changed files with 3335 additions and 3504 deletions
|
@ -24,16 +24,16 @@
|
|||
|
||||
package techreborn.items.battery;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPropertyGetter;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.PoweredItemContainerProvider;
|
||||
|
@ -49,13 +49,13 @@ public class ItemBattery extends Item implements IEnergyItemInfo {
|
|||
int maxTransfer = 0;
|
||||
|
||||
public ItemBattery(int maxEnergy, int maxTransfer) {
|
||||
super(new Item.Properties().group(TechReborn.ITEMGROUP).maxStackSize(1).defaultMaxDamage(1));
|
||||
super(new Item.Settings().itemGroup(TechReborn.ITEMGROUP).stackSize(1).durabilityIfNotSet(1));
|
||||
this.maxEnergy = maxEnergy;
|
||||
this.maxTransfer = maxTransfer;
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() {
|
||||
this.addProperty(new Identifier("techreborn:empty"), new ItemPropertyGetter() {
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public float call(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
@Environment(EnvType.CLIENT)
|
||||
public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) {
|
||||
if (!stack.isEmpty() && new ForgePowerItemManager(stack).getEnergyStored() == 0) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class ItemBattery extends Item implements IEnergyItemInfo {
|
|||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
NBTTagCompound nbt) {
|
||||
CompoundTag nbt) {
|
||||
return new PoweredItemContainerProvider(stack);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.items.battery;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.util.DefaultedList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
|
@ -40,10 +40,10 @@ public class ItemEnergyCrystal extends ItemBattery {
|
|||
super(ConfigTechReborn.EnergyCrystalMaxCharge, 1_000);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
public void appendItemsForGroup(ItemGroup group, DefaultedList<ItemStack> items) {
|
||||
if (!isInItemGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(TRContent.ENERGY_CRYSTAL);
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.items.battery;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.util.DefaultedList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
|
@ -40,10 +40,10 @@ public class ItemLapotronCrystal extends ItemBattery {
|
|||
super(ConfigTechReborn.LapotronCrystalMaxCharge, 10_000);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
public void appendItemsForGroup(ItemGroup group, DefaultedList<ItemStack> items) {
|
||||
if (!isInItemGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(TRContent.LAPOTRON_CRYSTAL);
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.items.battery;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.util.DefaultedList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
|
@ -40,10 +40,10 @@ public class ItemLapotronicOrb extends ItemBattery {
|
|||
super(ConfigTechReborn.LapotronicOrbMaxCharge, 100_000);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
public void appendItemsForGroup(ItemGroup group, DefaultedList<ItemStack> items) {
|
||||
if (!isInItemGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(TRContent.LAPOTRONIC_ORB);
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.items.battery;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.util.DefaultedList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
|
@ -39,10 +39,10 @@ public class ItemLithiumIonBattery extends ItemBattery {
|
|||
super(400_000, 1_000);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
public void appendItemsForGroup(ItemGroup group, DefaultedList<ItemStack> items) {
|
||||
if (!isInItemGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(TRContent.LITHIUM_ION_BATTERY);
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.items.battery;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.util.DefaultedList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
|
@ -39,10 +39,10 @@ public class ItemRedCellBattery extends ItemBattery {
|
|||
super(40_000, 100);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
public void appendItemsForGroup(ItemGroup group, DefaultedList<ItemStack> items) {
|
||||
if (!isInItemGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(TRContent.RED_CELL_BATTERY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue