ForestryMC/ForestryMC — pull request #89 by JamesMitchell (2014-08-11 08:01:03+00:00)
Title: Fixed mail system.

Fixes mail and traders.
The issue is that traders were given GameProfiles to identify them. This is required for players, but doesn't work with the traders. There isn't a valid way to make a GameProfile for a non-player, so I made use of MailAddresses instead. Now a MailAddress can hold either a string to identify traders or a GameProfile to identify player's mailboxes. I kept as much of the logic in MailAddress as possible, so that we only pass around the MailAddress without caring what's inside until it's really required.

Fixes #85

On this branch I can place all mail machines, send and receive mail and trades, the virtual commands work, and the catalog also works correctly. Also tested logging in and out, flying far away and mailing across unloaded areas. Everything beyond the initial NPE in #85 was extremely broken, I'm pretty happy with this progress.

Depends on the following PR in the forestryAPI. It will need to be merged in, then this PR will need to get updated to point to it.
https://github.com/ForestryMC/ForestryAPI/pull/3