Skip to content

Commit

Permalink
Merge pull request #8 from dimadencep/1.20.x/dev
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
dima-dencep authored Jul 5, 2023
2 parents be2aba9 + 475cb05 commit 8945c74
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
loaders: forge

game-versions: |
[1.19.2,${{ steps.read_property.outputs.minecraft_version }})
>=1.19.2 <=${{ steps.read_property.outputs.minecraft_version }}
dependencies: |
emotecraft{modrinth:pZ2wrerK}{curseforge:403422}
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
quilt
game-versions: |
[1.19.2,${{ steps.read_property.outputs.minecraft_version }})
>=1.19.2 <=${{ steps.read_property.outputs.minecraft_version }}
dependencies: |
emotecraft{modrinth:pZ2wrerK}{curseforge:397809}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.netty.buffer.Unpooled;
import io.netty.channel.local.LocalAddress;
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
import net.minecraft.client.network.ClientPlayerEntity;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -36,7 +37,7 @@ public EmotePacketWrapper(byte[] emotePacket) {
this.playerUUID = player.getUuid();

if (player.networkHandler != null) {
this.serverAddress = getIP(player.networkHandler.getConnection().getAddress());
this.serverAddress = getIP(player.networkHandler.connection.getAddress());
}
}
}
Expand All @@ -46,6 +47,13 @@ public BinaryWebSocketFrame toWebSocketFrame() {
}

private static String getIP(SocketAddress address) {
return ((InetSocketAddress) address).getAddress().getHostAddress();
if (address instanceof LocalAddress) {
return "localhost";

} else if (address instanceof InetSocketAddress inetSocketAddress) {
return inetSocketAddress.getAddress().getHostAddress();
}

return address.toString();
}
}
3 changes: 2 additions & 1 deletion common/src/main/resources/online-emotes.accesswidener
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
accessWidener v2 named
accessWidener v2 named
accessible field net/minecraft/client/network/ClientPlayNetworkHandler connection Lnet/minecraft/network/ClientConnection;
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx4G
forge_version = 1.20.1-47.0.43

# Mod Properties
mod_version = 2.0.0
mod_version = 2.0.1
maven_group = com.github.dima_dencep.mods
archives_base_name = online-emotes

Expand Down

0 comments on commit 8945c74

Please sign in to comment.