mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-09-18 21:54:50 +00:00
SPIGOT-4725: Virtual Merchant GUI crashes server
This commit is contained in:
parent
c8d1e94209
commit
6d504c2d4c
1 changed files with 5 additions and 1 deletions
|
@ -31,6 +31,7 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||||
private final IChatBaseComponent title;
|
private final IChatBaseComponent title;
|
||||||
private final MerchantRecipeList trades = new MerchantRecipeList();
|
private final MerchantRecipeList trades = new MerchantRecipeList();
|
||||||
private EntityHuman tradingPlayer;
|
private EntityHuman tradingPlayer;
|
||||||
|
private World tradingWorld;
|
||||||
|
|
||||||
public MinecraftMerchant(String title) {
|
public MinecraftMerchant(String title) {
|
||||||
Validate.notNull(title, "Title cannot be null");
|
Validate.notNull(title, "Title cannot be null");
|
||||||
|
@ -40,6 +41,9 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||||
@Override
|
@Override
|
||||||
public void setTradingPlayer(EntityHuman entityhuman) {
|
public void setTradingPlayer(EntityHuman entityhuman) {
|
||||||
this.tradingPlayer = entityhuman;
|
this.tradingPlayer = entityhuman;
|
||||||
|
if (entityhuman != null) {
|
||||||
|
this.tradingWorld = entityhuman.world;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,7 +72,7 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return null;
|
return this.tradingWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue