Skip to content

Commit

Permalink
add update for nameChanges at player instance creation, addresses #208
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdiplomat committed Mar 16, 2015
1 parent 90eb148 commit 2cf1a04
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@
import net.canarymod.api.world.position.BlockPosition;
import net.canarymod.api.world.position.Direction;
import net.canarymod.api.world.position.Location;
import net.canarymod.backbone.PlayerDataAccess;
import net.canarymod.chat.ChatFormat;
import net.canarymod.chat.ReceiverType;
import net.canarymod.config.Configuration;
import net.canarymod.database.Database;
import net.canarymod.database.exceptions.DatabaseWriteException;
import net.canarymod.exceptions.InvalidInstanceException;
import net.canarymod.hook.command.PlayerCommandHook;
import net.canarymod.hook.player.ChatHook;
Expand Down Expand Up @@ -715,7 +718,8 @@ public void initPlayerData() {
}
//defaultChatpattern.put("%name", getDisplayName()); // Display name not initialized at this time
defaultChatpattern.put("%prefix", getPrefix());
if (isNew) {

if (isNew || provider.nameChanged(this)) {
provider.addOrUpdatePlayerData(this);
}
}
Expand Down

1 comment on commit 2cf1a04

@darkdiplomat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops typo, address #206 not 208

Please sign in to comment.