mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Fix #1325 Null Pointer Exception from broken mailbox
This commit is contained in:
1 parent
c0a22f4a28
commit
e9809238de
15 files changed
+51
-43
No files matched your search
@@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.mail.EnumAddressee;
|
||||
import forestry.api.mail.EnumTradeStationState;
|
||||
import forestry.api.mail.IMailAddress;
|
||||
import forestry.api.mail.ITradeStationInfo;
|
||||
@@ -26,7 +27,7 @@ public class TradeStationInfo implements ITradeStationInfo {
|
||||
private final EnumTradeStationState state;
|
||||
|
||||
public TradeStationInfo(IMailAddress address, GameProfile owner, ItemStack tradegood, ItemStack[] required, EnumTradeStationState state) {
|
||||
if (!address.isTrader()) {
|
||||
if (address.getType() != EnumAddressee.TRADER) {
|
||||
throw new IllegalArgumentException("TradeStation address must be a trader");
|
||||
}
|
||||
this.address = address;
|
||||
|
||||
Reference in new issue
Block a user