Named all containers.

Closes #383
This commit is contained in:
Ellpeck 2016-11-20 13:46:35 +01:00
parent 0710aab830
commit 504835246c
4 changed files with 34 additions and 4 deletions

View file

@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -27,6 +28,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable; import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
@ -204,9 +206,13 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{
return !oldState.getBlock().isAssociatedBlock(newState.getBlock()); return !oldState.getBlock().isAssociatedBlock(newState.getBlock());
} }
public String getDisplayedName(){
return StringUtil.localize("container."+ModUtil.MOD_ID+"."+this.name+".name");
}
@Override @Override
public ITextComponent getDisplayName(){ public ITextComponent getDisplayName(){
return new TextComponentTranslation("container."+ModUtil.MOD_ID+"."+this.name+".name"); return new TextComponentString(this.getDisplayedName());
} }
@Override @Override

View file

@ -197,7 +197,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
@Override @Override
public String getName(){ public String getName(){
return this.name; return this.getDisplayedName();
} }
@Override @Override

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.util;
import de.ellpeck.actuallyadditions.mod.misc.ParticleColored; import de.ellpeck.actuallyadditions.mod.misc.ParticleColored;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
@ -54,8 +55,8 @@ public final class AssetUtil{
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, TileEntity tile){ public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, TileEntityBase tile){
displayNameString(font, xSize, yPositionOfMachineText, tile.getDisplayName().getFormattedText()); displayNameString(font, xSize, yPositionOfMachineText, tile.getDisplayedName());
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -645,6 +645,29 @@ container.actuallyadditions.bag.name=Traveler's Sack
container.actuallyadditions.voidBag.name=Void Sack container.actuallyadditions.voidBag.name=Void Sack
container.actuallyadditions.bioReactor.name=Bio Reactor container.actuallyadditions.bioReactor.name=Bio Reactor
container.actuallyadditions.farmer.name=Farmer container.actuallyadditions.farmer.name=Farmer
container.actuallyadditions.compost.name=Compost
container.actuallyadditions.fishingNet.name=Fishing Net
container.actuallyadditions.solarPanel.name=Solar Panel
container.actuallyadditions.heatCollector.name=Heat Collector
container.actuallyadditions.greenhouseGlass.name=Greenhouse Glass
container.actuallyadditions.playerInterface.name=Player Interface
container.actuallyadditions.lavaFactory.name=Lava Factory Controller
container.actuallyadditions.phantomBooster.name=Phantom Booster
container.actuallyadditions.smileyCloud.name=Smiley Cloud
container.actuallyadditions.leafGenerator.name=Not a Munchdew
container.actuallyadditions.reconstructor.name=Atomic Reconstructor
container.actuallyadditions.redstoneface.name=Phantom Redstoneface
container.actuallyadditions.laserRelayItem.name=Item Laser Relay
container.actuallyadditions.laserRelay.name=Laser Relay
container.actuallyadditions.laserRelayAdvanced.name=Advanced Laser Relay
container.actuallyadditions.laserRelayExtreme.name=Extreme Laser Relay
container.actuallyadditions.itemViewer.name=Item Interface
container.actuallyadditions.displayStand.name=Display Stand
container.actuallyadditions.shockSuppressor.name=Shock Suppressor
container.actuallyadditions.empowerer.name=Empowerer
container.actuallyadditions.laserRelayFluids.name=Fluid Laser Relay
container.actuallyadditions.distributorItem.name=Item Distributor
container.actuallyadditions.fireworkBox.name=Firework Box
#Update Information #Update Information
info.actuallyadditions.update.generic=[{"text":"There is an Update for "},{"text":"Actually Additions ","color":"dark_green"},{"text":"available!","color":"none"}] info.actuallyadditions.update.generic=[{"text":"There is an Update for "},{"text":"Actually Additions ","color":"dark_green"},{"text":"available!","color":"none"}]