Skip to content

Commit

Permalink
feat: update server name in properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Mar 4, 2024
1 parent 589875d commit 75d0f36
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/src/endstone/_internal/bootstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def _download(self, dst: Union[str, os.PathLike], url: str, sha256: str) -> None
def _download_finished(self) -> None:
self.validate()

properties = self.server_path / "server.properties"
with properties.open("r", encoding="utf-8") as file:
lines = file.readlines()

lines = [
"server-name=Endstone Server\n" if line.strip() == "server-name=Dedicated Server" else line
for line in lines
]

with properties.open("w", encoding="utf-8") as file:
file.writelines(lines)

def install(self) -> None:
"""
Installs the server if not already installed.
Expand Down

0 comments on commit 75d0f36

Please sign in to comment.