Fix-up of the Mail system

Fixed several crashes and bugs. Tested by sending mail and trading with multiple real accounts and a server.
closes #176
This commit is contained in:
mezz committed 2014-09-10 03:55:32 -07:00
1 parent 07afdf63b1
commit 36da6efa91
27 files changed
+470 -258

No files matched your search

@@ -20,8 +20,6 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.mojang.authlib.GameProfile;
import forestry.core.render.TextureManager;
import forestry.core.utils.StringUtil;
import forestry.plugins.PluginMail;
@@ -55,14 +53,14 @@ public class PostalCarrier implements IPostalCarrier {
}
@Override
public IPostalState deliverLetter(World world, IPostOffice office, MailAddress recipient, ItemStack letterstack, boolean doDeliver) {
public IPostalState deliverLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, boolean doDeliver) {
if(type == EnumAddressee.TRADER)
return handleTradeLetter(world, office, recipient, letterstack, doDeliver);
else
return storeInPOBox(world, office, recipient, letterstack, doDeliver);
}
private IPostalState handleTradeLetter(World world, IPostOffice office, MailAddress recipient, ItemStack letterstack, boolean doLodge) {
private IPostalState handleTradeLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, boolean doLodge) {
IPostalState state = EnumDeliveryState.NOT_MAILABLE;
ITradeStation trade = PostManager.postRegistry.getTradeStation(world, recipient);
@@ -74,7 +72,7 @@ public class PostalCarrier implements IPostalCarrier {
return state;
}
private EnumDeliveryState storeInPOBox(World world, IPostOffice office, MailAddress recipient, ItemStack letterstack, boolean doLodge) {
private EnumDeliveryState storeInPOBox(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, boolean doLodge) {
POBox pobox = PostRegistry.getPOBox(world, recipient);
if (pobox == null)