mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 19:49:54 +00:00
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:
1 parent
07afdf63b1
commit
36da6efa91
27 files changed
+470
-258
No files matched your search
@@ -20,7 +20,8 @@ import forestry.core.network.PacketUpdate;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.mail.gadgets.MachineTrader;
|
||||
import forestry.api.mail.MailAddress;
|
||||
import forestry.api.mail.PostManager;
|
||||
import forestry.api.mail.IMailAddress;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -35,7 +36,7 @@ public class ContainerTradeName extends ContainerForestry {
|
||||
isLinked = machine.isLinked();
|
||||
}
|
||||
|
||||
public MailAddress getAddress() {
|
||||
public IMailAddress getAddress() {
|
||||
return machine.getAddress();
|
||||
}
|
||||
|
||||
@@ -50,13 +51,13 @@ public class ContainerTradeName extends ContainerForestry {
|
||||
PacketUpdate packet = new PacketUpdate(PacketIds.TRADING_ADDRESS_SET, payload);
|
||||
Proxies.net.sendToServer(packet);
|
||||
|
||||
MailAddress address = new MailAddress(addressName);
|
||||
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
|
||||
machine.setAddress(address);
|
||||
}
|
||||
|
||||
public void handleSetAddress(PacketUpdate packet) {
|
||||
String addressName = packet.payload.stringPayload[0];
|
||||
MailAddress address = new MailAddress(addressName);
|
||||
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
|
||||
machine.setAddress(address);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user