unascribed / Drogtor

Nicknames for Fabric.
https://www.curseforge.com/minecraft/mc-mods/drogtor
MIT License
4 stars 4 forks source link

Age of Exile uses display names to teleport #7

Closed githubbingitup closed 3 years ago

githubbingitup commented 3 years ago

This doesn't happen with the Aether, but it does with Age of Exile. Not sure why the nicknames would prevent entering a dimension. I reported it to AOE but I figured I'd report it here too just so you're aware this can happen.

A config option to disable using /nick would be nice for those who just want the name colors, even if thats not a real solution.

RobertSkalko commented 3 years ago

I'll just note that I use custom teleportation code, but I mostly rely on vanilla teleport command. I'm not sure what this mod does but reproducing is very easy. Changing the nick seems to stop age of exile teleports from working.

To test, teleporter block > click with dungeon key > open dungeon, costs shards. Try walk in portal

I have a static hashmap of player uuids and some tick data. can that cause the issue? I think your mod does something to player uuids maybe.

Cynosphere commented 3 years ago

Only thing I could see breaking is MixinPlayerEntity implements DrogtorPlayer, but I feel like that would've broken a lot more with both vanilla and other mods if that was the case.

If Aether works fine, compare what AoE and Custom Portal API do differently and then either implement changes or just use Custom Portal API outright.

unascribed commented 3 years ago

I think your mod does something to player uuids maybe.

It does not. The most invasive thing Drogtor does is modify some packets to change the username; the server never sees the fake usernames, only clients. (It of course also updates PlayerEntity getName and getDisplayName, in order to do its job, but it does not modify game profiles.)

unascribed commented 3 years ago

https://github.com/RobertSkalko/Library-of-Exile/blob/4184310499679aa0301ae83af82ce4b9fe20fe79/src/main/java/com/robertx22/library_of_exile/utils/TeleportUtils.java#L22-L24

            String command = "/execute in " + dimension.toString() + " run tp " + player
                .getDisplayName()
                .asString() + " " + pos.getX() + " " + pos.getY() + " " + pos.getZ();

Excuse me, but what the fuck? This is the worst imaginable way to teleport a player. If you absolutely must do it this way, use getGameProfile().getName(), not display name, which is for displaying.

RobertSkalko commented 3 years ago

True, I'll try your solution. Sorry about that.