| 3 | import eu.the5zig.mod.The5zigMod; |
| 4 | |
| 5 | public class Server implements IServer { |
| 6 | |
| 7 | private String host; |
| 8 | private int port; |
| 9 | private long time; |
| 10 | |
| 11 | private transient boolean renderPotionEffects = true; |
| 12 | private transient boolean renderArmor = true; |
| 13 | private transient boolean renderPotionIndicator = true; |
| 14 | private transient boolean renderSaturation = true; |
| 15 | private transient boolean autoReconnect = true; |
| 16 | |
| 17 | // Default constructor for gson deserialization. Without this one, all server setting fields won't be initialized. |
| 18 | public Server() { |
| 19 | } |
| 20 | |
| 21 | public Server(String host, int port) { |
| 22 | this.host = host; |
| 23 | this.port = port; |
| 24 | this.time = System.currentTimeMillis(); |
| 25 | The5zigMod.getLastServerConfig().getConfigInstance().setLastServer(this); |
| 26 | save(); |
| 27 | } |
| 28 | |
| 29 | private void save() { |
| 30 | The5zigMod.getLastServerConfig().saveConfig(); |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public String getHost() { |
| 35 | return host; |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public int getPort() { |
| 40 | return port; |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public long getLastTimeJoined() { |
| 45 | return time; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public boolean isRenderPotionEffects() { |
| 50 | return renderPotionEffects; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public void setRenderPotionEffects(boolean renderPotionEffects) { |
| 55 | this.renderPotionEffects = renderPotionEffects; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public boolean isRenderArmor() { |
| 60 | return renderArmor; |
| 61 | } |
| 62 |
nothing calls this directly
no outgoing calls
no test coverage detected