Allow lang files to specify the location of the fluid name, closes #1386
This commit is contained in:
parent
fbd31e1177
commit
751746df6f
2 changed files with 5 additions and 6 deletions
|
@ -40,13 +40,10 @@ import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.*;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
import net.minecraftforge.fluids.FluidUtil;
|
|
||||||
import net.minecraftforge.fluids.IFluidBlock;
|
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||||
import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack;
|
import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack;
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
@ -161,12 +158,13 @@ public class DynamicCell extends Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(ItemStack stack) {
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
FluidStack fluidStack = getFluidHandler(stack).getFluid();
|
FluidStack fluidStack = getFluidHandler(stack).getFluid();
|
||||||
if (fluidStack == null)
|
if (fluidStack == null)
|
||||||
return super.getItemStackDisplayName(stack);
|
return super.getItemStackDisplayName(stack);
|
||||||
return fluidStack.getLocalizedName() + " Cell";
|
return I18n.translateToLocal("item.techreborn.cell.fluid.name").replaceAll("\\$fluid\\$", fluidStack.getLocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -375,6 +375,7 @@ item.techreborn.dustsmall.diorite.name=Small Pile of Diorite Dust
|
||||||
item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust
|
item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust
|
||||||
|
|
||||||
item.techreborn.cell.name=Empty Cell
|
item.techreborn.cell.name=Empty Cell
|
||||||
|
item.techreborn.cell.fluid.name=$fluid$ Cell
|
||||||
item.techreborn.rebattery.name=Battery
|
item.techreborn.rebattery.name=Battery
|
||||||
item.techreborn.lithiumBattery.name=Lithium Battery
|
item.techreborn.lithiumBattery.name=Lithium Battery
|
||||||
item.techreborn.energyCrystal.name=Energy Crystal
|
item.techreborn.energyCrystal.name=Energy Crystal
|
||||||
|
|
Loading…
Reference in a new issue