mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 11:49:14 +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
@@ -10,7 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.mail;
|
||||
|
||||
import forestry.api.mail.MailAddress;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -19,6 +18,7 @@ import net.minecraft.world.WorldSavedData;
|
||||
|
||||
import forestry.api.mail.ILetter;
|
||||
import forestry.api.mail.PostManager;
|
||||
import forestry.api.mail.IMailAddress;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
|
||||
public class POBox extends WorldSavedData implements IInventory {
|
||||
@@ -26,10 +26,10 @@ public class POBox extends WorldSavedData implements IInventory {
|
||||
public static final String SAVE_NAME = "POBox_";
|
||||
public static final short SLOT_SIZE = 84;
|
||||
|
||||
private MailAddress address;
|
||||
private IMailAddress address;
|
||||
private final InventoryAdapter letters = new InventoryAdapter(SLOT_SIZE, "Letters");
|
||||
|
||||
public POBox(MailAddress address) {
|
||||
public POBox(IMailAddress address) {
|
||||
super(SAVE_NAME + address);
|
||||
if (!address.isPlayer()) {
|
||||
throw new IllegalArgumentException("POBox address must be a player");
|
||||
|
||||
Reference in new issue
Block a user