public class GuiHandler implements IGuiHandler {
@Nullable
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id == 0) {
return new ContainerTrade(player.inventory /*merchant needs*/);
}
return null;
}
@Nullable
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id == 0) {
return new GuiTrade(player /*merchant needs*/);
}
return null;
}
}
Sorry for misunderstanding, english isn't my native language. Could you explain to me some more. This is my GuiHandler. I need a merchant instance for trade gui and container constructors. You said that instead of x, y, z coordinates I should send entity ID, aren't you? Maybe I saying something wrong. Correct me if needs, please.