Code cleanup (#5582)

* IntelliJ code analysis Verbose or redundant code constructs

* Move some more I18n calls to using LangUtils to have less deprecation warnings

* Minor cleanup

* Make some inner classes static that do not depend on information about the containing class

* Fix mismatched lang key entries

* Address review comments
This commit is contained in:
Richard Freimer authored and GitHub committed 2019-07-27 11:39:58 -04:00
1 parent 403cdaaeba
commit d9b58b592f
31 files changed
+143 -145

No files matched your search

@@ -66,7 +66,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.items.ItemHandlerHelper;
@@ -807,7 +806,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt
@Nonnull
@Override
public String getName() {
if (I18n.canTranslate("tile." + tier.getBaseTier().getName() + recipeType.getTranslationKey() + "Factory")) {
if (LangUtils.canLocalize("tile." + tier.getBaseTier().getName() + recipeType.getTranslationKey() + "Factory")) {
return LangUtils.localize("tile." + tier.getBaseTier().getName() + recipeType.getTranslationKey() + "Factory");
}
return tier.getBaseTier().getLocalizedName() + " " + recipeType.getLocalizedName() + " " + super.getName();