do it regardless + tesla loc

This commit is contained in:
Ellpeck 2016-07-21 20:04:10 +02:00
parent 24075e70e9
commit ab0c99cd0b
2 changed files with 13 additions and 16 deletions

View file

@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.Gui;
@ -50,9 +51,7 @@ public class EnergyDisplay extends Gui{
this.outline = outline; this.outline = outline;
this.drawTextNextTo = drawTextNextTo; this.drawTextNextTo = drawTextNextTo;
if(TileEntityBase.teslaLoaded){ this.displayTesla = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().thePlayer).theCompound.getBoolean("DisplayTesla");
this.displayTesla = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().thePlayer).theCompound.getBoolean("DisplayTesla");
}
} }
public void draw(){ public void draw(){
@ -87,9 +86,7 @@ public class EnergyDisplay extends Gui{
List<String> text = new ArrayList<String>(); List<String> text = new ArrayList<String>();
text.add(this.getOverlayText()); text.add(this.getOverlayText());
if(TileEntityBase.teslaLoaded){ text.add(TextFormatting.GRAY+""+TextFormatting.ITALIC+StringUtil.localize("info."+ModUtil.MOD_ID+".energy.to"+(this.displayTesla ? "RF" : "T")));
text.add(TextFormatting.GRAY+""+TextFormatting.ITALIC+"Click to change mode!");
}
GuiUtils.drawHoveringText(text, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRendererObj); GuiUtils.drawHoveringText(text, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRendererObj);
} }
} }
@ -109,17 +106,15 @@ public class EnergyDisplay extends Gui{
} }
private void changeDisplayMode(){ private void changeDisplayMode(){
if(TileEntityBase.teslaLoaded){ NBTTagCompound data = new NBTTagCompound();
NBTTagCompound data = new NBTTagCompound();
this.displayTesla = !this.displayTesla; this.displayTesla = !this.displayTesla;
data.setBoolean("DisplayTesla", this.displayTesla); data.setBoolean("DisplayTesla", this.displayTesla);
NBTTagCompound dataToSend = new NBTTagCompound(); NBTTagCompound dataToSend = new NBTTagCompound();
dataToSend.setTag("Data", data); dataToSend.setTag("Data", data);
dataToSend.setInteger("WorldID", Minecraft.getMinecraft().theWorld.provider.getDimension()); dataToSend.setInteger("WorldID", Minecraft.getMinecraft().theWorld.provider.getDimension());
dataToSend.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); dataToSend.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId());
PacketHandler.theNetwork.sendToServer(new PacketClientToServer(dataToSend, PacketHandler.CHANGE_PLAYER_DATA_HANDLER)); PacketHandler.theNetwork.sendToServer(new PacketClientToServer(dataToSend, PacketHandler.CHANGE_PLAYER_DATA_HANDLER));
}
} }
} }

View file

@ -572,6 +572,8 @@ info.actuallyadditions.booklet.edition=Edition
info.actuallyadditions.deathRecorded=Your death has been recorded. Use a Death Tracker to find the death location! info.actuallyadditions.deathRecorded=Your death has been recorded. Use a Death Tracker to find the death location!
info.actuallyadditions.placer.sides.1=Placement Sides info.actuallyadditions.placer.sides.1=Placement Sides
info.actuallyadditions.placer.sides.2=Usually when placing down blocks, they are placed towards the side of another block that you are looking at. Because the Phantom Placer can place blocks in mid-air, it doesn't know that. Usually you should just set it to a solid side. info.actuallyadditions.placer.sides.2=Usually when placing down blocks, they are placed towards the side of another block that you are looking at. Because the Phantom Placer can place blocks in mid-air, it doesn't know that. Usually you should just set it to a solid side.
info.actuallyadditions.energy.toRF=Click for Redstone Flux mode!
info.actuallyadditions.energy.toT=Click for Tesla mode!
#Container Names #Container Names
container.actuallyadditions.inputter.name=ESD container.actuallyadditions.inputter.name=ESD