Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/now-this-is-crazy/ipasservername
When adding a new server, if a name isn't provided, use the IP address.
https://github.com/now-this-is-crazy/ipasservername
fabric-mod fabricmc-mod minecraft-mod minecraftmod
Last synced: about 1 month ago
JSON representation
When adding a new server, if a name isn't provided, use the IP address.
- Host: GitHub
- URL: https://github.com/now-this-is-crazy/ipasservername
- Owner: Now-this-is-crazy
- License: mit
- Created: 2024-02-26T09:36:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-21T15:44:38.000Z (4 months ago)
- Last Synced: 2024-09-30T08:20:53.637Z (about 2 months ago)
- Topics: fabric-mod, fabricmc-mod, minecraft-mod, minecraftmod
- Language: Java
- Homepage:
- Size: 77.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IP as Server Name
## Overview
When adding a new server, if a name isn't provided, the mod will save the server with its IP address as the name.
## How It Works
The underlying code simply injects into the `addAndClose()` method inside the `AddServerScreen` class to check whether the server name equals `"Minecraft Server"` (the default server name), and if so sets the name to the address
```java
private void addAndClose(CallbackInfo ci) {
if (server.name.equals("Minecraft Server")) {
server.name = server.address;
}
}
```
(the server variable comes from a `@Shadow`)## Get the Mod
Simply head over to the [Releases](https://github.com/RedVortexDev/IPAsServerName/releases/latest) page and download the mod!